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:
parent
9cb6c5faf6
commit
86ba62ee30
1 changed files with 4 additions and 2 deletions
|
|
@ -36,6 +36,8 @@ def setFullName(font, fullName):
|
||||||
nameTable = font["name"]
|
nameTable = font["name"]
|
||||||
nameTable.setName(fullName, FULL_NAME, 1, 0, 0) # mac
|
nameTable.setName(fullName, FULL_NAME, 1, 0, 0) # mac
|
||||||
nameTable.setName(fullName, FULL_NAME, 3, 1, 0x409) # windows
|
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):
|
def getFamilyName(font):
|
||||||
|
|
@ -76,13 +78,13 @@ def renameStylesGoogleFonts(font):
|
||||||
if s != "Italic" and s.endswith("Italic"):
|
if s != "Italic" and s.endswith("Italic"):
|
||||||
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
|
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
|
||||||
s = s[:len(s) - len("Italic")] + " Italic"
|
s = s[:len(s) - len("Italic")] + " Italic"
|
||||||
rec.string = s
|
rec.string = s.strip()
|
||||||
if rid in (SUBFAMILY_NAME,) or rid in vfInstanceSubfamilyNameIds:
|
if rid in (SUBFAMILY_NAME,) or rid in vfInstanceSubfamilyNameIds:
|
||||||
s = removeWhitespace(rec.toUnicode())
|
s = removeWhitespace(rec.toUnicode())
|
||||||
if s != "Italic" and s.endswith("Italic"):
|
if s != "Italic" and s.endswith("Italic"):
|
||||||
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
|
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
|
||||||
s = s[:len(s) - len("Italic")] + " Italic"
|
s = s[:len(s) - len("Italic")] + " Italic"
|
||||||
rec.string = s
|
rec.string = s.strip()
|
||||||
# else: ignore standard names unrelated to style
|
# else: ignore standard names unrelated to style
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue