adds google style renaming for fullName and lLegacyName name records, for completeness even though it is not currently needed.

This commit is contained in:
Rasmus Andersson 2019-10-23 19:03:12 -07:00
parent 067b9689a3
commit 9cb6c5faf6

View file

@ -73,11 +73,14 @@ def renameStylesGoogleFonts(font):
s = familyName + " " + removeWhitespace(s[start + len(familyName):])
else:
s = removeWhitespace(s)
if s != "Italic" and s.endswith("Italic"):
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
s = s[:len(s) - len("Italic")] + " Italic"
rec.string = s
if rid in (SUBFAMILY_NAME,) or rid in vfInstanceSubfamilyNameIds:
s = removeWhitespace(rec.toUnicode())
if s != "Italic" and s.endswith("Italic"):
# fixup "ExtraBoldItalic" -> "ExtraBold Italic"
# fixup e.g. "ExtraBoldItalic" -> "ExtraBold Italic"
s = s[:len(s) - len("Italic")] + " Italic"
rec.string = s
# else: ignore standard names unrelated to style