1 /****************************************************************************
5 * FreeType PFR data structures (specification only).
7 * Copyright (C) 2002-2020 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.
22 #include <freetype/internal/ftobjs.h>
26 /************************************************************************/
28 /* the PFR Header structure */
29 typedef struct PFR_HeaderRec_
37 FT_UInt log_dir_offset;
39 FT_UInt log_font_max_size;
40 FT_UInt32 log_font_section_size;
41 FT_UInt32 log_font_section_offset;
43 FT_UInt32 phy_font_max_size;
44 FT_UInt32 phy_font_section_size;
45 FT_UInt32 phy_font_section_offset;
48 FT_UInt32 gps_section_size;
49 FT_UInt32 gps_section_offset;
51 FT_UInt max_blue_values;
55 FT_UInt phy_font_max_size_high;
58 FT_UInt32 bct_max_size;
59 FT_UInt32 bct_set_max_size;
60 FT_UInt32 phy_bct_set_max_size;
62 FT_UInt num_phy_fonts;
63 FT_UInt max_vert_stem_snap;
64 FT_UInt max_horz_stem_snap;
67 } PFR_HeaderRec, *PFR_Header;
70 /* used in `color_flags' field of the PFR_Header */
71 #define PFR_FLAG_BLACK_PIXEL 0x01U
72 #define PFR_FLAG_INVERT_BITMAP 0x02U
75 /************************************************************************/
77 typedef struct PFR_LogFontRec_
84 FT_Int stroke_thickness;
85 FT_Int bold_thickness;
89 FT_UInt32 phys_offset;
91 } PFR_LogFontRec, *PFR_LogFont;
94 #define PFR_LINE_JOIN_MITER 0x00U
95 #define PFR_LINE_JOIN_ROUND 0x01U
96 #define PFR_LINE_JOIN_BEVEL 0x02U
97 #define PFR_LINE_JOIN_MASK ( PFR_LINE_JOIN_ROUND | PFR_LINE_JOIN_BEVEL )
99 #define PFR_LOG_STROKE 0x04U
100 #define PFR_LOG_2BYTE_STROKE 0x08U
101 #define PFR_LOG_BOLD 0x10U
102 #define PFR_LOG_2BYTE_BOLD 0x20U
103 #define PFR_LOG_EXTRA_ITEMS 0x40U
106 /************************************************************************/
108 #define PFR_BITMAP_2BYTE_CHARCODE 0x01U
109 #define PFR_BITMAP_2BYTE_SIZE 0x02U
110 #define PFR_BITMAP_3BYTE_OFFSET 0x04U
112 /*not part of the specification but used for implementation */
113 #define PFR_BITMAP_CHARCODES_VALIDATED 0x40U
114 #define PFR_BITMAP_VALID_CHARCODES 0x80U
117 typedef struct PFR_BitmapCharRec_
121 FT_UInt32 gps_offset;
123 } PFR_BitmapCharRec, *PFR_BitmapChar;
126 #define PFR_STRIKE_2BYTE_XPPM 0x01U
127 #define PFR_STRIKE_2BYTE_YPPM 0x02U
128 #define PFR_STRIKE_3BYTE_SIZE 0x04U
129 #define PFR_STRIKE_3BYTE_OFFSET 0x08U
130 #define PFR_STRIKE_2BYTE_COUNT 0x10U
133 typedef struct PFR_StrikeRec_
140 FT_UInt32 gps_offset;
143 FT_UInt32 bct_offset;
147 PFR_BitmapChar bitmaps;
149 } PFR_StrikeRec, *PFR_Strike;
152 /************************************************************************/
154 typedef struct PFR_CharRec_
159 FT_UInt32 gps_offset;
161 } PFR_CharRec, *PFR_Char;
164 /************************************************************************/
166 typedef struct PFR_DimensionRec_
169 FT_UInt num_stem_snaps;
172 } PFR_DimensionRec, *PFR_Dimension;
174 /************************************************************************/
176 typedef struct PFR_KernItemRec_* PFR_KernItem;
178 typedef struct PFR_KernItemRec_
192 #define PFR_KERN_INDEX( g1, g2 ) \
193 ( ( (FT_UInt32)(g1) << 16 ) | (FT_UInt16)(g2) )
195 #define PFR_KERN_PAIR_INDEX( pair ) \
196 PFR_KERN_INDEX( (pair)->glyph1, (pair)->glyph2 )
198 #define PFR_NEXT_KPAIR( p ) ( p += 2, \
199 ( (FT_UInt32)p[-2] << 16 ) | p[-1] )
202 /************************************************************************/
204 typedef struct PFR_PhyFontRec_
209 FT_UInt font_ref_number;
210 FT_UInt outline_resolution;
211 FT_UInt metrics_resolution;
214 FT_Int standard_advance;
216 FT_Int ascent; /* optional, bbox.yMax if not present */
217 FT_Int descent; /* optional, bbox.yMin if not present */
218 FT_Int leading; /* optional, 0 if not present */
220 PFR_DimensionRec horizontal;
221 PFR_DimensionRec vertical;
224 FT_String* family_name;
225 FT_String* style_name;
229 PFR_StrikeRec* strikes;
231 FT_UInt num_blue_values;
237 FT_Offset chars_offset;
240 FT_UInt num_kern_pairs;
241 PFR_KernItem kern_items;
242 PFR_KernItem* kern_items_tail;
244 /* not part of the spec, but used during load */
248 } PFR_PhyFontRec, *PFR_PhyFont;
251 #define PFR_PHY_VERTICAL 0x01U
252 #define PFR_PHY_2BYTE_CHARCODE 0x02U
253 #define PFR_PHY_PROPORTIONAL 0x04U
254 #define PFR_PHY_ASCII_CODE 0x08U
255 #define PFR_PHY_2BYTE_GPS_SIZE 0x10U
256 #define PFR_PHY_3BYTE_GPS_OFFSET 0x20U
257 #define PFR_PHY_EXTRA_ITEMS 0x80U
260 #define PFR_KERN_2BYTE_CHAR 0x01U
261 #define PFR_KERN_2BYTE_ADJ 0x02U
264 /************************************************************************/
266 #define PFR_GLYPH_YCOUNT 0x01U
267 #define PFR_GLYPH_XCOUNT 0x02U
268 #define PFR_GLYPH_1BYTE_XYCOUNT 0x04U
270 #define PFR_GLYPH_SINGLE_EXTRA_ITEMS 0x08U
271 #define PFR_GLYPH_COMPOUND_EXTRA_ITEMS 0x40U
273 #define PFR_GLYPH_IS_COMPOUND 0x80U
276 /* controlled coordinate */
277 typedef struct PFR_CoordRec_
282 } PFR_CoordRec, *PFR_Coord;
285 typedef struct PFR_SubGlyphRec_
291 FT_UInt32 gps_offset;
294 } PFR_SubGlyphRec, *PFR_SubGlyph;
297 #define PFR_SUBGLYPH_XSCALE 0x10U
298 #define PFR_SUBGLYPH_YSCALE 0x20U
299 #define PFR_SUBGLYPH_2BYTE_SIZE 0x40U
300 #define PFR_SUBGLYPH_3BYTE_OFFSET 0x80U
303 typedef struct PFR_GlyphRec_
308 FT_UInt num_x_control;
309 FT_UInt num_y_control;
311 FT_UInt max_xy_control;
318 PFR_SubGlyphRec* subs;
320 FT_GlyphLoader loader;
323 } PFR_GlyphRec, *PFR_Glyph;
328 #endif /* PFRTYPES_H_ */