From 143b917365957753daedd731be6ef1894ba3ecde Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Fri, 3 Jun 2022 13:12:47 -0700 Subject: [PATCH] fix _get_vf_type bug in postprocess-single-axis-vfs.py that prevented single-axis VFs from building --- misc/tools/postprocess-single-axis-vfs.py | 9 +++++---- 1 file 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):