1
1
mirror of https://github.com/rsms/inter.git synced 2024-12-24 16:14:35 +03:00

fontbuild: set postscriptName in addition to fullName to "Inter" for variable fonts. Also trims whitespace from names in name.renameStylesGoogleFonts

This commit is contained in:
Rasmus Andersson 2019-10-23 19:51:44 -07:00
parent 9cb6c5faf6
commit 86ba62ee30

View File

@ -36,6 +36,8 @@ def setFullName(font, fullName):
nameTable = font["name"]
nameTable.setName(fullName, FULL_NAME, 1, 0, 0) # mac
nameTable.setName(fullName, FULL_NAME, 3, 1, 0x409) # windows
nameTable.setName(fullName, POSTSCRIPT_NAME, 1, 0, 0) # mac
nameTable.setName(fullName, POSTSCRIPT_NAME, 3, 1, 0x409) # windows
def getFamilyName(font):
@ -76,13 +78,13 @@ def renameStylesGoogleFonts(font):
if s != "Italic" and s.endswith("Italic"):
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
s = s[:len(s) - len("Italic")] + " Italic"
rec.string = s
rec.string = s.strip()
if rid in (SUBFAMILY_NAME,) or rid in vfInstanceSubfamilyNameIds:
s = removeWhitespace(rec.toUnicode())
if s != "Italic" and s.endswith("Italic"):
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
s = s[:len(s) - len("Italic")] + " Italic"
rec.string = s
rec.string = s.strip()
# else: ignore standard names unrelated to style