[AAT] Add support for 'feat' table

Reusing the otData machinery.

See discussion at:
https://github.com/behdad/fonttools/issues/178
https://github.com/behdad/fonttools/pull/180
This commit is contained in:
Behdad Esfahbod 2014-09-30 19:02:55 -04:00
parent 5dd64deacb
commit 730bedd3d1
4 changed files with 37 additions and 2 deletions

View File

@ -42,7 +42,7 @@ When using TTX from the command line there are a bunch of extra options, these a
The following tables are currently supported:
<BLOCKQUOTE><TT>
<!-- begin table list -->
BASE, CBDT, CBLC, CFF, COLR, CPAL, DSIG, EBDT, EBLC, FFTM, GDEF, GMAP, GPKG, GPOS, GSUB, JSTF, LTSH, MATH, META, OS/2, SING, SVG, TSI0, TSI1, TSI2, TSI3, TSI5, TSIB, TSID, TSIJ, TSIP, TSIS, TSIV, VDMX, VORG, cmap, cvt, fpgm, gasp, glyf, hdmx, head, hhea, hmtx, kern, loca, maxp, name, post, prep, sbix, vhea and vmtx
BASE, CBDT, CBLC, CFF, COLR, CPAL, DSIG, EBDT, EBLC, FFTM, GDEF, GMAP, GPKG, GPOS, GSUB, JSTF, LTSH, MATH, META, OS/2, SING, SVG, TSI0, TSI1, TSI2, TSI3, TSI5, TSIB, TSID, TSIJ, TSIP, TSIS, TSIV, VDMX, VORG, cmap, cvt, feat, fpgm, gasp, glyf, hdmx, head, hhea, hmtx, kern, loca, maxp, name, post, prep, sbix, vhea and vmtx
<!-- end table list -->
</TT></BLOCKQUOTE>
Other tables are dumped as hexadecimal data.

View File

@ -40,6 +40,7 @@ def _moduleFinderHint():
from . import V_O_R_G_
from . import _c_m_a_p
from . import _c_v_t
from . import _f_e_a_t
from . import _f_p_g_m
from . import _g_a_s_p
from . import _g_l_y_f

View File

@ -62,7 +62,7 @@ class BaseConverter(object):
self.tableClass = tableClass
self.isCount = name.endswith("Count")
self.isLookupType = name.endswith("LookupType")
self.isPropagated = name in ["ClassCount", "Class2Count", "FeatureTag"]
self.isPropagated = name in ["ClassCount", "Class2Count", "FeatureTag", "SettingsCount"]
def read(self, reader, font, tableDict):
"""Read a value from the reader."""

View File

@ -979,4 +979,38 @@ otData = [
('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'),
]),
##
## Apple Advanced Typography (AAT) tables
##
#
# feat
#
('feat', [
('Version', 'Version', None, None, 'Version of the feat table-initially set to 0x00010000.'),
('uint16', 'FeatureNameCount', None, None, 'Number of entries in the feature name array.'),
('uint16', 'Reserved1', None, None, 'Reserved (set to zero).'),
('uint32', 'Reserved2', None, None, 'Reserved (set to zero).'),
('FeatureName', 'FeatureNames', 'FeatureNameCount', 0, 'The feature name array.'),
]),
('FeatureName', [
('uint16', 'FeatureType', None, None, 'Feature type.'),
('uint16', 'SettingsCount', None, None, 'The number of records in the setting name array.'),
('LOffset', 'Settings', None, None, 'Offset to setting table for this feature.'),
('uint16', 'FeatureFlags', None, None, 'Single-bit flags associated with the feature type.'),
('uint16', 'FeatureNameID', None, None, 'The name table index for the feature name.'),
]),
('Settings', [
('Setting', 'Setting', 'SettingsCount', 0, 'The setting array.'),
]),
('Setting', [
('uint16', 'SettingValue', None, None, 'The setting.'),
('uint16', 'SettingNameID', None, None, 'The name table index for the setting name.'),
]),
]