-
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
Fixed gasp support bugs per #738 #739
Conversation
Please add a test that will prevent this issue from being reintroduced in the future. |
I added a test that confirms fonts written with a |
Very nice, thanks! We shall have a review on this fix soon. |
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 for the fix :)
just 2 simple questions/suggestion but no issue overall
Hi, (why) are we waiting for another review? It looks to me as if this is ready to be merged. |
I've approved but the repo owner seems to want 2 approval, and @ILOVEPIE don't seems available to approve. can't you also approve ? so there is no need to bypass the process and force the merge |
Context
See #738. In short, write support for the
gasp
table was implemented recently in #595, however is broken. Any font written by opentype.js that includes agasp
table cannot be re-imported by opentype.js.Changes
This PR makes two changes to resolve. First, it fixes the typo in the
gasp
write function, which was trying to iterate over the integergasp.numRanges
rather than the arraygasp.gaspRanges
. Second, it wraps the entiregasp
read function in atry
block. This should prevent any future issues where failing to parse this optional table prevents a font from being read.How Has This Been Tested?
I confirmed that the Changa-Regular.ttf font could be saved/read using
toArrayBuffer
/opentype.parse
, which (as described in #738) previously resulted in an error.Types of changes
Checklist:
npm run test
and all tests passed green (including code styling checks).