From 1a835a5ecf11226e21457669289c0abcb74b0389 Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Fri, 4 Mar 2016 19:34:12 -0800 Subject: [PATCH] Consider font style when generating familyname and fontname --- font-patcher | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/font-patcher b/font-patcher index 57bb42b31..3713ce050 100755 --- a/font-patcher +++ b/font-patcher @@ -84,10 +84,12 @@ if args.single: sourceFont = fontforge.open(args.font) fontname, style = re.match("^([^-]*)(?:(-.*))?$", sourceFont.fontname).groups() -familyname = sourceFont.familyname +style = style.replace('-', '') + +familyname = sourceFont.familyname.replace(style, "").rstrip() # fullname (filename) can always use long/verbose font name, even in windows fullname = sourceFont.fullname + verboseAdditionalFontNameSuffix -fontname = fontname + additionalFontNameSuffix.replace(" ", "") +fontname = fontname + additionalFontNameSuffix.replace(" ", "") + "-" + style if args.windows: maxLength = 31