From 1a835a5ecf11226e21457669289c0abcb74b0389 Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Fri, 4 Mar 2016 19:34:12 -0800 Subject: [PATCH 1/3] 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 From 7dc096e8b9e6697a27f159cb849ffd890a773da7 Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Sat, 5 Mar 2016 00:45:13 -0800 Subject: [PATCH 2/3] Consistent quote style --- font-patcher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font-patcher b/font-patcher index 3713ce050..18ea8f380 100755 --- a/font-patcher +++ b/font-patcher @@ -84,7 +84,7 @@ if args.single: sourceFont = fontforge.open(args.font) fontname, style = re.match("^([^-]*)(?:(-.*))?$", sourceFont.fontname).groups() -style = style.replace('-', '') +style = style.replace("-", "") familyname = sourceFont.familyname.replace(style, "").rstrip() # fullname (filename) can always use long/verbose font name, even in windows From 7cbc79b9ceae3fcf908a272609b14cbb859328af Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Sat, 12 Mar 2016 15:46:33 -0800 Subject: [PATCH 3/3] Fix regular expression for font style splitting Modify regular expression grouping instead of stripping dash from font style string --- font-patcher | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/font-patcher b/font-patcher index 18ea8f380..9c49c6847 100755 --- a/font-patcher +++ b/font-patcher @@ -83,9 +83,7 @@ if args.single: sourceFont = fontforge.open(args.font) -fontname, style = re.match("^([^-]*)(?:(-.*))?$", sourceFont.fontname).groups() -style = style.replace("-", "") - +fontname, style = re.match("^([^-]*)(?:-(.*))?$", sourceFont.fontname).groups() familyname = sourceFont.familyname.replace(style, "").rstrip() # fullname (filename) can always use long/verbose font name, even in windows fullname = sourceFont.fullname + verboseAdditionalFontNameSuffix