1 /***************************************************************************/
5 /* Basic Type 1/Type 2 tables definitions and interface (specification */
8 /* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 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 Type~1 or Type~2 FontInfo dictionary. */
66 /* Note 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
;
84 /*************************************************************************/
90 /* A handle to a @PS_FontInfoRec structure. */
92 typedef struct PS_FontInfoRec_
* PS_FontInfo
;
95 /*************************************************************************/
101 /* This type is equivalent to @PS_FontInfoRec. It is deprecated but */
102 /* kept to maintain source compatibility between various versions of */
105 typedef PS_FontInfoRec T1_FontInfo
;
108 /*************************************************************************/
114 /* A structure used to model a Type~1 or Type~2 private dictionary. */
115 /* Note that for Multiple Master fonts, each instance has its own */
116 /* Private dictionary. */
118 typedef struct PS_PrivateRec_
123 FT_Byte num_blue_values
;
124 FT_Byte num_other_blues
;
125 FT_Byte num_family_blues
;
126 FT_Byte num_family_other_blues
;
128 FT_Short blue_values
[14];
129 FT_Short other_blues
[10];
131 FT_Short family_blues
[14];
132 FT_Short family_other_blues
[10];
138 FT_UShort standard_width
[1];
139 FT_UShort standard_height
[1];
141 FT_Byte num_snap_widths
;
142 FT_Byte num_snap_heights
;
144 FT_Bool round_stem_up
;
146 FT_Short snap_widths
[13]; /* including std width */
147 FT_Short snap_heights
[13]; /* including std height */
149 FT_Fixed expansion_factor
;
151 FT_Long language_group
;
154 FT_Short min_feature
[2];
159 /*************************************************************************/
165 /* A handle to a @PS_PrivateRec structure. */
167 typedef struct PS_PrivateRec_
* PS_Private
;
170 /*************************************************************************/
176 /* This type is equivalent to @PS_PrivateRec. It is deprecated but */
177 /* kept to maintain source compatibility between various versions of */
180 typedef PS_PrivateRec T1_Private
;
183 /*************************************************************************/
189 /* A set of flags used to indicate which fields are present in a */
190 /* given blend dictionary (font info or private). Used to support */
191 /* Multiple Masters fonts. */
193 typedef enum T1_Blend_Flags_
195 /*# required fields in a FontInfo blend dictionary */
196 T1_BLEND_UNDERLINE_POSITION
= 0,
197 T1_BLEND_UNDERLINE_THICKNESS
,
198 T1_BLEND_ITALIC_ANGLE
,
200 /*# required fields in a Private blend dictionary */
201 T1_BLEND_BLUE_VALUES
,
202 T1_BLEND_OTHER_BLUES
,
203 T1_BLEND_STANDARD_WIDTH
,
204 T1_BLEND_STANDARD_HEIGHT
,
205 T1_BLEND_STEM_SNAP_WIDTHS
,
206 T1_BLEND_STEM_SNAP_HEIGHTS
,
209 T1_BLEND_FAMILY_BLUES
,
210 T1_BLEND_FAMILY_OTHER_BLUES
,
221 /*# backwards compatible definitions */
222 #define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION
223 #define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS
224 #define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE
225 #define t1_blend_blue_values T1_BLEND_BLUE_VALUES
226 #define t1_blend_other_blues T1_BLEND_OTHER_BLUES
227 #define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH
228 #define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT
229 #define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS
230 #define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS
231 #define t1_blend_blue_scale T1_BLEND_BLUE_SCALE
232 #define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT
233 #define t1_blend_family_blues T1_BLEND_FAMILY_BLUES
234 #define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES
235 #define t1_blend_force_bold T1_BLEND_FORCE_BOLD
236 #define t1_blend_max T1_BLEND_MAX
239 /* maximum number of Multiple Masters designs, as defined in the spec */
240 #define T1_MAX_MM_DESIGNS 16
242 /* maximum number of Multiple Masters axes, as defined in the spec */
243 #define T1_MAX_MM_AXIS 4
245 /* maximum number of elements in a design map */
246 #define T1_MAX_MM_MAP_POINTS 20
249 /* this structure is used to store the BlendDesignMap entry for an axis */
250 typedef struct PS_DesignMap_
253 FT_Long
* design_points
;
254 FT_Fixed
* blend_points
;
256 } PS_DesignMapRec
, *PS_DesignMap
;
258 /* backwards-compatible definition */
259 typedef PS_DesignMapRec T1_DesignMap
;
262 typedef struct PS_BlendRec_
267 FT_String
* axis_names
[T1_MAX_MM_AXIS
];
268 FT_Fixed
* design_pos
[T1_MAX_MM_DESIGNS
];
269 PS_DesignMapRec design_map
[T1_MAX_MM_AXIS
];
271 FT_Fixed
* weight_vector
;
272 FT_Fixed
* default_weight_vector
;
274 PS_FontInfo font_infos
[T1_MAX_MM_DESIGNS
+ 1];
275 PS_Private privates
[T1_MAX_MM_DESIGNS
+ 1];
277 FT_ULong blend_bitflags
;
279 FT_BBox
* bboxes
[T1_MAX_MM_DESIGNS
+ 1];
283 /* undocumented, optional: the default design instance; */
284 /* corresponds to default_weight_vector -- */
285 /* num_default_design_vector == 0 means it is not present */
286 /* in the font and associated metrics files */
287 FT_UInt default_design_vector
[T1_MAX_MM_DESIGNS
];
288 FT_UInt num_default_design_vector
;
290 } PS_BlendRec
, *PS_Blend
;
293 /* backwards-compatible definition */
294 typedef PS_BlendRec T1_Blend
;
297 /*************************************************************************/
300 /* CID_FaceDictRec */
303 /* A structure used to represent data in a CID top-level dictionary. */
305 typedef struct CID_FaceDictRec_
307 PS_PrivateRec private_dict
;
309 FT_UInt len_buildchar
;
310 FT_Fixed forcebold_threshold
;
312 FT_Fixed expansion_factor
;
316 FT_Matrix font_matrix
;
317 FT_Vector font_offset
;
320 FT_ULong subrmap_offset
;
326 /*************************************************************************/
332 /* A handle to a @CID_FaceDictRec structure. */
334 typedef struct CID_FaceDictRec_
* CID_FaceDict
;
339 /* backwards-compatible definition */
340 typedef CID_FaceDictRec CID_FontDict
;
343 /*************************************************************************/
346 /* CID_FaceInfoRec */
349 /* A structure used to represent CID Face information. */
351 typedef struct CID_FaceInfoRec_
353 FT_String
* cid_font_name
;
354 FT_Fixed cid_version
;
355 FT_Int cid_font_type
;
361 PS_FontInfoRec font_info
;
368 FT_ULong cidmap_offset
;
374 CID_FaceDict font_dicts
;
376 FT_ULong data_offset
;
381 /*************************************************************************/
387 /* A handle to a @CID_FaceInfoRec structure. */
389 typedef struct CID_FaceInfoRec_
* CID_FaceInfo
;
392 /*************************************************************************/
398 /* This type is equivalent to @CID_FaceInfoRec. It is deprecated but */
399 /* kept to maintain source compatibility between various versions of */
402 typedef CID_FaceInfoRec CID_Info
;
405 /************************************************************************
408 * FT_Has_PS_Glyph_Names
411 * Return true if a given face provides reliable PostScript glyph
412 * names. This is similar to using the @FT_HAS_GLYPH_NAMES macro,
413 * except that certain fonts (mostly TrueType) contain incorrect
416 * When this function returns true, the caller is sure that the glyph
417 * names returned by @FT_Get_Glyph_Name are reliable.
424 * Boolean. True if glyph names are reliable.
428 FT_Has_PS_Glyph_Names( FT_Face face
);
431 /************************************************************************
434 * FT_Get_PS_Font_Info
437 * Retrieve the @PS_FontInfoRec structure corresponding to a given
442 * PostScript face handle.
446 * Output font info structure pointer.
449 * FreeType error code. 0~means success.
452 * The string pointers within the font info structure are owned by
453 * the face and don't need to be freed by the caller.
455 * If the font's format is not PostScript-based, this function will
456 * return the `FT_Err_Invalid_Argument' error code.
459 FT_EXPORT( FT_Error
)
460 FT_Get_PS_Font_Info( FT_Face face
,
461 PS_FontInfo afont_info
);
464 /************************************************************************
467 * FT_Get_PS_Font_Private
470 * Retrieve the @PS_PrivateRec structure corresponding to a given
475 * PostScript face handle.
479 * Output private dictionary structure pointer.
482 * FreeType error code. 0~means success.
485 * The string pointers within the @PS_PrivateRec structure are owned by
486 * the face and don't need to be freed by the caller.
488 * If the font's format is not PostScript-based, this function returns
489 * the `FT_Err_Invalid_Argument' error code.
492 FT_EXPORT( FT_Error
)
493 FT_Get_PS_Font_Private( FT_Face face
,
494 PS_Private afont_private
);
501 #endif /* __T1TABLES_H__ */