-
Notifications
You must be signed in to change notification settings - Fork 487
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
fix fvar axis/instance name parsing and writing (fix #687) #694
Conversation
Thanks a lot, Constantin! This is a rather crucial fix for a serious bug, is there some way this could be reviewed in the near future? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @Connum 💪
Rebased onto current master, needs another review to be able to merge |
Oh boy, the rebase broke something... I'll have a look at it later. |
@yne ready for final review |
Description
Fixes parsing of name IDs in the fvar table (fix #687) and adds parsing/optional writing of the postScriptNameID field.
I also refactored name handling a bit. Having the fvar make function modify the name table by creating new entries (without checking if a name entry already existed) was a bad design choice and shouldn't be done during writing anyway, so I removed the
addName()
function completely. New names should be added to the name tables and then be referenced by ID in the fvar table. When we add "comfort" functions to the variable features later, these should handle this accordingly, but for now this has to be done manually.Motivation and Context
Parsing the names for axes/instances in the fvar table did not work correctly in all cases. Name ID values 2 and 17 for the instance name, as well as 6 for the postScriptNameID were not parsed correctly (and postScriptNameID was so far not parsed at all). These are allowed according to the spec:
How Has This Been Tested?
Test font provided in #687 and additional tests created.
Types of changes
Checklist:
npm run test
and all tests passed green (including code styling checks).