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

font validation failed, installing Meslo font #413

Closed
zno5 opened this issue Dec 28, 2019 · 7 comments
Closed

font validation failed, installing Meslo font #413

zno5 opened this issue Dec 28, 2019 · 7 comments
Labels

Comments

@zno5
Copy link

zno5 commented Dec 28, 2019

🎯 font validation failed

Font validation has failed when I install Meslo bold italic font.
Other fonts(bold, italic, regular) are fine.

The problem is name table usability has caution.

🔧 Your Setup

  • Meslo LG S Bold Italic Nerd Font Complete Mono.ttf
  • macOS 10.14.6

★ Optional

Screen Shot 2019-12-28 at 10 37 20 AM

@ryanoasis
Copy link
Owner

@zno5 Thanks for the report, low priority issue but issue non-the-less. Is it the same warning with regular Meslo font (non Nerd Font patched) ?

@yaneura-no-gomi
Copy link

yaneura-no-gomi commented Feb 7, 2020

I have the same problem with Meslo LG M Bold Nerd Font Complete Mono.ttf

@PatTheMav
Copy link

PatTheMav commented Mar 2, 2021

@ryanoasis Fwiw I had the same issue when patching SF Mono recently (which felt like a regression because I didn't use to have that issue). What "fixed" it for me was to add this little stinker before the subFamily is added to fontname:

        subFamily = subFamily.replace(' ', '')

Whereas the fontname was SFMonoNerdFont-Regular Italic, it now became SFMonoNerdFont-RegularItalic - without any spaces in there (they are removed from the fontname as well) macOS seems to like the name table again.

To summarise:

Results in bad name table:

Family Name:    SFMono Nerd Font
Full Name:      SFMono Regular Italic Nerd Font
Font Name:      SFMonoNerdFont-Regular Italic
Sub-Family:     Regular Italic

Results in good name table:

Family Name:    SFMono Nerd Font
Full Name:      SFMono Regular Italic Nerd Font
Font Name:      SFMonoNerdFont-RegularItalic
Sub-Family:     RegularItalic

EDIT: On top of that I found that to fix the "full name" (as presented by macOS' font book) requires to work around a quirk - macOS generates this name from the Windows font properties, which are not always overwritten by fontforge. To fix this one has to first set the SFNTName property for Fullname to an empty string, and then once more for the correct value.

@torarnv torarnv mentioned this issue Apr 10, 2022
2 tasks
@torarnv
Copy link
Contributor

torarnv commented Apr 10, 2022

Had this after patching Menlo:

image

@torarnv
Copy link
Contributor

torarnv commented Apr 10, 2022

The subFamily = subFamily.replace(' ', '') trick worked.

torarnv added a commit to torarnv/nerd-fonts that referenced this issue Apr 10, 2022
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 ryanoasis#413
@torarnv
Copy link
Contributor

torarnv commented Apr 10, 2022

Fixed in #820. Only the font name (PS name) needs sanitation.

@Finii Finii closed this as completed in 6acec45 Aug 23, 2022
@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
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 ryanoasis#413
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants