googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

Allow user-defined filters to be pre-filters #548

Closed simoncozens closed 3 years ago

simoncozens commented 3 years ago

I have a filter which strokes an open path. This needs to be run before cubic-to-quadratic and overlap removal. This currently can't be done from the command line. With this PR, we can now do:

fontmake --filter 'pre::ufostroker::StrokeFilter(Width=50)' -u OpenPaths.ufo -o ttf
simoncozens commented 3 years ago

Apparently we can do this already by passing pre=True in the kwargs! I shall document this in fontmake docs instead.