Closed andyclymer closed 9 years ago
This is causing Compositor to now throw a AttributeError: 'NoneType' object has no attribute 'FeatureList'. Looking into why...
Ah! I think I know why, line 105 in init.py needs to check if there was a gsub table before it asks for the FeatureList. I can make a fix.
When I added this feature to Compositor I had misinterpreted how Stylistic Set names are arranged in the table — Stylistic Set names are not sequential starting from ID 256, the names are instead arranged to match the order of the features (i.e. Stylistic Set 4 could be the first Stylistic Set in the font’s features and would be named at ID 256, Stylistic Set 10 could be the second feature at ID 257, etc.)
The correct Name ID for each Stylistic Set is compiled into the table as a parameter of the Stylistic Set’s FeatureRecord:
There is support for calling a feature’s UINameID parameter in Behdad Esfahbod’s fork of FontTools, but not in the version on SourceForge (and this patch is built to not cause an error with the SourceForge version).
The table loading order in the Compositor font had to change to make this work, loadCMAP() and loadFeatures() had to come before loadInfo() so that the GSUB table would already be loaded by the time the names were unpacked. I don’t believe it looks like this will cause any problem, however.