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

Unable to write GSUB lookup type 6 tables. #309

Closed
shabeernotion opened this issue Oct 10, 2017 · 8 comments · Fixed by #453
Closed

Unable to write GSUB lookup type 6 tables. #309

shabeernotion opened this issue Oct 10, 2017 · 8 comments · Fixed by #453

Comments

@shabeernotion
Copy link

Expected Behavior

I have loaded Ribeye-Marrow-regular.ttf font and trying to font.toArrayBuffer() on Aws

Current Behavior

It throws following error:
Unable to write GSUB lookup type 6 tables.

@Jolg42
Copy link
Member

Jolg42 commented Oct 11, 2017

Hi @shabeernotion

So you could check https://github.com/nodebox/opentype.js/blob/master/src/tables/gsub.js
Reading of all GSUB types 1,2,3,4,5,6,7,8 are supported but only types 1,3,4 for writing.

Feel free to contribute and add the type 4 if you need it 😉

@shabeernotion
Copy link
Author

May I know how to add type 2 and type 6?

@Jolg42
Copy link
Member

Jolg42 commented Oct 11, 2017

So for adding the support for these 2 types you'll need to check how the reading part was done and read the OpenType specification to understand how it works.
After that write your code and make sure it works well (reading / writing).

It's easier as the reading part is implemented but still need to be done 😉

@shabeernotion
Copy link
Author

Should I implement in order to parse? Are there any other way that I can parse without doing it?

@Jolg42
Copy link
Member

Jolg42 commented Oct 11, 2017

So parsing is already implemented actually!

@shabeernotion
Copy link
Author

shabeernotion commented Oct 11, 2017

Yeah but actually this error throws on toArrayBuffer(). So, If it's throws an error, I hope it won't parse correctly.

@Jolg42
Copy link
Member

Jolg42 commented Oct 11, 2017

Yes indeed, so what's happening is that toArrayBuffer() is trying to write the GSUB type 6 that was read when loading the font and it can't because it's not implemented.
Basically opening is working but when doing toArrayBuffer() you ask to convert the data back to a font format and it can't.

@Connum
Copy link
Contributor

Connum commented Oct 20, 2020

I've got writing for GSUB type 6 format 1 and 3 working so far:
https://github.com/Connum/opentype.js/tree/add-lookup-type-6
Testing and feedback is encouraged and would be great to have before creating a PR.

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 a pull request may close this issue.

3 participants