diff options
author | Rasmus Andersson <rasmus@notion.se> | 2019-10-24 04:44:33 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2019-10-24 04:44:33 +0300 |
commit | 0ea81677797e2f4df5e514b791c96feb40318756 (patch) | |
tree | 06e625a5703d416c277b6ced229d59e2aa202f93 /misc/fontbuildlib/name.py | |
parent | 51781961e3213be3d2dd104457ecbb5f2eaa9daa (diff) | |
download | inter-0ea81677797e2f4df5e514b791c96feb40318756.tar.xz |
change fontbuild rename command to apply Google Fonts standard style names with --google-style flag (replaces flag --compact-style)
Diffstat (limited to 'misc/fontbuildlib/name.py')
-rw-r--r-- | misc/fontbuildlib/name.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/misc/fontbuildlib/name.py b/misc/fontbuildlib/name.py index c999a243a..c9e36b1ed 100644 --- a/misc/fontbuildlib/name.py +++ b/misc/fontbuildlib/name.py @@ -53,7 +53,7 @@ def getFamilyName(font): return r.toUnicode() -def removeWhitespaceFromStyles(font): +def renameStylesGoogleFonts(font): familyName = getFamilyName(font) # collect subfamily (style) name IDs for variable font's named instances @@ -75,7 +75,11 @@ def removeWhitespaceFromStyles(font): s = removeWhitespace(s) rec.string = s if rid in (SUBFAMILY_NAME,) or rid in vfInstanceSubfamilyNameIds: - rec.string = removeWhitespace(rec.toUnicode()) + s = removeWhitespace(rec.toUnicode()) + if s != "Italic" and s.endswith("Italic"): + # fixup "ExtraBoldItalic" -> "ExtraBold Italic" + s = s[:len(s) - len("Italic")] + " Italic" + rec.string = s # else: ignore standard names unrelated to style |