Scribus
Open source desktop publishing at your fingertips
sfnt_format.h
1 //
2 // sfnt_format.h
3 // Scribus
4 //
5 // Created by Andreas Vox on 26.04.15.
6 //
7 //
8 
9 #ifndef Scribus_sfnt_format_h
10 #define Scribus_sfnt_format_h
11 
12 namespace sfnt {
13 
14 enum TTC_Format {
15  ttc_Tag = 0,
16  ttc_Version = 4,
17  ttc_numFonts = 8,
18  ttc_OffsetTables = 12,
19  ttc_ulDsigTag_OffsetTables = 0,
20  ttc_ulDsigLength_OffsetTables = 4,
21  ttc_ulDsigOffset_OffsetTables = 8
22 };
23 
24 
25 enum TTF_Format {
26  ttf_sfnt_version = 0,
27  ttf_numtables = 4,
28  ttf_searchRange = 6,
29  ttf_entrySelector = 8,
30  ttf_rangeShift = 10,
31  ttf_TableRecords = 12,
32  ttf_TableRecord_tag = 0,
33  ttf_TableRecord_checkSum = 4,
34  ttf_TableRecord_offset = 8,
35  ttf_TableRecord_length = 12,
36  ttf_TableRecord_Size = 16
37 };
38 
39 
40 enum TTF_head_Format {
41  ttf_head_version = 0,
42  ttf_head_fontRevision = 4,
43  ttf_head_checkSumAdjustment = 8,
44  ttf_head_magicNumber = 12,
45  ttf_head_flags = 16,
46  ttf_head_unitsPerEm = 18,
47  ttf_head_created = 20,
48  ttf_head_modified = 28,
49  ttf_head_xMin = 36,
50  ttf_head_yMin = 38,
51  ttf_head_xMax = 40,
52  ttf_head_yMax = 42,
53  ttf_head_macStyle = 44,
54  ttf_head_lowestRecPPEM = 46,
55  ttf_head_fontDirectionHint = 48,
56  ttf_head_indexToLocFormat = 50,
57  ttf_head_glyphDataFormat = 52
58 };
59 
60 
61 enum TTF_cmap_Format {
62  ttf_cmap_version = 0,
63  ttf_cmap_numberSubtables = 2,
64  ttf_cmap_encodings = 4,
65  ttf_cmap_encoding_platformID = 0,
66  ttf_cmap_encoding_platformSpecificID = 2,
67  ttf_cmap_encoding_offset = 4,
68  ttf_cmap_encoding_Size = 8,
69  ttf_cmapx_format = 0,
70  ttf_cmap4_length = 2,
71  ttf_cmap4_language = 4,
72  ttf_cmap4_segCountX2 = 6,
73  ttf_cmap4_searchRange = 8,
74  ttf_cmap4_entrySelector = 10,
75  ttf_cmap4_rangeShift = 12,
76  ttf_cmap4_EndCodes = 14,
77  ttf_cmap4_reservePad_EndCodes = 0,
78  ttf_cmap4_StartCodes_EndCodes = 2,
79  ttf_cmap4_IdDeltas_StartCodes = 0,
80  ttf_cmap4_IdRangeOffsets_IdDeltas = 0,
81  ttf_cmap4_GlyphIds_IdRangeOffsets = 0,
82  ttf_cmap6_firstCode = 6,
83  ttf_cmap6_entryCount = 8,
84  ttf_cmap6_glyphIndexArray = 10,
85  ttf_cmap12_nGroups = 12,
86  ttf_cmap12_Groups = 16,
87  ttf_cmap12_Group_startCharCode = 0,
88  ttf_cmap12_Group_endCharCode = 4,
89  ttf_cmap12_Group_startGlyphCode = 8,
90  ttf_cmap12_Group_Size = 12
91 };
92 
93 
94 enum TTF_glyf_Format {
95  ttf_glyf_numberOfContours = 0,
96  ttf_glyf_Max_numberOfContours = 0x7fff,
97 
98  ttf_glyf_xMin = 2,
99  ttf_glyf_yMin = 4,
100  ttf_glyf_xMax = 6,
101  ttf_glyf_yMax = 8,
102  ttf_glyf_headerSize = 10,
103  ttf_glyf_Components = 10,
104  ttf_glyf_Component_flags = 0,
105  ttf_glyf_Component_glyphIndex = 2,
106  ttf_glyf_Component_arguments = 4
107 };
108 
109 
110 enum TTF_glyf_ComponentFlags {
111  ttf_glyf_ComponentFlag_ARG_1_AND_2_ARE_WORDS = 0x0001,
112  ttf_glyf_ComponentFlag_ARGS_ARE_XYVALUES = 0x0002,
113  ttf_glyf_ComponentFlag_ROUND_XY_TO_GRID = 0x0004,
114  ttf_glyf_ComponentFlag_WE_HAVE_A_SCALE = 0x0008,
115  /* 0x0010 reserved */
116  ttf_glyf_ComponentFlag_MORE_COMPONENTS = 0x0020,
117  ttf_glyf_ComponentFlag_WE_HAVE_AN_X_AND_Y_SCALE = 0x0040,
118  ttf_glyf_ComponentFlag_WE_HAVE_A_TWO_BY_TWO = 0x0080,
119  ttf_glyf_ComponentFlag_WE_HAVE_INSTRUCTIONS = 0x0100,
120  ttf_glyf_ComponentFlag_USE_MY_METRICS = 0x0200,
121  ttf_glyf_ComponentFlag_OVERLAP_COMPOUND = 0x0400,
122  ttf_glyf_ComponentFlag_SCALED_COMPONENT_OFFSET = 0x0800,
123  ttf_glyf_ComponentFlag_UNSCALED_COMPONENT_OFFSET = 0x1000,
124 };
125 
126 
127 enum ttf_hhea_Format {
128  ttf_hhea_numOfLongHorMetrics = 34
129 };
130 
131 
132 enum ttf_maxp_Format {
133  ttf_maxp_version = 0,
134  ttf_maxp_numGlyphs = 4,
135  ttf_maxp_maxPoints = 6,
136  ttf_maxp_maxContours = 8,
137  ttf_maxp_maxComponentPoints = 10,
138  ttf_maxp_maxComponentContours = 12,
139  ttf_maxp_maxZones = 14,
140  ttf_maxp_maxTwilightPoints = 16,
141  ttf_maxp_maxStorage = 18,
142  ttf_maxp_maxFunctionDefs = 20,
143  ttf_maxp_maxInstructionDefs = 22,
144  ttf_maxp_maxStackElements = 24,
145  ttf_maxp_maxSizeOfInstructions = 26,
146  ttf_maxp_maxComponentElements = 28,
147  ttf_maxp_maxComponentDepth = 30,
148  ttf_maxp_Size = 32
149 };
150 
151 enum TTF_os2_Format {
152  ttf_os2_version = 0,
153  ttf_os2_xAvgCharWidth = 2,
154  ttf_os2_usWeightClass = 4,
155  ttf_os2_usWidthClass = 6,
156  ttf_os2_fsType = 8,
157  ttf_os2_ySubscriptXSize = 10,
158  ttf_os2_ySubscriptYSize = 12,
159  ttf_os2_ySubscriptXOffset = 14,
160  ttf_os2_ySubscriptYOffset = 16,
161  ttf_os2_ySuperscriptXSize = 18,
162  ttf_os2_ySuperscriptYSize = 20,
163  ttf_os2_ySuperscriptXOffset = 22,
164  ttf_os2_ySuperscriptYOffset = 24,
165  ttf_os2_yStrikeoutSize = 26,
166  ttf_os2_yStrikeoutPosition = 28,
167  ttf_os2_sFamilyClass = 30,
168  ttf_os2_panose = 32,
169  ttf_os2_ulCharRange = 42,
170  ttf_os2_ulUnicodeRange1 = 42,
171  ttf_os2_ulUnicodeRange2 = 46,
172  ttf_os2_ulUnicodeRange3 = 50,
173  ttf_os2_ulUnicodeRange4 = 54,
174  ttf_os2_achVendID = 58,
175  ttf_os2_fsSelection = 62,
176  ttf_os2_usFirstCharIndex = 64,
177  ttf_os2_usLastCharIndex = 66,
178  ttf_os2_sTypeAscender = 68,
179  ttf_os2_sTypeoDescender = 70,
180  ttf_os2_sTypoLineGap = 72,
181  ttf_os2_usWinAscent = 74,
182  ttf_os2_usWinDescent = 76,
183  ttf_os2_f1_ulCodePageRange1 = 78,
184  ttf_os2_f1_ulCodePageRange2 = 82,
185  ttf_os2_f2_sxHeight = 86,
186  ttf_os2_f2_CapHeight = 88,
187  ttf_os2_f2_usDefaultChar = 90,
188  ttf_os2_f2_usBreakChar = 92,
189  ttf_os2_f2_usMaxContext = 94,
190  ttf_os2_f5_usLowerOpticalPointSize = 96,
191  ttf_os2_f5_usUpperOpticalPointSize = 98
192 };
193 
194 enum TTF_post_Format {
195  ttf_post_format = 0,
196  /* more fields */
197  ttf_post_header_length = 32
198 };
199 
200 
201 enum TTF_post_format {
202  post_format10 = 0x00010000,
203  post_format20 = 0x00020000,
204  post_format25 = 0x00025000,
205  post_format30 = 0x00030000,
206  post_format40 = 0x00040000,
207 };
208 
209 } // namespace
210 
211 #endif
Definition: sfnt.cpp:18