ref: 7760595f84a8edc365f280a9358d4075d42d51ea
parent: 4795b36cf9a4fa37d9c2aa0a2ac4d8ee9d2bc2b3
author: David Turner <[email protected]>
date: Wed Oct 29 16:43:52 EST 2003
* include/freetype/internal/bdftypes.h: removed obsolete header * include/freetype/internal/cfftypes.h, src/cff/cfftypes.h, src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h, include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from 'include/freetype/internal' to 'src/cff' since no other modules needs to known about these types * include/freetype/internal/t42types.h, include/freetype/internal/internal.h, src/type42/t42objs.h, src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from 'include/freetype/internal' to 'src/type42' since no other modules needs to known about these types * src/gzip/infblock.c: removing compiler warning * include/freetype/internal/services/svpsinfo.h, include/freetype/internal/ftserv.h, src/cff/cffdrivr.c, src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c, src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined in "svpsinfo.h", removing some sad hacks.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2003-10-29 David Turner <[email protected]>
+
+ * include/freetype/internal/bdftypes.h: removed obsolete header
+
+ * include/freetype/internal/cfftypes.h, src/cff/cfftypes.h,
+ src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h,
+ include/freetype/internal/services/svbdf.h: moving "cfftypes.h" from
+ 'include/freetype/internal' to 'src/cff' since no other modules needs
+ to known about these types
+
+ * include/freetype/internal/t42types.h,
+ include/freetype/internal/internal.h, src/type42/t42objs.h,
+ src/type42/t42drivr.c, src/type42/t42types.h: moving "t42types.h" from
+ 'include/freetype/internal' to 'src/type42' since no other modules needs
+ to known about these types
+
+ * src/gzip/infblock.c: removing compiler warning
+
+ * include/freetype/internal/services/svpsinfo.h,
+ include/freetype/internal/ftserv.h, src/cff/cffdrivr.c,
+ src/cid/ciddrivr.c, src/type1/t1driver.c, src/type42/t42drivr.c,
+ src/base/fttype1.c: migrating to FT_SERVICE_ID_POSTSCRIPT_INFO defined
+ in "svpsinfo.h", removing some sad hacks.
+
+
2003-10-22 Werner Lemberg <[email protected]>
* src/type1/t1load.c (parse_encoding): Handle `/Encoding [ ... ]'.
--- a/include/freetype/internal/bdftypes.h
+++ /dev/null
@@ -1,58 +1,0 @@
-/* bdftypes.h
-
- FreeType font driver for bdf fonts
-
- Copyright (C) 2001, 2002 by
- Francesco Zappa Nardelli
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#ifndef __BDFTYPES_H__
-#define __BDFTYPES_H__
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_BDF_H
-
-
-FT_BEGIN_HEADER
-
-
- typedef struct BDF_Public_FaceRec_
- {
- FT_FaceRec root;
-
- char* charset_encoding;
- char* charset_registry;
-
- } BDF_Public_FaceRec, *BDF_Public_Face;
-
-
- typedef FT_Error (*BDF_GetPropertyFunc)( FT_Face face,
- const char* prop_name,
- BDF_PropertyRec *aproperty );
-
-FT_END_HEADER
-
-
-#endif /* __BDFTYPES_H__ */
-
-
-/* END */
--- a/include/freetype/internal/cfftypes.h
+++ /dev/null
@@ -1,256 +1,0 @@
-/***************************************************************************/
-/* */
-/* cfftypes.h */
-/* */
-/* Basic OpenType/CFF type definitions and interface (specification */
-/* only). */
-/* */
-/* Copyright 1996-2001, 2002, 2003 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __CFFTYPES_H__
-#define __CFFTYPES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-
-FT_BEGIN_HEADER
-
-
- /*************************************************************************/
- /* */
- /* <Struct> */
- /* CFF_IndexRec */
- /* */
- /* <Description> */
- /* A structure used to model a CFF Index table. */
- /* */
- /* <Fields> */
- /* stream :: The source input stream. */
- /* */
- /* count :: The number of elements in the index. */
- /* */
- /* off_size :: The size in bytes of object offsets in index. */
- /* */
- /* data_offset :: The position of first data byte in the index's */
- /* bytes. */
- /* */
- /* offsets :: A table of element offsets in the index. */
- /* */
- /* bytes :: If the index is loaded in memory, its bytes. */
- /* */
- typedef struct CFF_IndexRec_
- {
- FT_Stream stream;
- FT_UInt count;
- FT_Byte off_size;
- FT_ULong data_offset;
-
- FT_ULong* offsets;
- FT_Byte* bytes;
-
- } CFF_IndexRec, *CFF_Index;
-
-
- typedef struct CFF_EncodingRec_
- {
- FT_UInt format;
- FT_ULong offset;
-
- FT_UInt count;
- FT_UShort sids [256]; /* avoid dynamic allocations */
- FT_UShort codes[256];
-
- } CFF_EncodingRec, *CFF_Encoding;
-
-
- typedef struct CFF_CharsetRec_
- {
-
- FT_UInt format;
- FT_ULong offset;
-
- FT_UShort* sids;
-
- } CFF_CharsetRec, *CFF_Charset;
-
-
- typedef struct CFF_FontRecDictRec_
- {
- FT_UInt version;
- FT_UInt notice;
- FT_UInt copyright;
- FT_UInt full_name;
- FT_UInt family_name;
- FT_UInt weight;
- FT_Bool is_fixed_pitch;
- FT_Fixed italic_angle;
- FT_Fixed underline_position;
- FT_Fixed underline_thickness;
- FT_Int paint_type;
- FT_Int charstring_type;
- FT_Matrix font_matrix;
- FT_UShort units_per_em;
- FT_Vector font_offset;
- FT_ULong unique_id;
- FT_BBox font_bbox;
- FT_Pos stroke_width;
- FT_ULong charset_offset;
- FT_ULong encoding_offset;
- FT_ULong charstrings_offset;
- FT_ULong private_offset;
- FT_ULong private_size;
- FT_Long synthetic_base;
- FT_UInt embedded_postscript;
- FT_UInt base_font_name;
- FT_UInt postscript;
-
- /* these should only be used for the top-level font dictionary */
- FT_UInt cid_registry;
- FT_UInt cid_ordering;
- FT_ULong cid_supplement;
-
- FT_Long cid_font_version;
- FT_Long cid_font_revision;
- FT_Long cid_font_type;
- FT_Long cid_count;
- FT_ULong cid_uid_base;
- FT_ULong cid_fd_array_offset;
- FT_ULong cid_fd_select_offset;
- FT_UInt cid_font_name;
-
- } CFF_FontRecDictRec, *CFF_FontRecDict;
-
-
- typedef struct CFF_PrivateRec_
- {
- FT_Byte num_blue_values;
- FT_Byte num_other_blues;
- FT_Byte num_family_blues;
- FT_Byte num_family_other_blues;
-
- FT_Pos blue_values[14];
- FT_Pos other_blues[10];
- FT_Pos family_blues[14];
- FT_Pos family_other_blues[10];
-
- FT_Fixed blue_scale;
- FT_Pos blue_shift;
- FT_Pos blue_fuzz;
- FT_Pos standard_width;
- FT_Pos standard_height;
-
- FT_Byte num_snap_widths;
- FT_Byte num_snap_heights;
- FT_Pos snap_widths[13];
- FT_Pos snap_heights[13];
- FT_Bool force_bold;
- FT_Fixed force_bold_threshold;
- FT_Int lenIV;
- FT_Int language_group;
- FT_Fixed expansion_factor;
- FT_Long initial_random_seed;
- FT_ULong local_subrs_offset;
- FT_Pos default_width;
- FT_Pos nominal_width;
-
- } CFF_PrivateRec, *CFF_Private;
-
-
- typedef struct CFF_FDSelectRec_
- {
- FT_Byte format;
- FT_UInt range_count;
-
- /* that's the table, taken from the file `as is' */
- FT_Byte* data;
- FT_UInt data_size;
-
- /* small cache for format 3 only */
- FT_UInt cache_first;
- FT_UInt cache_count;
- FT_Byte cache_fd;
-
- } CFF_FDSelectRec, *CFF_FDSelect;
-
-
- /* A SubFont packs a font dict and a private dict together. They are */
- /* needed to support CID-keyed CFF fonts. */
- typedef struct CFF_SubFontRec_
- {
- CFF_FontRecDictRec font_dict;
- CFF_PrivateRec private_dict;
-
- CFF_IndexRec local_subrs_index;
- FT_UInt num_local_subrs;
- FT_Byte** local_subrs;
-
- } CFF_SubFontRec, *CFF_SubFont;
-
-
- /* maximum number of sub-fonts in a CID-keyed file */
-#define CFF_MAX_CID_FONTS 16
-
-
- typedef struct CFF_FontRec_
- {
- FT_Stream stream;
- FT_Memory memory;
- FT_UInt num_faces;
- FT_UInt num_glyphs;
-
- FT_Byte version_major;
- FT_Byte version_minor;
- FT_Byte header_size;
- FT_Byte absolute_offsize;
-
-
- CFF_IndexRec name_index;
- CFF_IndexRec top_dict_index;
- CFF_IndexRec string_index;
- CFF_IndexRec global_subrs_index;
-
- CFF_EncodingRec encoding;
- CFF_CharsetRec charset;
-
- CFF_IndexRec charstrings_index;
- CFF_IndexRec font_dict_index;
- CFF_IndexRec private_index;
- CFF_IndexRec local_subrs_index;
-
- FT_String* font_name;
- FT_UInt num_global_subrs;
- FT_Byte** global_subrs;
-
- CFF_SubFontRec top_font;
- FT_UInt num_subfonts;
- CFF_SubFont subfonts[CFF_MAX_CID_FONTS];
-
- CFF_FDSelectRec fd_select;
-
- /* interface to PostScript hinter */
- void* pshinter;
-
- /* interface to Postscript Names service */
- void* psnames;
-
- } CFF_FontRec, *CFF_Font;
-
-
-FT_END_HEADER
-
-#endif /* __CFFTYPES_H__ */
-
-
-/* END */
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -241,6 +241,8 @@
#define FT_SERVICE_MULTIPLE_MASTERS_H <freetype/internal/services/svmm.h>
#define FT_SERVICE_POSTSCRIPT_NAME_H <freetype/internal/services/svpostnm.h>
#define FT_SERVICE_POSTSCRIPT_NAMES_H <freetype/internal/services/svpsname.h>
+#define FT_SERVICE_POSTSCRIPT_CMAPS_H <freetype/internal/services/svpscmap.h>
+#define FT_SERVICE_POSTSCRIPT_INFO_H <freetype/internal/services/svpsinfo.h>
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_BDF_H <freetype/internal/services/svbdf.h>
#define FT_SERVICE_XFREE86_NAME_H <freetype/internal/services/svxf86nm.h>
--- a/include/freetype/internal/internal.h
+++ b/include/freetype/internal/internal.h
@@ -37,9 +37,6 @@
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
-#define FT_INTERNAL_TYPE42_TYPES_H <freetype/internal/t42types.h>
-#define FT_INTERNAL_CFF_TYPES_H <freetype/internal/cfftypes.h>
-#define FT_INTERNAL_BDF_TYPES_H <freetype/internal/bdftypes.h>
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -24,7 +24,7 @@
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_TYPE1_TYPES_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
FT_BEGIN_HEADER
@@ -651,7 +651,7 @@
T1_Decoder_ZoneRec zones[T1_MAX_SUBRS_CALLS + 1];
T1_Decoder_Zone zone;
- FT_Service_PsNames psnames; /* for seac */
+ FT_Service_PsCMaps psnames; /* for seac */
FT_UInt num_glyphs;
FT_Byte** glyph_names;
--- a/include/freetype/internal/services/svbdf.h
+++ b/include/freetype/internal/services/svbdf.h
@@ -19,6 +19,7 @@
#ifndef __SVBDF_H__
#define __SVBDF_H__
+#include FT_BDF_H
#include FT_INTERNAL_SERVICE_H
@@ -27,7 +28,6 @@
#define FT_SERVICE_ID_BDF "bdf"
-
typedef FT_Error
(*FT_BDF_GetCharsetIdFunc)( FT_Face face,
const char* *acharset_encoding,
@@ -47,7 +47,7 @@
/* */
-
+
FT_END_HEADER
--- /dev/null
+++ b/include/freetype/internal/services/svpscmap.h
@@ -1,0 +1,110 @@
+/***************************************************************************/
+/* */
+/* svpscmap.h */
+/* */
+/* The FreeType PostScript charmap service (specification) */
+/* */
+/* Copyright 2003 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __SVPSCMAP_H__
+#define __SVPSCMAP_H__
+
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps"
+
+
+ /*
+ * Adobe glyph name to unicode value
+ */
+ typedef FT_UInt32
+ (*PS_Unicode_ValueFunc)( const char* glyph_name );
+
+ /*
+ * Unicode value to Adobe glyph name index. 0xFFFF if not found
+ */
+ typedef FT_UInt
+ (*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
+ const char** glyph_names,
+ FT_ULong unicode );
+
+ /*
+ * Macintosh name id to glyph name, NULL if invalid index
+ */
+ typedef const char*
+ (*PS_Macintosh_Name_Func)( FT_UInt name_index );
+
+ /*
+ * Adobe standard string id to glyph name, NULL if invalid index
+ */
+ typedef const char*
+ (*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
+
+ /*
+ * Simple unicode -> glyph index charmap built from font glyph names
+ * table.
+ */
+ typedef struct PS_UniMap_
+ {
+ FT_UInt unicode;
+ FT_UInt glyph_index;
+
+ } PS_UniMap;
+
+
+ typedef struct PS_Unicodes_
+ {
+ FT_UInt num_maps;
+ PS_UniMap* maps;
+
+ } PS_Unicodes;
+
+
+ typedef FT_Error
+ (*PS_Unicodes_InitFunc)( FT_Memory memory,
+ FT_UInt num_glyphs,
+ const char** glyph_names,
+ PS_Unicodes* unicodes );
+
+ typedef FT_UInt
+ (*PS_Unicodes_CharIndexFunc)( PS_Unicodes* unicodes,
+ FT_UInt unicode );
+
+ typedef FT_ULong
+ (*PS_Unicodes_CharNextFunc)( PS_Unicodes* unicodes,
+ FT_ULong unicode );
+
+
+ FT_DEFINE_SERVICE( PsCMaps )
+ {
+ PS_Unicode_ValueFunc unicode_value;
+
+ PS_Unicodes_InitFunc unicodes_init;
+ PS_Unicodes_CharIndexFunc unicodes_char_index;
+ PS_Unicodes_CharNextFunc unicodes_char_next;
+
+ PS_Macintosh_Name_Func macintosh_name;
+ PS_Adobe_Std_Strings_Func adobe_std_strings;
+ const unsigned short* adobe_std_encoding;
+ const unsigned short* adobe_expert_encoding;
+ };
+
+ /* */
+
+
+FT_END_HEADER
+
+
+#endif /* __SVPSNAME_H__ */
--- /dev/null
+++ b/include/freetype/internal/services/svpsinfo.h
@@ -1,0 +1,30 @@
+#ifndef __SVPSINFO_H__
+#define __SVPSINFO_H__
+
+#include FT_INTERNAL_SERVICE_H
+#include FT_INTERNAL_TYPE1_TYPES_H
+
+FT_BEGIN_HEADER
+
+
+#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info"
+
+ typedef FT_Error (*PS_GetFontInfoFunc)( FT_Face face,
+ PS_FontInfoRec* afont_info );
+
+ typedef FT_Int (*PS_HasGlyphNamesFunc)( FT_Face face );
+
+ FT_DEFINE_SERVICE( PsInfo )
+ {
+ PS_GetFontInfoFunc ps_get_font_info;
+ PS_HasGlyphNamesFunc ps_has_glyph_names;
+ };
+
+ /* */
+
+
+FT_END_HEADER
+
+
+
+#endif /* __SVPSINFO_H__ */
--- a/include/freetype/internal/services/svpsname.h
+++ /dev/null
@@ -1,110 +1,0 @@
-/***************************************************************************/
-/* */
-/* svpsname.h */
-/* */
-/* The FreeType glyph PS name services (specification). */
-/* */
-/* Copyright 2003 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __SVPSNAME_H__
-#define __SVPSNAME_H__
-
-
-FT_BEGIN_HEADER
-
-
-#define FT_SERVICE_ID_POSTSCRIPT_NAMES "postscript-names"
-
-
- /*
- * Adobe glyph name to unicode value
- */
- typedef FT_UInt32
- (*PS_Unicode_ValueFunc)( const char* glyph_name );
-
- /*
- * Unicode value to Adobe glyph name index. 0xFFFF if not found
- */
- typedef FT_UInt
- (*PS_Unicode_Index_Func)( FT_UInt num_glyphs,
- const char** glyph_names,
- FT_ULong unicode );
-
- /*
- * Macintosh name id to glyph name, NULL if invalid index
- */
- typedef const char*
- (*PS_Macintosh_Name_Func)( FT_UInt name_index );
-
- /*
- * Adobe standard string id to glyph name, NULL if invalid index
- */
- typedef const char*
- (*PS_Adobe_Std_Strings_Func)( FT_UInt string_index );
-
- /*
- * Simple unicode -> glyph index charmap built from font glyph names
- * table.
- */
- typedef struct PS_UniMap_
- {
- FT_UInt unicode;
- FT_UInt glyph_index;
-
- } PS_UniMap;
-
-
- typedef struct PS_Unicodes_
- {
- FT_UInt num_maps;
- PS_UniMap* maps;
-
- } PS_Unicodes;
-
-
- typedef FT_Error
- (*PS_Unicodes_InitFunc)( FT_Memory memory,
- FT_UInt num_glyphs,
- const char** glyph_names,
- PS_Unicodes* unicodes );
-
- typedef FT_UInt
- (*PS_Unicodes_CharIndexFunc)( PS_Unicodes* unicodes,
- FT_UInt unicode );
-
- typedef FT_ULong
- (*PS_Unicodes_CharNextFunc)( PS_Unicodes* unicodes,
- FT_ULong unicode );
-
-
- FT_DEFINE_SERVICE( PsNames )
- {
- PS_Unicode_ValueFunc unicode_value;
-
- PS_Unicodes_InitFunc unicodes_init;
- PS_Unicodes_CharIndexFunc unicodes_char_index;
- PS_Unicodes_CharNextFunc unicodes_char_next;
-
- PS_Macintosh_Name_Func macintosh_name;
- PS_Adobe_Std_Strings_Func adobe_std_strings;
- const unsigned short* adobe_std_encoding;
- const unsigned short* adobe_expert_encoding;
- };
-
- /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __SVPSNAME_H__ */
--- a/include/freetype/internal/t1types.h
+++ b/include/freetype/internal/t1types.h
@@ -25,7 +25,7 @@
#include FT_TYPE1_TABLES_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
#include FT_INTERNAL_SERVICE_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
FT_BEGIN_HEADER
--- a/include/freetype/internal/t42types.h
+++ /dev/null
@@ -1,54 +1,0 @@
-/***************************************************************************/
-/* */
-/* t42types.h */
-/* */
-/* Type 42 font data types (specification only). */
-/* */
-/* Copyright 2002 by Roberto Alameda. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
-
-
-#ifndef __T42TYPES_H__
-#define __T42TYPES_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-#include FT_TYPE1_TABLES_H
-#include FT_INTERNAL_TYPE1_TYPES_H
-#include FT_INTERNAL_POSTSCRIPT_HINTS_H
-
-
-FT_BEGIN_HEADER
-
-
- typedef struct T42_FaceRec_
- {
- FT_FaceRec root;
- T1_FontRec type1;
- const void* psnames;
- const void* psaux;
- const void* afm_data;
- FT_Byte* ttf_data;
- FT_ULong ttf_size;
- FT_Face ttf_face;
- FT_CharMapRec charmaprecs[2];
- FT_CharMap charmaps[2];
- PS_Unicodes unicode_map;
-
- } T42_FaceRec, *T42_Face;
-
-
-FT_END_HEADER
-
-#endif /* __T1TYPES_H__ */
-
-
-/* END */
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -1500,7 +1500,7 @@
/* the basic TrueType tables in the face object */
void* sfnt;
- /* a typeless pointer to the FT_Service_PsNamesRec table used to */
+ /* a typeless pointer to the FT_Service_PsCMapsRec table used to */
/* handle glyph names <-> unicode & Mac values */
void* psnames;
--- a/src/base/ftbdf.c
+++ b/src/base/ftbdf.c
@@ -17,7 +17,6 @@
#include <ft2build.h>
-#include FT_INTERNAL_BDF_TYPES_H
#include FT_INTERNAL_OBJECTS_H
#include FT_SERVICE_BDF_H
--- a/src/base/fttype1.c
+++ b/src/base/fttype1.c
@@ -17,9 +17,9 @@
#include <ft2build.h>
-#include FT_INTERNAL_TYPE1_TYPES_H
-#include FT_INTERNAL_TYPE42_TYPES_H
#include FT_INTERNAL_OBJECTS_H
+#include FT_INTERNAL_SERVICE_H
+#include FT_SERVICE_POSTSCRIPT_INFO_H
/* documentation is in t1tables.h */
@@ -28,58 +28,36 @@
FT_Get_PS_Font_Info( FT_Face face,
PS_FontInfoRec* afont_info )
{
- PS_FontInfo font_info = NULL;
- FT_Error error = FT_Err_Invalid_Argument;
- const char* driver_name;
+ FT_Error error = FT_Err_Invalid_Argument;
-
- if ( face && face->driver && face->driver->root.clazz )
+ if ( face )
{
- driver_name = face->driver->root.clazz->module_name;
- if ( ft_strcmp( driver_name, "type1" ) == 0 )
- font_info = &((T1_Face)face)->type1.font_info;
- else if ( ft_strcmp( driver_name, "t1cid" ) == 0 )
- font_info = &((CID_Face)face)->cid.font_info;
- else if ( ft_strcmp( driver_name, "type42" ) == 0 )
- font_info = &((T42_Face)face)->type1.font_info;
- }
- if ( font_info != NULL )
- {
- *afont_info = *font_info;
- error = FT_Err_Ok;
- }
+ FT_Service_PsInfo service = NULL;
+ FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO );
+
+ if ( service && service->ps_get_font_info )
+ error = service->ps_get_font_info( face, afont_info );
+ }
return error;
}
- /* XXX: Bad hack, but I didn't want to change several drivers here. */
-
/* documentation is in t1tables.h */
FT_EXPORT_DEF( FT_Int )
FT_Has_PS_Glyph_Names( FT_Face face )
{
- FT_Int result = 0;
- const char* driver_name;
+ FT_Int result = 0;
+ FT_Service_PsInfo service = NULL;
-
- if ( face && face->driver && face->driver->root.clazz )
+ if ( face )
{
- /* Currently, only the type1, type42, and cff drivers provide */
- /* reliable glyph names... */
+ FT_FACE_FIND_SERVICE( service, face, POSTSCRIPT_INFO );
- /* We could probably hack the TrueType driver to recognize */
- /* certain cases where the glyph names are most certainly */
- /* correct (e.g. using a 20 or 22 format `post' table), but */
- /* this will probably happen later... */
-
- driver_name = face->driver->root.clazz->module_name;
- result = ( ft_strcmp( driver_name, "type1" ) == 0 ||
- ft_strcmp( driver_name, "type42" ) == 0 ||
- ft_strcmp( driver_name, "cff" ) == 0 );
+ if ( service && service->ps_has_glyph_names )
+ result = service->ps_has_glyph_names( face );
}
-
return result;
}
--- a/src/cff/cffcmap.c
+++ b/src/cff/cffcmap.c
@@ -146,7 +146,7 @@
FT_Memory memory = FT_FACE_MEMORY( face );
CFF_Font cff = (CFF_Font)face->extra.data;
CFF_Charset charset = &cff->charset;
- FT_Service_PsNames psnames = (FT_Service_PsNames)cff->psnames;
+ FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)cff->psnames;
cmap->num_pairs = 0;
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -22,7 +22,8 @@
#include FT_INTERNAL_STREAM_H
#include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_IDS_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+#include FT_SERVICE_POSTSCRIPT_INFO_H
#include "cffdrivr.h"
#include "cffgload.h"
@@ -227,11 +228,11 @@
FT_Memory memory = FT_FACE_MEMORY( face );
FT_String* gname;
FT_UShort sid;
- FT_Service_PsNames psnames;
+ FT_Service_PsCMaps psnames;
FT_Error error;
- FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
if ( !psnames )
{
FT_ERROR(( "cff_get_glyph_name:" ));
@@ -274,7 +275,7 @@
{
CFF_Font cff;
CFF_Charset charset;
- FT_Service_PsNames psnames;
+ FT_Service_PsCMaps psnames;
FT_Memory memory = FT_FACE_MEMORY( face );
FT_String* name;
FT_UShort sid;
@@ -285,7 +286,7 @@
cff = (CFF_FontRec *)face->extra.data;
charset = &cff->charset;
- FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
for ( i = 0; i < cff->num_glyphs; i++ )
{
sid = charset->sids[i];
@@ -314,7 +315,26 @@
(FT_GlyphDict_NameIndexFunc)cff_get_name_index,
};
+ /*
+ * POSTSCRIPT INFO SERVICE
+ *
+ */
+ static FT_Int
+ cff_ps_has_glyph_names( FT_Face face )
+ {
+ FT_UNUSED( face );
+ return 1;
+ }
+
+ static const FT_Service_PsInfoRec cff_service_ps_info =
+ {
+ (PS_GetFontInfoFunc) NULL, /* unsupported with CFF fonts */
+ (PS_HasGlyphNamesFunc) cff_ps_has_glyph_names
+ };
+
+
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -329,9 +349,10 @@
static const FT_ServiceDescRec cff_services[] =
{
- { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CFF },
+ { FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CFF },
+ { FT_SERVICE_ID_POSTSCRIPT_INFO, &cff_service_ps_info },
#ifndef FT_CONFIG_OPTION_NO_GLYPH_NAMES
- { FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict },
+ { FT_SERVICE_ID_GLYPH_DICT, &cff_service_glyph_dict },
#endif
{ NULL, NULL }
};
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -20,7 +20,7 @@
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_STREAM_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_TRUETYPE_TAGS_H
#include "cffload.h"
@@ -1314,7 +1314,7 @@
FT_LOCAL_DEF( FT_String* )
cff_index_get_sid_string( CFF_Index idx,
FT_UInt sid,
- FT_Service_PsNames psnames )
+ FT_Service_PsCMaps psnames )
{
/* if it is not a standard string, return it */
if ( sid > 390 )
--- a/src/cff/cffload.h
+++ b/src/cff/cffload.h
@@ -21,8 +21,8 @@
#include <ft2build.h>
-#include FT_INTERNAL_CFF_TYPES_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include "cfftypes.h"
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
FT_BEGIN_HEADER
@@ -38,7 +38,7 @@
FT_LOCAL( FT_String* )
cff_index_get_sid_string( CFF_Index idx,
FT_UInt sid,
- FT_Service_PsNames psnames );
+ FT_Service_PsCMaps psnames );
FT_LOCAL( FT_Error )
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -24,7 +24,7 @@
#include FT_TRUETYPE_IDS_H
#include FT_TRUETYPE_TAGS_H
#include FT_INTERNAL_SFNT_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
#include "cffobjs.h"
#include "cffload.h"
@@ -255,7 +255,7 @@
{
FT_Error error;
SFNT_Service sfnt;
- FT_Service_PsNames psnames;
+ FT_Service_PsCMaps psnames;
PSHinter_Service pshinter;
FT_Bool pure_cff = 1;
FT_Bool sfnt_format = 0;
@@ -273,7 +273,7 @@
if ( !sfnt )
goto Bad_Format;
- FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
pshinter = (PSHinter_Service)FT_Get_Module_Interface(
face->root.driver->root.library, "pshinter" );
@@ -324,7 +324,7 @@
/* FreeType 2 */
}
- /* now, load the CFF part of the file */
+ /* now, load the CFF part of the file */
error = face->goto_table( face, TTAG_CFF, stream, 0 );
if ( error )
goto Exit;
--- a/src/cff/cffobjs.h
+++ b/src/cff/cffobjs.h
@@ -22,9 +22,9 @@
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
-#include FT_INTERNAL_CFF_TYPES_H
+#include "cfftypes.h"
#include FT_INTERNAL_TRUETYPE_TYPES_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
FT_BEGIN_HEADER
--- a/src/cff/cffparse.h
+++ b/src/cff/cffparse.h
@@ -21,7 +21,7 @@
#include <ft2build.h>
-#include FT_INTERNAL_CFF_TYPES_H
+#include "cfftypes.h"
#include FT_INTERNAL_OBJECTS_H
--- /dev/null
+++ b/src/cff/cfftypes.h
@@ -1,0 +1,256 @@
+/***************************************************************************/
+/* */
+/* cfftypes.h */
+/* */
+/* Basic OpenType/CFF type definitions and interface (specification */
+/* only). */
+/* */
+/* Copyright 1996-2001, 2002, 2003 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __CFFTYPES_H__
+#define __CFFTYPES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
+
+FT_BEGIN_HEADER
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* CFF_IndexRec */
+ /* */
+ /* <Description> */
+ /* A structure used to model a CFF Index table. */
+ /* */
+ /* <Fields> */
+ /* stream :: The source input stream. */
+ /* */
+ /* count :: The number of elements in the index. */
+ /* */
+ /* off_size :: The size in bytes of object offsets in index. */
+ /* */
+ /* data_offset :: The position of first data byte in the index's */
+ /* bytes. */
+ /* */
+ /* offsets :: A table of element offsets in the index. */
+ /* */
+ /* bytes :: If the index is loaded in memory, its bytes. */
+ /* */
+ typedef struct CFF_IndexRec_
+ {
+ FT_Stream stream;
+ FT_UInt count;
+ FT_Byte off_size;
+ FT_ULong data_offset;
+
+ FT_ULong* offsets;
+ FT_Byte* bytes;
+
+ } CFF_IndexRec, *CFF_Index;
+
+
+ typedef struct CFF_EncodingRec_
+ {
+ FT_UInt format;
+ FT_ULong offset;
+
+ FT_UInt count;
+ FT_UShort sids [256]; /* avoid dynamic allocations */
+ FT_UShort codes[256];
+
+ } CFF_EncodingRec, *CFF_Encoding;
+
+
+ typedef struct CFF_CharsetRec_
+ {
+
+ FT_UInt format;
+ FT_ULong offset;
+
+ FT_UShort* sids;
+
+ } CFF_CharsetRec, *CFF_Charset;
+
+
+ typedef struct CFF_FontRecDictRec_
+ {
+ FT_UInt version;
+ FT_UInt notice;
+ FT_UInt copyright;
+ FT_UInt full_name;
+ FT_UInt family_name;
+ FT_UInt weight;
+ FT_Bool is_fixed_pitch;
+ FT_Fixed italic_angle;
+ FT_Fixed underline_position;
+ FT_Fixed underline_thickness;
+ FT_Int paint_type;
+ FT_Int charstring_type;
+ FT_Matrix font_matrix;
+ FT_UShort units_per_em;
+ FT_Vector font_offset;
+ FT_ULong unique_id;
+ FT_BBox font_bbox;
+ FT_Pos stroke_width;
+ FT_ULong charset_offset;
+ FT_ULong encoding_offset;
+ FT_ULong charstrings_offset;
+ FT_ULong private_offset;
+ FT_ULong private_size;
+ FT_Long synthetic_base;
+ FT_UInt embedded_postscript;
+ FT_UInt base_font_name;
+ FT_UInt postscript;
+
+ /* these should only be used for the top-level font dictionary */
+ FT_UInt cid_registry;
+ FT_UInt cid_ordering;
+ FT_ULong cid_supplement;
+
+ FT_Long cid_font_version;
+ FT_Long cid_font_revision;
+ FT_Long cid_font_type;
+ FT_Long cid_count;
+ FT_ULong cid_uid_base;
+ FT_ULong cid_fd_array_offset;
+ FT_ULong cid_fd_select_offset;
+ FT_UInt cid_font_name;
+
+ } CFF_FontRecDictRec, *CFF_FontRecDict;
+
+
+ typedef struct CFF_PrivateRec_
+ {
+ FT_Byte num_blue_values;
+ FT_Byte num_other_blues;
+ FT_Byte num_family_blues;
+ FT_Byte num_family_other_blues;
+
+ FT_Pos blue_values[14];
+ FT_Pos other_blues[10];
+ FT_Pos family_blues[14];
+ FT_Pos family_other_blues[10];
+
+ FT_Fixed blue_scale;
+ FT_Pos blue_shift;
+ FT_Pos blue_fuzz;
+ FT_Pos standard_width;
+ FT_Pos standard_height;
+
+ FT_Byte num_snap_widths;
+ FT_Byte num_snap_heights;
+ FT_Pos snap_widths[13];
+ FT_Pos snap_heights[13];
+ FT_Bool force_bold;
+ FT_Fixed force_bold_threshold;
+ FT_Int lenIV;
+ FT_Int language_group;
+ FT_Fixed expansion_factor;
+ FT_Long initial_random_seed;
+ FT_ULong local_subrs_offset;
+ FT_Pos default_width;
+ FT_Pos nominal_width;
+
+ } CFF_PrivateRec, *CFF_Private;
+
+
+ typedef struct CFF_FDSelectRec_
+ {
+ FT_Byte format;
+ FT_UInt range_count;
+
+ /* that's the table, taken from the file `as is' */
+ FT_Byte* data;
+ FT_UInt data_size;
+
+ /* small cache for format 3 only */
+ FT_UInt cache_first;
+ FT_UInt cache_count;
+ FT_Byte cache_fd;
+
+ } CFF_FDSelectRec, *CFF_FDSelect;
+
+
+ /* A SubFont packs a font dict and a private dict together. They are */
+ /* needed to support CID-keyed CFF fonts. */
+ typedef struct CFF_SubFontRec_
+ {
+ CFF_FontRecDictRec font_dict;
+ CFF_PrivateRec private_dict;
+
+ CFF_IndexRec local_subrs_index;
+ FT_UInt num_local_subrs;
+ FT_Byte** local_subrs;
+
+ } CFF_SubFontRec, *CFF_SubFont;
+
+
+ /* maximum number of sub-fonts in a CID-keyed file */
+#define CFF_MAX_CID_FONTS 16
+
+
+ typedef struct CFF_FontRec_
+ {
+ FT_Stream stream;
+ FT_Memory memory;
+ FT_UInt num_faces;
+ FT_UInt num_glyphs;
+
+ FT_Byte version_major;
+ FT_Byte version_minor;
+ FT_Byte header_size;
+ FT_Byte absolute_offsize;
+
+
+ CFF_IndexRec name_index;
+ CFF_IndexRec top_dict_index;
+ CFF_IndexRec string_index;
+ CFF_IndexRec global_subrs_index;
+
+ CFF_EncodingRec encoding;
+ CFF_CharsetRec charset;
+
+ CFF_IndexRec charstrings_index;
+ CFF_IndexRec font_dict_index;
+ CFF_IndexRec private_index;
+ CFF_IndexRec local_subrs_index;
+
+ FT_String* font_name;
+ FT_UInt num_global_subrs;
+ FT_Byte** global_subrs;
+
+ CFF_SubFontRec top_font;
+ FT_UInt num_subfonts;
+ CFF_SubFont subfonts[CFF_MAX_CID_FONTS];
+
+ CFF_FDSelectRec fd_select;
+
+ /* interface to PostScript hinter */
+ void* pshinter;
+
+ /* interface to Postscript Names service */
+ void* psnames;
+
+ } CFF_FontRec, *CFF_Font;
+
+
+FT_END_HEADER
+
+#endif /* __CFFTYPES_H__ */
+
+
+/* END */
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -23,7 +23,7 @@
#include "cidgload.h"
#include "cidload.h"
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
@@ -269,7 +269,7 @@
FT_Parameter* params )
{
FT_Error error;
- FT_Service_PsNames psnames;
+ FT_Service_PsCMaps psnames;
PSAux_Service psaux;
PSHinter_Service pshinter;
@@ -281,7 +281,7 @@
face->root.num_faces = 1;
- FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
psaux = (PSAux_Service)face->psaux;
if ( !psaux )
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -26,6 +26,7 @@
#include FT_SERVICE_POSTSCRIPT_NAME_H
#include FT_SERVICE_XFREE86_NAME_H
+#include FT_SERVICE_POSTSCRIPT_INFO_H
/*************************************************************************/
/* */
@@ -62,6 +63,26 @@
/*
+ * POSTSCRIPT INFO SERVICE
+ *
+ */
+
+ static FT_Error
+ cid_ps_get_font_info( FT_Face face,
+ PS_FontInfoRec* afont_info )
+ {
+ *afont_info = ((CID_Face)face)->cid.font_info;
+ return 0;
+ }
+
+ static const FT_Service_PsInfoRec cid_service_ps_info =
+ {
+ (PS_GetFontInfoFunc) cid_ps_get_font_info,
+ (PS_HasGlyphNamesFunc) NULL /* unsupported with CID fonts */
+ };
+
+
+ /*
* SERVICE LIST
*
*/
@@ -70,6 +91,7 @@
{
{ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &cid_service_ps_name },
{ FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_CID },
+ { FT_SERVICE_ID_POSTSCRIPT_INFO, &cid_service_ps_info },
{ NULL, NULL }
};
--- a/src/gzip/infblock.c
+++ b/src/gzip/infblock.c
@@ -156,7 +156,8 @@
uInt bl, bd;
inflate_huft *tl, *td;
- inflate_trees_fixed(&bl, &bd, &tl, &td, z);
+ inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl,
+ (const inflate_huft**)&td, z);
s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
if (s->sub.decode.codes == Z_NULL)
{
--- a/src/psaux/t1cmap.c
+++ b/src/psaux/t1cmap.c
@@ -36,7 +36,7 @@
FT_Int is_expert )
{
T1_Face face = (T1_Face)FT_CMAP_FACE( cmap );
- FT_Service_PsNames psnames = (FT_Service_PsNames)face->psnames;
+ FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames;
cmap->num_glyphs = face->type1.num_glyphs;
@@ -282,7 +282,7 @@
FT_UInt count;
T1_Face face = (T1_Face)FT_CMAP_FACE( cmap );
FT_Memory memory = FT_FACE_MEMORY( face );
- FT_Service_PsNames psnames = (FT_Service_PsNames)face->psnames;
+ FT_Service_PsCMaps psnames = (FT_Service_PsCMaps)face->psnames;
cmap->num_pairs = 0;
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -127,7 +127,7 @@
{
FT_UInt n;
const FT_String* glyph_name;
- FT_Service_PsNames psnames = decoder->psnames;
+ FT_Service_PsCMaps psnames = decoder->psnames;
/* check range of standard char code */
@@ -1129,10 +1129,10 @@
/* retrieve PSNames interface from list of current modules */
{
- FT_Service_PsNames psnames = 0;
+ FT_Service_PsCMaps psnames = 0;
- FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
if ( !psnames )
{
FT_ERROR(( "t1_decoder_init: " ));
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -18,7 +18,7 @@
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include "psmodule.h"
#include "pstables.h"
@@ -335,7 +335,7 @@
static
- const FT_Service_PsNamesRec psnames_interface =
+ const FT_Service_PsCMapsRec pscmaps_interface =
{
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST
@@ -361,9 +361,9 @@
};
- static const FT_ServiceDescRec psnames_services[] =
+ static const FT_ServiceDescRec pscmaps_services[] =
{
- { FT_SERVICE_ID_POSTSCRIPT_NAMES, &psnames_interface },
+ { FT_SERVICE_ID_POSTSCRIPT_CMAPS, &pscmaps_interface },
{ NULL, NULL }
};
@@ -374,7 +374,7 @@
{
FT_UNUSED( module );
- return ft_service_list_lookup( psnames_services, service_id );
+ return ft_service_list_lookup( pscmaps_services, service_id );
}
#endif /* !FT_CONFIG_OPTION_NO_POSTSCRIPT_NAMES */
@@ -397,7 +397,7 @@
(FT_Module_Destructor) 0,
(FT_Module_Requester) 0
#else
- (void*)&psnames_interface, /* module specific interface */
+ (void*)&pscmaps_interface, /* module specific interface */
(FT_Module_Constructor)0,
(FT_Module_Destructor) 0,
(FT_Module_Requester) psnames_get_service
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -23,7 +23,7 @@
#include FT_INTERNAL_SFNT_H
#include FT_TRUETYPE_IDS_H
#include FT_TRUETYPE_TAGS_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include "sferrors.h"
@@ -364,7 +364,7 @@
face->goto_table = sfnt->goto_table;
}
- FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, face->psnames, POSTSCRIPT_CMAPS );
/* check that we have a valid TrueType file */
error = sfnt->load_sfnt_header( face, stream, face_index, &sfnt_header );
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -50,7 +50,7 @@
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#define MAC_NAME( x ) ( (FT_String*)psnames->macintosh_name( x ) )
@@ -441,7 +441,7 @@
FT_Fixed format;
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
- FT_Service_PsNames psnames;
+ FT_Service_PsCMaps psnames;
#endif
@@ -452,7 +452,7 @@
return SFNT_Err_Invalid_Glyph_Index;
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
- psnames = (FT_Service_PsNames)face->psnames;
+ psnames = (FT_Service_PsCMaps)face->psnames;
if ( !psnames )
return SFNT_Err_Unimplemented_Feature;
#endif
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -34,7 +34,8 @@
#include FT_SERVICE_GLYPH_DICT_H
#include FT_SERVICE_XFREE86_NAME_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
+#include FT_SERVICE_POSTSCRIPT_INFO_H
/*************************************************************************/
/* */
@@ -136,6 +137,32 @@
/*
+ * POSTSCRIPT INFO SERVICE
+ *
+ */
+
+ static FT_Error
+ t1_ps_get_font_info( FT_Face face,
+ PS_FontInfoRec* afont_info )
+ {
+ *afont_info = ((T1_Face)face)->type1.font_info;
+ return 0;
+ }
+
+ static FT_Int
+ t1_ps_has_glyph_names( FT_Face face )
+ {
+ FT_UNUSED( face );
+ return 1;
+ }
+
+ static const FT_Service_PsInfoRec t1_service_ps_info =
+ {
+ (PS_GetFontInfoFunc) t1_ps_get_font_info,
+ (PS_HasGlyphNamesFunc) t1_ps_has_glyph_names
+ };
+
+ /*
* SERVICE LIST
*
*/
@@ -145,6 +172,7 @@
{ FT_SERVICE_ID_POSTSCRIPT_FONT_NAME, &t1_service_ps_name },
{ FT_SERVICE_ID_GLYPH_DICT, &t1_service_glyph_dict },
{ FT_SERVICE_ID_XF86_NAME, FT_XF86_FORMAT_TYPE_1 },
+ { FT_SERVICE_ID_POSTSCRIPT_INFO, &t1_service_ps_info },
#ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT
{ FT_SERVICE_ID_MULTI_MASTERS, &t1_service_multi_masters },
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -29,7 +29,7 @@
#include "t1afm.h"
#endif
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H
@@ -276,7 +276,7 @@
FT_Parameter* params )
{
FT_Error error;
- FT_Service_PsNames psnames;
+ FT_Service_PsCMaps psnames;
PSAux_Service psaux;
T1_Font type1 = &face->type1;
PS_FontInfo info = &type1->font_info;
@@ -289,7 +289,7 @@
face->root.num_faces = 1;
- FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
face->psnames = psnames;
face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
--- a/src/type42/t42drivr.c
+++ b/src/type42/t42drivr.c
@@ -43,6 +43,7 @@
#include FT_SERVICE_XFREE86_NAME_H
#include FT_SERVICE_GLYPH_DICT_H
#include FT_SERVICE_POSTSCRIPT_NAME_H
+#include FT_SERVICE_POSTSCRIPT_INFO_H
#undef FT_COMPONENT
#define FT_COMPONENT trace_t42
@@ -124,6 +125,33 @@
static FT_Service_PsFontNameRec t42_service_ps_font_name =
{
(FT_PsName_GetFunc)t42_get_ps_font_name
+ };
+
+
+ /*
+ * POSTSCRIPT INFO SERVICE
+ *
+ */
+
+ static FT_Error
+ t42_ps_get_font_info( FT_Face face,
+ PS_FontInfoRec* afont_info )
+ {
+ *afont_info = ((T42_Face)face)->type1.font_info;
+ return 0;
+ }
+
+ static FT_Int
+ t42_ps_has_glyph_names( FT_Face face )
+ {
+ FT_UNUSED( face );
+ return 1;
+ }
+
+ static const FT_Service_PsInfoRec t42_service_ps_info =
+ {
+ (PS_GetFontInfoFunc) t42_ps_get_font_info,
+ (PS_HasGlyphNamesFunc) t42_ps_has_glyph_names
};
--- a/src/type42/t42objs.c
+++ b/src/type42/t42objs.c
@@ -154,7 +154,7 @@
FT_Parameter* params )
{
FT_Error error;
- FT_Service_PsNames psnames;
+ FT_Service_PsCMaps psnames;
PSAux_Service psaux;
FT_Face root = (FT_Face)&face->root;
T1_Font type1 = &face->type1;
@@ -169,7 +169,7 @@
face->ttf_face = NULL;
face->root.num_faces = 1;
- FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_NAMES );
+ FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
face->psnames = psnames;
face->psaux = FT_Get_Module_Interface( FT_FACE_LIBRARY( face ),
--- a/src/type42/t42objs.h
+++ b/src/type42/t42objs.h
@@ -22,10 +22,10 @@
#include FT_FREETYPE_H
#include FT_TYPE1_TABLES_H
#include FT_INTERNAL_TYPE1_TYPES_H
-#include FT_INTERNAL_TYPE42_TYPES_H
+#include "t42types.h"
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_DRIVER_H
-#include FT_SERVICE_POSTSCRIPT_NAMES_H
+#include FT_SERVICE_POSTSCRIPT_CMAPS_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H
--- /dev/null
+++ b/src/type42/t42types.h
@@ -1,0 +1,54 @@
+/***************************************************************************/
+/* */
+/* t42types.h */
+/* */
+/* Type 42 font data types (specification only). */
+/* */
+/* Copyright 2002 by Roberto Alameda. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
+#ifndef __T42TYPES_H__
+#define __T42TYPES_H__
+
+
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#include FT_TYPE1_TABLES_H
+#include FT_INTERNAL_TYPE1_TYPES_H
+#include FT_INTERNAL_POSTSCRIPT_HINTS_H
+
+
+FT_BEGIN_HEADER
+
+
+ typedef struct T42_FaceRec_
+ {
+ FT_FaceRec root;
+ T1_FontRec type1;
+ const void* psnames;
+ const void* psaux;
+ const void* afm_data;
+ FT_Byte* ttf_data;
+ FT_ULong ttf_size;
+ FT_Face ttf_face;
+ FT_CharMapRec charmaprecs[2];
+ FT_CharMap charmaps[2];
+ PS_Unicodes unicode_map;
+
+ } T42_FaceRec, *T42_Face;
+
+
+FT_END_HEADER
+
+#endif /* __T1TYPES_H__ */
+
+
+/* END */