• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1otData = [
2
3	#
4	# common
5	#
6
7	('LookupOrder', []),
8
9	('ScriptList', [
10		('uint16', 'ScriptCount', None, None, 'Number of ScriptRecords'),
11		('struct', 'ScriptRecord', 'ScriptCount', 0, 'Array of ScriptRecords -listed alphabetically by ScriptTag'),
12	]),
13
14	('ScriptRecord', [
15		('Tag', 'ScriptTag', None, None, '4-byte ScriptTag identifier'),
16		('Offset', 'Script', None, None, 'Offset to Script table-from beginning of ScriptList'),
17	]),
18
19	('Script', [
20		('Offset', 'DefaultLangSys', None, None, 'Offset to DefaultLangSys table-from beginning of Script table-may be NULL'),
21		('uint16', 'LangSysCount', None, None, 'Number of LangSysRecords for this script-excluding the DefaultLangSys'),
22		('struct', 'LangSysRecord', 'LangSysCount', 0, 'Array of LangSysRecords-listed alphabetically by LangSysTag'),
23	]),
24
25	('LangSysRecord', [
26		('Tag', 'LangSysTag', None, None, '4-byte LangSysTag identifier'),
27		('Offset', 'LangSys', None, None, 'Offset to LangSys table-from beginning of Script table'),
28	]),
29
30	('LangSys', [
31		('Offset', 'LookupOrder', None, None, '= NULL (reserved for an offset to a reordering table)'),
32		('uint16', 'ReqFeatureIndex', None, None, 'Index of a feature required for this language system- if no required features = 0xFFFF'),
33		('uint16', 'FeatureCount', None, None, 'Number of FeatureIndex values for this language system-excludes the required feature'),
34		('uint16', 'FeatureIndex', 'FeatureCount', 0, 'Array of indices into the FeatureList-in arbitrary order'),
35	]),
36
37	('FeatureList', [
38		('uint16', 'FeatureCount', None, None, 'Number of FeatureRecords in this table'),
39		('struct', 'FeatureRecord', 'FeatureCount', 0, 'Array of FeatureRecords-zero-based (first feature has FeatureIndex = 0)-listed alphabetically by FeatureTag'),
40	]),
41
42	('FeatureRecord', [
43		('Tag', 'FeatureTag', None, None, '4-byte feature identification tag'),
44		('Offset', 'Feature', None, None, 'Offset to Feature table-from beginning of FeatureList'),
45	]),
46
47	('Feature', [
48		('Offset', 'FeatureParams', None, None, '= NULL (reserved for offset to FeatureParams)'),
49		('uint16', 'LookupCount', None, None, 'Number of LookupList indices for this feature'),
50		('uint16', 'LookupListIndex', 'LookupCount', 0, 'Array of LookupList indices for this feature -zero-based (first lookup is LookupListIndex = 0)'),
51	]),
52
53	('FeatureParams', [
54	]),
55
56	('FeatureParamsSize', [
57		('DeciPoints', 'DesignSize', None, None, 'The design size in 720/inch units (decipoints).'),
58		('uint16', 'SubfamilyID', None, None, 'Serves as an identifier that associates fonts in a subfamily.'),
59		('NameID', 'SubfamilyNameID', None, None, 'Subfamily NameID.'),
60		('DeciPoints', 'RangeStart', None, None, 'Small end of recommended usage range (exclusive) in 720/inch units.'),
61		('DeciPoints', 'RangeEnd', None, None, 'Large end of recommended usage range (inclusive) in 720/inch units.'),
62	]),
63
64	('FeatureParamsStylisticSet', [
65		('uint16', 'Version', None, None, 'Set to 0.'),
66		('NameID', 'UINameID', None, None, 'UI NameID.'),
67	]),
68
69	('FeatureParamsCharacterVariants', [
70		('uint16', 'Format', None, None, 'Set to 0.'),
71		('NameID', 'FeatUILabelNameID', None, None, 'Feature UI label NameID.'),
72		('NameID', 'FeatUITooltipTextNameID', None, None, 'Feature UI tooltip text NameID.'),
73		('NameID', 'SampleTextNameID', None, None, 'Sample text NameID.'),
74		('uint16', 'NumNamedParameters', None, None, 'Number of named parameters.'),
75		('NameID', 'FirstParamUILabelNameID', None, None, 'First NameID of UI feature parameters.'),
76		('uint16', 'CharCount', None, None, 'Count of characters this feature provides glyph variants for.'),
77		('uint24', 'Character', 'CharCount', 0, 'Unicode characters for which this feature provides glyph variants.'),
78	]),
79
80	('LookupList', [
81		('uint16', 'LookupCount', None, None, 'Number of lookups in this table'),
82		('Offset', 'Lookup', 'LookupCount', 0, 'Array of offsets to Lookup tables-from beginning of LookupList -zero based (first lookup is Lookup index = 0)'),
83	]),
84
85	('Lookup', [
86		('uint16', 'LookupType', None, None, 'Different enumerations for GSUB and GPOS'),
87		('LookupFlag', 'LookupFlag', None, None, 'Lookup qualifiers'),
88		('uint16', 'SubTableCount', None, None, 'Number of SubTables for this lookup'),
89		('Offset', 'SubTable', 'SubTableCount', 0, 'Array of offsets to SubTables-from beginning of Lookup table'),
90		('uint16', 'MarkFilteringSet', None, 'LookupFlag & 0x0010', 'If set, indicates that the lookup table structure is followed by a MarkFilteringSet field. The layout engine skips over all mark glyphs not in the mark filtering set indicated.'),
91	]),
92
93	('CoverageFormat1', [
94		('uint16', 'CoverageFormat', None, None, 'Format identifier-format = 1'),
95		('uint16', 'GlyphCount', None, None, 'Number of glyphs in the GlyphArray'),
96		('GlyphID', 'GlyphArray', 'GlyphCount', 0, 'Array of GlyphIDs-in numerical order'),
97	]),
98
99	('CoverageFormat2', [
100		('uint16', 'CoverageFormat', None, None, 'Format identifier-format = 2'),
101		('uint16', 'RangeCount', None, None, 'Number of RangeRecords'),
102		('struct', 'RangeRecord', 'RangeCount', 0, 'Array of glyph ranges-ordered by Start GlyphID'),
103	]),
104
105	('RangeRecord', [
106		('GlyphID', 'Start', None, None, 'First GlyphID in the range'),
107		('GlyphID', 'End', None, None, 'Last GlyphID in the range'),
108		('uint16', 'StartCoverageIndex', None, None, 'Coverage Index of first GlyphID in range'),
109	]),
110
111	('ClassDefFormat1', [
112		('uint16', 'ClassFormat', None, None, 'Format identifier-format = 1'),
113		('GlyphID', 'StartGlyph', None, None, 'First GlyphID of the ClassValueArray'),
114		('uint16', 'GlyphCount', None, None, 'Size of the ClassValueArray'),
115		('uint16', 'ClassValueArray', 'GlyphCount', 0, 'Array of Class Values-one per GlyphID'),
116	]),
117
118	('ClassDefFormat2', [
119		('uint16', 'ClassFormat', None, None, 'Format identifier-format = 2'),
120		('uint16', 'ClassRangeCount', None, None, 'Number of ClassRangeRecords'),
121		('struct', 'ClassRangeRecord', 'ClassRangeCount', 0, 'Array of ClassRangeRecords-ordered by Start GlyphID'),
122	]),
123
124	('ClassRangeRecord', [
125		('GlyphID', 'Start', None, None, 'First GlyphID in the range'),
126		('GlyphID', 'End', None, None, 'Last GlyphID in the range'),
127		('uint16', 'Class', None, None, 'Applied to all glyphs in the range'),
128	]),
129
130	('Device', [
131		('uint16', 'StartSize', None, None, 'Smallest size to correct-in ppem'),
132		('uint16', 'EndSize', None, None, 'Largest size to correct-in ppem'),
133		('uint16', 'DeltaFormat', None, None, 'Format of DeltaValue array data: 1, 2, or 3'),
134		('DeltaValue', 'DeltaValue', '', 'DeltaFormat in (1,2,3)', 'Array of compressed data'),
135	]),
136
137
138	#
139	# gpos
140	#
141
142	('GPOS', [
143		('Version', 'Version', None, None, 'Version of the GPOS table- 0x00010000 or 0x00010001'),
144		('Offset', 'ScriptList', None, None, 'Offset to ScriptList table-from beginning of GPOS table'),
145		('Offset', 'FeatureList', None, None, 'Offset to FeatureList table-from beginning of GPOS table'),
146		('Offset', 'LookupList', None, None, 'Offset to LookupList table-from beginning of GPOS table'),
147		('LOffset', 'FeatureVariations', None, 'Version >= 0x00010001', 'Offset to FeatureVariations table-from beginning of GPOS table'),
148	]),
149
150	('SinglePosFormat1', [
151		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
152		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of SinglePos subtable'),
153		('uint16', 'ValueFormat', None, None, 'Defines the types of data in the ValueRecord'),
154		('ValueRecord', 'Value', None, None, 'Defines positioning value(s)-applied to all glyphs in the Coverage table'),
155	]),
156
157	('SinglePosFormat2', [
158		('uint16', 'PosFormat', None, None, 'Format identifier-format = 2'),
159		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of SinglePos subtable'),
160		('uint16', 'ValueFormat', None, None, 'Defines the types of data in the ValueRecord'),
161		('uint16', 'ValueCount', None, None, 'Number of ValueRecords'),
162		('ValueRecord', 'Value', 'ValueCount', 0, 'Array of ValueRecords-positioning values applied to glyphs'),
163	]),
164
165	('PairPosFormat1', [
166		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
167		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of PairPos subtable-only the first glyph in each pair'),
168		('uint16', 'ValueFormat1', None, None, 'Defines the types of data in ValueRecord1-for the first glyph in the pair -may be zero (0)'),
169		('uint16', 'ValueFormat2', None, None, 'Defines the types of data in ValueRecord2-for the second glyph in the pair -may be zero (0)'),
170		('uint16', 'PairSetCount', None, None, 'Number of PairSet tables'),
171		('Offset', 'PairSet', 'PairSetCount', 0, 'Array of offsets to PairSet tables-from beginning of PairPos subtable-ordered by Coverage Index'),
172	]),
173
174	('PairSet', [
175		('uint16', 'PairValueCount', None, None, 'Number of PairValueRecords'),
176		('struct', 'PairValueRecord', 'PairValueCount', 0, 'Array of PairValueRecords-ordered by GlyphID of the second glyph'),
177	]),
178
179	('PairValueRecord', [
180		('GlyphID', 'SecondGlyph', None, None, 'GlyphID of second glyph in the pair-first glyph is listed in the Coverage table'),
181		('ValueRecord', 'Value1', None, None, 'Positioning data for the first glyph in the pair'),
182		('ValueRecord', 'Value2', None, None, 'Positioning data for the second glyph in the pair'),
183	]),
184
185	('PairPosFormat2', [
186		('uint16', 'PosFormat', None, None, 'Format identifier-format = 2'),
187		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of PairPos subtable-for the first glyph of the pair'),
188		('uint16', 'ValueFormat1', None, None, 'ValueRecord definition-for the first glyph of the pair-may be zero (0)'),
189		('uint16', 'ValueFormat2', None, None, 'ValueRecord definition-for the second glyph of the pair-may be zero (0)'),
190		('Offset', 'ClassDef1', None, None, 'Offset to ClassDef table-from beginning of PairPos subtable-for the first glyph of the pair'),
191		('Offset', 'ClassDef2', None, None, 'Offset to ClassDef table-from beginning of PairPos subtable-for the second glyph of the pair'),
192		('uint16', 'Class1Count', None, None, 'Number of classes in ClassDef1 table-includes Class0'),
193		('uint16', 'Class2Count', None, None, 'Number of classes in ClassDef2 table-includes Class0'),
194		('struct', 'Class1Record', 'Class1Count', 0, 'Array of Class1 records-ordered by Class1'),
195	]),
196
197	('Class1Record', [
198		('struct', 'Class2Record', 'Class2Count', 0, 'Array of Class2 records-ordered by Class2'),
199	]),
200
201	('Class2Record', [
202		('ValueRecord', 'Value1', None, None, 'Positioning for first glyph-empty if ValueFormat1 = 0'),
203		('ValueRecord', 'Value2', None, None, 'Positioning for second glyph-empty if ValueFormat2 = 0'),
204	]),
205
206	('CursivePosFormat1', [
207		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
208		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of CursivePos subtable'),
209		('uint16', 'EntryExitCount', None, None, 'Number of EntryExit records'),
210		('struct', 'EntryExitRecord', 'EntryExitCount', 0, 'Array of EntryExit records-in Coverage Index order'),
211	]),
212
213	('EntryExitRecord', [
214		('Offset', 'EntryAnchor', None, None, 'Offset to EntryAnchor table-from beginning of CursivePos subtable-may be NULL'),
215		('Offset', 'ExitAnchor', None, None, 'Offset to ExitAnchor table-from beginning of CursivePos subtable-may be NULL'),
216	]),
217
218	('MarkBasePosFormat1', [
219		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
220		('Offset', 'MarkCoverage', None, None, 'Offset to MarkCoverage table-from beginning of MarkBasePos subtable'),
221		('Offset', 'BaseCoverage', None, None, 'Offset to BaseCoverage table-from beginning of MarkBasePos subtable'),
222		('uint16', 'ClassCount', None, None, 'Number of classes defined for marks'),
223		('Offset', 'MarkArray', None, None, 'Offset to MarkArray table-from beginning of MarkBasePos subtable'),
224		('Offset', 'BaseArray', None, None, 'Offset to BaseArray table-from beginning of MarkBasePos subtable'),
225	]),
226
227	('BaseArray', [
228		('uint16', 'BaseCount', None, None, 'Number of BaseRecords'),
229		('struct', 'BaseRecord', 'BaseCount', 0, 'Array of BaseRecords-in order of BaseCoverage Index'),
230	]),
231
232	('BaseRecord', [
233		('Offset', 'BaseAnchor', 'ClassCount', 0, 'Array of offsets (one per class) to Anchor tables-from beginning of BaseArray table-ordered by class-zero-based'),
234	]),
235
236	('MarkLigPosFormat1', [
237		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
238		('Offset', 'MarkCoverage', None, None, 'Offset to Mark Coverage table-from beginning of MarkLigPos subtable'),
239		('Offset', 'LigatureCoverage', None, None, 'Offset to Ligature Coverage table-from beginning of MarkLigPos subtable'),
240		('uint16', 'ClassCount', None, None, 'Number of defined mark classes'),
241		('Offset', 'MarkArray', None, None, 'Offset to MarkArray table-from beginning of MarkLigPos subtable'),
242		('Offset', 'LigatureArray', None, None, 'Offset to LigatureArray table-from beginning of MarkLigPos subtable'),
243	]),
244
245	('LigatureArray', [
246		('uint16', 'LigatureCount', None, None, 'Number of LigatureAttach table offsets'),
247		('Offset', 'LigatureAttach', 'LigatureCount', 0, 'Array of offsets to LigatureAttach tables-from beginning of LigatureArray table-ordered by LigatureCoverage Index'),
248	]),
249
250	('LigatureAttach', [
251		('uint16', 'ComponentCount', None, None, 'Number of ComponentRecords in this ligature'),
252		('struct', 'ComponentRecord', 'ComponentCount', 0, 'Array of Component records-ordered in writing direction'),
253	]),
254
255	('ComponentRecord', [
256		('Offset', 'LigatureAnchor', 'ClassCount', 0, 'Array of offsets (one per class) to Anchor tables-from beginning of LigatureAttach table-ordered by class-NULL if a component does not have an attachment for a class-zero-based array'),
257	]),
258
259	('MarkMarkPosFormat1', [
260		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
261		('Offset', 'Mark1Coverage', None, None, 'Offset to Combining Mark Coverage table-from beginning of MarkMarkPos subtable'),
262		('Offset', 'Mark2Coverage', None, None, 'Offset to Base Mark Coverage table-from beginning of MarkMarkPos subtable'),
263		('uint16', 'ClassCount', None, None, 'Number of Combining Mark classes defined'),
264		('Offset', 'Mark1Array', None, None, 'Offset to MarkArray table for Mark1-from beginning of MarkMarkPos subtable'),
265		('Offset', 'Mark2Array', None, None, 'Offset to Mark2Array table for Mark2-from beginning of MarkMarkPos subtable'),
266	]),
267
268	('Mark2Array', [
269		('uint16', 'Mark2Count', None, None, 'Number of Mark2 records'),
270		('struct', 'Mark2Record', 'Mark2Count', 0, 'Array of Mark2 records-in Coverage order'),
271	]),
272
273	('Mark2Record', [
274		('Offset', 'Mark2Anchor', 'ClassCount', 0, 'Array of offsets (one per class) to Anchor tables-from beginning of Mark2Array table-zero-based array'),
275	]),
276
277	('PosLookupRecord', [
278		('uint16', 'SequenceIndex', None, None, 'Index to input glyph sequence-first glyph = 0'),
279		('uint16', 'LookupListIndex', None, None, 'Lookup to apply to that position-zero-based'),
280	]),
281
282	('ContextPosFormat1', [
283		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
284		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of ContextPos subtable'),
285		('uint16', 'PosRuleSetCount', None, None, 'Number of PosRuleSet tables'),
286		('Offset', 'PosRuleSet', 'PosRuleSetCount', 0, 'Array of offsets to PosRuleSet tables-from beginning of ContextPos subtable-ordered by Coverage Index'),
287	]),
288
289	('PosRuleSet', [
290		('uint16', 'PosRuleCount', None, None, 'Number of PosRule tables'),
291		('Offset', 'PosRule', 'PosRuleCount', 0, 'Array of offsets to PosRule tables-from beginning of PosRuleSet-ordered by preference'),
292	]),
293
294	('PosRule', [
295		('uint16', 'GlyphCount', None, None, 'Number of glyphs in the Input glyph sequence'),
296		('uint16', 'PosCount', None, None, 'Number of PosLookupRecords'),
297		('GlyphID', 'Input', 'GlyphCount', -1, 'Array of input GlyphIDs-starting with the second glyph'),
298		('struct', 'PosLookupRecord', 'PosCount', 0, 'Array of positioning lookups-in design order'),
299	]),
300
301	('ContextPosFormat2', [
302		('uint16', 'PosFormat', None, None, 'Format identifier-format = 2'),
303		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of ContextPos subtable'),
304		('Offset', 'ClassDef', None, None, 'Offset to ClassDef table-from beginning of ContextPos subtable'),
305		('uint16', 'PosClassSetCount', None, None, 'Number of PosClassSet tables'),
306		('Offset', 'PosClassSet', 'PosClassSetCount', 0, 'Array of offsets to PosClassSet tables-from beginning of ContextPos subtable-ordered by class-may be NULL'),
307	]),
308
309	('PosClassSet', [
310		('uint16', 'PosClassRuleCount', None, None, 'Number of PosClassRule tables'),
311		('Offset', 'PosClassRule', 'PosClassRuleCount', 0, 'Array of offsets to PosClassRule tables-from beginning of PosClassSet-ordered by preference'),
312	]),
313
314	('PosClassRule', [
315		('uint16', 'GlyphCount', None, None, 'Number of glyphs to be matched'),
316		('uint16', 'PosCount', None, None, 'Number of PosLookupRecords'),
317		('uint16', 'Class', 'GlyphCount', -1, 'Array of classes-beginning with the second class-to be matched to the input glyph sequence'),
318		('struct', 'PosLookupRecord', 'PosCount', 0, 'Array of positioning lookups-in design order'),
319	]),
320
321	('ContextPosFormat3', [
322		('uint16', 'PosFormat', None, None, 'Format identifier-format = 3'),
323		('uint16', 'GlyphCount', None, None, 'Number of glyphs in the input sequence'),
324		('uint16', 'PosCount', None, None, 'Number of PosLookupRecords'),
325		('Offset', 'Coverage', 'GlyphCount', 0, 'Array of offsets to Coverage tables-from beginning of ContextPos subtable'),
326		('struct', 'PosLookupRecord', 'PosCount', 0, 'Array of positioning lookups-in design order'),
327	]),
328
329	('ChainContextPosFormat1', [
330		('uint16', 'PosFormat', None, None, 'Format identifier-format = 1'),
331		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of ContextPos subtable'),
332		('uint16', 'ChainPosRuleSetCount', None, None, 'Number of ChainPosRuleSet tables'),
333		('Offset', 'ChainPosRuleSet', 'ChainPosRuleSetCount', 0, 'Array of offsets to ChainPosRuleSet tables-from beginning of ContextPos subtable-ordered by Coverage Index'),
334	]),
335
336	('ChainPosRuleSet', [
337		('uint16', 'ChainPosRuleCount', None, None, 'Number of ChainPosRule tables'),
338		('Offset', 'ChainPosRule', 'ChainPosRuleCount', 0, 'Array of offsets to ChainPosRule tables-from beginning of ChainPosRuleSet-ordered by preference'),
339	]),
340
341	('ChainPosRule', [
342		('uint16', 'BacktrackGlyphCount', None, None, 'Total number of glyphs in the backtrack sequence (number of glyphs to be matched before the first glyph)'),
343		('GlyphID', 'Backtrack', 'BacktrackGlyphCount', 0, "Array of backtracking GlyphID's (to be matched before the input sequence)"),
344		('uint16', 'InputGlyphCount', None, None, 'Total number of glyphs in the input sequence (includes the first glyph)'),
345		('GlyphID', 'Input', 'InputGlyphCount', -1, 'Array of input GlyphIDs (start with second glyph)'),
346		('uint16', 'LookAheadGlyphCount', None, None, 'Total number of glyphs in the look ahead sequence (number of glyphs to be matched after the input sequence)'),
347		('GlyphID', 'LookAhead', 'LookAheadGlyphCount', 0, "Array of lookahead GlyphID's (to be matched after the input sequence)"),
348		('uint16', 'PosCount', None, None, 'Number of PosLookupRecords'),
349		('struct', 'PosLookupRecord', 'PosCount', 0, 'Array of PosLookupRecords (in design order)'),
350	]),
351
352	('ChainContextPosFormat2', [
353		('uint16', 'PosFormat', None, None, 'Format identifier-format = 2'),
354		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of ChainContextPos subtable'),
355		('Offset', 'BacktrackClassDef', None, None, 'Offset to ClassDef table containing backtrack sequence context-from beginning of ChainContextPos subtable'),
356		('Offset', 'InputClassDef', None, None, 'Offset to ClassDef table containing input sequence context-from beginning of ChainContextPos subtable'),
357		('Offset', 'LookAheadClassDef', None, None, 'Offset to ClassDef table containing lookahead sequence context-from beginning of ChainContextPos subtable'),
358		('uint16', 'ChainPosClassSetCount', None, None, 'Number of ChainPosClassSet tables'),
359		('Offset', 'ChainPosClassSet', 'ChainPosClassSetCount', 0, 'Array of offsets to ChainPosClassSet tables-from beginning of ChainContextPos subtable-ordered by input class-may be NULL'),
360	]),
361
362	('ChainPosClassSet', [
363		('uint16', 'ChainPosClassRuleCount', None, None, 'Number of ChainPosClassRule tables'),
364		('Offset', 'ChainPosClassRule', 'ChainPosClassRuleCount', 0, 'Array of offsets to ChainPosClassRule tables-from beginning of ChainPosClassSet-ordered by preference'),
365	]),
366
367	('ChainPosClassRule', [
368		('uint16', 'BacktrackGlyphCount', None, None, 'Total number of glyphs in the backtrack sequence (number of glyphs to be matched before the first glyph)'),
369		('uint16', 'Backtrack', 'BacktrackGlyphCount', 0, 'Array of backtracking classes(to be matched before the input sequence)'),
370		('uint16', 'InputGlyphCount', None, None, 'Total number of classes in the input sequence (includes the first class)'),
371		('uint16', 'Input', 'InputGlyphCount', -1, 'Array of input classes(start with second class; to be matched with the input glyph sequence)'),
372		('uint16', 'LookAheadGlyphCount', None, None, 'Total number of classes in the look ahead sequence (number of classes to be matched after the input sequence)'),
373		('uint16', 'LookAhead', 'LookAheadGlyphCount', 0, 'Array of lookahead classes(to be matched after the input sequence)'),
374		('uint16', 'PosCount', None, None, 'Number of PosLookupRecords'),
375		('struct', 'PosLookupRecord', 'PosCount', 0, 'Array of PosLookupRecords (in design order)'),
376	]),
377
378	('ChainContextPosFormat3', [
379		('uint16', 'PosFormat', None, None, 'Format identifier-format = 3'),
380		('uint16', 'BacktrackGlyphCount', None, None, 'Number of glyphs in the backtracking sequence'),
381		('Offset', 'BacktrackCoverage', 'BacktrackGlyphCount', 0, 'Array of offsets to coverage tables in backtracking sequence, in glyph sequence order'),
382		('uint16', 'InputGlyphCount', None, None, 'Number of glyphs in input sequence'),
383		('Offset', 'InputCoverage', 'InputGlyphCount', 0, 'Array of offsets to coverage tables in input sequence, in glyph sequence order'),
384		('uint16', 'LookAheadGlyphCount', None, None, 'Number of glyphs in lookahead sequence'),
385		('Offset', 'LookAheadCoverage', 'LookAheadGlyphCount', 0, 'Array of offsets to coverage tables in lookahead sequence, in glyph sequence order'),
386		('uint16', 'PosCount', None, None, 'Number of PosLookupRecords'),
387		('struct', 'PosLookupRecord', 'PosCount', 0, 'Array of PosLookupRecords,in design order'),
388	]),
389
390	('ExtensionPosFormat1', [
391		('uint16', 'ExtFormat', None, None, 'Format identifier. Set to 1.'),
392		('uint16', 'ExtensionLookupType', None, None, 'Lookup type of subtable referenced by ExtensionOffset (i.e. the extension subtable).'),
393		('LOffset', 'ExtSubTable', None, None, 'Offset to SubTable'),
394	]),
395
396#	('ValueRecord', [
397#		('int16', 'XPlacement', None, None, 'Horizontal adjustment for placement-in design units'),
398#		('int16', 'YPlacement', None, None, 'Vertical adjustment for placement-in design units'),
399#		('int16', 'XAdvance', None, None, 'Horizontal adjustment for advance-in design units (only used for horizontal writing)'),
400#		('int16', 'YAdvance', None, None, 'Vertical adjustment for advance-in design units (only used for vertical writing)'),
401#		('Offset', 'XPlaDevice', None, None, 'Offset to Device table for horizontal placement-measured from beginning of PosTable (may be NULL)'),
402#		('Offset', 'YPlaDevice', None, None, 'Offset to Device table for vertical placement-measured from beginning of PosTable (may be NULL)'),
403#		('Offset', 'XAdvDevice', None, None, 'Offset to Device table for horizontal advance-measured from beginning of PosTable (may be NULL)'),
404#		('Offset', 'YAdvDevice', None, None, 'Offset to Device table for vertical advance-measured from beginning of PosTable (may be NULL)'),
405#	]),
406
407	('AnchorFormat1', [
408		('uint16', 'AnchorFormat', None, None, 'Format identifier-format = 1'),
409		('int16', 'XCoordinate', None, None, 'Horizontal value-in design units'),
410		('int16', 'YCoordinate', None, None, 'Vertical value-in design units'),
411	]),
412
413	('AnchorFormat2', [
414		('uint16', 'AnchorFormat', None, None, 'Format identifier-format = 2'),
415		('int16', 'XCoordinate', None, None, 'Horizontal value-in design units'),
416		('int16', 'YCoordinate', None, None, 'Vertical value-in design units'),
417		('uint16', 'AnchorPoint', None, None, 'Index to glyph contour point'),
418	]),
419
420	('AnchorFormat3', [
421		('uint16', 'AnchorFormat', None, None, 'Format identifier-format = 3'),
422		('int16', 'XCoordinate', None, None, 'Horizontal value-in design units'),
423		('int16', 'YCoordinate', None, None, 'Vertical value-in design units'),
424		('Offset', 'XDeviceTable', None, None, 'Offset to Device table for X coordinate- from beginning of Anchor table (may be NULL)'),
425		('Offset', 'YDeviceTable', None, None, 'Offset to Device table for Y coordinate- from beginning of Anchor table (may be NULL)'),
426	]),
427
428	('MarkArray', [
429		('uint16', 'MarkCount', None, None, 'Number of MarkRecords'),
430		('struct', 'MarkRecord', 'MarkCount', 0, 'Array of MarkRecords-in Coverage order'),
431	]),
432
433	('MarkRecord', [
434		('uint16', 'Class', None, None, 'Class defined for this mark'),
435		('Offset', 'MarkAnchor', None, None, 'Offset to Anchor table-from beginning of MarkArray table'),
436	]),
437
438
439	#
440	# gsub
441	#
442
443	('GSUB', [
444		('Version', 'Version', None, None, 'Version of the GSUB table- 0x00010000 or 0x00010001'),
445		('Offset', 'ScriptList', None, None, 'Offset to ScriptList table-from beginning of GSUB table'),
446		('Offset', 'FeatureList', None, None, 'Offset to FeatureList table-from beginning of GSUB table'),
447		('Offset', 'LookupList', None, None, 'Offset to LookupList table-from beginning of GSUB table'),
448		('LOffset', 'FeatureVariations', None, 'Version >= 0x00010001', 'Offset to FeatureVariations table-from beginning of GSUB table'),
449	]),
450
451	('SingleSubstFormat1', [
452		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 1'),
453		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
454		('uint16', 'DeltaGlyphID', None, None, 'Add to original GlyphID modulo 65536 to get substitute GlyphID'),
455	]),
456
457	('SingleSubstFormat2', [
458		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 2'),
459		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
460		('uint16', 'GlyphCount', None, None, 'Number of GlyphIDs in the Substitute array'),
461		('GlyphID', 'Substitute', 'GlyphCount', 0, 'Array of substitute GlyphIDs-ordered by Coverage Index'),
462	]),
463
464	('MultipleSubstFormat1', [
465		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 1'),
466		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
467		('uint16', 'SequenceCount', None, None, 'Number of Sequence table offsets in the Sequence array'),
468		('Offset', 'Sequence', 'SequenceCount', 0, 'Array of offsets to Sequence tables-from beginning of Substitution table-ordered by Coverage Index'),
469	]),
470
471	('Sequence', [
472		('uint16', 'GlyphCount', None, None, 'Number of GlyphIDs in the Substitute array. This should always be greater than 0.'),
473		('GlyphID', 'Substitute', 'GlyphCount', 0, 'String of GlyphIDs to substitute'),
474	]),
475
476	('AlternateSubstFormat1', [
477		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 1'),
478		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
479		('uint16', 'AlternateSetCount', None, None, 'Number of AlternateSet tables'),
480		('Offset', 'AlternateSet', 'AlternateSetCount', 0, 'Array of offsets to AlternateSet tables-from beginning of Substitution table-ordered by Coverage Index'),
481	]),
482
483	('AlternateSet', [
484		('uint16', 'GlyphCount', None, None, 'Number of GlyphIDs in the Alternate array'),
485		('GlyphID', 'Alternate', 'GlyphCount', 0, 'Array of alternate GlyphIDs-in arbitrary order'),
486	]),
487
488	('LigatureSubstFormat1', [
489		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 1'),
490		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
491		('uint16', 'LigSetCount', None, None, 'Number of LigatureSet tables'),
492		('Offset', 'LigatureSet', 'LigSetCount', 0, 'Array of offsets to LigatureSet tables-from beginning of Substitution table-ordered by Coverage Index'),
493	]),
494
495	('LigatureSet', [
496		('uint16', 'LigatureCount', None, None, 'Number of Ligature tables'),
497		('Offset', 'Ligature', 'LigatureCount', 0, 'Array of offsets to Ligature tables-from beginning of LigatureSet table-ordered by preference'),
498	]),
499
500	('Ligature', [
501		('GlyphID', 'LigGlyph', None, None, 'GlyphID of ligature to substitute'),
502		('uint16', 'CompCount', None, None, 'Number of components in the ligature'),
503		('GlyphID', 'Component', 'CompCount', -1, 'Array of component GlyphIDs-start with the second component-ordered in writing direction'),
504	]),
505
506	('SubstLookupRecord', [
507		('uint16', 'SequenceIndex', None, None, 'Index into current glyph sequence-first glyph = 0'),
508		('uint16', 'LookupListIndex', None, None, 'Lookup to apply to that position-zero-based'),
509	]),
510
511	('ContextSubstFormat1', [
512		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 1'),
513		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
514		('uint16', 'SubRuleSetCount', None, None, 'Number of SubRuleSet tables-must equal GlyphCount in Coverage table'),
515		('Offset', 'SubRuleSet', 'SubRuleSetCount', 0, 'Array of offsets to SubRuleSet tables-from beginning of Substitution table-ordered by Coverage Index'),
516	]),
517
518	('SubRuleSet', [
519		('uint16', 'SubRuleCount', None, None, 'Number of SubRule tables'),
520		('Offset', 'SubRule', 'SubRuleCount', 0, 'Array of offsets to SubRule tables-from beginning of SubRuleSet table-ordered by preference'),
521	]),
522
523	('SubRule', [
524		('uint16', 'GlyphCount', None, None, 'Total number of glyphs in input glyph sequence-includes the first glyph'),
525		('uint16', 'SubstCount', None, None, 'Number of SubstLookupRecords'),
526		('GlyphID', 'Input', 'GlyphCount', -1, 'Array of input GlyphIDs-start with second glyph'),
527		('struct', 'SubstLookupRecord', 'SubstCount', 0, 'Array of SubstLookupRecords-in design order'),
528	]),
529
530	('ContextSubstFormat2', [
531		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 2'),
532		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
533		('Offset', 'ClassDef', None, None, 'Offset to glyph ClassDef table-from beginning of Substitution table'),
534		('uint16', 'SubClassSetCount', None, None, 'Number of SubClassSet tables'),
535		('Offset', 'SubClassSet', 'SubClassSetCount', 0, 'Array of offsets to SubClassSet tables-from beginning of Substitution table-ordered by class-may be NULL'),
536	]),
537
538	('SubClassSet', [
539		('uint16', 'SubClassRuleCount', None, None, 'Number of SubClassRule tables'),
540		('Offset', 'SubClassRule', 'SubClassRuleCount', 0, 'Array of offsets to SubClassRule tables-from beginning of SubClassSet-ordered by preference'),
541	]),
542
543	('SubClassRule', [
544		('uint16', 'GlyphCount', None, None, 'Total number of classes specified for the context in the rule-includes the first class'),
545		('uint16', 'SubstCount', None, None, 'Number of SubstLookupRecords'),
546		('uint16', 'Class', 'GlyphCount', -1, 'Array of classes-beginning with the second class-to be matched to the input glyph class sequence'),
547		('struct', 'SubstLookupRecord', 'SubstCount', 0, 'Array of Substitution lookups-in design order'),
548	]),
549
550	('ContextSubstFormat3', [
551		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 3'),
552		('uint16', 'GlyphCount', None, None, 'Number of glyphs in the input glyph sequence'),
553		('uint16', 'SubstCount', None, None, 'Number of SubstLookupRecords'),
554		('Offset', 'Coverage', 'GlyphCount', 0, 'Array of offsets to Coverage table-from beginning of Substitution table-in glyph sequence order'),
555		('struct', 'SubstLookupRecord', 'SubstCount', 0, 'Array of SubstLookupRecords-in design order'),
556	]),
557
558	('ChainContextSubstFormat1', [
559		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 1'),
560		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
561		('uint16', 'ChainSubRuleSetCount', None, None, 'Number of ChainSubRuleSet tables-must equal GlyphCount in Coverage table'),
562		('Offset', 'ChainSubRuleSet', 'ChainSubRuleSetCount', 0, 'Array of offsets to ChainSubRuleSet tables-from beginning of Substitution table-ordered by Coverage Index'),
563	]),
564
565	('ChainSubRuleSet', [
566		('uint16', 'ChainSubRuleCount', None, None, 'Number of ChainSubRule tables'),
567		('Offset', 'ChainSubRule', 'ChainSubRuleCount', 0, 'Array of offsets to ChainSubRule tables-from beginning of ChainSubRuleSet table-ordered by preference'),
568	]),
569
570	('ChainSubRule', [
571		('uint16', 'BacktrackGlyphCount', None, None, 'Total number of glyphs in the backtrack sequence (number of glyphs to be matched before the first glyph)'),
572		('GlyphID', 'Backtrack', 'BacktrackGlyphCount', 0, "Array of backtracking GlyphID's (to be matched before the input sequence)"),
573		('uint16', 'InputGlyphCount', None, None, 'Total number of glyphs in the input sequence (includes the first glyph)'),
574		('GlyphID', 'Input', 'InputGlyphCount', -1, 'Array of input GlyphIDs (start with second glyph)'),
575		('uint16', 'LookAheadGlyphCount', None, None, 'Total number of glyphs in the look ahead sequence (number of glyphs to be matched after the input sequence)'),
576		('GlyphID', 'LookAhead', 'LookAheadGlyphCount', 0, "Array of lookahead GlyphID's (to be matched after the input sequence)"),
577		('uint16', 'SubstCount', None, None, 'Number of SubstLookupRecords'),
578		('struct', 'SubstLookupRecord', 'SubstCount', 0, 'Array of SubstLookupRecords (in design order)'),
579	]),
580
581	('ChainContextSubstFormat2', [
582		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 2'),
583		('Offset', 'Coverage', None, None, 'Offset to Coverage table-from beginning of Substitution table'),
584		('Offset', 'BacktrackClassDef', None, None, 'Offset to glyph ClassDef table containing backtrack sequence data-from beginning of Substitution table'),
585		('Offset', 'InputClassDef', None, None, 'Offset to glyph ClassDef table containing input sequence data-from beginning of Substitution table'),
586		('Offset', 'LookAheadClassDef', None, None, 'Offset to glyph ClassDef table containing lookahead sequence data-from beginning of Substitution table'),
587		('uint16', 'ChainSubClassSetCount', None, None, 'Number of ChainSubClassSet tables'),
588		('Offset', 'ChainSubClassSet', 'ChainSubClassSetCount', 0, 'Array of offsets to ChainSubClassSet tables-from beginning of Substitution table-ordered by input class-may be NULL'),
589	]),
590
591	('ChainSubClassSet', [
592		('uint16', 'ChainSubClassRuleCount', None, None, 'Number of ChainSubClassRule tables'),
593		('Offset', 'ChainSubClassRule', 'ChainSubClassRuleCount', 0, 'Array of offsets to ChainSubClassRule tables-from beginning of ChainSubClassSet-ordered by preference'),
594	]),
595
596	('ChainSubClassRule', [
597		('uint16', 'BacktrackGlyphCount', None, None, 'Total number of glyphs in the backtrack sequence (number of glyphs to be matched before the first glyph)'),
598		('uint16', 'Backtrack', 'BacktrackGlyphCount', 0, 'Array of backtracking classes(to be matched before the input sequence)'),
599		('uint16', 'InputGlyphCount', None, None, 'Total number of classes in the input sequence (includes the first class)'),
600		('uint16', 'Input', 'InputGlyphCount', -1, 'Array of input classes(start with second class; to be matched with the input glyph sequence)'),
601		('uint16', 'LookAheadGlyphCount', None, None, 'Total number of classes in the look ahead sequence (number of classes to be matched after the input sequence)'),
602		('uint16', 'LookAhead', 'LookAheadGlyphCount', 0, 'Array of lookahead classes(to be matched after the input sequence)'),
603		('uint16', 'SubstCount', None, None, 'Number of SubstLookupRecords'),
604		('struct', 'SubstLookupRecord', 'SubstCount', 0, 'Array of SubstLookupRecords (in design order)'),
605	]),
606
607	('ChainContextSubstFormat3', [
608		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 3'),
609		('uint16', 'BacktrackGlyphCount', None, None, 'Number of glyphs in the backtracking sequence'),
610		('Offset', 'BacktrackCoverage', 'BacktrackGlyphCount', 0, 'Array of offsets to coverage tables in backtracking sequence, in glyph sequence order'),
611		('uint16', 'InputGlyphCount', None, None, 'Number of glyphs in input sequence'),
612		('Offset', 'InputCoverage', 'InputGlyphCount', 0, 'Array of offsets to coverage tables in input sequence, in glyph sequence order'),
613		('uint16', 'LookAheadGlyphCount', None, None, 'Number of glyphs in lookahead sequence'),
614		('Offset', 'LookAheadCoverage', 'LookAheadGlyphCount', 0, 'Array of offsets to coverage tables in lookahead sequence, in glyph sequence order'),
615		('uint16', 'SubstCount', None, None, 'Number of SubstLookupRecords'),
616		('struct', 'SubstLookupRecord', 'SubstCount', 0, 'Array of SubstLookupRecords, in design order'),
617	]),
618
619	('ExtensionSubstFormat1', [
620		('uint16', 'ExtFormat', None, None, 'Format identifier. Set to 1.'),
621		('uint16', 'ExtensionLookupType', None, None, 'Lookup type of subtable referenced by ExtensionOffset (i.e. the extension subtable).'),
622		('LOffset', 'ExtSubTable', None, None, 'Array of offsets to Lookup tables-from beginning of LookupList -zero based (first lookup is Lookup index = 0)'),
623	]),
624
625	('ReverseChainSingleSubstFormat1', [
626		('uint16', 'SubstFormat', None, None, 'Format identifier-format = 1'),
627		('Offset', 'Coverage', None, 0, 'Offset to Coverage table - from beginning of Substitution table'),
628		('uint16', 'BacktrackGlyphCount', None, None, 'Number of glyphs in the backtracking sequence'),
629		('Offset', 'BacktrackCoverage', 'BacktrackGlyphCount', 0, 'Array of offsets to coverage tables in backtracking sequence, in glyph sequence order'),
630		('uint16', 'LookAheadGlyphCount', None, None, 'Number of glyphs in lookahead sequence'),
631		('Offset', 'LookAheadCoverage', 'LookAheadGlyphCount', 0, 'Array of offsets to coverage tables in lookahead sequence, in glyph sequence order'),
632		('uint16', 'GlyphCount', None, None, 'Number of GlyphIDs in the Substitute array'),
633		('GlyphID', 'Substitute', 'GlyphCount', 0, 'Array of substitute GlyphIDs-ordered by Coverage index'),
634	]),
635
636	#
637	# gdef
638	#
639
640	('GDEF', [
641		('Version', 'Version', None, None, 'Version of the GDEF table- 0x00010000, 0x00010002, or 0x00010003'),
642		('Offset', 'GlyphClassDef', None, None, 'Offset to class definition table for glyph type-from beginning of GDEF header (may be NULL)'),
643		('Offset', 'AttachList', None, None, 'Offset to list of glyphs with attachment points-from beginning of GDEF header (may be NULL)'),
644		('Offset', 'LigCaretList', None, None, 'Offset to list of positioning points for ligature carets-from beginning of GDEF header (may be NULL)'),
645		('Offset', 'MarkAttachClassDef', None, None, 'Offset to class definition table for mark attachment type-from beginning of GDEF header (may be NULL)'),
646		('Offset', 'MarkGlyphSetsDef', None, 'Version >= 0x00010002', 'Offset to the table of mark set definitions-from beginning of GDEF header (may be NULL)'),
647		('LOffset', 'VarStore', None, 'Version >= 0x00010003', 'Offset to variation store (may be NULL)'),
648	]),
649
650	('AttachList', [
651		('Offset', 'Coverage', None, None, 'Offset to Coverage table - from beginning of AttachList table'),
652		('uint16', 'GlyphCount', None, None, 'Number of glyphs with attachment points'),
653		('Offset', 'AttachPoint', 'GlyphCount', 0, 'Array of offsets to AttachPoint tables-from beginning of AttachList table-in Coverage Index order'),
654	]),
655
656	('AttachPoint', [
657		('uint16', 'PointCount', None, None, 'Number of attachment points on this glyph'),
658		('uint16', 'PointIndex', 'PointCount', 0, 'Array of contour point indices -in increasing numerical order'),
659	]),
660
661	('LigCaretList', [
662		('Offset', 'Coverage', None, None, 'Offset to Coverage table - from beginning of LigCaretList table'),
663		('uint16', 'LigGlyphCount', None, None, 'Number of ligature glyphs'),
664		('Offset', 'LigGlyph', 'LigGlyphCount', 0, 'Array of offsets to LigGlyph tables-from beginning of LigCaretList table-in Coverage Index order'),
665	]),
666
667	('LigGlyph', [
668		('uint16', 'CaretCount', None, None, 'Number of CaretValues for this ligature (components - 1)'),
669		('Offset', 'CaretValue', 'CaretCount', 0, 'Array of offsets to CaretValue tables-from beginning of LigGlyph table-in increasing coordinate order'),
670	]),
671
672	('CaretValueFormat1', [
673		('uint16', 'CaretValueFormat', None, None, 'Format identifier-format = 1'),
674		('int16', 'Coordinate', None, None, 'X or Y value, in design units'),
675	]),
676
677	('CaretValueFormat2', [
678		('uint16', 'CaretValueFormat', None, None, 'Format identifier-format = 2'),
679		('uint16', 'CaretValuePoint', None, None, 'Contour point index on glyph'),
680	]),
681
682	('CaretValueFormat3', [
683		('uint16', 'CaretValueFormat', None, None, 'Format identifier-format = 3'),
684		('int16', 'Coordinate', None, None, 'X or Y value, in design units'),
685		('Offset', 'DeviceTable', None, None, 'Offset to Device table for X or Y value-from beginning of CaretValue table'),
686	]),
687
688	('MarkGlyphSetsDef', [
689		('uint16', 'MarkSetTableFormat', None, None, 'Format identifier == 1'),
690		('uint16', 'MarkSetCount', None, None, 'Number of mark sets defined'),
691		('LOffset', 'Coverage', 'MarkSetCount', 0, 'Array of offsets to mark set coverage tables.'),
692	]),
693
694	#
695	# base
696	#
697
698	('BASE', [
699		('Version', 'Version', None, None, 'Version of the BASE table-initially 0x00010000'),
700		('Offset', 'HorizAxis', None, None, 'Offset to horizontal Axis table-from beginning of BASE table-may be NULL'),
701		('Offset', 'VertAxis', None, None, 'Offset to vertical Axis table-from beginning of BASE table-may be NULL'),
702		('LOffset', 'VarStore', None, 'Version >= 0x00010001', 'Offset to variation store (may be NULL)'),
703	]),
704
705	('Axis', [
706		('Offset', 'BaseTagList', None, None, 'Offset to BaseTagList table-from beginning of Axis table-may be NULL'),
707		('Offset', 'BaseScriptList', None, None, 'Offset to BaseScriptList table-from beginning of Axis table'),
708	]),
709
710	('BaseTagList', [
711		('uint16', 'BaseTagCount', None, None, 'Number of baseline identification tags in this text direction-may be zero (0)'),
712		('Tag', 'BaselineTag', 'BaseTagCount', 0, 'Array of 4-byte baseline identification tags-must be in alphabetical order'),
713	]),
714
715	('BaseScriptList', [
716		('uint16', 'BaseScriptCount', None, None, 'Number of BaseScriptRecords defined'),
717		('struct', 'BaseScriptRecord', 'BaseScriptCount', 0, 'Array of BaseScriptRecords-in alphabetical order by BaseScriptTag'),
718	]),
719
720	('BaseScriptRecord', [
721		('Tag', 'BaseScriptTag', None, None, '4-byte script identification tag'),
722		('Offset', 'BaseScript', None, None, 'Offset to BaseScript table-from beginning of BaseScriptList'),
723	]),
724
725	('BaseScript', [
726		('Offset', 'BaseValues', None, None, 'Offset to BaseValues table-from beginning of BaseScript table-may be NULL'),
727		('Offset', 'DefaultMinMax', None, None, 'Offset to MinMax table- from beginning of BaseScript table-may be NULL'),
728		('uint16', 'BaseLangSysCount', None, None, 'Number of BaseLangSysRecords defined-may be zero (0)'),
729		('struct', 'BaseLangSysRecord', 'BaseLangSysCount', 0, 'Array of BaseLangSysRecords-in alphabetical order by BaseLangSysTag'),
730	]),
731
732	('BaseLangSysRecord', [
733		('Tag', 'BaseLangSysTag', None, None, '4-byte language system identification tag'),
734		('Offset', 'MinMax', None, None, 'Offset to MinMax table-from beginning of BaseScript table'),
735	]),
736
737	('BaseValues', [
738		('uint16', 'DefaultIndex', None, None, 'Index number of default baseline for this script-equals index position of baseline tag in BaselineArray of the BaseTagList'),
739		('uint16', 'BaseCoordCount', None, None, 'Number of BaseCoord tables defined-should equal BaseTagCount in the BaseTagList'),
740		('Offset', 'BaseCoord', 'BaseCoordCount', 0, 'Array of offsets to BaseCoord-from beginning of BaseValues table-order matches BaselineTag array in the BaseTagList'),
741	]),
742
743	('MinMax', [
744		('Offset', 'MinCoord', None, None, 'Offset to BaseCoord table-defines minimum extent value-from the beginning of MinMax table-may be NULL'),
745		('Offset', 'MaxCoord', None, None, 'Offset to BaseCoord table-defines maximum extent value-from the beginning of MinMax table-may be NULL'),
746		('uint16', 'FeatMinMaxCount', None, None, 'Number of FeatMinMaxRecords-may be zero (0)'),
747		('struct', 'FeatMinMaxRecord', 'FeatMinMaxCount', 0, 'Array of FeatMinMaxRecords-in alphabetical order, by FeatureTableTag'),
748	]),
749
750	('FeatMinMaxRecord', [
751		('Tag', 'FeatureTableTag', None, None, '4-byte feature identification tag-must match FeatureTag in FeatureList'),
752		('Offset', 'MinCoord', None, None, 'Offset to BaseCoord table-defines minimum extent value-from beginning of MinMax table-may be NULL'),
753		('Offset', 'MaxCoord', None, None, 'Offset to BaseCoord table-defines maximum extent value-from beginning of MinMax table-may be NULL'),
754	]),
755
756	('BaseCoordFormat1', [
757		('uint16', 'BaseCoordFormat', None, None, 'Format identifier-format = 1'),
758		('int16', 'Coordinate', None, None, 'X or Y value, in design units'),
759	]),
760
761	('BaseCoordFormat2', [
762		('uint16', 'BaseCoordFormat', None, None, 'Format identifier-format = 2'),
763		('int16', 'Coordinate', None, None, 'X or Y value, in design units'),
764		('GlyphID', 'ReferenceGlyph', None, None, 'GlyphID of control glyph'),
765		('uint16', 'BaseCoordPoint', None, None, 'Index of contour point on the ReferenceGlyph'),
766	]),
767
768	('BaseCoordFormat3', [
769		('uint16', 'BaseCoordFormat', None, None, 'Format identifier-format = 3'),
770		('int16', 'Coordinate', None, None, 'X or Y value, in design units'),
771		('Offset', 'DeviceTable', None, None, 'Offset to Device table for X or Y value'),
772	]),
773
774
775	#
776	# jstf
777	#
778
779	('JSTF', [
780		('Version', 'Version', None, None, 'Version of the JSTF table-initially set to 0x00010000'),
781		('uint16', 'JstfScriptCount', None, None, 'Number of JstfScriptRecords in this table'),
782		('struct', 'JstfScriptRecord', 'JstfScriptCount', 0, 'Array of JstfScriptRecords-in alphabetical order, by JstfScriptTag'),
783	]),
784
785	('JstfScriptRecord', [
786		('Tag', 'JstfScriptTag', None, None, '4-byte JstfScript identification'),
787		('Offset', 'JstfScript', None, None, 'Offset to JstfScript table-from beginning of JSTF Header'),
788	]),
789
790	('JstfScript', [
791		('Offset', 'ExtenderGlyph', None, None, 'Offset to ExtenderGlyph table-from beginning of JstfScript table-may be NULL'),
792		('Offset', 'DefJstfLangSys', None, None, 'Offset to Default JstfLangSys table-from beginning of JstfScript table-may be NULL'),
793		('uint16', 'JstfLangSysCount', None, None, 'Number of JstfLangSysRecords in this table- may be zero (0)'),
794		('struct', 'JstfLangSysRecord', 'JstfLangSysCount', 0, 'Array of JstfLangSysRecords-in alphabetical order, by JstfLangSysTag'),
795	]),
796
797	('JstfLangSysRecord', [
798		('Tag', 'JstfLangSysTag', None, None, '4-byte JstfLangSys identifier'),
799		('Offset', 'JstfLangSys', None, None, 'Offset to JstfLangSys table-from beginning of JstfScript table'),
800	]),
801
802	('ExtenderGlyph', [
803		('uint16', 'GlyphCount', None, None, 'Number of Extender Glyphs in this script'),
804		('GlyphID', 'ExtenderGlyph', 'GlyphCount', 0, 'GlyphIDs-in increasing numerical order'),
805	]),
806
807	('JstfLangSys', [
808		('uint16', 'JstfPriorityCount', None, None, 'Number of JstfPriority tables'),
809		('Offset', 'JstfPriority', 'JstfPriorityCount', 0, 'Array of offsets to JstfPriority tables-from beginning of JstfLangSys table-in priority order'),
810	]),
811
812	('JstfPriority', [
813		('Offset', 'ShrinkageEnableGSUB', None, None, 'Offset to Shrinkage Enable JstfGSUBModList table-from beginning of JstfPriority table-may be NULL'),
814		('Offset', 'ShrinkageDisableGSUB', None, None, 'Offset to Shrinkage Disable JstfGSUBModList table-from beginning of JstfPriority table-may be NULL'),
815		('Offset', 'ShrinkageEnableGPOS', None, None, 'Offset to Shrinkage Enable JstfGPOSModList table-from beginning of JstfPriority table-may be NULL'),
816		('Offset', 'ShrinkageDisableGPOS', None, None, 'Offset to Shrinkage Disable JstfGPOSModList table-from beginning of JstfPriority table-may be NULL'),
817		('Offset', 'ShrinkageJstfMax', None, None, 'Offset to Shrinkage JstfMax table-from beginning of JstfPriority table -may be NULL'),
818		('Offset', 'ExtensionEnableGSUB', None, None, 'Offset to Extension Enable JstfGSUBModList table-may be NULL'),
819		('Offset', 'ExtensionDisableGSUB', None, None, 'Offset to Extension Disable JstfGSUBModList table-from beginning of JstfPriority table-may be NULL'),
820		('Offset', 'ExtensionEnableGPOS', None, None, 'Offset to Extension Enable JstfGSUBModList table-may be NULL'),
821		('Offset', 'ExtensionDisableGPOS', None, None, 'Offset to Extension Disable JstfGSUBModList table-from beginning of JstfPriority table-may be NULL'),
822		('Offset', 'ExtensionJstfMax', None, None, 'Offset to Extension JstfMax table-from beginning of JstfPriority table -may be NULL'),
823	]),
824
825	('JstfGSUBModList', [
826		('uint16', 'LookupCount', None, None, 'Number of lookups for this modification'),
827		('uint16', 'GSUBLookupIndex', 'LookupCount', 0, 'Array of LookupIndex identifiers in GSUB-in increasing numerical order'),
828	]),
829
830	('JstfGPOSModList', [
831		('uint16', 'LookupCount', None, None, 'Number of lookups for this modification'),
832		('uint16', 'GPOSLookupIndex', 'LookupCount', 0, 'Array of LookupIndex identifiers in GPOS-in increasing numerical order'),
833	]),
834
835	('JstfMax', [
836		('uint16', 'LookupCount', None, None, 'Number of lookup Indices for this modification'),
837		('Offset', 'Lookup', 'LookupCount', 0, 'Array of offsets to GPOS-type lookup tables-from beginning of JstfMax table-in design order'),
838	]),
839
840
841	#
842	# STAT
843	#
844	('STAT', [
845		('Version', 'Version', None, None, 'Version of the table-initially set to 0x00010000, currently 0x00010002.'),
846		('uint16', 'DesignAxisRecordSize', None, None, 'Size in bytes of each design axis record'),
847		('uint16', 'DesignAxisCount', None, None, 'Number of design axis records'),
848		('LOffsetTo(AxisRecordArray)', 'DesignAxisRecord', None, None, 'Offset in bytes from the beginning of the STAT table to the start of the design axes array'),
849		('uint16', 'AxisValueCount', None, None, 'Number of axis value tables'),
850		('LOffsetTo(AxisValueArray)', 'AxisValueArray', None, None, 'Offset in bytes from the beginning of the STAT table to the start of the axes value offset array'),
851		('NameID', 'ElidedFallbackNameID', None, 'Version >= 0x00010001', 'NameID to use when all style attributes are elided.'),
852	]),
853
854	('AxisRecordArray', [
855		('AxisRecord', 'Axis', 'DesignAxisCount', 0, 'Axis records'),
856	]),
857
858	('AxisRecord', [
859		('Tag', 'AxisTag', None, None, 'A tag identifying the axis of design variation'),
860		('NameID', 'AxisNameID', None, None, 'The name ID for entries in the "name" table that provide a display string for this axis'),
861		('uint16', 'AxisOrdering', None, None, 'A value that applications can use to determine primary sorting of face names, or for ordering of descriptors when composing family or face names'),
862		('uint8', 'MoreBytes', 'DesignAxisRecordSize', -8, 'Extra bytes.  Set to empty array.'),
863	]),
864
865	('AxisValueArray', [
866		('Offset', 'AxisValue', 'AxisValueCount', 0, 'Axis values'),
867	]),
868
869	('AxisValueFormat1', [
870		('uint16', 'Format', None, None, 'Format, = 1'),
871		('uint16', 'AxisIndex', None, None, 'Index into the axis record array identifying the axis of design variation to which the axis value record applies.'),
872		('STATFlags', 'Flags', None, None, 'Flags.'),
873		('NameID', 'ValueNameID', None, None, ''),
874		('Fixed', 'Value', None, None, ''),
875	]),
876
877	('AxisValueFormat2', [
878		('uint16', 'Format', None, None, 'Format, = 2'),
879		('uint16', 'AxisIndex', None, None, 'Index into the axis record array identifying the axis of design variation to which the axis value record applies.'),
880		('STATFlags', 'Flags', None, None, 'Flags.'),
881		('NameID', 'ValueNameID', None, None, ''),
882		('Fixed', 'NominalValue', None, None, ''),
883		('Fixed', 'RangeMinValue', None, None, ''),
884		('Fixed', 'RangeMaxValue', None, None, ''),
885	]),
886
887	('AxisValueFormat3', [
888		('uint16', 'Format', None, None, 'Format, = 3'),
889		('uint16', 'AxisIndex', None, None, 'Index into the axis record array identifying the axis of design variation to which the axis value record applies.'),
890		('STATFlags', 'Flags', None, None, 'Flags.'),
891		('NameID', 'ValueNameID', None, None, ''),
892		('Fixed', 'Value', None, None, ''),
893		('Fixed', 'LinkedValue', None, None, ''),
894	]),
895
896	('AxisValueFormat4', [
897		('uint16', 'Format', None, None, 'Format, = 4'),
898		('uint16', 'AxisCount', None, None, 'The total number of axes contributing to this axis-values combination.'),
899		('STATFlags', 'Flags', None, None, 'Flags.'),
900		('NameID', 'ValueNameID', None, None, ''),
901		('struct', 'AxisValueRecord', 'AxisCount', 0, 'Array of AxisValue records that provide the combination of axis values, one for each contributing axis. '),
902	]),
903
904	('AxisValueRecord', [
905			('uint16', 'AxisIndex', None, None, 'Index into the axis record array identifying the axis of design variation to which the axis value record applies.'),
906			('Fixed', 'Value', None, None, 'A numeric value for this attribute value.'),
907	]),
908
909
910	#
911	# Variation fonts
912	#
913
914	# GSUB/GPOS FeatureVariations
915
916	('FeatureVariations', [
917		('Version', 'Version', None, None, 'Version of the table-initially set to 0x00010000'),
918		('uint32', 'FeatureVariationCount', None, None, 'Number of records in the FeatureVariationRecord array'),
919		('struct', 'FeatureVariationRecord', 'FeatureVariationCount', 0, 'Array of FeatureVariationRecord'),
920	]),
921
922	('FeatureVariationRecord', [
923		('LOffset', 'ConditionSet', None, None, 'Offset to a ConditionSet table, from beginning of the FeatureVariations table.'),
924		('LOffset', 'FeatureTableSubstitution', None, None, 'Offset to a FeatureTableSubstitution table, from beginning of the FeatureVariations table'),
925	]),
926
927	('ConditionSet', [
928		('uint16', 'ConditionCount', None, None, 'Number of condition tables in the ConditionTable array'),
929		('LOffset', 'ConditionTable', 'ConditionCount', 0, 'Array of condition tables.'),
930	]),
931
932	('ConditionTableFormat1', [
933		('uint16', 'Format', None, None, 'Format, = 1'),
934		('uint16', 'AxisIndex', None, None, 'Index for the variation axis within the fvar table, base 0.'),
935		('F2Dot14', 'FilterRangeMinValue', None, None, 'Minimum normalized axis value of the font variation instances that satisfy this condition.'),
936		('F2Dot14', 'FilterRangeMaxValue', None, None, 'Maximum value that satisfies this condition.'),
937	]),
938
939	('FeatureTableSubstitution', [
940		('Version', 'Version', None, None, 'Version of the table-initially set to 0x00010000'),
941		('uint16', 'SubstitutionCount', None, None, 'Number of records in the FeatureVariationRecords array'),
942		('FeatureTableSubstitutionRecord', 'SubstitutionRecord', 'SubstitutionCount', 0, 'Array of FeatureTableSubstitutionRecord'),
943	]),
944
945	('FeatureTableSubstitutionRecord', [
946		('uint16', 'FeatureIndex', None, None, 'The feature table index to match.'),
947		('LOffset', 'Feature', None, None, 'Offset to an alternate feature table, from start of the FeatureTableSubstitution table.'),
948	]),
949
950	# VariationStore
951
952	('VarRegionAxis', [
953		('F2Dot14', 'StartCoord', None, None, ''),
954		('F2Dot14', 'PeakCoord', None, None, ''),
955		('F2Dot14', 'EndCoord', None, None, ''),
956	]),
957
958	('VarRegion', [
959		('struct', 'VarRegionAxis', 'RegionAxisCount', 0, ''),
960	]),
961
962	('VarRegionList', [
963		('uint16', 'RegionAxisCount', None, None, ''),
964		('uint16', 'RegionCount', None, None, ''),
965		('VarRegion', 'Region', 'RegionCount', 0, ''),
966	]),
967
968	('VarData', [
969		('uint16', 'ItemCount', None, None, ''),
970		('uint16', 'NumShorts', None, None, ''),
971		('uint16', 'VarRegionCount', None, None, ''),
972		('uint16', 'VarRegionIndex', 'VarRegionCount', 0, ''),
973		('VarDataValue', 'Item', 'ItemCount', 0, ''),
974	]),
975
976	('VarStore', [
977		('uint16', 'Format', None, None, 'Set to 1.'),
978		('LOffset', 'VarRegionList', None, None, ''),
979		('uint16', 'VarDataCount', None, None, ''),
980		('LOffset', 'VarData', 'VarDataCount', 0, ''),
981	]),
982
983	# Variation helpers
984
985	('VarIdxMap', [
986		('uint16', 'EntryFormat', None, None, ''), # Automatically computed
987		('uint16', 'MappingCount', None, None, ''), # Automatically computed
988		('VarIdxMapValue', 'mapping', '', 0, 'Array of compressed data'),
989	]),
990
991	# Glyph advance variations
992
993	('HVAR', [
994		('Version', 'Version', None, None, 'Version of the HVAR table-initially = 0x00010000'),
995		('LOffset', 'VarStore', None, None, ''),
996		('LOffsetTo(VarIdxMap)', 'AdvWidthMap', None, None, ''),
997		('LOffsetTo(VarIdxMap)', 'LsbMap', None, None, ''),
998		('LOffsetTo(VarIdxMap)', 'RsbMap', None, None, ''),
999	]),
1000	('VVAR', [
1001		('Version', 'Version', None, None, 'Version of the VVAR table-initially = 0x00010000'),
1002		('LOffset', 'VarStore', None, None, ''),
1003		('LOffsetTo(VarIdxMap)', 'AdvHeightMap', None, None, ''),
1004		('LOffsetTo(VarIdxMap)', 'TsbMap', None, None, ''),
1005		('LOffsetTo(VarIdxMap)', 'BsbMap', None, None, ''),
1006		('LOffsetTo(VarIdxMap)', 'VOrgMap', None, None, 'Vertical origin mapping.'),
1007	]),
1008
1009	# Font-wide metrics variations
1010
1011	('MetricsValueRecord', [
1012		('Tag', 'ValueTag', None, None, '4-byte font-wide measure identifier'),
1013		('uint32', 'VarIdx', None, None, 'Combined outer-inner variation index'),
1014		('uint8', 'MoreBytes', 'ValueRecordSize', -8, 'Extra bytes.  Set to empty array.'),
1015	]),
1016
1017	('MVAR', [
1018		('Version', 'Version', None, None, 'Version of the MVAR table-initially = 0x00010000'),
1019		('uint16', 'Reserved', None, None, 'Set to 0'),
1020		('uint16', 'ValueRecordSize', None, None, ''),
1021		('uint16', 'ValueRecordCount', None, None, ''),
1022		('Offset', 'VarStore', None, None, ''),
1023		('MetricsValueRecord', 'ValueRecord', 'ValueRecordCount', 0, ''),
1024	]),
1025
1026
1027	#
1028	# math
1029	#
1030
1031	('MATH', [
1032		('Version', 'Version', None, None, 'Version of the MATH table-initially set to 0x00010000.'),
1033		('Offset', 'MathConstants', None, None, 'Offset to MathConstants table - from the beginning of MATH table.'),
1034		('Offset', 'MathGlyphInfo', None, None, 'Offset to MathGlyphInfo table - from the beginning of MATH table.'),
1035		('Offset', 'MathVariants', None, None, 'Offset to MathVariants table - from the beginning of MATH table.'),
1036	]),
1037
1038	('MathValueRecord', [
1039		('int16', 'Value', None, None, 'The X or Y value in design units.'),
1040		('Offset', 'DeviceTable', None, None, 'Offset to the device table - from the beginning of parent table. May be NULL. Suggested format for device table is 1.'),
1041	]),
1042
1043	('MathConstants', [
1044		('int16', 'ScriptPercentScaleDown', None, None, 'Percentage of scaling down for script level 1. Suggested value: 80%.'),
1045		('int16', 'ScriptScriptPercentScaleDown', None, None, 'Percentage of scaling down for script level 2 (ScriptScript). Suggested value: 60%.'),
1046		('uint16', 'DelimitedSubFormulaMinHeight', None, None, 'Minimum height required for a delimited expression to be treated as a subformula. Suggested value: normal line height x1.5.'),
1047		('uint16', 'DisplayOperatorMinHeight', None, None, 'Minimum height of n-ary operators (such as integral and summation) for formulas in display mode.'),
1048		('MathValueRecord', 'MathLeading', None, None, 'White space to be left between math formulas to ensure proper line spacing. For example, for applications that treat line gap as a part of line ascender, formulas with ink  going above (os2.sTypoAscender + os2.sTypoLineGap - MathLeading) or with ink going below os2.sTypoDescender will result in increasing line height.'),
1049		('MathValueRecord', 'AxisHeight', None, None, 'Axis height of the font.'),
1050		('MathValueRecord', 'AccentBaseHeight', None, None, 'Maximum (ink) height of accent base that does not require raising the accents. Suggested: x-height of the font (os2.sxHeight) plus any possible overshots.'),
1051		('MathValueRecord', 'FlattenedAccentBaseHeight', None, None, 'Maximum (ink) height of accent base that does not require flattening the accents. Suggested: cap height of the font (os2.sCapHeight).'),
1052		('MathValueRecord', 'SubscriptShiftDown', None, None, 'The standard shift down applied to subscript elements. Positive for moving in the downward direction. Suggested: os2.ySubscriptYOffset.'),
1053		('MathValueRecord', 'SubscriptTopMax', None, None, 'Maximum allowed height of the (ink) top of subscripts that does not require moving subscripts further down. Suggested: 4/5 x-height.'),
1054		('MathValueRecord', 'SubscriptBaselineDropMin', None, None, 'Minimum allowed drop of the baseline of subscripts relative to the (ink) bottom of the base. Checked for bases that are treated as a box or extended shape. Positive for subscript baseline dropped below the base bottom.'),
1055		('MathValueRecord', 'SuperscriptShiftUp', None, None, 'Standard shift up applied to superscript elements. Suggested: os2.ySuperscriptYOffset.'),
1056		('MathValueRecord', 'SuperscriptShiftUpCramped', None, None, 'Standard shift of superscripts relative to the base, in cramped style.'),
1057		('MathValueRecord', 'SuperscriptBottomMin', None, None, 'Minimum allowed height of the (ink) bottom of superscripts that does not require moving subscripts further up. Suggested: 1/4 x-height.'),
1058		('MathValueRecord', 'SuperscriptBaselineDropMax', None, None, 'Maximum allowed drop of the baseline of superscripts relative to the (ink) top of the base. Checked for bases that are treated as a box or extended shape. Positive for superscript baseline below the base top.'),
1059		('MathValueRecord', 'SubSuperscriptGapMin', None, None, 'Minimum gap between the superscript and subscript ink. Suggested: 4x default rule thickness.'),
1060		('MathValueRecord', 'SuperscriptBottomMaxWithSubscript', None, None, 'The maximum level to which the (ink) bottom of superscript can be pushed to increase the gap between superscript and subscript, before subscript starts being moved down. Suggested: 4/5 x-height.'),
1061		('MathValueRecord', 'SpaceAfterScript', None, None, 'Extra white space to be added after each subscript and superscript. Suggested: 0.5pt for a 12 pt font.'),
1062		('MathValueRecord', 'UpperLimitGapMin', None, None, 'Minimum gap between the (ink) bottom of the upper limit, and the (ink) top of the base operator.'),
1063		('MathValueRecord', 'UpperLimitBaselineRiseMin', None, None, 'Minimum distance between baseline of upper limit and (ink) top of the base operator.'),
1064		('MathValueRecord', 'LowerLimitGapMin', None, None, 'Minimum gap between (ink) top of the lower limit, and (ink) bottom of the base operator.'),
1065		('MathValueRecord', 'LowerLimitBaselineDropMin', None, None, 'Minimum distance between baseline of the lower limit and (ink) bottom of the base operator.'),
1066		('MathValueRecord', 'StackTopShiftUp', None, None, 'Standard shift up applied to the top element of a stack.'),
1067		('MathValueRecord', 'StackTopDisplayStyleShiftUp', None, None, 'Standard shift up applied to the top element of a stack in display style.'),
1068		('MathValueRecord', 'StackBottomShiftDown', None, None, 'Standard shift down applied to the bottom element of a stack. Positive for moving in the downward direction.'),
1069		('MathValueRecord', 'StackBottomDisplayStyleShiftDown', None, None, 'Standard shift down applied to the bottom element of a stack in display style. Positive for moving in the downward direction.'),
1070		('MathValueRecord', 'StackGapMin', None, None, 'Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element. Suggested: 3x default rule thickness.'),
1071		('MathValueRecord', 'StackDisplayStyleGapMin', None, None, 'Minimum gap between (ink) bottom of the top element of a stack, and the (ink) top of the bottom element in display style. Suggested: 7x default rule thickness.'),
1072		('MathValueRecord', 'StretchStackTopShiftUp', None, None, 'Standard shift up applied to the top element of the stretch stack.'),
1073		('MathValueRecord', 'StretchStackBottomShiftDown', None, None, 'Standard shift down applied to the bottom element of the stretch stack. Positive for moving in the downward direction.'),
1074		('MathValueRecord', 'StretchStackGapAboveMin', None, None, 'Minimum gap between the ink of the stretched element, and the (ink) bottom of the element above. Suggested: UpperLimitGapMin'),
1075		('MathValueRecord', 'StretchStackGapBelowMin', None, None, 'Minimum gap between the ink of the stretched element, and the (ink) top of the element below. Suggested: LowerLimitGapMin.'),
1076		('MathValueRecord', 'FractionNumeratorShiftUp', None, None, 'Standard shift up applied to the numerator.'),
1077		('MathValueRecord', 'FractionNumeratorDisplayStyleShiftUp', None, None, 'Standard shift up applied to the numerator in display style. Suggested: StackTopDisplayStyleShiftUp.'),
1078		('MathValueRecord', 'FractionDenominatorShiftDown', None, None, 'Standard shift down applied to the denominator. Positive for moving in the downward direction.'),
1079		('MathValueRecord', 'FractionDenominatorDisplayStyleShiftDown', None, None, 'Standard shift down applied to the denominator in display style. Positive for moving in the downward direction. Suggested: StackBottomDisplayStyleShiftDown.'),
1080		('MathValueRecord', 'FractionNumeratorGapMin', None, None, 'Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar. Suggested: default rule thickness'),
1081		('MathValueRecord', 'FractionNumDisplayStyleGapMin', None, None, 'Minimum tolerated gap between the (ink) bottom of the numerator and the ink of the fraction bar in display style. Suggested: 3x default rule thickness.'),
1082		('MathValueRecord', 'FractionRuleThickness', None, None, 'Thickness of the fraction bar. Suggested: default rule thickness.'),
1083		('MathValueRecord', 'FractionDenominatorGapMin', None, None, 'Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar. Suggested: default rule thickness'),
1084		('MathValueRecord', 'FractionDenomDisplayStyleGapMin', None, None, 'Minimum tolerated gap between the (ink) top of the denominator and the ink of the fraction bar in display style. Suggested: 3x default rule thickness.'),
1085		('MathValueRecord', 'SkewedFractionHorizontalGap', None, None, 'Horizontal distance between the top and bottom elements of a skewed fraction.'),
1086		('MathValueRecord', 'SkewedFractionVerticalGap', None, None, 'Vertical distance between the ink of the top and bottom elements of a skewed fraction.'),
1087		('MathValueRecord', 'OverbarVerticalGap', None, None, 'Distance between the overbar and the (ink) top of he base. Suggested: 3x default rule thickness.'),
1088		('MathValueRecord', 'OverbarRuleThickness', None, None, 'Thickness of overbar. Suggested: default rule thickness.'),
1089		('MathValueRecord', 'OverbarExtraAscender', None, None, 'Extra white space reserved above the overbar. Suggested: default rule thickness.'),
1090		('MathValueRecord', 'UnderbarVerticalGap', None, None, 'Distance between underbar and (ink) bottom of the base. Suggested: 3x default rule thickness.'),
1091		('MathValueRecord', 'UnderbarRuleThickness', None, None, 'Thickness of underbar. Suggested: default rule thickness.'),
1092		('MathValueRecord', 'UnderbarExtraDescender', None, None, 'Extra white space reserved below the underbar. Always positive. Suggested: default rule thickness.'),
1093		('MathValueRecord', 'RadicalVerticalGap', None, None, 'Space between the (ink) top of the expression and the bar over it. Suggested: 1 1/4 default rule thickness.'),
1094		('MathValueRecord', 'RadicalDisplayStyleVerticalGap', None, None, 'Space between the (ink) top of the expression and the bar over it. Suggested: default rule thickness + 1/4 x-height.'),
1095		('MathValueRecord', 'RadicalRuleThickness', None, None, 'Thickness of the radical rule. This is the thickness of the rule in designed or constructed radical signs. Suggested: default rule thickness.'),
1096		('MathValueRecord', 'RadicalExtraAscender', None, None, 'Extra white space reserved above the radical. Suggested: RadicalRuleThickness.'),
1097		('MathValueRecord', 'RadicalKernBeforeDegree', None, None, 'Extra horizontal kern before the degree of a radical, if such is present. Suggested: 5/18 of em.'),
1098		('MathValueRecord', 'RadicalKernAfterDegree', None, None, 'Negative kern after the degree of a radical, if such is present. Suggested: 10/18 of em.'),
1099		('uint16', 'RadicalDegreeBottomRaisePercent', None, None, 'Height of the bottom of the radical degree, if such is present, in proportion to the ascender of the radical sign. Suggested: 60%.'),
1100	]),
1101
1102	('MathGlyphInfo', [
1103		('Offset', 'MathItalicsCorrectionInfo', None, None, 'Offset to MathItalicsCorrectionInfo table - from the beginning of MathGlyphInfo table.'),
1104		('Offset', 'MathTopAccentAttachment', None, None, 'Offset to MathTopAccentAttachment table - from the beginning of MathGlyphInfo table.'),
1105		('Offset', 'ExtendedShapeCoverage', None, None, 'Offset to coverage table for Extended Shape glyphs - from the  beginning of MathGlyphInfo table. When the left or right glyph of a box is an extended shape variant, the (ink) box (and not the default position defined by values in MathConstants table) should be used for vertical positioning purposes. May be NULL.'),
1106		('Offset', 'MathKernInfo', None, None, 'Offset to MathKernInfo table - from the beginning of MathGlyphInfo table.'),
1107	]),
1108
1109	('MathItalicsCorrectionInfo', [
1110		('Offset', 'Coverage', None, None, 'Offset to Coverage table - from the beginning of MathItalicsCorrectionInfo table.'),
1111		('uint16', 'ItalicsCorrectionCount', None, None, 'Number of italics correction values. Should coincide with the number of covered glyphs.'),
1112		('MathValueRecord', 'ItalicsCorrection', 'ItalicsCorrectionCount', 0, 'Array of MathValueRecords defining italics correction values for each covered glyph.'),
1113	]),
1114
1115	('MathTopAccentAttachment', [
1116		('Offset', 'TopAccentCoverage', None, None, 'Offset to Coverage table - from the beginning of  MathTopAccentAttachment table.'),
1117		('uint16', 'TopAccentAttachmentCount', None, None, 'Number of top accent attachment point values. Should coincide with the number of covered glyphs'),
1118		('MathValueRecord', 'TopAccentAttachment', 'TopAccentAttachmentCount', 0, 'Array of MathValueRecords defining top accent attachment points for each covered glyph'),
1119	]),
1120
1121	('MathKernInfo', [
1122		('Offset', 'MathKernCoverage', None, None, 'Offset to Coverage table - from the beginning of the MathKernInfo table.'),
1123		('uint16', 'MathKernCount', None, None, 'Number of MathKernInfoRecords.'),
1124		('MathKernInfoRecord', 'MathKernInfoRecords', 'MathKernCount', 0, 'Array of MathKernInfoRecords, per-glyph information for mathematical positioning of subscripts and superscripts.'),
1125	]),
1126
1127	('MathKernInfoRecord', [
1128		('Offset', 'TopRightMathKern', None, None, 'Offset to MathKern table for top right corner - from the beginning of MathKernInfo table. May be NULL.'),
1129		('Offset', 'TopLeftMathKern', None, None, 'Offset to MathKern table for the top left corner - from the beginning of MathKernInfo table. May be NULL.'),
1130		('Offset', 'BottomRightMathKern', None, None, 'Offset to MathKern table for bottom right corner - from the beginning of MathKernInfo table. May be NULL.'),
1131		('Offset', 'BottomLeftMathKern', None, None, 'Offset to MathKern table for bottom left corner - from the beginning of MathKernInfo table. May be NULL.'),
1132	]),
1133
1134	('MathKern', [
1135		('uint16', 'HeightCount', None, None, 'Number of heights on which the kern value changes.'),
1136		('MathValueRecord', 'CorrectionHeight', 'HeightCount', 0, 'Array of correction heights at which the kern value changes. Sorted by the height value in design units.'),
1137		('MathValueRecord', 'KernValue', 'HeightCount', 1, 'Array of kern values corresponding to heights. First value is the kern value for all heights less or equal than the first height in this table.Last value is the value to be applied for all heights greater than the last height in this table. Negative values are interpreted as move glyphs closer to each other.'),
1138	]),
1139
1140	('MathVariants', [
1141		('uint16', 'MinConnectorOverlap', None, None, 'Minimum overlap of connecting glyphs during glyph construction,  in design units.'),
1142		('Offset', 'VertGlyphCoverage', None, None, 'Offset to Coverage table - from the beginning of MathVariants table.'),
1143		('Offset', 'HorizGlyphCoverage', None, None, 'Offset to Coverage table - from the beginning of MathVariants table.'),
1144		('uint16', 'VertGlyphCount', None, None, 'Number of glyphs for which information is provided for vertically growing variants.'),
1145		('uint16', 'HorizGlyphCount', None, None, 'Number of glyphs for which information is provided for horizontally growing variants.'),
1146		('Offset', 'VertGlyphConstruction', 'VertGlyphCount', 0, 'Array of offsets to MathGlyphConstruction tables - from the beginning of the MathVariants table, for shapes growing in vertical direction.'),
1147		('Offset', 'HorizGlyphConstruction', 'HorizGlyphCount', 0, 'Array of offsets to MathGlyphConstruction tables - from the beginning of the MathVariants table, for shapes growing in horizontal direction.'),
1148	]),
1149
1150	('MathGlyphConstruction', [
1151		('Offset', 'GlyphAssembly', None, None, 'Offset to GlyphAssembly table for this shape - from the beginning of MathGlyphConstruction table. May be NULL'),
1152		('uint16', 'VariantCount', None, None, 'Count of glyph growing variants for this glyph.'),
1153		('MathGlyphVariantRecord', 'MathGlyphVariantRecord', 'VariantCount', 0, 'MathGlyphVariantRecords for alternative variants of the glyphs.'),
1154	]),
1155
1156	('MathGlyphVariantRecord', [
1157		('GlyphID', 'VariantGlyph', None, None, 'Glyph ID for the variant.'),
1158		('uint16', 'AdvanceMeasurement', None, None, 'Advance width/height, in design units, of the variant, in the direction of requested glyph extension.'),
1159	]),
1160
1161	('GlyphAssembly', [
1162		('MathValueRecord', 'ItalicsCorrection', None, None, 'Italics correction of this GlyphAssembly. Should not depend on the assembly size.'),
1163		('uint16', 'PartCount', None, None, 'Number of parts in this assembly.'),
1164		('GlyphPartRecord', 'PartRecords', 'PartCount', 0, 'Array of part records, from left to right and bottom to top.'),
1165	]),
1166
1167	('GlyphPartRecord', [
1168		('GlyphID', 'glyph', None, None, 'Glyph ID for the part.'),
1169		('uint16', 'StartConnectorLength', None, None, 'Advance width/ height of the straight bar connector material, in design units, is at the beginning of the glyph, in the direction of the extension.'),
1170		('uint16', 'EndConnectorLength', None, None, 'Advance width/ height of the straight bar connector material, in design units, is at the end of the glyph, in the direction of the extension.'),
1171		('uint16', 'FullAdvance', None, None, 'Full advance width/height for this part, in the direction of the extension. In design units.'),
1172		('uint16', 'PartFlags', None, None, 'Part qualifiers. PartFlags enumeration currently uses only one bit: 0x0001 fExtender: If set, the part can be skipped or repeated. 0xFFFE Reserved'),
1173	]),
1174
1175
1176	##
1177	## Apple Advanced Typography (AAT) tables
1178	##
1179
1180	('AATLookupSegment', [
1181		('uint16', 'lastGlyph', None, None, 'Last glyph index in this segment.'),
1182		('uint16', 'firstGlyph', None, None, 'First glyph index in this segment.'),
1183		('uint16', 'value', None, None, 'A 16-bit offset from the start of the table to the data.'),
1184	]),
1185
1186
1187	#
1188	# ankr
1189	#
1190
1191	('ankr', [
1192		('struct', 'AnchorPoints', None, None, 'Anchor points table.'),
1193        ]),
1194
1195	('AnchorPointsFormat0', [
1196		('uint16', 'Format', None, None, 'Format of the anchor points table, = 0.'),
1197		('uint16', 'Flags', None, None, 'Flags. Currenty unused, set to zero.'),
1198		('AATLookupWithDataOffset(AnchorGlyphData)', 'Anchors', None, None, 'Table of with anchor overrides for each glyph.'),
1199	]),
1200
1201	('AnchorGlyphData', [
1202		('uint32', 'AnchorPointCount', None, None, 'Number of anchor points for this glyph.'),
1203		('struct', 'AnchorPoint', 'AnchorPointCount', 0, 'Individual anchor points.'),
1204	]),
1205
1206	('AnchorPoint', [
1207		('int16', 'XCoordinate', None, None, 'X coordinate of this anchor point.'),
1208		('int16', 'YCoordinate', None, None, 'Y coordinate of this anchor point.'),
1209	]),
1210
1211	#
1212	# bsln
1213	#
1214
1215	('bsln', [
1216		('Version', 'Version', None, None, 'Version number of the AAT baseline table (0x00010000 for the initial version).'),
1217		('struct', 'Baseline', None, None, 'Baseline table.'),
1218	]),
1219
1220	('BaselineFormat0', [
1221		('uint16', 'Format', None, None, 'Format of the baseline table, = 0.'),
1222		('uint16', 'DefaultBaseline', None, None, 'Default baseline value for all glyphs. This value can be from 0 through 31.'),
1223		('uint16', 'Delta', 32, 0, u'These are the FUnit distance deltas from the font’s natural baseline to the other baselines used in the font. A total of 32 deltas must be assigned.'),
1224	]),
1225
1226	('BaselineFormat1', [
1227		('uint16', 'Format', None, None, 'Format of the baseline table, = 1.'),
1228		('uint16', 'DefaultBaseline', None, None, 'Default baseline value for all glyphs. This value can be from 0 through 31.'),
1229		('uint16', 'Delta', 32, 0, u'These are the FUnit distance deltas from the font’s natural baseline to the other baselines used in the font. A total of 32 deltas must be assigned.'),
1230		('AATLookup(uint16)', 'BaselineValues', None, None, 'Lookup table that maps glyphs to their baseline values.'),
1231	]),
1232
1233	('BaselineFormat2', [
1234		('uint16', 'Format', None, None, 'Format of the baseline table, = 1.'),
1235		('uint16', 'DefaultBaseline', None, None, 'Default baseline value for all glyphs. This value can be from 0 through 31.'),
1236		('GlyphID', 'StandardGlyph', None, None, 'Glyph index of the glyph in this font to be used to set the baseline values. This glyph must contain a set of control points (whose numbers are contained in the following field) that determines baseline distances.'),
1237		('uint16', 'ControlPoint', 32, 0, 'Array of 32 control point numbers, associated with the standard glyph. A value of 0xFFFF means there is no corresponding control point in the standard glyph.'),
1238	]),
1239
1240	('BaselineFormat3', [
1241		('uint16', 'Format', None, None, 'Format of the baseline table, = 1.'),
1242		('uint16', 'DefaultBaseline', None, None, 'Default baseline value for all glyphs. This value can be from 0 through 31.'),
1243		('GlyphID', 'StandardGlyph', None, None, 'Glyph index of the glyph in this font to be used to set the baseline values. This glyph must contain a set of control points (whose numbers are contained in the following field) that determines baseline distances.'),
1244		('uint16', 'ControlPoint', 32, 0, 'Array of 32 control point numbers, associated with the standard glyph. A value of 0xFFFF means there is no corresponding control point in the standard glyph.'),
1245		('AATLookup(uint16)', 'BaselineValues', None, None, 'Lookup table that maps glyphs to their baseline values.'),
1246	]),
1247
1248
1249	#
1250	# cidg
1251	#
1252
1253	('cidg', [
1254		('struct', 'CIDGlyphMapping', None, None, 'CID-to-glyph mapping table.'),
1255        ]),
1256
1257	('CIDGlyphMappingFormat0', [
1258		('uint16', 'Format', None, None, 'Format of the CID-to-glyph mapping table, = 0.'),
1259		('uint16', 'DataFormat', None, None, 'Currenty unused, set to zero.'),
1260		('uint32', 'StructLength', None, None, 'Size of the table in bytes.'),
1261		('uint16', 'Registry', None, None, 'The registry ID.'),
1262		('char64', 'RegistryName', None, None, 'The registry name in ASCII; unused bytes should be set to 0.'),
1263		('uint16', 'Order', None, None, 'The order ID.'),
1264		('char64', 'OrderName', None, None, 'The order name in ASCII; unused bytes should be set to 0.'),
1265		('uint16', 'SupplementVersion', None, None, 'The supplement version.'),
1266		('CIDGlyphMap', 'Mapping', None, None, 'A mapping from CIDs to the glyphs in the font, starting with CID 0. If a CID from the identified collection has no glyph in the font, 0xFFFF is used'),
1267	]),
1268
1269
1270	#
1271	# feat
1272	#
1273
1274	('feat', [
1275		('Version', 'Version', None, None, 'Version of the feat table-initially set to 0x00010000.'),
1276		('FeatureNames', 'FeatureNames', None, None, 'The feature names.'),
1277	]),
1278
1279	('FeatureNames', [
1280		('uint16', 'FeatureNameCount', None, None, 'Number of entries in the feature name array.'),
1281		('uint16', 'Reserved1', None, None, 'Reserved (set to zero).'),
1282		('uint32', 'Reserved2', None, None, 'Reserved (set to zero).'),
1283		('FeatureName', 'FeatureName', 'FeatureNameCount', 0, 'The feature name array.'),
1284	]),
1285
1286	('FeatureName', [
1287		('uint16', 'FeatureType', None, None, 'Feature type.'),
1288		('uint16', 'SettingsCount', None, None, 'The number of records in the setting name array.'),
1289		('LOffset', 'Settings', None, None, 'Offset to setting table for this feature.'),
1290		('uint16', 'FeatureFlags', None, None, 'Single-bit flags associated with the feature type.'),
1291		('NameID', 'FeatureNameID', None, None, 'The name table index for the feature name.'),
1292	]),
1293
1294	('Settings', [
1295		('Setting', 'Setting', 'SettingsCount', 0, 'The setting array.'),
1296	]),
1297
1298	('Setting', [
1299		('uint16', 'SettingValue', None, None, 'The setting.'),
1300		('NameID', 'SettingNameID', None, None, 'The name table index for the setting name.'),
1301	]),
1302
1303
1304	#
1305	# gcid
1306	#
1307
1308	('gcid', [
1309		('struct', 'GlyphCIDMapping', None, None, 'Glyph to CID mapping table.'),
1310        ]),
1311
1312	('GlyphCIDMappingFormat0', [
1313		('uint16', 'Format', None, None, 'Format of the glyph-to-CID mapping table, = 0.'),
1314		('uint16', 'DataFormat', None, None, 'Currenty unused, set to zero.'),
1315		('uint32', 'StructLength', None, None, 'Size of the table in bytes.'),
1316		('uint16', 'Registry', None, None, 'The registry ID.'),
1317		('char64', 'RegistryName', None, None, 'The registry name in ASCII; unused bytes should be set to 0.'),
1318		('uint16', 'Order', None, None, 'The order ID.'),
1319		('char64', 'OrderName', None, None, 'The order name in ASCII; unused bytes should be set to 0.'),
1320		('uint16', 'SupplementVersion', None, None, 'The supplement version.'),
1321		('GlyphCIDMap', 'Mapping', None, None, 'The CIDs for the glyphs in the font, starting with glyph 0. If a glyph does not correspond to a CID in the identified collection, 0xFFFF is used'),
1322	]),
1323
1324
1325	#
1326	# lcar
1327	#
1328
1329	('lcar', [
1330		('Version', 'Version', None, None, 'Version number of the ligature caret table (0x00010000 for the initial version).'),
1331		('struct', 'LigatureCarets', None, None, 'Ligature carets table.'),
1332        ]),
1333
1334	('LigatureCaretsFormat0', [
1335		('uint16', 'Format', None, None, 'Format of the ligature caret table. Format 0 indicates division points are distances in font units, Format 1 indicates division points are indexes of control points.'),
1336		('AATLookup(LigCaretDistances)', 'Carets', None, None, 'Lookup table associating ligature glyphs with their caret positions, in font unit distances.'),
1337	]),
1338
1339	('LigatureCaretsFormat1', [
1340		('uint16', 'Format', None, None, 'Format of the ligature caret table. Format 0 indicates division points are distances in font units, Format 1 indicates division points are indexes of control points.'),
1341		('AATLookup(LigCaretPoints)', 'Carets', None, None, 'Lookup table associating ligature glyphs with their caret positions, as control points.'),
1342	]),
1343
1344	('LigCaretDistances', [
1345		('uint16', 'DivsionPointCount', None, None, 'Number of division points.'),
1346		('int16', 'DivisionPoint', 'DivsionPointCount', 0, 'Distance in font units through which a subdivision is made orthogonally to the baseline.'),
1347	]),
1348
1349	('LigCaretPoints', [
1350		('uint16', 'DivsionPointCount', None, None, 'Number of division points.'),
1351		('int16', 'DivisionPoint', 'DivsionPointCount', 0, 'The number of the control point through which a subdivision is made orthogonally to the baseline.'),
1352	]),
1353
1354
1355	#
1356	# mort
1357	#
1358
1359	('mort', [
1360		('Version', 'Version', None, None, 'Version of the mort table.'),
1361		('uint32', 'MorphChainCount', None, None, 'Number of metamorphosis chains.'),
1362		('MortChain', 'MorphChain', 'MorphChainCount', 0, 'Array of metamorphosis chains.'),
1363	]),
1364
1365	('MortChain', [
1366		('Flags32', 'DefaultFlags', None, None, 'The default specification for subtables.'),
1367		('uint32', 'StructLength', None, None, 'Total byte count, including this header; must be a multiple of 4.'),
1368		('uint16', 'MorphFeatureCount', None, None, 'Number of metamorphosis feature entries.'),
1369		('uint16', 'MorphSubtableCount', None, None, 'The number of subtables in the chain.'),
1370		('struct', 'MorphFeature', 'MorphFeatureCount', 0, 'Array of metamorphosis features.'),
1371		('MortSubtable', 'MorphSubtable', 'MorphSubtableCount', 0, 'Array of metamorphosis subtables.'),
1372	]),
1373
1374	('MortSubtable', [
1375		('uint16', 'StructLength', None, None, 'Total subtable length, including this header.'),
1376		('uint8', 'CoverageFlags', None, None, 'Most significant byte of coverage flags.'),
1377		('uint8', 'MorphType', None, None, 'Subtable type.'),
1378		('Flags32', 'SubFeatureFlags', None, None, 'The 32-bit mask identifying which subtable this is (the subtable being executed if the AND of this value and the processed defaultFlags is nonzero).'),
1379		('SubStruct', 'SubStruct', None, None, 'SubTable.'),
1380	]),
1381
1382	#
1383	# morx
1384	#
1385
1386	('morx', [
1387		('uint16', 'Version', None, None, 'Version of the morx table.'),
1388		('uint16', 'Reserved', None, None, 'Reserved (set to zero).'),
1389		('uint32', 'MorphChainCount', None, None, 'Number of extended metamorphosis chains.'),
1390		('MorxChain', 'MorphChain', 'MorphChainCount', 0, 'Array of extended metamorphosis chains.'),
1391	]),
1392
1393	('MorxChain', [
1394		('Flags32', 'DefaultFlags', None, None, 'The default specification for subtables.'),
1395		('uint32', 'StructLength', None, None, 'Total byte count, including this header; must be a multiple of 4.'),
1396		('uint32', 'MorphFeatureCount', None, None, 'Number of feature subtable entries.'),
1397		('uint32', 'MorphSubtableCount', None, None, 'The number of subtables in the chain.'),
1398		('MorphFeature', 'MorphFeature', 'MorphFeatureCount', 0, 'Array of metamorphosis features.'),
1399		('MorxSubtable', 'MorphSubtable', 'MorphSubtableCount', 0, 'Array of extended metamorphosis subtables.'),
1400	]),
1401
1402	('MorphFeature', [
1403		('uint16', 'FeatureType', None, None, 'The type of feature.'),
1404		('uint16', 'FeatureSetting', None, None, "The feature's setting (aka selector)."),
1405		('Flags32', 'EnableFlags', None, None, 'Flags for the settings that this feature and setting enables.'),
1406		('Flags32', 'DisableFlags', None, None, 'Complement of flags for the settings that this feature and setting disable.'),
1407	]),
1408
1409	# Apple TrueType Reference Manual, chapter “The ‘morx’ table”,
1410	# section “Metamorphosis Subtables”.
1411	# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html
1412	('MorxSubtable', [
1413		('uint32', 'StructLength', None, None, 'Total subtable length, including this header.'),
1414		('uint8', 'CoverageFlags', None, None, 'Most significant byte of coverage flags.'),
1415		('uint16', 'Reserved', None, None, 'Unused.'),
1416		('uint8', 'MorphType', None, None, 'Subtable type.'),
1417		('Flags32', 'SubFeatureFlags', None, None, 'The 32-bit mask identifying which subtable this is (the subtable being executed if the AND of this value and the processed defaultFlags is nonzero).'),
1418		('SubStruct', 'SubStruct', None, None, 'SubTable.'),
1419        ]),
1420
1421	('StateHeader', [
1422		('uint32', 'ClassCount', None, None, 'Number of classes, which is the number of 16-bit entry indices in a single line in the state array.'),
1423		('uint32', 'MorphClass', None, None, 'Offset from the start of this state table header to the start of the class table.'),
1424		('uint32', 'StateArrayOffset', None, None, 'Offset from the start of this state table header to the start of the state array.'),
1425		('uint32', 'EntryTableOffset', None, None, 'Offset from the start of this state table header to the start of the entry table.'),
1426	]),
1427
1428	('RearrangementMorph', [
1429		('STXHeader(RearrangementMorphAction)', 'StateTable', None, None, 'Finite-state transducer table for indic rearrangement.'),
1430	]),
1431
1432	('ContextualMorph', [
1433		('STXHeader(ContextualMorphAction)', 'StateTable', None, None, 'Finite-state transducer for contextual glyph substitution.'),
1434	]),
1435
1436	('LigatureMorph', [
1437		('STXHeader(LigatureMorphAction)', 'StateTable', None, None, 'Finite-state transducer for ligature substitution.'),
1438	]),
1439
1440	('NoncontextualMorph', [
1441		('AATLookup(GlyphID)', 'Substitution', None, None, 'The noncontextual glyph substitution table.'),
1442        ]),
1443
1444	('InsertionMorph', [
1445		('STXHeader(InsertionMorphAction)', 'StateTable', None, None, 'Finite-state transducer for glyph insertion.'),
1446	]),
1447
1448	('MorphClass', [
1449		('uint16', 'FirstGlyph', None, None, 'Glyph index of the first glyph in the class table.'),
1450		#('uint16', 'GlyphCount', None, None, 'Number of glyphs in class table.'),
1451		#('uint8', 'GlyphClass', 'GlyphCount', 0, 'The class codes (indexed by glyph index minus firstGlyph). Class codes range from 0 to the value of stateSize minus 1.'),
1452	]),
1453
1454	# If the 'morx' table version is 3 or greater, then the last subtable in the chain is followed by a subtableGlyphCoverageArray, as described below.
1455	#		('Offset', 'MarkGlyphSetsDef', None, 'round(Version*0x10000) >= 0x00010002', 'Offset to the table of mark set definitions-from beginning of GDEF header (may be NULL)'),
1456
1457
1458	#
1459	# prop
1460	#
1461
1462	('prop', [
1463		('Fixed', 'Version', None, None, 'Version number of the AAT glyphs property table. Version 1.0 is the initial table version. Version 2.0, which is recognized by macOS 8.5 and later, adds support for the “attaches on right” bit. Version 3.0, which gets recognized by macOS X and iOS, adds support for the additional directional properties defined in Unicode 3.0.'),
1464		('struct', 'GlyphProperties', None, None, 'Glyph properties.'),
1465	]),
1466
1467	('GlyphPropertiesFormat0', [
1468		('uint16', 'Format', None, None, 'Format, = 0.'),
1469		('uint16', 'DefaultProperties', None, None, 'Default properties applied to a glyph. Since there is no lookup table in prop format 0, the default properties get applied to every glyph in the font.'),
1470        ]),
1471
1472	('GlyphPropertiesFormat1', [
1473		('uint16', 'Format', None, None, 'Format, = 1.'),
1474		('uint16', 'DefaultProperties', None, None, 'Default properties applied to a glyph if that glyph is not present in the Properties lookup table.'),
1475		('AATLookup(uint16)', 'Properties', None, None, 'Lookup data associating glyphs with their properties.'),
1476        ]),
1477
1478
1479	#
1480	# opbd
1481	#
1482
1483	('opbd', [
1484		('Version', 'Version', None, None, 'Version number of the optical bounds table (0x00010000 for the initial version).'),
1485		('struct', 'OpticalBounds', None, None, 'Optical bounds table.'),
1486	]),
1487
1488	('OpticalBoundsFormat0', [
1489		('uint16', 'Format', None, None, 'Format of the optical bounds table, = 0.'),
1490		('AATLookup(OpticalBoundsDeltas)', 'OpticalBoundsDeltas', None, None, 'Lookup table associating glyphs with their optical bounds, given as deltas in font units.'),
1491	]),
1492
1493	('OpticalBoundsFormat1', [
1494		('uint16', 'Format', None, None, 'Format of the optical bounds table, = 1.'),
1495		('AATLookup(OpticalBoundsPoints)', 'OpticalBoundsPoints', None, None, 'Lookup table associating glyphs with their optical bounds, given as references to control points.'),
1496	]),
1497
1498	('OpticalBoundsDeltas', [
1499		('int16', 'Left', None, None, 'Delta value for the left-side optical edge.'),
1500		('int16', 'Top', None, None, 'Delta value for the top-side optical edge.'),
1501		('int16', 'Right', None, None, 'Delta value for the right-side optical edge.'),
1502		('int16', 'Bottom', None, None, 'Delta value for the bottom-side optical edge.'),
1503	]),
1504
1505	('OpticalBoundsPoints', [
1506		('int16', 'Left', None, None, 'Control point index for the left-side optical edge, or -1 if this glyph has none.'),
1507		('int16', 'Top', None, None, 'Control point index for the top-side optical edge, or -1 if this glyph has none.'),
1508		('int16', 'Right', None, None, 'Control point index for the right-side optical edge, or -1 if this glyph has none.'),
1509		('int16', 'Bottom', None, None, 'Control point index for the bottom-side optical edge, or -1 if this glyph has none.'),
1510	]),
1511
1512	#
1513	# TSIC
1514	#
1515	('TSIC', [
1516		('Version', 'Version', None, None, 'Version of table initially set to 0x00010000.'),
1517		('uint16', 'Flags', None, None, 'TSIC flags - set to 0'),
1518		('uint16', 'AxisCount', None, None, 'Axis count from fvar'),
1519		('uint16', 'RecordCount', None, None, 'TSIC record count'),
1520		('uint16', 'Reserved', None, None, 'Set to 0'),
1521		('Tag', 'AxisArray', 'AxisCount', 0, 'Array of axis tags in fvar order'),
1522		('LocationRecord', 'RecordLocations', 'RecordCount', 0, 'Location in variation space of TSIC record'),
1523		('TSICRecord', 'Record', 'RecordCount', 0, 'Array of TSIC records'),
1524	]),
1525
1526	('LocationRecord', [
1527		('F2Dot14', 'Axis', 'AxisCount', 0, 'Axis record'),
1528	]),
1529
1530	('TSICRecord', [
1531		('uint16', 'Flags', None, None, 'Record flags - set to 0'),
1532		('uint16', 'NumCVTEntries', None, None, 'Number of CVT number value pairs'),
1533		('uint16', 'NameLength', None, None, 'Length of optional user record name'),
1534		('uint16', 'NameArray', 'NameLength', 0, 'Unicode 16 name'),
1535		('uint16', 'CVTArray', 'NumCVTEntries', 0, 'CVT number array'),
1536		('int16', 'CVTValueArray', 'NumCVTEntries', 0, 'CVT value'),
1537	]),
1538
1539	#
1540	# COLR
1541	#
1542
1543	('COLR', [
1544		('uint16', 'Version', None, None, 'Table version number (starts at 0).'),
1545		('uint16', 'BaseGlyphRecordCount', None, None, 'Number of Base Glyph Records.'),
1546		('LOffset', 'BaseGlyphRecordArray', None, None, 'Offset (from beginning of COLR table) to Base Glyph records.'),
1547		('LOffset', 'LayerRecordArray', None, None, 'Offset (from beginning of COLR table) to Layer Records.'),
1548		('uint16', 'LayerRecordCount', None, None, 'Number of Layer Records.'),
1549		('LOffset', 'BaseGlyphV1List', None, 'Version >= 1', 'Offset (from beginning of COLR table) to array of Version-1 Base Glyph records.'),
1550		('LOffset', 'LayerV1List', None, 'Version >= 1', 'Offset (from beginning of COLR table) to LayerV1List.'),
1551		('LOffset', 'VarStore', None, 'Version >= 1', 'Offset to variation store (may be NULL)'),
1552	]),
1553
1554	('BaseGlyphRecordArray', [
1555		('BaseGlyphRecord', 'BaseGlyphRecord', 'BaseGlyphRecordCount', 0, 'Base Glyph records.'),
1556	]),
1557
1558	('BaseGlyphRecord', [
1559		('GlyphID', 'BaseGlyph', None, None, 'Glyph ID of reference glyph. This glyph is for reference only and is not rendered for color.'),
1560		('uint16', 'FirstLayerIndex', None, None, 'Index (from beginning of the Layer Records) to the layer record. There will be numLayers consecutive entries for this base glyph.'),
1561		('uint16', 'NumLayers', None, None, 'Number of color layers associated with this glyph.'),
1562	]),
1563
1564	('LayerRecordArray', [
1565		('LayerRecord', 'LayerRecord', 'LayerRecordCount', 0, 'Layer records.'),
1566	]),
1567
1568	('LayerRecord', [
1569		('GlyphID', 'LayerGlyph', None, None, 'Glyph ID of layer glyph (must be in z-order from bottom to top).'),
1570		('uint16', 'PaletteIndex', None, None, 'Index value to use with a selected color palette.'),
1571	]),
1572
1573	('BaseGlyphV1List', [
1574		('uint32', 'BaseGlyphCount', None, None, 'Number of Version-1 Base Glyph records'),
1575		('struct', 'BaseGlyphV1Record', 'BaseGlyphCount', 0, 'Array of Version-1 Base Glyph records'),
1576	]),
1577
1578	('BaseGlyphV1Record', [
1579		('GlyphID', 'BaseGlyph', None, None, 'Glyph ID of reference glyph.'),
1580		('LOffset', 'Paint', None, None, 'Offset (from beginning of BaseGlyphV1Record) to Paint, typically a PaintColrLayers.'),
1581	]),
1582
1583	('LayerV1List', [
1584		('uint32', 'LayerCount', None, None, 'Number of Version-1 Layers'),
1585		('LOffset', 'Paint', 'LayerCount', 0, 'Array of offsets to Paint tables, from the start of the LayerV1List table.'),
1586	]),
1587
1588	# COLRv1 Affine2x3 uses the same column-major order to serialize a 2D
1589	# Affine Transformation as the one used by fontTools.misc.transform.
1590	# However, for historical reasons, the labels 'xy' and 'yx' are swapped.
1591	# Their fundamental meaning is the same though.
1592	# COLRv1 Affine2x3 follows the names found in FreeType and Cairo.
1593	# In all case, the second element in the 6-tuple correspond to the
1594	# y-part of the x basis vector, and the third to the x-part of the y
1595	# basis vector.
1596	# See https://github.com/googlefonts/colr-gradients-spec/pull/85
1597	('Affine2x3', [
1598		('Fixed', 'xx', None, None, 'x-part of x basis vector'),
1599		('Fixed', 'yx', None, None, 'y-part of x basis vector'),
1600		('Fixed', 'xy', None, None, 'x-part of y basis vector'),
1601		('Fixed', 'yy', None, None, 'y-part of y basis vector'),
1602		('Fixed', 'dx', None, None, 'Translation in x direction'),
1603		('Fixed', 'dy', None, None, 'Translation in y direction'),
1604	]),
1605	('VarAffine2x3', [
1606		('VarFixed', 'xx', None, None, 'x-part of x basis vector'),
1607		('VarFixed', 'yx', None, None, 'y-part of x basis vector'),
1608		('VarFixed', 'xy', None, None, 'x-part of y basis vector'),
1609		('VarFixed', 'yy', None, None, 'y-part of y basis vector'),
1610		('VarFixed', 'dx', None, None, 'Translation in x direction'),
1611		('VarFixed', 'dy', None, None, 'Translation in y direction'),
1612	]),
1613
1614	('ColorIndex', [
1615		('uint16', 'PaletteIndex', None, None, 'Index value to use with a selected color palette.'),
1616		('F2Dot14', 'Alpha', None, None, 'Values outsided [0.,1.] reserved'),
1617	]),
1618	('VarColorIndex', [
1619		('uint16', 'PaletteIndex', None, None, 'Index value to use with a selected color palette.'),
1620		('VarF2Dot14', 'Alpha', None, None, 'Values outsided [0.,1.] reserved'),
1621	]),
1622
1623	('ColorStop', [
1624		('F2Dot14', 'StopOffset', None, None, ''),
1625		('ColorIndex', 'Color', None, None, ''),
1626	]),
1627	('VarColorStop', [
1628		('VarF2Dot14', 'StopOffset', None, None, ''),
1629		('VarColorIndex', 'Color', None, None, ''),
1630	]),
1631
1632	('ColorLine', [
1633		('ExtendMode', 'Extend', None, None, 'Enum {PAD = 0, REPEAT = 1, REFLECT = 2}'),
1634		('uint16', 'StopCount', None, None, 'Number of Color stops.'),
1635		('ColorStop', 'ColorStop', 'StopCount', 0, 'Array of Color stops.'),
1636	]),
1637	('VarColorLine', [
1638		('ExtendMode', 'Extend', None, None, 'Enum {PAD = 0, REPEAT = 1, REFLECT = 2}'),
1639		('uint16', 'StopCount', None, None, 'Number of Color stops.'),
1640		('VarColorStop', 'ColorStop', 'StopCount', 0, 'Array of Color stops.'),
1641	]),
1642
1643	# PaintColrLayers
1644	('PaintFormat1', [
1645		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 1'),
1646		('uint8', 'NumLayers', None, None, 'Number of offsets to Paint to read from LayerV1List.'),
1647		('uint32', 'FirstLayerIndex', None, None, 'Index into LayerV1List.'),
1648	]),
1649
1650	# PaintSolid
1651	('PaintFormat2', [
1652		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 2'),
1653		('ColorIndex', 'Color', None, None, 'A solid color paint.'),
1654	]),
1655	# PaintVarSolid
1656	('PaintFormat3', [
1657		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 3'),
1658		('VarColorIndex', 'Color', None, None, 'A solid color paint.'),
1659	]),
1660
1661	# PaintLinearGradient
1662	('PaintFormat4', [
1663		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 4'),
1664		('Offset24', 'ColorLine', None, None, 'Offset (from beginning of PaintLinearGradient table) to ColorLine subtable.'),
1665		('int16', 'x0', None, None, ''),
1666		('int16', 'y0', None, None, ''),
1667		('int16', 'x1', None, None, ''),
1668		('int16', 'y1', None, None, ''),
1669		('int16', 'x2', None, None, ''),
1670		('int16', 'y2', None, None, ''),
1671	]),
1672	# PaintVarLinearGradient
1673	('PaintFormat5', [
1674		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 5'),
1675		('LOffset24To(VarColorLine)', 'ColorLine', None, None, 'Offset (from beginning of PaintVarLinearGradient table) to VarColorLine subtable.'),
1676		('VarInt16', 'x0', None, None, ''),
1677		('VarInt16', 'y0', None, None, ''),
1678		('VarInt16', 'x1', None, None, ''),
1679		('VarInt16', 'y1', None, None, ''),
1680		('VarInt16', 'x2', None, None, ''),
1681		('VarInt16', 'y2', None, None, ''),
1682	]),
1683
1684	# PaintRadialGradient
1685	('PaintFormat6', [
1686		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 6'),
1687		('Offset24', 'ColorLine', None, None, 'Offset (from beginning of PaintRadialGradient table) to ColorLine subtable.'),
1688		('int16', 'x0', None, None, ''),
1689		('int16', 'y0', None, None, ''),
1690		('uint16', 'r0', None, None, ''),
1691		('int16', 'x1', None, None, ''),
1692		('int16', 'y1', None, None, ''),
1693		('uint16', 'r1', None, None, ''),
1694	]),
1695	# PaintVarRadialGradient
1696	('PaintFormat7', [
1697		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 7'),
1698		('LOffset24To(VarColorLine)', 'ColorLine', None, None, 'Offset (from beginning of PaintVarRadialGradient table) to VarColorLine subtable.'),
1699		('VarInt16', 'x0', None, None, ''),
1700		('VarInt16', 'y0', None, None, ''),
1701		('VarUInt16', 'r0', None, None, ''),
1702		('VarInt16', 'x1', None, None, ''),
1703		('VarInt16', 'y1', None, None, ''),
1704		('VarUInt16', 'r1', None, None, ''),
1705	]),
1706
1707	# PaintSweepGradient
1708	('PaintFormat8', [
1709		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 8'),
1710		('Offset24', 'ColorLine', None, None, 'Offset (from beginning of PaintSweepGradient table) to ColorLine subtable.'),
1711		('int16', 'centerX', None, None, 'Center x coordinate.'),
1712		('int16', 'centerY', None, None, 'Center y coordinate.'),
1713		('Fixed', 'startAngle', None, None, 'Start of the angular range of the gradient.'),
1714		('Fixed', 'endAngle', None, None, 'End of the angular range of the gradient.'),
1715	]),
1716	# PaintVarSweepGradient
1717	('PaintFormat9', [
1718		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 9'),
1719		('LOffset24To(VarColorLine)', 'ColorLine', None, None, 'Offset (from beginning of PaintVarSweepGradient table) to VarColorLine subtable.'),
1720		('VarInt16', 'centerX', None, None, 'Center x coordinate.'),
1721		('VarInt16', 'centerY', None, None, 'Center y coordinate.'),
1722		('VarFixed', 'startAngle', None, None, 'Start of the angular range of the gradient.'),
1723		('VarFixed', 'endAngle', None, None, 'End of the angular range of the gradient.'),
1724	]),
1725
1726	# PaintGlyph
1727	('PaintFormat10', [
1728		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 10'),
1729		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintGlyph table) to Paint subtable.'),
1730		('GlyphID', 'Glyph', None, None, 'Glyph ID for the source outline.'),
1731	]),
1732
1733	# PaintColrGlyph
1734	('PaintFormat11', [
1735		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 11'),
1736		('GlyphID', 'Glyph', None, None, 'Virtual glyph ID for a BaseGlyphV1List base glyph.'),
1737	]),
1738
1739	# PaintTransform
1740	('PaintFormat12', [
1741		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 12'),
1742		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintTransform table) to Paint subtable.'),
1743		('Affine2x3', 'Transform', None, None, '2x3 matrix for 2D affine transformations.'),
1744	]),
1745	# PaintVarTransform
1746	('PaintFormat13', [
1747		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 13'),
1748		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintVarTransform table) to Paint subtable.'),
1749		('VarAffine2x3', 'Transform', None, None, '2x3 matrix for 2D affine transformations.'),
1750	]),
1751
1752	# PaintTranslate
1753	('PaintFormat14', [
1754		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 14'),
1755		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintTranslate table) to Paint subtable.'),
1756		('Fixed', 'dx', None, None, 'Translation in x direction.'),
1757		('Fixed', 'dy', None, None, 'Translation in y direction.'),
1758	]),
1759	# PaintVarTranslate
1760	('PaintFormat15', [
1761		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 15'),
1762		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintVarTranslate table) to Paint subtable.'),
1763		('VarFixed', 'dx', None, None, 'Translation in x direction.'),
1764		('VarFixed', 'dy', None, None, 'Translation in y direction.'),
1765	]),
1766
1767	# PaintRotate
1768	('PaintFormat16', [
1769		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 16'),
1770		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintRotate table) to Paint subtable.'),
1771		('Fixed', 'angle', None, None, ''),
1772		('Fixed', 'centerX', None, None, ''),
1773		('Fixed', 'centerY', None, None, ''),
1774	]),
1775	# PaintVarRotate
1776	('PaintFormat17', [
1777		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 17'),
1778		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintVarRotate table) to Paint subtable.'),
1779		('VarFixed', 'angle', None, None, ''),
1780		('VarFixed', 'centerX', None, None, ''),
1781		('VarFixed', 'centerY', None, None, ''),
1782	]),
1783
1784	# PaintSkew
1785	('PaintFormat18', [
1786		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 18'),
1787		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintSkew table) to Paint subtable.'),
1788		('Fixed', 'xSkewAngle', None, None, ''),
1789		('Fixed', 'ySkewAngle', None, None, ''),
1790		('Fixed', 'centerX', None, None, ''),
1791		('Fixed', 'centerY', None, None, ''),
1792	]),
1793	# PaintVarSkew
1794	('PaintFormat19', [
1795		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 19'),
1796		('Offset24', 'Paint', None, None, 'Offset (from beginning of PaintVarSkew table) to Paint subtable.'),
1797		('VarFixed', 'xSkewAngle', None, None, ''),
1798		('VarFixed', 'ySkewAngle', None, None, ''),
1799		('VarFixed', 'centerX', None, None, ''),
1800		('VarFixed', 'centerY', None, None, ''),
1801	]),
1802
1803	# PaintComposite
1804	('PaintFormat20', [
1805		('uint8', 'PaintFormat', None, None, 'Format identifier-format = 20'),
1806		('LOffset24To(Paint)', 'SourcePaint', None, None, 'Offset (from beginning of PaintComposite table) to source Paint subtable.'),
1807		('CompositeMode', 'CompositeMode', None, None, 'A CompositeMode enumeration value.'),
1808		('LOffset24To(Paint)', 'BackdropPaint', None, None, 'Offset (from beginning of PaintComposite table) to backdrop Paint subtable.'),
1809	]),
1810]
1811