Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take the style from the filename if it's longer than the subfamily (fixes #257) #526

Merged
merged 2 commits into from
Jan 30, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
duganchen marked this conversation as resolved.
Show resolved Hide resolved
if len(subFamily) < len(fallbackStyle):
duganchen marked this conversation as resolved.
Show resolved Hide resolved
subFamily = fallbackStyle

if self.args.windows:
maxFamilyLength = 31
maxFontLength = maxFamilyLength - len('-' + subFamily)
Expand Down