summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2022-06-03 23:12:47 +0300
committerRasmus Andersson <rasmus@notion.se>2022-06-03 23:12:47 +0300
commit143b917365957753daedd731be6ef1894ba3ecde (patch)
treef746185e837b4a7428a52874e4c91bb61d9ecb3d /misc
parent67947d74cf113a22e6be4b069a96889d42cd7594 (diff)
downloadinter-143b917365957753daedd731be6ef1894ba3ecde.tar.xz
fix _get_vf_type bug in postprocess-single-axis-vfs.py that prevented single-axis VFs from building
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/tools/postprocess-single-axis-vfs.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/misc/tools/postprocess-single-axis-vfs.py b/misc/tools/postprocess-single-axis-vfs.py
index 189c4fb3b..4e34a2557 100755
--- a/misc/tools/postprocess-single-axis-vfs.py
+++ b/misc/tools/postprocess-single-axis-vfs.py
@@ -22,11 +22,11 @@ Atm, the script will work well for single axis fonts and families which
have a single vf for Roman and another for Italic/Condensed, both using the wght
axis (covers 95% of GF cases).
"""
+import os, sys
from argparse import ArgumentParser
from fontTools.ttLib import TTFont, newTable
from fontTools.ttLib.tables import otTables
-import os
-import sys
+
if sys.version_info.major == 3:
unicode = str
@@ -158,8 +158,9 @@ def _get_vf_types(ttfonts):
def _get_vf_type(ttfont):
- style = ttfont['name'].getName(2, 3, 1, 1033).toUnicode()
- return 'Italic' if 'Italic' in style else 'Roman'
+ if ttfont['head'].macStyle & 0b10:
+ return 'Italic'
+ return 'Roman'
def _get_vf_default_style(ttfont):