1 /***************************************************************************/
5 /* Basic OpenType/CFF type definitions and interface (specification */
8 /* Copyright 1996-2000 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 /***************************************************************************/
24 #include <freetype/freetype.h>
27 /*************************************************************************/
33 /* A structure used to model a CFF Index table. */
38 /* count :: The number of elements in the index. */
40 /* off_size :: The size in bytes of object offsets in index. */
42 /* data_offset :: The position of first data byte in the index's */
47 /* bytes :: If the index is loaded in memory, its bytes. */
49 typedef struct CFF_Index_
62 typedef struct CFF_Font_Dict_
70 FT_Bool is_fixed_pitch;
71 FT_Fixed italic_angle;
72 FT_Pos underline_position;
73 FT_Pos underline_thickness;
75 FT_Int charstring_type;
76 FT_Matrix font_matrix;
80 FT_ULong charset_offset;
81 FT_ULong encoding_offset;
82 FT_ULong charstrings_offset;
83 FT_ULong private_offset;
84 FT_ULong private_size;
85 FT_Long synthetic_base;
86 FT_UInt embedded_postscript;
87 FT_UInt base_font_name;
90 /* these should only be used for the top-level font dictionary */
93 FT_ULong cid_supplement;
95 FT_Long cid_font_version;
96 FT_Long cid_font_revision;
97 FT_Long cid_font_type;
99 FT_ULong cid_uid_base;
100 FT_ULong cid_fd_array_offset;
101 FT_ULong cid_fd_select_offset;
102 FT_UInt cid_font_name;
107 typedef struct CFF_Private_
109 FT_Byte num_blue_values;
110 FT_Byte num_other_blues;
111 FT_Byte num_family_blues;
112 FT_Byte num_family_other_blues;
114 FT_Pos blue_values[14];
115 FT_Pos other_blues[10];
116 FT_Pos family_blues[14];
117 FT_Pos family_other_blues[10];
122 FT_Pos standard_width;
123 FT_Pos standard_height;
125 FT_Byte num_snap_widths;
126 FT_Byte num_snap_heights;
127 FT_Pos snap_widths[13];
128 FT_Pos snap_heights[13];
130 FT_Fixed force_bold_threshold;
132 FT_Int language_group;
133 FT_Fixed expansion_factor;
134 FT_Long initial_random_seed;
135 FT_ULong local_subrs_offset;
136 FT_Pos default_width;
137 FT_Pos nominal_width;
142 typedef struct CFF_FD_Select_
147 /* that's the table, taken from the file `as is' */
151 /* small cache for format 3 only */
159 /* A SubFont packs a font dict and a private dict together. They are */
160 /* needed to support CID-keyed CFF fonts. */
161 typedef struct CFF_SubFont_
163 CFF_Font_Dict font_dict;
164 CFF_Private private_dict;
166 CFF_Index local_subrs_index;
167 FT_UInt num_local_subrs;
168 FT_Byte** local_subrs;
173 /* maximum number of sub-fonts in a CID-keyed file */
174 #define CFF_MAX_CID_FONTS 16
177 typedef struct CFF_Font_
184 FT_Byte version_major;
185 FT_Byte version_minor;
187 FT_Byte absolute_offsize;
190 CFF_Index name_index;
191 CFF_Index top_dict_index;
192 CFF_Index string_index;
193 CFF_Index global_subrs_index;
195 /* we don't load the Encoding and CharSet tables */
197 CFF_Index charstrings_index;
198 CFF_Index font_dict_index;
199 CFF_Index private_index;
200 CFF_Index local_subrs_index;
202 FT_String* font_name;
203 FT_UInt num_global_subrs;
204 FT_Byte** global_subrs;
206 CFF_SubFont top_font;
207 FT_UInt num_subfonts;
208 CFF_SubFont* subfonts[CFF_MAX_CID_FONTS];
210 CFF_FD_Select fd_select;
215 #endif /* T2TYPES_H */