1 /***************************************************************************/
5 /* Basic Type 1/Type 2 tables definitions and interface (specification */
8 /* Copyright 1996-2001, 2002, 2003, 2004, 2006 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 /***************************************************************************/
20 #ifndef __T1TABLES_H__
21 #define __T1TABLES_H__
25 #include FT_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."
37 /*************************************************************************/
46 /* Type 1 (PostScript) specific font tables. */
49 /* This section contains the definition of Type 1-specific tables, */
50 /* including structures related to other PostScript font formats. */
52 /*************************************************************************/
55 /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */
56 /* structures in order to support Multiple Master fonts. */
59 /*************************************************************************/
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. */
69 typedef struct PS_FontInfoRec
74 FT_String
* family_name
;
77 FT_Bool is_fixed_pitch
;
78 FT_Short underline_position
;
79 FT_UShort underline_thickness
;
81 } PS_FontInfoRec
, *PS_FontInfo
;
84 /*************************************************************************/
90 /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
91 /* kept to maintain source compatibility between various versions of */
94 typedef PS_FontInfoRec T1_FontInfo
;
97 /*************************************************************************/
103 /* A structure used to model a Type1/Type2 private dictionary. Note */
104 /* that for Multiple Master fonts, each instance has its own Private */
107 typedef struct PS_PrivateRec_
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
;
117 FT_Short blue_values
[14];
118 FT_Short other_blues
[10];
120 FT_Short family_blues
[14];
121 FT_Short family_other_blues
[10];
127 FT_UShort standard_width
[1];
128 FT_UShort standard_height
[1];
130 FT_Byte num_snap_widths
;
131 FT_Byte num_snap_heights
;
133 FT_Bool round_stem_up
;
135 FT_Short snap_widths
[13]; /* including std width */
136 FT_Short snap_heights
[13]; /* including std height */
138 FT_Fixed expansion_factor
;
140 FT_Long language_group
;
143 FT_Short min_feature
[2];
145 } PS_PrivateRec
, *PS_Private
;
148 /*************************************************************************/
154 /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
155 /* kept to maintain source compatibility between various versions of */
158 typedef PS_PrivateRec T1_Private
;
161 /*************************************************************************/
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. */
173 /*# required fields in a FontInfo blend dictionary */
174 T1_BLEND_UNDERLINE_POSITION
= 0,
175 T1_BLEND_UNDERLINE_THICKNESS
,
176 T1_BLEND_ITALIC_ANGLE
,
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
,
187 T1_BLEND_FAMILY_BLUES
,
188 T1_BLEND_FAMILY_OTHER_BLUES
,
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
217 /* maximum number of Multiple Masters designs, as defined in the spec */
218 #define T1_MAX_MM_DESIGNS 16
220 /* maximum number of Multiple Masters axes, as defined in the spec */
221 #define T1_MAX_MM_AXIS 4
223 /* maximum number of elements in a design map */
224 #define T1_MAX_MM_MAP_POINTS 20
227 /* this structure is used to store the BlendDesignMap entry for an axis */
228 typedef struct PS_DesignMap_
231 FT_Long
* design_points
;
232 FT_Fixed
* blend_points
;
234 } PS_DesignMapRec
, *PS_DesignMap
;
236 /* backwards-compatible definition */
237 typedef PS_DesignMapRec T1_DesignMap
;
240 typedef struct PS_BlendRec_
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
];
249 FT_Fixed
* weight_vector
;
250 FT_Fixed
* default_weight_vector
;
252 PS_FontInfo font_infos
[T1_MAX_MM_DESIGNS
+ 1];
253 PS_Private privates
[T1_MAX_MM_DESIGNS
+ 1];
255 FT_ULong blend_bitflags
;
257 FT_BBox
* bboxes
[T1_MAX_MM_DESIGNS
+ 1];
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
;
268 } PS_BlendRec
, *PS_Blend
;
271 /* backwards-compatible definition */
272 typedef PS_BlendRec T1_Blend
;
275 typedef struct CID_FaceDictRec_
277 PS_PrivateRec private_dict
;
279 FT_UInt len_buildchar
;
280 FT_Fixed forcebold_threshold
;
282 FT_Fixed expansion_factor
;
286 FT_Matrix font_matrix
;
287 FT_Vector font_offset
;
290 FT_ULong subrmap_offset
;
293 } CID_FaceDictRec
, *CID_FaceDict
;
296 /* backwards-compatible definition */
297 typedef CID_FaceDictRec CID_FontDict
;
300 /*************************************************************************/
303 /* CID_FaceInfoRec */
306 /* A structure used to represent CID Face information. */
308 typedef struct CID_FaceInfoRec_
310 FT_String
* cid_font_name
;
311 FT_Fixed cid_version
;
312 FT_Int cid_font_type
;
318 PS_FontInfoRec font_info
;
325 FT_ULong cidmap_offset
;
331 CID_FaceDict font_dicts
;
333 FT_ULong data_offset
;
335 } CID_FaceInfoRec
, *CID_FaceInfo
;
338 /*************************************************************************/
344 /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
345 /* kept to maintain source compatibility between various versions of */
348 typedef CID_FaceInfoRec CID_Info
;
353 /************************************************************************
356 * FT_Has_PS_Glyph_Names
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
364 * When this function returns true, the caller is sure that the glyph
365 * names returned by @FT_Get_Glyph_Name are reliable.
372 * Boolean. True if glyph names are reliable.
375 FT_Has_PS_Glyph_Names( FT_Face face
);
378 /************************************************************************
381 * FT_Get_PS_Font_Info
384 * Retrieve the @PS_FontInfoRec structure corresponding to a given
389 * Postscript face handle.
393 * Output font info structure pointer.
396 * FreeType error code. 0 means success.
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.
402 * If the font's format is not Postscript-based, this function will
403 * return the `FT_Err_Invalid_Argument' error code.
405 FT_EXPORT( FT_Error
)
406 FT_Get_PS_Font_Info( FT_Face face
,
407 PS_FontInfoRec
*afont_info
);
410 /************************************************************************
413 * FT_Get_PS_Font_Private
416 * Retrieve the @PS_PrivateRec structure corresponding to a given
421 * Postscript face handle.
425 * Output private dictionary structure pointer.
428 * FreeType error code. 0 means success.
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.
434 * If the font's format is not Postscript-based, this function will
435 * return the `FT_Err_Invalid_Argument' error code.
437 FT_EXPORT( FT_Error
)
438 FT_Get_PS_Font_Private( FT_Face face
,
439 PS_PrivateRec
*afont_private
);
447 #endif /* __T1TABLES_H__ */