You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by NightFurySL2001 July 2, 2023
3. extractor raises two error: AttributeError: 'dict' object has no attribute 'bFamilyType' ...
I can't catch the bug for the former. Maybe it's due to fontbuilder doesn't build panose?
looks to me like a bug in the fontBuilder, because it leaves the OS/2 table's panose attribute as a dictionary (as in _panoseDefaults), whereas it should set it to a Panose object like the OS/2 table's decompile method does. The reason it works when saving from the fontBuilder is that the fonttools' sstruct.pack method accepts either an object or a dictionary and so compile works regardless.
We should fix it in fonttools. @NightFurySL2001 do you mind filing an issue or working on a PR even?
As a workaround, you could temporarily save the fontBuilder's font (to a tempfile or BytesIO stream), reload it and then try to extractor it. I believe it will work then, for the panose attribute will be an object and not a dict upon decompiling.
The text was updated successfully, but these errors were encountered:
After thinking a bit more, maybe fontBuilder should provide a method to normalise the TTFont object in it? There are multiple ways that the TTFont object might be messed up during the building process, including passing in an integer value as the version number as shown in robotools/extractor/issues/59.
When using fontBuilder to build a font, the default panose is set as a dictionary and not a object namespace causing issues downstream.
Discussed in #3196
Originally posted by NightFurySL2001 July 2, 2023
3.
extractor
raises two error:AttributeError: 'dict' object has no attribute 'bFamilyType'
...I can't catch the bug for the former. Maybe it's due to
fontbuilder
doesn't build panose?looks to me like a bug in the fontBuilder, because it leaves the OS/2 table's
panose
attribute as a dictionary (as in_panoseDefaults
), whereas it should set it to aPanose
object like the OS/2 table's decompile method does. The reason it works when saving from the fontBuilder is that the fonttools'sstruct.pack
method accepts either an object or a dictionary and so compile works regardless.We should fix it in fonttools. @NightFurySL2001 do you mind filing an issue or working on a PR even?
As a workaround, you could temporarily save the fontBuilder's font (to a tempfile or BytesIO stream), reload it and then try to extractor it. I believe it will work then, for the panose attribute will be an object and not a dict upon decompiling.
The text was updated successfully, but these errors were encountered: