fix _get_vf_type bug in postprocess-single-axis-vfs.py that prevented single-axis VFs from building
This commit is contained in:
parent
67947d74cf
commit
143b917365
1 changed files with 5 additions and 4 deletions
|
|
@ -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
|
have a single vf for Roman and another for Italic/Condensed, both using the wght
|
||||||
axis (covers 95% of GF cases).
|
axis (covers 95% of GF cases).
|
||||||
"""
|
"""
|
||||||
|
import os, sys
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from fontTools.ttLib import TTFont, newTable
|
from fontTools.ttLib import TTFont, newTable
|
||||||
from fontTools.ttLib.tables import otTables
|
from fontTools.ttLib.tables import otTables
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
if sys.version_info.major == 3:
|
if sys.version_info.major == 3:
|
||||||
unicode = str
|
unicode = str
|
||||||
|
|
||||||
|
|
@ -158,8 +158,9 @@ def _get_vf_types(ttfonts):
|
||||||
|
|
||||||
|
|
||||||
def _get_vf_type(ttfont):
|
def _get_vf_type(ttfont):
|
||||||
style = ttfont['name'].getName(2, 3, 1, 1033).toUnicode()
|
if ttfont['head'].macStyle & 0b10:
|
||||||
return 'Italic' if 'Italic' in style else 'Roman'
|
return 'Italic'
|
||||||
|
return 'Roman'
|
||||||
|
|
||||||
|
|
||||||
def _get_vf_default_style(ttfont):
|
def _get_vf_default_style(ttfont):
|
||||||
|
|
|
||||||
Reference in a new issue