[cantarell-fonts] Variable font: Apply ufo2ft filters explicitly
- From: Nikolaus Waxweiler <nwaxweiler src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cantarell-fonts] Variable font: Apply ufo2ft filters explicitly
- Date: Mon, 13 May 2019 19:57:05 +0000 (UTC)
commit 481340b18d9460491a4de4338a0e97e1c9edbcc6
Author: Nikolaus Waxweiler <madigens gmail com>
Date: Mon May 13 20:56:44 2019 +0100
Variable font: Apply ufo2ft filters explicitly
ufo2ft up and and including 2.8.0 did not do it for TTFs, but for OTFs.
scripts/make-variable-font.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/scripts/make-variable-font.py b/scripts/make-variable-font.py
index 63b6a3db..046f9f0a 100644
--- a/scripts/make-variable-font.py
+++ b/scripts/make-variable-font.py
@@ -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)
]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]