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.namedVariations fails on some fonts #272
Comments
By changing Line 79 in 417af0c
and Line 85 in 417af0c
to: record.nameID >= 256 || record.nameID == 2 || record.nameID == 17 will solve the issue.Is there a reason to create the name array fontFeatures ? Why when looking for a name just dont search on the full list?
|
I have the same problem. Glyphs uses |
Can we get this merged? |
Font Subfamily name is Name ID Code 2. This means you could search and replace any named instances with |
also getting this error. — if there is a fix, please merge 🙏 |
I also run into this issue, it is actually quite common. |
This also happens with other references (eg. ID 17 was known as “Preferred Subfamily”) |
Have you found a work around @Typogram ? Even just a way to lookup by name id without having to create a dictionary via https://learn.microsoft.com/en-us/typography/opentype/spec/name |
When parsing some fonts and trying to get namedVariation. it throws the following error:
TypeError: Cannot read property 'en' of undefined
When printing the instance where the undefined is raised it shows the following,
name
is missing.{ nameID: 2, flags: 0, coord: [ 0, 400, 100, 0 ], postscriptNameID: 6 }
I dug a bit and the issue is cause because when getting the instance name is not fnding id 2 since
name.records.fontFeatures
starts at ID 256. When instance name matches with font ID 2 will use that, it seems this is very common and allowed by the spec:The text was updated successfully, but these errors were encountered: