googlefonts / ufo2ft

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

Instantiator should swap glyphs across all layers #837

Closed madig closed 6 months ago

madig commented 6 months ago

The function https://github.com/googlefonts/ufo2ft/blob/8e9e6eb66a2d22714c9da9544bdbfe1aa44d0cf0/Lib/ufo2ft/instantiator.py#L835 only works on the default layer, leaving sparse intermediate layers in a Designspace untreated. Instead of just running on all layers, it should pick out those that are referenced in the Designspace.

anthrotype commented 6 months ago

are you sure? swap_glyph_names is only ever called inside generate_instance method on a new Font object that was created from scratch and holds the interpolated UFO data. This Font only contains one layer, the default one. Are you trying to use this swap_glyph_names from some other place?

madig commented 6 months ago

Oh, duh, yes, I was using it in a different way.