1 /***************************************************************************/
5 /* Basic Type1/Type2 type definitions and interface (specification */
8 /* Copyright 1996-2004, 2006, 2008, 2009, 2011, 2013 by */
9 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
11 /* This file is part of the FreeType project, and may only be used, */
12 /* modified, and distributed under the terms of the FreeType project */
13 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
14 /* this file you indicate that you have read the license and */
15 /* understand and accept it fully. */
17 /***************************************************************************/
25 #include FT_TYPE1_TABLES_H
26 #include FT_INTERNAL_POSTSCRIPT_HINTS_H
27 #include FT_INTERNAL_SERVICE_H
28 #include FT_SERVICE_POSTSCRIPT_CMAPS_H
34 /*************************************************************************/
35 /*************************************************************************/
36 /*************************************************************************/
39 /*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
42 /*************************************************************************/
43 /*************************************************************************/
44 /*************************************************************************/
47 /*************************************************************************/
53 /* A structure modeling a custom encoding. */
56 /* num_chars :: The number of character codes in the encoding. */
59 /* code_first :: The lowest valid character code in the encoding. */
61 /* code_last :: The highest valid character code in the encoding */
62 /* + 1. When equal to code_first there are no valid */
63 /* character codes. */
65 /* char_index :: An array of corresponding glyph indices. */
67 /* char_name :: An array of corresponding glyph names. */
69 typedef struct T1_EncodingRecRec_
75 FT_UShort* char_index;
76 FT_String** char_name;
78 } T1_EncodingRec, *T1_Encoding;
81 /* used to hold extra data of PS_FontInfoRec that
82 * cannot be stored in the publicly defined structure.
84 * Note these can't be blended with multiple-masters.
86 typedef struct PS_FontExtraRec_
93 typedef struct T1_FontRec_
95 PS_FontInfoRec font_info; /* font info dictionary */
96 PS_FontExtraRec font_extra; /* font info extra fields */
97 PS_PrivateRec private_dict; /* private dictionary */
98 FT_String* font_name; /* top-level dictionary */
100 T1_EncodingType encoding_type;
101 T1_EncodingRec encoding;
103 FT_Byte* subrs_block;
104 FT_Byte* charstrings_block;
105 FT_Byte* glyph_names_block;
109 FT_PtrDist* subrs_len;
112 FT_String** glyph_names; /* array of glyph names */
113 FT_Byte** charstrings; /* array of glyph charstrings */
114 FT_PtrDist* charstrings_len;
118 FT_Matrix font_matrix;
119 FT_Vector font_offset;
123 FT_Fixed stroke_width;
125 } T1_FontRec, *T1_Font;
128 typedef struct CID_SubrsRec_
133 } CID_SubrsRec, *CID_Subrs;
136 /*************************************************************************/
137 /*************************************************************************/
138 /*************************************************************************/
141 /*** AFM FONT INFORMATION STRUCTURES ***/
144 /*************************************************************************/
145 /*************************************************************************/
146 /*************************************************************************/
148 typedef struct AFM_TrackKernRec_
156 } AFM_TrackKernRec, *AFM_TrackKern;
158 typedef struct AFM_KernPairRec_
165 } AFM_KernPairRec, *AFM_KernPair;
167 typedef struct AFM_FontInfoRec_
173 AFM_TrackKern TrackKerns; /* free if non-NULL */
175 AFM_KernPair KernPairs; /* free if non-NULL */
178 } AFM_FontInfoRec, *AFM_FontInfo;
181 /*************************************************************************/
182 /*************************************************************************/
183 /*************************************************************************/
186 /*** ORIGINAL T1_FACE CLASS DEFINITION ***/
189 /*************************************************************************/
190 /*************************************************************************/
191 /*************************************************************************/
194 typedef struct T1_FaceRec_* T1_Face;
195 typedef struct CID_FaceRec_* CID_Face;
198 typedef struct T1_FaceRec_
204 const void* afm_data;
205 FT_CharMapRec charmaprecs[2];
206 FT_CharMap charmaps[2];
208 /* support for Multiple Masters fonts */
211 /* undocumented, optional: indices of subroutines that express */
212 /* the NormalizeDesignVector and the ConvertDesignVector procedure, */
213 /* respectively, as Type 2 charstrings; -1 if keywords not present */
217 /* undocumented, optional: has the same meaning as len_buildchar */
218 /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
219 FT_UInt len_buildchar;
222 /* since version 2.1 - interface to PostScript hinter */
223 const void* pshinter;
228 typedef struct CID_FaceRec_
234 PS_FontExtraRec font_extra;
240 /* since version 2.1 - interface to PostScript hinter */
243 /* since version 2.1.8, but was originally positioned after `afm_data' */
244 FT_Byte* binary_data; /* used if hex data has been converted */
245 FT_Stream cid_stream;
252 #endif /* __T1TYPES_H__ */