googlefonts / glyphsLib

A bridge from Glyphs source files (.glyphs) to UFOs
Apache License 2.0
178 stars 51 forks source link

features: Do not include empty labels #970

Closed m4rc1e closed 5 months ago

m4rc1e commented 5 months ago

In Glyphsapp, users can define names for Stylistic Sets.

Screenshot 2024-01-09 at 11 23 56

Currently, if a user doesn't add a name, GlyphsLib will export the stylistic set with an empty name.

This PR won't add empty names which mimics the behaviour of GlyphsApp's exporter.

I discovered this issue while checking https://github.com/google/fonts/pull/7104. Fontbakery is reporting that the font is missing nameIDs 256, 257 etc which stem from this issue, https://github.com/fonttools/fontbakery/issues/3671#issuecomment-1882830352

anthrotype commented 5 months ago

but why are there feature labels with empty string value? how are those created to begin with? Can the user just clean up their source files to make sure these empty labels are removed?

m4rc1e commented 5 months ago

but why are there feature labels with empty string value? how are those created to begin with?

When the user adds a stylistic set feature, you get the UI in the above pic which includes an empty text box.

Can the user just clean up their source files to make sure these empty labels are removed?

It doesn't look like it. If you want a stylistic set, the text box is there and you cannot remove it.

schriftgestalt commented 5 months ago

it would be good to have a test case for this. That can ensure that my Glyphs3 branch will not regress on this.

anthrotype commented 5 months ago

it would be good to have a test case for this

👍 /cc @m4rc1e

emmamarichal commented 4 months ago

I tested it on Pacifico: Test_stylisticsets_nameID.zip

The fail disappeared, with only have ⚠ WARN: Ensure Stylistic Sets have description. now. Thanks @m4rc1e!