I think I knew this but had forgotten. I just stumbled on Rubik.glyphs where the GSMaster have userData containing raw "'com.github.googlei18n.ufo2ft.filters" keys:
https://github.com/googlefonts/rubik/blob/e337a5f69a9bea30e58d05bd40184d79cc099628/sources/Rubik.glyphs#L1746-L1754
since userData is passed through unchanged into the UFO lib, fontmake (ufo2ft) happily applies the filters whereas fontc doesn't know that it may have to look at the userData for ufo2ft-specific lib keys, only looks at the Glyphs native customParameters, so it will not e.g. flatten the composite glyphs when building Rubik.glyphs
I see that the FilterParamHandler class only has to_ufo but doesn't have a corresponding to_glyphs which would convert those lib elements into equivalent Glyphs filter custom parameter definitions:
|
The handler below only handles the latter, one-way case. Since ufo2ft |
|
filters are a UFO lib key, they are automatically stored in a master's |
|
userData by another code path. |
|
""" |
|
|
|
def to_glyphs(self, glyphs, ufo): |
|
pass |
|
|
|
def to_ufo(self, builder, glyphs, ufo): |
We also have a write_glyphs_filter function in
|
def write_glyphs_filter(result): |
which doesn't seem to be used anywhere.
I wonder if @belluzj or @madig remember why it was done this way and the ufo->glyphs path was never implemented for filters?
I think I knew this but had forgotten. I just stumbled on Rubik.glyphs where the GSMaster have userData containing raw "'com.github.googlei18n.ufo2ft.filters" keys:
https://github.com/googlefonts/rubik/blob/e337a5f69a9bea30e58d05bd40184d79cc099628/sources/Rubik.glyphs#L1746-L1754
since userData is passed through unchanged into the UFO lib, fontmake (ufo2ft) happily applies the filters whereas fontc doesn't know that it may have to look at the userData for ufo2ft-specific lib keys, only looks at the Glyphs native customParameters, so it will not e.g. flatten the composite glyphs when building Rubik.glyphs
I see that the
FilterParamHandlerclass only hasto_ufobut doesn't have a correspondingto_glyphswhich would convert those lib elements into equivalent Glyphs filter custom parameter definitions:glyphsLib/Lib/glyphsLib/builder/custom_params.py
Lines 941 to 949 in 52c9823
We also have a
write_glyphs_filterfunction inglyphsLib/Lib/glyphsLib/builder/filters.py
Line 78 in 52c9823
which doesn't seem to be used anywhere.
I wonder if @belluzj or @madig remember why it was done this way and the ufo->glyphs path was never implemented for filters?