1 /***************************************************************************/
5 /* Basic OpenType/CFF type definitions and interface (specification */
8 /* Copyright 1996-2001 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 __CFFTYPES_H__
21 #define __CFFTYPES_H__
25 #include FT_FREETYPE_H
31 /*************************************************************************/
37 /* A structure used to model a CFF Index table. */
40 /* stream :: The source input stream. */
42 /* count :: The number of elements in the index. */
44 /* off_size :: The size in bytes of object offsets in index. */
46 /* data_offset :: The position of first data byte in the index's */
49 /* offsets :: A table of element offsets in the index. */
51 /* bytes :: If the index is loaded in memory, its bytes. */
53 typedef struct CFF_Index_
66 typedef struct CFF_Encoding_
77 typedef struct CFF_Charset_
88 typedef struct CFF_Font_Dict_
96 FT_Bool is_fixed_pitch;
97 FT_Fixed italic_angle;
98 FT_Pos underline_position;
99 FT_Pos underline_thickness;
101 FT_Int charstring_type;
102 FT_Matrix font_matrix;
103 FT_UShort units_per_em;
104 FT_Vector font_offset;
108 FT_ULong charset_offset;
109 FT_ULong encoding_offset;
110 FT_ULong charstrings_offset;
111 FT_ULong private_offset;
112 FT_ULong private_size;
113 FT_Long synthetic_base;
114 FT_UInt embedded_postscript;
115 FT_UInt base_font_name;
118 /* these should only be used for the top-level font dictionary */
119 FT_UInt cid_registry;
120 FT_UInt cid_ordering;
121 FT_ULong cid_supplement;
123 FT_Long cid_font_version;
124 FT_Long cid_font_revision;
125 FT_Long cid_font_type;
127 FT_ULong cid_uid_base;
128 FT_ULong cid_fd_array_offset;
129 FT_ULong cid_fd_select_offset;
130 FT_UInt cid_font_name;
135 typedef struct CFF_Private_
137 FT_Byte num_blue_values;
138 FT_Byte num_other_blues;
139 FT_Byte num_family_blues;
140 FT_Byte num_family_other_blues;
142 FT_Pos blue_values[14];
143 FT_Pos other_blues[10];
144 FT_Pos family_blues[14];
145 FT_Pos family_other_blues[10];
150 FT_Pos standard_width;
151 FT_Pos standard_height;
153 FT_Byte num_snap_widths;
154 FT_Byte num_snap_heights;
155 FT_Pos snap_widths[13];
156 FT_Pos snap_heights[13];
158 FT_Fixed force_bold_threshold;
160 FT_Int language_group;
161 FT_Fixed expansion_factor;
162 FT_Long initial_random_seed;
163 FT_ULong local_subrs_offset;
164 FT_Pos default_width;
165 FT_Pos nominal_width;
170 typedef struct CFF_FD_Select_
175 /* that's the table, taken from the file `as is' */
179 /* small cache for format 3 only */
187 /* A SubFont packs a font dict and a private dict together. They are */
188 /* needed to support CID-keyed CFF fonts. */
189 typedef struct CFF_SubFont_
191 CFF_Font_Dict font_dict;
192 CFF_Private private_dict;
194 CFF_Index local_subrs_index;
195 FT_UInt num_local_subrs;
196 FT_Byte** local_subrs;
201 /* maximum number of sub-fonts in a CID-keyed file */
202 #define CFF_MAX_CID_FONTS 16
205 typedef struct CFF_Font_
212 FT_Byte version_major;
213 FT_Byte version_minor;
215 FT_Byte absolute_offsize;
218 CFF_Index name_index;
219 CFF_Index top_dict_index;
220 CFF_Index string_index;
221 CFF_Index global_subrs_index;
223 CFF_Encoding encoding;
226 CFF_Index charstrings_index;
227 CFF_Index font_dict_index;
228 CFF_Index private_index;
229 CFF_Index local_subrs_index;
231 FT_String* font_name;
232 FT_UInt num_global_subrs;
233 FT_Byte** global_subrs;
235 CFF_SubFont top_font;
236 FT_UInt num_subfonts;
237 CFF_SubFont* subfonts[CFF_MAX_CID_FONTS];
239 CFF_FD_Select fd_select;
246 #endif /* __CFFTYPES_H__ */