Merge 25584, 25588.
[reactos.git] / reactos / dll / 3rdparty / freetype / include / freetype / t1tables.h
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, 2006 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 dictionary. */
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
198
199 /*# backwards compatible definitions */
200 #define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
201 #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
202 #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
203 #define t1_blend_blue_values T1_BLEND_BLUE_VALUES
204 #define t1_blend_other_blues T1_BLEND_OTHER_BLUES
205 #define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
206 #define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
207 #define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
208 #define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
209 #define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
210 #define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
211 #define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
212 #define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
213 #define t1_blend_force_bold T1_BLEND_FORCE_BOLD
214 #define t1_blend_max T1_BLEND_MAX
215
216
217 /* maximum number of Multiple Masters designs, as defined in the spec */
218 #define T1_MAX_MM_DESIGNS 16
219
220 /* maximum number of Multiple Masters axes, as defined in the spec */
221 #define T1_MAX_MM_AXIS 4
222
223 /* maximum number of elements in a design map */
224 #define T1_MAX_MM_MAP_POINTS 20
225
226
227 /* this structure is used to store the BlendDesignMap entry for an axis */
228 typedef struct PS_DesignMap_
229 {
230 FT_Byte num_points;
231 FT_Long* design_points;
232 FT_Fixed* blend_points;
233
234 } PS_DesignMapRec, *PS_DesignMap;
235
236 /* backwards-compatible definition */
237 typedef PS_DesignMapRec T1_DesignMap;
238
239
240 typedef struct PS_BlendRec_
241 {
242 FT_UInt num_designs;
243 FT_UInt num_axis;
244
245 FT_String* axis_names[T1_MAX_MM_AXIS];
246 FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
247 PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
248
249 FT_Fixed* weight_vector;
250 FT_Fixed* default_weight_vector;
251
252 PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
253 PS_Private privates [T1_MAX_MM_DESIGNS + 1];
254
255 FT_ULong blend_bitflags;
256
257 FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
258
259 /* since 2.3.0 */
260
261 /* undocumented, optional: the default design instance; */
262 /* corresponds to default_weight_vector -- */
263 /* num_default_design_vector == 0 means it is not present */
264 /* in the font and associated metrics files */
265 FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
266 FT_UInt num_default_design_vector;
267
268 } PS_BlendRec, *PS_Blend;
269
270
271 /* backwards-compatible definition */
272 typedef PS_BlendRec T1_Blend;
273
274
275 typedef struct CID_FaceDictRec_
276 {
277 PS_PrivateRec private_dict;
278
279 FT_UInt len_buildchar;
280 FT_Fixed forcebold_threshold;
281 FT_Pos stroke_width;
282 FT_Fixed expansion_factor;
283
284 FT_Byte paint_type;
285 FT_Byte font_type;
286 FT_Matrix font_matrix;
287 FT_Vector font_offset;
288
289 FT_UInt num_subrs;
290 FT_ULong subrmap_offset;
291 FT_Int sd_bytes;
292
293 } CID_FaceDictRec, *CID_FaceDict;
294
295
296 /* backwards-compatible definition */
297 typedef CID_FaceDictRec CID_FontDict;
298
299
300 /*************************************************************************/
301 /* */
302 /* <Struct> */
303 /* CID_FaceInfoRec */
304 /* */
305 /* <Description> */
306 /* A structure used to represent CID Face information. */
307 /* */
308 typedef struct CID_FaceInfoRec_
309 {
310 FT_String* cid_font_name;
311 FT_Fixed cid_version;
312 FT_Int cid_font_type;
313
314 FT_String* registry;
315 FT_String* ordering;
316 FT_Int supplement;
317
318 PS_FontInfoRec font_info;
319 FT_BBox font_bbox;
320 FT_ULong uid_base;
321
322 FT_Int num_xuid;
323 FT_ULong xuid[16];
324
325 FT_ULong cidmap_offset;
326 FT_Int fd_bytes;
327 FT_Int gd_bytes;
328 FT_ULong cid_count;
329
330 FT_Int num_dicts;
331 CID_FaceDict font_dicts;
332
333 FT_ULong data_offset;
334
335 } CID_FaceInfoRec, *CID_FaceInfo;
336
337
338 /*************************************************************************/
339 /* */
340 /* <Struct> */
341 /* CID_Info */
342 /* */
343 /* <Description> */
344 /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
345 /* kept to maintain source compatibility between various versions of */
346 /* FreeType. */
347 /* */
348 typedef CID_FaceInfoRec CID_Info;
349
350 /* */
351
352
353 /************************************************************************
354 *
355 * @function:
356 * FT_Has_PS_Glyph_Names
357 *
358 * @description:
359 * Return true if a given face provides reliable Postscript glyph
360 * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
361 * except that certain fonts (mostly TrueType) contain incorrect
362 * glyph name tables.
363 *
364 * When this function returns true, the caller is sure that the glyph
365 * names returned by @FT_Get_Glyph_Name are reliable.
366 *
367 * @input:
368 * face ::
369 * face handle
370 *
371 * @return:
372 * Boolean. True if glyph names are reliable.
373 */
374 FT_EXPORT( FT_Int )
375 FT_Has_PS_Glyph_Names( FT_Face face );
376
377
378 /************************************************************************
379 *
380 * @function:
381 * FT_Get_PS_Font_Info
382 *
383 * @description:
384 * Retrieve the @PS_FontInfoRec structure corresponding to a given
385 * Postscript font.
386 *
387 * @input:
388 * face ::
389 * Postscript face handle.
390 *
391 * @output:
392 * afont_info ::
393 * Output font info structure pointer.
394 *
395 * @return:
396 * FreeType error code. 0 means success.
397 *
398 * @note:
399 * The string pointers within the font info structure are owned by
400 * the face and don't need to be freed by the caller.
401 *
402 * If the font's format is not Postscript-based, this function will
403 * return the `FT_Err_Invalid_Argument' error code.
404 */
405 FT_EXPORT( FT_Error )
406 FT_Get_PS_Font_Info( FT_Face face,
407 PS_FontInfoRec *afont_info );
408
409
410 /************************************************************************
411 *
412 * @function:
413 * FT_Get_PS_Font_Private
414 *
415 * @description:
416 * Retrieve the @PS_PrivateRec structure corresponding to a given
417 * Postscript font.
418 *
419 * @input:
420 * face ::
421 * Postscript face handle.
422 *
423 * @output:
424 * afont_private ::
425 * Output private dictionary structure pointer.
426 *
427 * @return:
428 * FreeType error code. 0 means success.
429 *
430 * @note:
431 * The string pointers within the font info structure are owned by
432 * the face and don't need to be freed by the caller.
433 *
434 * If the font's format is not Postscript-based, this function will
435 * return the `FT_Err_Invalid_Argument' error code.
436 */
437 FT_EXPORT( FT_Error )
438 FT_Get_PS_Font_Private( FT_Face face,
439 PS_PrivateRec *afont_private );
440
441 /* */
442
443
444
445 FT_END_HEADER
446
447 #endif /* __T1TABLES_H__ */
448
449
450 /* END */