question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Feb 16, 2021

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).

0reactions
anthrotypecommented, Oct 20, 2022

makeMissingRequiredGlyphs which adds a .notdef glyph which I don’t need since cid00000 is already that glyph

Then we should probably check that a glyph named “cid00000” exists as well and is the first glyph, in which case assume .notdef is already present and don’t make one up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fontmake/font_project.py at main · googlefonts ... - GitHub
Compile fonts from sources (UFO, Glyphs) to binary (OpenType, TrueType). - fontmake/font_project.py at main · googlefonts/fontmake.
Read more >
Source code for fontTools.varLib.instancer
Partially instantiate a variable font. The module exports an `instantiateVariableFont` function and CLI that allow to create full instances (i.e. static ...
Read more >
Working with Font Variations - FontLab Help Center
Use File > Export Font As to export your entire variable font into a variable font format such as Variable TT ( .ttf...
Read more >
NEWS.rst - third_party/fonttools - Git at Google
[varLib] Always build ``gvar`` table for TrueType-flavored Variable Fonts, ... [fontBuilder] Enable making CFF2 fonts with ``post`` table format 2 (#1557).
Read more >
Glyphs 3 Handbook
15.1.3 UFO Export, 217 ... scripts with the Create Document button in the bottom right: ... If the Glyphs Viewer app cannot find...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found