Skip to content

Conversation

@anthrotype
Copy link
Member

fonttools varLib already treats empty glyphs in non-default masters as non-participating ('sparse') in gvar interpolation.
But fontmake's compatibility checker currently rejects these as it expects all glyphs to have the same number/type of segments.

In fonttools/fonttools#3956 we relaxed this requirement in cu2qu. So we can now let fontmake pass these through.

Adding empty non-default glyhps can be useful for defining masters that only contribute kerning data. The kerning.plist needs the glyphs to be present in the UFO default layer, otherwise the the pair referencing any missing glyphs will be pruned by the ufo2ft kernFeatureWriter. By adding empty glyphs, the kerning pairs can stay and the ufo2ft's VariableKernFeatureWriter can generate a variable kern feature, but no additional gvar deltas will get added for those glyphs.

Fixes #1158

made the Bold 'space' glyph non-empty (the default 'Regular' is still empty) to trigger error when default is empty but non-default is not.

also added 'E' glyph which is non-empty in default 'Regular' master but it is empty in the non-default 'Bold' master. This should be allowed and pass the check, not raise an error. The empty non-default glyph should be treated as if it is not there.
This is to add support for sparse kerning.
unrelated to this PR, flake8 complains about "Exception class with `__init__` should pass all args to `super().__init__()` in order to work with `copy.copy()`"
@anthrotype anthrotype merged commit 35e9e5d into main Nov 21, 2025
15 checks passed
@anthrotype anthrotype deleted the allow-empty-non-default-glyphs branch November 21, 2025 11:30
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.

How to build with sparse source kerning?

1 participant