Skip to content

Commit

Permalink
Take the style from the filename if it's longer than the subfamily (f…
Browse files Browse the repository at this point in the history
…ixes ryanoasis#257)
  • Loading branch information
duganchen committed Sep 16, 2020
1 parent c41890f commit bfe4bef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bfe4bef

Please sign in to comment.