Skip to content

'com.github.googlei18n.ufo2ft.filters' are not converted back to Glyphs filters custom parameters #1106

@anthrotype

Description

@anthrotype

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions