ufo2ft: Cannot set post table format 3 in TTF variable font using UFO key

Because of this line forcing False instead of passing None it doesn’t seem to be possible to set post table format 3.0 with only the UFO key <key>com.github.googlei18n.ufo2ft.keepGlyphNames</key> <false/>

https://github.com/googlefonts/ufo2ft/blob/648e7a19dd02215a6f720f2ec7f3980f16d05ca5/Lib/ufo2ft/__init__.py#L604

For most fonts it will probably work fine as is, but when the font contains 65535 glyphs it can fail while running through the names (that seems like a whole different issue in fontTools, but can be ignored for this case). The fontmake error is a bit useless: fontmake: Error: In 'Test.designspace': Generating fonts from Designspace failed: unsigned short is greater than maximum

That’s only useful if you know that it means the post table (2.0) and that it means you are trying to add indices > 65535 to the array at https://github.com/fonttools/fonttools/blob/7878c32a85b93296141b35d15b909eff220e46a9/Lib/fontTools/ttLib/tables/_p_o_s_t.py#L172

If I change False to useProductionNames then it will make post format 3.0 and compile fine. The same line is in compileVariableCFF2, but that will fail for different reasons so my question here is what’s the reason to set this to False instead of passing the value along?

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 31 (17 by maintainers)

Commits related to this issue

Most upvoted comments

why is this forcing False instead of passing the provided value?

because: compileVariableTTF delegates to compileInterpolatableTTFsFromDS (or OTFs) to build the masters, but we don’t want to process the production names for each individual master, we only want to do the renaming (if any) one time at the end, on the varfont itself. We don’t want any glyph renaming to happen before we build the VF, because designspace can contain rules that reference glyphs using the human-readable names (not the uniXXXX production names).