-
Notifications
You must be signed in to change notification settings - Fork 479
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
getEnglishName('fontFamily') returns undefined, font.names.macintosh is incomplete #570
Comments
If font.names.macintosh is incomplete then the font is corrupt, the macintosh names table is required. |
OK but then I still think we should handle this more gracefully, by setting the macintosh names to available names, our at least rather log a warning instead of throwing an error |
It doesn't seem to be too uncommon by the way, I have another variable font with the same issue. Or it might have been the unicode table there, but I'll have to check again. Anyway we should handle this in a better way. |
The Mac names are not required anymore. I used to work for Monotype and now work for Fontwerk – and we don't produce any Mac name table entries anymore. Even Apple stopped producing mac names in their fonts. |
For fontwerk I wrote this fontbakery test: |
This will be fixed by #701
|
Expected Behavior
The font download shouldn't fail if
font.getEnglishName('fontFamily')
returnsundefined
, but even more so,font.getEnglishName('fontFamily')
shouldn't return undefined in the first place.Current Behavior
For some fonts
font.download()
fails becausefont.getEnglishName('fontFamily')
returnsundefined
Possible Solution
The issues seems to be related to #542. The name table.names.macintosh contains several numeric IDs for, but none of the regular entries. In
getEnglishName()
we should probably do this (we can't use optional chaining because it cannot be transpiled currently, but just to get the idea):Also in names.js,
The name/platform shouldn't be initialized to an empty object, but the default name properties should be copied from one of the existing ones.
But also it shouldn't ever happen that the names objects are in such an irregular state.
Steps to Reproduce (for bugs)
font.getEnglishName('fontFamily')
font.download()
Your Environment
The text was updated successfully, but these errors were encountered: