Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use filters #240

Open
khaledhosny opened this issue Mar 30, 2018 · 7 comments
Open

Document how to use filters #240

khaledhosny opened this issue Mar 30, 2018 · 7 comments

Comments

@khaledhosny
Copy link
Collaborator

I’m trying to use PropagateAnchorsFilter in my UFOs, but I couldn’t find any documentation and had to navigate through the source code (and still navigating).

@anthrotype
Copy link
Member

Thanks. Yes, sorry, documentation is none at the moment.

I suggest you have a look at the ufo2ft/filters/__init__.py, especially the loadFilters and getFilterClass functions.

the lib key is "com.github.googlei18n.ufo2ft.filters", contains a plist array of dicts, each dict has a required "name" string (e.g. "Propagate Anchors"), then optional "include" or "exclude" array of strings (glyph names), and depending on the filter class, required positional "args" (plist array) and/or optional "kwargs" (plist dict); finally a "pre" (bool) element to determine whether a filter should happen before (True) or after (False) the default filters.

See the ufo2ft.preProcessor module which manages loading and running the default and custom filters.

@khaledhosny
Copy link
Collaborator Author

Thanks, that is pretty much what I found at the end (then discover that the latest does not have that filter yet 😃).

@anthrotype
Copy link
Member

I think we can cut a release tomorrow. /cc @moyogo

@khaledhosny
Copy link
Collaborator Author

I’m testing with master now, but I’m not getting my anchors propagated, investigating.

@khaledhosny
Copy link
Collaborator Author

Hmm, looks like fontmake decomposes components before calling ufo2ft compiler, so it is too late for the filter and no anchors gets propagated.

@anthrotype
Copy link
Member

Yep. I have a wip branch that makes fontmake use ufo2ft filters for decomposing, removing overlaps and cubic2quadratic conversion. i’ll push soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants