-
Notifications
You must be signed in to change notification settings - Fork 492
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
Add writing support for lookup type 6, formats 1 and 3 #453
Conversation
…com/Connum/opentype.js into add-gsub-lookup-type-2-multiple-sub
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.
Well done! 💯
Inter contains format 6, type 2. I ran into the error "lookup type 6 format 2 is not yet supported" when trying to modify Inter. |
@calebmer if it's of any help, I found that the 3.0 release of Inter works with this library. Seems like the format 2 thing has been introduced within that release cycle. |
Oh thanks! I ended up using Python's fonttools ttx for the modification I needed to make. |
Description
This allows to write fonts containing tables of lookup type 6, in formats 1 and 3.
Motivation and Context
Fonts containing such tables would simply fail when writing. Lookup type 6 is needed for the Chaining Contextual Substitution feature.
I originally planned to implement all three formats for this type, but this PR now only implements format 1 and 3 and will still throw a descriptive error when encountering format 2, for the following reasons:
If anyone can provide a font using format 6, type 2, I would be happy to look into this and implement it, if and when my free time allows. I would also be interested in implementing all other missing types (5, 7 and 8) in order to complete the writing functionality of the library.
How Has This Been Tested?
I added test cases for writing both formats according to the specs. I also loaded and saved several font files containing such tables, checking that they contained the corresponding tables afterwards.
Screenshots (if appropriate):
Types of changes
Checklist:
npm run test
and all tests passed green (including code styling checks).