1 /***************************************************************************/
5 /* FreeType PFR data structures (specification only). */
7 /* Copyright 2002, 2003, 2005, 2007 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16 /***************************************************************************/
19 #ifndef __PFRTYPES_H__
20 #define __PFRTYPES_H__
23 #include FT_INTERNAL_OBJECTS_H
27 /************************************************************************/
29 /* the PFR Header structure */
30 typedef struct PFR_HeaderRec_
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
;
49 FT_UInt32 gps_section_size
;
50 FT_UInt32 gps_section_offset
;
52 FT_UInt max_blue_values
;
56 FT_UInt phy_font_max_size_high
;
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
;
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
80 /************************************************************************/
82 typedef struct PFR_LogFontRec_
89 FT_Int stroke_thickness
;
90 FT_Int bold_thickness
;
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,
104 PFR_LOG_2BYTE_STROKE
= 8,
106 PFR_LINE_JOIN_MASK
= 3
111 typedef enum PFR_LineJoinFlags_
113 PFR_LINE_JOIN_MITER
= 0,
114 PFR_LINE_JOIN_ROUND
= 1,
115 PFR_LINE_JOIN_BEVEL
= 2
120 /************************************************************************/
122 typedef enum PFR_BitmapFlags_
124 PFR_BITMAP_3BYTE_OFFSET
= 4,
125 PFR_BITMAP_2BYTE_SIZE
= 2,
126 PFR_BITMAP_2BYTE_CHARCODE
= 1
131 typedef struct PFR_BitmapCharRec_
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
151 typedef struct PFR_StrikeRec_
158 FT_UInt32 gps_offset
;
161 FT_UInt32 bct_offset
;
165 PFR_BitmapChar bitmaps
;
167 } PFR_StrikeRec
, *PFR_Strike
;
170 /************************************************************************/
172 typedef struct PFR_CharRec_
177 FT_UInt32 gps_offset
;
179 } PFR_CharRec
, *PFR_Char
;
182 /************************************************************************/
184 typedef struct PFR_DimensionRec_
187 FT_UInt num_stem_snaps
;
190 } PFR_DimensionRec
, *PFR_Dimension
;
192 /************************************************************************/
194 typedef struct PFR_KernItemRec_
* PFR_KernItem
;
196 typedef struct 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_
227 FT_UInt font_ref_number
;
228 FT_UInt outline_resolution
;
229 FT_UInt metrics_resolution
;
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
;
242 FT_String
* family_name
;
243 FT_String
* style_name
;
247 PFR_StrikeRec
* strikes
;
249 FT_UInt num_blue_values
;
255 FT_Offset chars_offset
;
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 */
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
282 typedef enum PFR_KernFlags_
284 PFR_KERN_2BYTE_CHAR
= 0x01,
285 PFR_KERN_2BYTE_ADJ
= 0x02
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
303 /* controlled coordinate */
304 typedef struct PFR_CoordRec_
309 } PFR_CoordRec
, *PFR_Coord
;
312 typedef struct PFR_SubGlyphRec_
318 FT_UInt32 gps_offset
;
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
334 typedef struct PFR_GlyphRec_
339 FT_UInt num_x_control
;
340 FT_UInt num_y_control
;
342 FT_UInt max_xy_control
;
349 PFR_SubGlyphRec
* subs
;
351 FT_GlyphLoader loader
;
354 } PFR_GlyphRec
, *PFR_Glyph
;
359 #endif /* __PFRTYPES_H__ */