Skip to content

Designspace.lib["skipExportGlyphs"] must override invididual UFO's lib.plist when building statics#1146

Merged
anthrotype merged 1 commit intomainfrom
use-ds-skip-export-glyphs-key-for-statics
Jun 4, 2025
Merged

Designspace.lib["skipExportGlyphs"] must override invididual UFO's lib.plist when building statics#1146
anthrotype merged 1 commit intomainfrom
use-ds-skip-export-glyphs-key-for-statics

Conversation

@anthrotype
Copy link
Member

@anthrotype anthrotype commented Jun 3, 2025

https://fonttools.readthedocs.io/en/latest/designspaceLib/index.html#public-skipexportglyphs

applications using a Designspace as the corner stone of the font compilation process should use the lib key in that Designspace instead of any of the UFOs. If the lib key is empty or not present in the Designspace, all glyphs should be exported, regardless of what the same lib key in any of the UFOs says.

ufo2ft already does the right thing when fontmake gives it a designspace to build a VF, or when fontmake calls ufo2ft.instantiator to interpolate static UFOs.

However, when fontmake builds static master TTFs from a designspace input (i.e. -o ttf -m Font.designspace but without the -i interpolate flag to build instances), then it simply loads the master UFOs as individual sources and calls compileTTF/compileOTF on each UFO. ufo2ft then reads the "public.skipExportGlyphs" in each individual UFO lib.plist, which should not have happened because fontmake started compiling from a designspace (but ufo2ft can't know that).

This PR fixes it, by reading the skipExportGlyphs key inside the designspace.lib (can be missing or empty) and passing it as parameter to ufo2ft compileTTF/compileOTF methods (this overrides whatever skipExportGlyphs in the UFO lib.plist).

The bug was spotted in googlefonts/fontc#1507

It is a minor bug and we may actually prefer to close as wontfix. There may be old projects out there relying on the fact that fontmake -m Font.designspace -o ttf is a shorthand for a bunch of fontmake -u Font-{Light,Regular,Bold}.ufo -o ttf etc.

@anthrotype anthrotype merged commit 6a003f1 into main Jun 4, 2025
14 checks passed
@anthrotype anthrotype deleted the use-ds-skip-export-glyphs-key-for-statics branch June 4, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants