attempt at fixing names for Windows, re issue #519
This commit is contained in:
parent
036a0373b2
commit
6e73e79950
8 changed files with 455 additions and 253 deletions
|
|
@ -1,19 +1,6 @@
|
|||
import sys
|
||||
import defcon
|
||||
|
||||
def ufo_set_wws(ufo):
|
||||
# Fix missing WWS entries for Display fonts:
|
||||
# See https://github.com/googlefonts/glyphsLib/issues/820
|
||||
subfamily = ufo.info.styleName
|
||||
if subfamily.find("Display") == -1:
|
||||
return
|
||||
subfamily = subfamily[len("Display"):].strip()
|
||||
if subfamily == "":
|
||||
# "Display" -> "Regular"
|
||||
subfamily = "Regular"
|
||||
ufo.info.openTypeNameWWSFamilyName = "Inter Display"
|
||||
ufo.info.openTypeNameWWSSubfamilyName = subfamily
|
||||
|
||||
|
||||
# See https://github.com/rsms/inter/issues/508
|
||||
# TODO: Remove when https://github.com/googlefonts/glyphsLib/issues/821 is fixed
|
||||
|
|
@ -30,18 +17,8 @@ def fix_fractional_advance_width(ufo):
|
|||
|
||||
def main(argv):
|
||||
ufo_file = argv[1]
|
||||
|
||||
# TODO: Uncomment when https://github.com/googlefonts/glyphsLib/issues/821 is fixed
|
||||
# if ufo_file.find("Display") == -1:
|
||||
# return # skip fonts of "default" family
|
||||
|
||||
ufo = defcon.Font(ufo_file)
|
||||
|
||||
if ufo_file.find("Display") != -1:
|
||||
ufo_set_wws(ufo)
|
||||
|
||||
fix_fractional_advance_width(ufo)
|
||||
|
||||
ufo.save(ufo_file)
|
||||
|
||||
|
||||
|
|
|
|||
Reference in a new issue