googlefonts / ufomerge

ufomerge
Apache License 2.0
11 stars 3 forks source link

Remove empty classes and lookups? #3

Closed madig closed 1 year ago

madig commented 1 year ago

A UFO I want to subset is later crashing feaLib with Empty glyph class in contextual positioning rule. Is there a particular reason why dropping empty lookups isn't implemented yet? Otherwise I'd try my hand at it.

simoncozens commented 1 year ago

I think I started - 0e12df4 and ca84892 are supposed to address this. But obviously I didn't get all of them...

madig commented 1 year ago

https://github.com/googlefonts/ufomerge/blob/257e339f0b3a8474de508aa4c288f6e163fd7e58/Lib/ufomerge/__init__.py#L488

Should this be if not hasattr(feature, "statements"):? Otherwise ast.LookupBlock get skipped over?