mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
font-patcher: Ensure PostScript font name does not contain spaces
When pulling the subfamily out of the sfnt_names SubFamily property, we will get a subfamily with possible spaces, e.g. 'Bold Italic'. When constructing the final unique font name (PostScript name), we need to remove those spaces, to make the font name valid, otherwise the font will fail validation with a warning when installing. Fixes #413
This commit is contained in:
parent
ccc6f4e546
commit
6acec45622
1 changed files with 3 additions and 2 deletions
|
@ -516,8 +516,9 @@ class font_patcher:
|
|||
familyname += " Mono"
|
||||
|
||||
# Don't truncate the subfamily to keep fontname unique. MacOS treats fonts with
|
||||
# the same name as the same font, even if subFamily is different.
|
||||
fontname += '-' + subFamily
|
||||
# the same name as the same font, even if subFamily is different. Make sure to
|
||||
# keep the resulting fontname (PostScript name) valid by removing spaces.
|
||||
fontname += '-' + subFamily.replace(' ', '')
|
||||
|
||||
# rename font
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue