Disabling auto-refresh of game list by default, as it is causing bugs sometimes
[open-ps2-loader.git] / thirdparty / freetype-2.3.12 / src / pfr / pfrtypes.h
blob918310814c57e5de236707a6db53e7938891a210
1 /***************************************************************************/
2 /* */
3 /* pfrtypes.h */
4 /* */
5 /* FreeType PFR data structures (specification only). */
6 /* */
7 /* Copyright 2002, 2003, 2005, 2007 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
9 /* */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
15 /* */
16 /***************************************************************************/
19 #ifndef __PFRTYPES_H__
20 #define __PFRTYPES_H__
22 #include <ft2build.h>
23 #include FT_INTERNAL_OBJECTS_H
25 FT_BEGIN_HEADER
27 /************************************************************************/
29 /* the PFR Header structure */
30 typedef struct PFR_HeaderRec_
32 FT_UInt32 signature;
33 FT_UInt version;
34 FT_UInt signature2;
35 FT_UInt header_size;
37 FT_UInt log_dir_size;
38 FT_UInt log_dir_offset;
40 FT_UInt log_font_max_size;
41 FT_UInt32 log_font_section_size;
42 FT_UInt32 log_font_section_offset;
44 FT_UInt32 phy_font_max_size;
45 FT_UInt32 phy_font_section_size;
46 FT_UInt32 phy_font_section_offset;
48 FT_UInt gps_max_size;
49 FT_UInt32 gps_section_size;
50 FT_UInt32 gps_section_offset;
52 FT_UInt max_blue_values;
53 FT_UInt max_x_orus;
54 FT_UInt max_y_orus;
56 FT_UInt phy_font_max_size_high;
57 FT_UInt color_flags;
59 FT_UInt32 bct_max_size;
60 FT_UInt32 bct_set_max_size;
61 FT_UInt32 phy_bct_set_max_size;
63 FT_UInt num_phy_fonts;
64 FT_UInt max_vert_stem_snap;
65 FT_UInt max_horz_stem_snap;
66 FT_UInt max_chars;
68 } PFR_HeaderRec, *PFR_Header;
71 /* used in `color_flags' field of the PFR_Header */
72 typedef enum PFR_HeaderFlags_
74 PFR_FLAG_BLACK_PIXEL = 1,
75 PFR_FLAG_INVERT_BITMAP = 2
77 } PFR_HeaderFlags;
80 /************************************************************************/
82 typedef struct PFR_LogFontRec_
84 FT_UInt32 size;
85 FT_UInt32 offset;
87 FT_Int32 matrix[4];
88 FT_UInt stroke_flags;
89 FT_Int stroke_thickness;
90 FT_Int bold_thickness;
91 FT_Int32 miter_limit;
93 FT_UInt32 phys_size;
94 FT_UInt32 phys_offset;
96 } PFR_LogFontRec, *PFR_LogFont;
99 typedef enum PFR_LogFlags_
101 PFR_LOG_EXTRA_ITEMS = 0x40,
102 PFR_LOG_2BYTE_BOLD = 0x20,
103 PFR_LOG_BOLD = 0x10,
104 PFR_LOG_2BYTE_STROKE = 8,
105 PFR_LOG_STROKE = 4,
106 PFR_LINE_JOIN_MASK = 3
108 } PFR_LogFlags;
111 typedef enum PFR_LineJoinFlags_
113 PFR_LINE_JOIN_MITER = 0,
114 PFR_LINE_JOIN_ROUND = 1,
115 PFR_LINE_JOIN_BEVEL = 2
117 } PFR_LineJoinFlags;
120 /************************************************************************/
122 typedef enum PFR_BitmapFlags_
124 PFR_BITMAP_3BYTE_OFFSET = 4,
125 PFR_BITMAP_2BYTE_SIZE = 2,
126 PFR_BITMAP_2BYTE_CHARCODE = 1
128 } PFR_BitmapFlags;
131 typedef struct PFR_BitmapCharRec_
133 FT_UInt char_code;
134 FT_UInt gps_size;
135 FT_UInt32 gps_offset;
137 } PFR_BitmapCharRec, *PFR_BitmapChar;
140 typedef enum PFR_StrikeFlags_
142 PFR_STRIKE_2BYTE_COUNT = 0x10,
143 PFR_STRIKE_3BYTE_OFFSET = 0x08,
144 PFR_STRIKE_3BYTE_SIZE = 0x04,
145 PFR_STRIKE_2BYTE_YPPM = 0x02,
146 PFR_STRIKE_2BYTE_XPPM = 0x01
148 } PFR_StrikeFlags;
151 typedef struct PFR_StrikeRec_
153 FT_UInt x_ppm;
154 FT_UInt y_ppm;
155 FT_UInt flags;
157 FT_UInt32 gps_size;
158 FT_UInt32 gps_offset;
160 FT_UInt32 bct_size;
161 FT_UInt32 bct_offset;
163 /* optional */
164 FT_UInt num_bitmaps;
165 PFR_BitmapChar bitmaps;
167 } PFR_StrikeRec, *PFR_Strike;
170 /************************************************************************/
172 typedef struct PFR_CharRec_
174 FT_UInt char_code;
175 FT_Int advance;
176 FT_UInt gps_size;
177 FT_UInt32 gps_offset;
179 } PFR_CharRec, *PFR_Char;
182 /************************************************************************/
184 typedef struct PFR_DimensionRec_
186 FT_UInt standard;
187 FT_UInt num_stem_snaps;
188 FT_Int* stem_snaps;
190 } PFR_DimensionRec, *PFR_Dimension;
192 /************************************************************************/
194 typedef struct PFR_KernItemRec_* PFR_KernItem;
196 typedef struct PFR_KernItemRec_
198 PFR_KernItem next;
199 FT_Byte pair_count;
200 FT_Byte flags;
201 FT_Short base_adj;
202 FT_UInt pair_size;
203 FT_Offset offset;
204 FT_UInt32 pair1;
205 FT_UInt32 pair2;
207 } PFR_KernItemRec;
210 #define PFR_KERN_INDEX( g1, g2 ) \
211 ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) )
213 #define PFR_KERN_PAIR_INDEX( pair ) \
214 PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 )
216 #define PFR_NEXT_KPAIR( p ) ( p += 2, \
217 ( (FT_UInt32)p[-2] << 16 ) | p[-1] )
220 /************************************************************************/
222 typedef struct PFR_PhyFontRec_
224 FT_Memory memory;
225 FT_UInt32 offset;
227 FT_UInt font_ref_number;
228 FT_UInt outline_resolution;
229 FT_UInt metrics_resolution;
230 FT_BBox bbox;
231 FT_UInt flags;
232 FT_UInt standard_advance;
234 FT_Int ascent; /* optional, bbox.yMax if not present */
235 FT_Int descent; /* optional, bbox.yMin if not present */
236 FT_Int leading; /* optional, 0 if not present */
238 PFR_DimensionRec horizontal;
239 PFR_DimensionRec vertical;
241 FT_String* font_id;
242 FT_String* family_name;
243 FT_String* style_name;
245 FT_UInt num_strikes;
246 FT_UInt max_strikes;
247 PFR_StrikeRec* strikes;
249 FT_UInt num_blue_values;
250 FT_Int *blue_values;
251 FT_UInt blue_fuzz;
252 FT_UInt blue_scale;
254 FT_UInt num_chars;
255 FT_Offset chars_offset;
256 PFR_Char chars;
258 FT_UInt num_kern_pairs;
259 PFR_KernItem kern_items;
260 PFR_KernItem* kern_items_tail;
262 /* not part of the spec, but used during load */
263 FT_Long bct_offset;
264 FT_Byte* cursor;
266 } PFR_PhyFontRec, *PFR_PhyFont;
269 typedef enum PFR_PhyFlags_
271 PFR_PHY_EXTRA_ITEMS = 0x80,
272 PFR_PHY_3BYTE_GPS_OFFSET = 0x20,
273 PFR_PHY_2BYTE_GPS_SIZE = 0x10,
274 PFR_PHY_ASCII_CODE = 0x08,
275 PFR_PHY_PROPORTIONAL = 0x04,
276 PFR_PHY_2BYTE_CHARCODE = 0x02,
277 PFR_PHY_VERTICAL = 0x01
279 } PFR_PhyFlags;
282 typedef enum PFR_KernFlags_
284 PFR_KERN_2BYTE_CHAR = 0x01,
285 PFR_KERN_2BYTE_ADJ = 0x02
287 } PFR_KernFlags;
290 /************************************************************************/
292 typedef enum PFR_GlyphFlags_
294 PFR_GLYPH_IS_COMPOUND = 0x80,
295 PFR_GLYPH_EXTRA_ITEMS = 0x08,
296 PFR_GLYPH_1BYTE_XYCOUNT = 0x04,
297 PFR_GLYPH_XCOUNT = 0x02,
298 PFR_GLYPH_YCOUNT = 0x01
300 } PFR_GlyphFlags;
303 /* controlled coordinate */
304 typedef struct PFR_CoordRec_
306 FT_UInt org;
307 FT_UInt cur;
309 } PFR_CoordRec, *PFR_Coord;
312 typedef struct PFR_SubGlyphRec_
314 FT_Fixed x_scale;
315 FT_Fixed y_scale;
316 FT_Int x_delta;
317 FT_Int y_delta;
318 FT_UInt32 gps_offset;
319 FT_UInt gps_size;
321 } PFR_SubGlyphRec, *PFR_SubGlyph;
324 typedef enum PFR_SubgGlyphFlags_
326 PFR_SUBGLYPH_3BYTE_OFFSET = 0x80,
327 PFR_SUBGLYPH_2BYTE_SIZE = 0x40,
328 PFR_SUBGLYPH_YSCALE = 0x20,
329 PFR_SUBGLYPH_XSCALE = 0x10
331 } PFR_SubGlyphFlags;
334 typedef struct PFR_GlyphRec_
336 FT_Byte format;
338 #if 0
339 FT_UInt num_x_control;
340 FT_UInt num_y_control;
341 #endif
342 FT_UInt max_xy_control;
343 FT_Pos* x_control;
344 FT_Pos* y_control;
347 FT_UInt num_subs;
348 FT_UInt max_subs;
349 PFR_SubGlyphRec* subs;
351 FT_GlyphLoader loader;
352 FT_Bool path_begun;
354 } PFR_GlyphRec, *PFR_Glyph;
357 FT_END_HEADER
359 #endif /* __PFRTYPES_H__ */
362 /* END */