1 /***************************************************************************/
5 /* Basic Type 1/Type 2 tables definitions and interface (specification */
8 /* Copyright 1996-2001, 2002, 2003, 2004 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 */
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,
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
215 /* maximum number of Multiple Masters designs, as defined in the spec */
216 #define T1_MAX_MM_DESIGNS 16
218 /* maximum number of Multiple Masters axes, as defined in the spec */
219 #define T1_MAX_MM_AXIS 4
221 /* maximum number of elements in a design map */
222 #define T1_MAX_MM_MAP_POINTS 20
225 /* this structure is used to store the BlendDesignMap entry for an axis */
226 typedef struct PS_DesignMap_
229 FT_Long* design_points;
230 FT_Fixed* blend_points;
232 } PS_DesignMapRec, *PS_DesignMap;
234 /* backwards-compatible definition */
235 typedef PS_DesignMapRec T1_DesignMap;
238 typedef struct PS_BlendRec_
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];
247 FT_Fixed* weight_vector;
248 FT_Fixed* default_weight_vector;
250 PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
251 PS_Private privates [T1_MAX_MM_DESIGNS + 1];
253 FT_ULong blend_bitflags;
255 FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
257 } PS_BlendRec, *PS_Blend;
260 /* backwards-compatible definition */
261 typedef PS_BlendRec T1_Blend;
264 typedef struct CID_FaceDictRec_
266 PS_PrivateRec private_dict;
268 FT_UInt len_buildchar;
269 FT_Fixed forcebold_threshold;
271 FT_Fixed expansion_factor;
275 FT_Matrix font_matrix;
276 FT_Vector font_offset;
279 FT_ULong subrmap_offset;
282 } CID_FaceDictRec, *CID_FaceDict;
285 /* backwards-compatible definition */
286 typedef CID_FaceDictRec CID_FontDict;
289 typedef struct CID_FaceInfoRec_
291 FT_String* cid_font_name;
292 FT_Fixed cid_version;
293 FT_Int cid_font_type;
299 PS_FontInfoRec font_info;
306 FT_ULong cidmap_offset;
312 CID_FaceDict font_dicts;
314 FT_ULong data_offset;
316 } CID_FaceInfoRec, *CID_FaceInfo;
319 /*************************************************************************/
325 /* This type is equivalent to CID_FaceInfoRec. It is deprecated but */
326 /* kept to maintain source compatibility between various versions of */
329 typedef CID_FaceInfoRec CID_Info;
334 /************************************************************************
337 * FT_Has_PS_Glyph_Names
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
345 * When this function returns true, the caller is sure that the glyph
346 * names returned by @FT_Get_Glyph_Name are reliable.
353 * Boolean. True if glyph names are reliable.
356 FT_Has_PS_Glyph_Names( FT_Face face );
359 /************************************************************************
362 * FT_Get_PS_Font_Info
365 * Retrieve the @PS_FontInfoRec structure corresponding to a given
370 * Postscript face handle.
374 * Output font info structure pointer.
377 * FreeType error code. 0 means success.
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.
383 * If the font's format is not Postscript-based, this function will
384 * return the FT_Err_Invalid_Argument error code.
386 FT_EXPORT( FT_Error )
387 FT_Get_PS_Font_Info( FT_Face face,
388 PS_FontInfoRec *afont_info );
391 /************************************************************************
394 * FT_Get_PS_Font_Private
397 * Retrieve the @PS_PrivateRec structure corresponding to a given
402 * Postscript face handle.
406 * Output private dictionary structure pointer.
409 * FreeType error code. 0 means success.
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.
415 * If the font's format is not Postscript-based, this function will
416 * return the FT_Err_Invalid_Argument error code.
418 FT_EXPORT( FT_Error )
419 FT_Get_PS_Font_Private( FT_Face face,
420 PS_PrivateRec *afont_private );
428 #endif /* __T1TABLES_H__ */