From bfe4befabefe10e06792fdb9ced7ff6eb84fcf81 Mon Sep 17 00:00:00 2001 From: Dugan Chen Date: Tue, 15 Sep 2020 23:38:11 -0700 Subject: [PATCH 1/2] Take the style from the filename if it's longer than the subfamily (fixes #257) --- font-patcher | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/font-patcher b/font-patcher index aa25fcd0b6..f4504e851c 100755 --- a/font-patcher +++ b/font-patcher @@ -293,6 +293,11 @@ class font_patcher: # some fonts have inaccurate 'SubFamily', if it is Regular let us trust the filename more: if subFamily == "Regular": subFamily = fallbackStyle + + # This is meant to cover the case where the SubFmaily is "Italic" and the filename is *-BoldItalic. + if len(subFamily) < len(fallbackStyle): + subFamily = fallbackStyle + if self.args.windows: maxFamilyLength = 31 maxFontLength = maxFamilyLength - len('-' + subFamily) From 0c372875ced7a855a65da58f5ccb811520cf6504 Mon Sep 17 00:00:00 2001 From: duganchen Date: Mon, 30 Nov 2020 21:00:54 -0800 Subject: [PATCH 2/2] Update font-patcher Fix "Subfmaily" typo --- font-patcher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font-patcher b/font-patcher index f4504e851c..aa701ce57a 100755 --- a/font-patcher +++ b/font-patcher @@ -294,7 +294,7 @@ class font_patcher: if subFamily == "Regular": subFamily = fallbackStyle - # This is meant to cover the case where the SubFmaily is "Italic" and the filename is *-BoldItalic. + # This is meant to cover the case where the SubFamily is "Italic" and the filename is *-BoldItalic. if len(subFamily) < len(fallbackStyle): subFamily = fallbackStyle