Commit 481340b1 authored by Nikolaus Waxweiler's avatar Nikolaus Waxweiler

Variable font: Apply ufo2ft filters explicitly

ufo2ft up and and including 2.8.0 did not do it for TTFs, but for OTFs.
parent eb854810
Pipeline #81704 passed with stage
in 2 minutes and 4 seconds
......@@ -35,6 +35,18 @@ designspace = fontTools.designspaceLib.DesignSpaceDocument.fromfile(designspace_
for source in designspace.sources:
source.font = ufoLib2.Font.open(designspace_path.parent / source.filename)
# 1.5. Apply ufo2ft filters to masters before compiling them -- in ufo2ft up to and
# including 2.8.0, filters were applied in compileInterpolatableOTFsFromDS, but not
# compileInterpolatableTTFsFromDS. Do it manually to be sure...
pre_filter, post_filter = ufo2ft.filters.loadFilters(source.font)
for pf in pre_filter:
pf(font=source.font)
for pf in post_filter:
pf(font=source.font)
# ... and then delete the key so they aren't re-applied.
del source.font.lib["com.github.googlei18n.ufo2ft.filters"]
designspace.instances = [
s for s in designspace.instances if s.lib.get("com.schriftgestaltung.export", True)
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment