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

Treat nameID 2 and 17 as font feature record #297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ptoussai
Copy link

@ptoussai ptoussai commented Dec 2, 2022

This is a fix for #272

@quitequinn
Copy link

Can we accept this pull request? @devongovett @blikblum

@Pomax
Copy link
Contributor

Pomax commented Feb 8, 2023

This wouldn't be correct, though. Name ID 2 and 17 have firmly established meaning, being the font subfamily records (see https://learn.microsoft.com/en-us/typography/opentype/spec/name#name-ids). Playing a guessing game using Name IDs over 25 is fair game, but 1 through 25 are off limits.

@quitequinn
Copy link

quitequinn commented Feb 8, 2023

Currently, fontKit is giving inconsistent results for fonts that work as intended. The fontkit.openSync('font.ttf'). namedVariations have an expected format, a format that I believe fontKit decided on, and fonts that use Name ID 2 to select the named value are causing fontKit to break that convention. I also don't think this is a situation where we can blame the font developer — they aren't the intended audience of fontKit.

I would argue that regardless of whether Name ID 2 and 17 have firmly established meanings, the current implementation of fontKit is creating errors, and this is a decent way to fix them without causing additional errors. Am I misunderstanding something?

@ptoussai
Copy link
Author

https://learn.microsoft.com/en-us/typography/opentype/otspec180/fvar

Values of 2 or 17 can be used; otherwise, values must be greater than 255 and less than 32768.

Name IDs 2 and 17 have an established meaning, but they can also be referenced by the fvar table.

If anything, the fix is a bit too broad as it makes these Name IDs accessible to other tables, such as feat, but I don't see the need for restriction.

Popular font authoring software already make use of this, and Fontkit should support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants