1 | /***************************************************************************/
|
---|
2 | /* */
|
---|
3 | /* t1tables.h */
|
---|
4 | /* */
|
---|
5 | /* Basic Type 1/Type 2 tables definitions and interface (specification */
|
---|
6 | /* only). */
|
---|
7 | /* */
|
---|
8 | /* Copyright 1996-2001, 2002, 2003, 2004 by */
|
---|
9 | /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
---|
10 | /* */
|
---|
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. */
|
---|
16 | /* */
|
---|
17 | /***************************************************************************/
|
---|
18 |
|
---|
19 |
|
---|
20 | #ifndef __T1TABLES_H__
|
---|
21 | #define __T1TABLES_H__
|
---|
22 |
|
---|
23 |
|
---|
24 | #include <ft2build.h>
|
---|
25 | #include FT_FREETYPE_H
|
---|
26 |
|
---|
27 | #ifdef FREETYPE_H
|
---|
28 | #error "freetype.h of FreeType 1 has been loaded!"
|
---|
29 | #error "Please fix the directory search order for header files"
|
---|
30 | #error "so that freetype.h of FreeType 2 is found first."
|
---|
31 | #endif
|
---|
32 |
|
---|
33 |
|
---|
34 | FT_BEGIN_HEADER
|
---|
35 |
|
---|
36 |
|
---|
37 | /*************************************************************************/
|
---|
38 | /* */
|
---|
39 | /* <Section> */
|
---|
40 | /* type1_tables */
|
---|
41 | /* */
|
---|
42 | /* <Title> */
|
---|
43 | /* Type 1 Tables */
|
---|
44 | /* */
|
---|
45 | /* <Abstract> */
|
---|
46 | /* Type 1 (PostScript) specific font tables. */
|
---|
47 | /* */
|
---|
48 | /* <Description> */
|
---|
49 | /* This section contains the definition of Type 1-specific tables, */
|
---|
50 | /* including structures related to other PostScript font formats. */
|
---|
51 | /* */
|
---|
52 | /*************************************************************************/
|
---|
53 |
|
---|
54 |
|
---|
55 | /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
|
---|
56 | /* structures in order to support Multiple Master fonts. */
|
---|
57 |
|
---|
58 |
|
---|
59 | /*************************************************************************/
|
---|
60 | /* */
|
---|
61 | /* <Struct> */
|
---|
62 | /* PS_FontInfoRec */
|
---|
63 | /* */
|
---|
64 | /* <Description> */
|
---|
65 | /* A structure used to model a Type1/Type2 FontInfo dictionary. Note */
|
---|
66 | /* that for Multiple Master fonts, each instance has its own */
|
---|
67 | /* FontInfo. */
|
---|
68 | /* */
|
---|
69 | typedef struct PS_FontInfoRec
|
---|
70 | {
|
---|
71 | FT_String* version;
|
---|
72 | FT_String* notice;
|
---|
73 | FT_String* full_name;
|
---|
74 | FT_String* family_name;
|
---|
75 | FT_String* weight;
|
---|
76 | FT_Long italic_angle;
|
---|
77 | FT_Bool is_fixed_pitch;
|
---|
78 | FT_Short underline_position;
|
---|
79 | FT_UShort underline_thickness;
|
---|
80 |
|
---|
81 | } PS_FontInfoRec, *PS_FontInfo;
|
---|
82 |
|
---|
83 |
|
---|
84 | /*************************************************************************/
|
---|
85 | /* */
|
---|
86 | /* <Struct> */
|
---|
87 | /* T1_FontInfo */
|
---|
88 | /* */
|
---|
89 | /* <Description> */
|
---|
90 | /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
|
---|
91 | /* kept to maintain source compatibility between various versions of */
|
---|
92 | /* FreeType. */
|
---|
93 | /* */
|
---|
94 | typedef PS_FontInfoRec T1_FontInfo;
|
---|
95 |
|
---|
96 |
|
---|
97 | /*************************************************************************/
|
---|
98 | /* */
|
---|
99 | /* <Struct> */
|
---|
100 | /* PS_PrivateRec */
|
---|
101 | /* */
|
---|
102 | /* <Description> */
|
---|
103 | /* A structure used to model a Type1/Type2 private dictionary. Note */
|
---|
104 | /* that for Multiple Master fonts, each instance has its own Private */
|
---|
105 | /* dictionary. */
|
---|
106 | /* */
|
---|
107 | typedef struct PS_PrivateRec_
|
---|
108 | {
|
---|
109 | FT_Int unique_id;
|
---|
110 | FT_Int lenIV;
|
---|
111 |
|
---|
112 | FT_Byte num_blue_values;
|
---|
113 | FT_Byte num_other_blues;
|
---|
114 | FT_Byte num_family_blues;
|
---|
115 | FT_Byte num_family_other_blues;
|
---|
116 |
|
---|
117 | FT_Short blue_values[14];
|
---|
118 | FT_Short other_blues[10];
|
---|
119 |
|
---|
120 | FT_Short family_blues [14];
|
---|
121 | FT_Short family_other_blues[10];
|
---|
122 |
|
---|
123 | FT_Fixed blue_scale;
|
---|
124 | FT_Int blue_shift;
|
---|
125 | FT_Int blue_fuzz;
|
---|
126 |
|
---|
127 | FT_UShort standard_width[1];
|
---|
128 | FT_UShort standard_height[1];
|
---|
129 |
|
---|
130 | FT_Byte num_snap_widths;
|
---|
131 | FT_Byte num_snap_heights;
|
---|
132 | FT_Bool force_bold;
|
---|
133 | FT_Bool round_stem_up;
|
---|
134 |
|
---|
135 | FT_Short snap_widths [13]; /* including std width */
|
---|
136 | FT_Short snap_heights[13]; /* including std height */
|
---|
137 |
|
---|
138 | FT_Fixed expansion_factor;
|
---|
139 |
|
---|
140 | FT_Long language_group;
|
---|
141 | FT_Long password;
|
---|
142 |
|
---|
143 | FT_Short min_feature[2];
|
---|
144 |
|
---|
145 | } PS_PrivateRec, *PS_Private;
|
---|
146 |
|
---|
147 |
|
---|
148 | /*************************************************************************/
|
---|
149 | /* */
|
---|
150 | /* <Struct> */
|
---|
151 | /* T1_Private */
|
---|
152 | /* */
|
---|
153 | /* <Description> */
|
---|
154 | /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
|
---|
155 | /* kept to maintain source compatibility between various versions of */
|
---|
156 | /* FreeType. */
|
---|
157 | /* */
|
---|
158 | typedef PS_PrivateRec T1_Private;
|
---|
159 |
|
---|
160 |
|
---|
161 | /*************************************************************************/
|
---|
162 | /* */
|
---|
163 | /* <Enum> */
|
---|
164 | /* T1_Blend_Flags */
|
---|
165 | /* */
|
---|
166 | /* <Description> */
|
---|
167 | /* A set of flags used to indicate which fields are present in a */
|
---|
168 | /* given blend dictionary (font info or private). Used to support */
|
---|
169 | /* Multiple Masters fonts. */
|
---|
170 | /* */
|
---|
171 | typedef enum
|
---|
172 | {
|
---|
173 | /*# required fields in a FontInfo blend dictionary */
|
---|
174 | T1_BLEND_UNDERLINE_POSITION = 0,
|
---|
175 | T1_BLEND_UNDERLINE_THICKNESS,
|
---|
176 | T1_BLEND_ITALIC_ANGLE,
|
---|
177 |
|
---|
178 | /*# required fields in a Private blend dictionary */
|
---|
179 | T1_BLEND_BLUE_VALUES,
|
---|
180 | T1_BLEND_OTHER_BLUES,
|
---|
181 | T1_BLEND_STANDARD_WIDTH,
|
---|
182 | T1_BLEND_STANDARD_HEIGHT,
|
---|
183 | T1_BLEND_STEM_SNAP_WIDTHS,
|
---|
184 | T1_BLEND_STEM_SNAP_HEIGHTS,
|
---|
185 | T1_BLEND_BLUE_SCALE,
|
---|
186 | T1_BLEND_BLUE_SHIFT,
|
---|
187 | T1_BLEND_FAMILY_BLUES,
|
---|
188 | T1_BLEND_FAMILY_OTHER_BLUES,
|
---|
189 | T1_BLEND_FORCE_BOLD,
|
---|
190 |
|
---|
191 | /*# never remove */
|
---|
192 | T1_BLEND_MAX
|
---|
193 |
|
---|
194 | } T1_Blend_Flags;
|
---|
195 |
|
---|
196 |
|
---|
197 | /*# backwards compatible definitions */
|
---|
198 | #define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
|
---|
199 | #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
|
---|
200 | #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
|
---|
201 | #define t1_blend_blue_values T1_BLEND_BLUE_VALUES
|
---|
202 | #define t1_blend_other_blues T1_BLEND_OTHER_BLUES
|
---|
203 | #define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
|
---|
204 | #define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
|
---|
205 | #define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
|
---|
206 | #define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
|
---|
207 | #define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
|
---|
208 | #define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
|
---|
209 | #define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
|
---|
210 | #define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
|
---|
211 | #define t1_blend_force_bold T1_BLEND_FORCE_BOLD
|
---|
212 | #define t1_blend_max T1_BLEND_MAX
|
---|
213 |
|
---|
214 |
|
---|
215 | /* maximum number of Multiple Masters designs, as defined in the spec */
|
---|
216 | #define T1_MAX_MM_DESIGNS 16
|
---|
217 |
|
---|
218 | /* maximum number of Multiple Masters axes, as defined in the spec */
|
---|
219 | #define T1_MAX_MM_AXIS 4
|
---|
220 |
|
---|
221 | /* maximum number of elements in a design map */
|
---|
222 | #define T1_MAX_MM_MAP_POINTS 20
|
---|
223 |
|
---|
224 |
|
---|
225 | /* this structure is used to store the BlendDesignMap entry for an axis */
|
---|
226 | typedef struct PS_DesignMap_
|
---|
227 | {
|
---|
228 | FT_Byte num_points;
|
---|
229 | FT_Long* design_points;
|
---|
230 | FT_Fixed* blend_points;
|
---|
231 |
|
---|
232 | } PS_DesignMapRec, *PS_DesignMap;
|
---|
233 |
|
---|
234 | /* backwards-compatible definition */
|
---|
235 | typedef PS_DesignMapRec T1_DesignMap;
|
---|
236 |
|
---|
237 |
|
---|
238 | typedef struct PS_BlendRec_
|
---|
239 | {
|
---|
240 | FT_UInt num_designs;
|
---|
241 | FT_UInt num_axis;
|
---|
242 |
|
---|
243 | FT_String* axis_names[T1_MAX_MM_AXIS];
|
---|
244 | FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
|
---|
245 | PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
|
---|
246 |
|
---|
247 | FT_Fixed* weight_vector;
|
---|
248 | FT_Fixed* default_weight_vector;
|
---|
249 |
|
---|
250 | PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
|
---|
251 | PS_Private privates [T1_MAX_MM_DESIGNS + 1];
|
---|
252 |
|
---|
253 | FT_ULong blend_bitflags;
|
---|
254 |
|
---|
255 | FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
|
---|
256 |
|
---|
257 | } PS_BlendRec, *PS_Blend;
|
---|
258 |
|
---|
259 |
|
---|
260 | /* backwards-compatible definition */
|
---|
261 | typedef PS_BlendRec T1_Blend;
|
---|
262 |
|
---|
263 |
|
---|
264 | typedef struct CID_FaceDictRec_
|
---|
265 | {
|
---|
266 | PS_PrivateRec private_dict;
|
---|
267 |
|
---|
268 | FT_UInt len_buildchar;
|
---|
269 | FT_Fixed forcebold_threshold;
|
---|
270 | FT_Pos stroke_width;
|
---|
271 | FT_Fixed expansion_factor;
|
---|
272 |
|
---|
273 | FT_Byte paint_type;
|
---|
274 | FT_Byte font_type;
|
---|
275 | FT_Matrix font_matrix;
|
---|
276 | FT_Vector font_offset;
|
---|
277 |
|
---|
278 | FT_UInt num_subrs;
|
---|
279 | FT_ULong subrmap_offset;
|
---|
280 | FT_Int sd_bytes;
|
---|
281 |
|
---|
282 | } CID_FaceDictRec, *CID_FaceDict;
|
---|
283 |
|
---|
284 |
|
---|
285 | /* backwards-compatible definition */
|
---|
286 | typedef CID_FaceDictRec CID_FontDict;
|
---|
287 |
|
---|
288 |
|
---|
289 | typedef struct CID_FaceInfoRec_
|
---|
290 | {
|
---|
291 | FT_String* cid_font_name;
|
---|
292 | FT_Fixed cid_version;
|
---|
293 | FT_Int cid_font_type;
|
---|
294 |
|
---|
295 | FT_String* registry;
|
---|
296 | FT_String* ordering;
|
---|
297 | FT_Int supplement;
|
---|
298 |
|
---|
299 | PS_FontInfoRec font_info;
|
---|
300 | FT_BBox font_bbox;
|
---|
301 | FT_ULong uid_base;
|
---|
302 |
|
---|
303 | FT_Int num_xuid;
|
---|
304 | FT_ULong xuid[16];
|
---|
305 |
|
---|
306 | FT_ULong cidmap_offset;
|
---|
307 | FT_Int fd_bytes;
|
---|
308 | FT_Int gd_bytes;
|
---|
309 | FT_ULong cid_count;
|
---|
310 |
|
---|
311 | FT_Int num_dicts;
|
---|
312 | CID_FaceDict font_dicts;
|
---|
313 |
|
---|
314 | FT_ULong data_offset;
|
---|
315 |
|
---|
316 | } CID_FaceInfoRec, *CID_FaceInfo;
|
---|
317 |
|
---|
318 |
|
---|
319 | /*************************************************************************/
|
---|
320 | /* */
|
---|
321 | /* <Struct> */
|
---|
322 | /* CID_Info */
|
---|
323 | /* */
|
---|
324 | /* <Description> */
|
---|
325 | /* This type is equivalent to CID_FaceInfoRec. It is deprecated but */
|
---|
326 | /* kept to maintain source compatibility between various versions of */
|
---|
327 | /* FreeType. */
|
---|
328 | /* */
|
---|
329 | typedef CID_FaceInfoRec CID_Info;
|
---|
330 |
|
---|
331 | /* */
|
---|
332 |
|
---|
333 |
|
---|
334 | /************************************************************************
|
---|
335 | *
|
---|
336 | * @function:
|
---|
337 | * FT_Has_PS_Glyph_Names
|
---|
338 | *
|
---|
339 | * @description:
|
---|
340 | * Return true if a given face provides reliable Postscript glyph
|
---|
341 | * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
|
---|
342 | * except that certain fonts (mostly TrueType) contain incorrect
|
---|
343 | * glyph name tables.
|
---|
344 | *
|
---|
345 | * When this function returns true, the caller is sure that the glyph
|
---|
346 | * names returned by @FT_Get_Glyph_Name are reliable.
|
---|
347 | *
|
---|
348 | * @input:
|
---|
349 | * face ::
|
---|
350 | * face handle
|
---|
351 | *
|
---|
352 | * @return:
|
---|
353 | * Boolean. True if glyph names are reliable.
|
---|
354 | */
|
---|
355 | FT_EXPORT( FT_Int )
|
---|
356 | FT_Has_PS_Glyph_Names( FT_Face face );
|
---|
357 |
|
---|
358 |
|
---|
359 | /************************************************************************
|
---|
360 | *
|
---|
361 | * @function:
|
---|
362 | * FT_Get_PS_Font_Info
|
---|
363 | *
|
---|
364 | * @description:
|
---|
365 | * Retrieve the @PS_FontInfoRec structure corresponding to a given
|
---|
366 | * Postscript font.
|
---|
367 | *
|
---|
368 | * @input:
|
---|
369 | * face ::
|
---|
370 | * Postscript face handle.
|
---|
371 | *
|
---|
372 | * @output:
|
---|
373 | * afont_info ::
|
---|
374 | * Output font info structure pointer.
|
---|
375 | *
|
---|
376 | * @return:
|
---|
377 | * FreeType error code. 0 means success.
|
---|
378 | *
|
---|
379 | * @note:
|
---|
380 | * The string pointers within the font info structure are owned by
|
---|
381 | * the face and don't need to be freed by the caller.
|
---|
382 | *
|
---|
383 | * If the font's format is not Postscript-based, this function will
|
---|
384 | * return the FT_Err_Invalid_Argument error code.
|
---|
385 | */
|
---|
386 | FT_EXPORT( FT_Error )
|
---|
387 | FT_Get_PS_Font_Info( FT_Face face,
|
---|
388 | PS_FontInfoRec *afont_info );
|
---|
389 |
|
---|
390 |
|
---|
391 | /************************************************************************
|
---|
392 | *
|
---|
393 | * @function:
|
---|
394 | * FT_Get_PS_Font_Private
|
---|
395 | *
|
---|
396 | * @description:
|
---|
397 | * Retrieve the @PS_PrivateRec structure corresponding to a given
|
---|
398 | * Postscript font.
|
---|
399 | *
|
---|
400 | * @input:
|
---|
401 | * face ::
|
---|
402 | * Postscript face handle.
|
---|
403 | *
|
---|
404 | * @output:
|
---|
405 | * afont_private ::
|
---|
406 | * Output private dictionary structure pointer.
|
---|
407 | *
|
---|
408 | * @return:
|
---|
409 | * FreeType error code. 0 means success.
|
---|
410 | *
|
---|
411 | * @note:
|
---|
412 | * The string pointers within the font info structure are owned by
|
---|
413 | * the face and don't need to be freed by the caller.
|
---|
414 | *
|
---|
415 | * If the font's format is not Postscript-based, this function will
|
---|
416 | * return the FT_Err_Invalid_Argument error code.
|
---|
417 | */
|
---|
418 | FT_EXPORT( FT_Error )
|
---|
419 | FT_Get_PS_Font_Private( FT_Face face,
|
---|
420 | PS_PrivateRec *afont_private );
|
---|
421 |
|
---|
422 | /* */
|
---|
423 |
|
---|
424 |
|
---|
425 |
|
---|
426 | FT_END_HEADER
|
---|
427 |
|
---|
428 | #endif /* __T1TABLES_H__ */
|
---|
429 |
|
---|
430 |
|
---|
431 | /* END */
|
---|