googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

DecomposeTransformedComponentsFilter should decompose the same glyphs in all masters #451

Closed moyogo closed 1 year ago

moyogo commented 3 years ago

In some sources there may be a glyph with one component transformed in some masters but not in others. For example Ldot may have the dot as a component scaled in some masters but not scaled in others.

The DecomposeTransformedComponentsFilter should decompose those glyphs in all masters if they have a scaled component in at least one master.

simoncozens commented 1 year ago

This is still an issue, leading to glyphs passing the compatibility checker but failing to generate a gvar. (Examples from Noto Sans:

WARNING:fontTools.varLib:glyph dong has incompatible masters; skipping
WARNING:fontTools.varLib:glyph bilabialclick has incompatible masters; skipping
WARNING:fontTools.varLib:glyph Omonocular-cy has incompatible masters; skipping
WARNING:fontTools.varLib:glyph Odoublemonocular-cy has incompatible masters; skipping
WARNING:fontTools.varLib:glyph asterism has incompatible masters; skipping
WARNING:fontTools.varLib:glyph u1DF1D has incompatible masters; skipping

)

All these are compatible glyphs, but the error is caused by some of the masters having transformations.

anthrotype commented 1 year ago

The DecomposeTransformedComponentsFilter should decompose those glyphs in all masters if they have a scaled component in at least one master.

I believe this is already implemented now, please reopen if that's not the case.

https://github.com/googlefonts/ufo2ft/blob/d1c5ad448c809268d803bc44b82d73650105a78f/Lib/ufo2ft/preProcessor.py#L323-L338