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