SOLVED Unable to open UFO containing openTypeNameRecords
-
I have a UFO containing the following data in fontinfo.plist:
<key>openTypeNameRecords</key> <array> <dict> <key>languageID</key> <integer>1050</integer> <key>nameID</key> <integer>9</integer> <key>platformID</key> <integer>3</integer> <key>string</key> <string>Name with Croatian glyphs đć</string> </dict> </array>
when I try to open this file in RF3.4 (or later betas) it refuses to open with the following traceback:
Traceback (most recent call last): File "lib/doodleDocument.pyc", line 96, in _loadFont File "/Applications/RoboFont-3.4.app/Contents/Resources/lib/python3.7/defcon/objects/font.py", line 396, in _get_info File "/Applications/RoboFont-3.4.app/Contents/Resources/lib/python3.7/fontTools/ufoLib/__init__.py", line 515, in readInfo File "/Applications/RoboFont-3.4.app/Contents/Resources/lib/python3.7/defcon/objects/info.py", line 38, in setter ValueError: Invalid value ([{'languageID': 1050, 'nameID': 9, 'platformID': 3, 'string': 'Name with Croatian glyphs đć'}]) for attribute openTypeNameRecords.
The IDs for the name record in question appear to be defined correctly:
https://docs.microsoft.com/en-us/typography/opentype/spec/name#platform-encoding-and-language-ids.
-
Indeed that is the culprit. Thanks @frederik!
-
you are missing the
encodingID
key in the name dict...see the dict prototype https://github.com/fonttools/fonttools/blob/main/Lib/fontTools/ufoLib/validators.py#L200