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

Error parsing fonts with CFF outlines #40

Closed
lojjic opened this issue May 4, 2020 · 1 comment
Closed

Error parsing fonts with CFF outlines #40

lojjic opened this issue May 4, 2020 · 1 comment

Comments

@lojjic
Copy link
Collaborator

lojjic commented May 4, 2020

See lojjic/aframe-troika-text#20

The font referenced there (https://fonts.google.com/download?family=Noto%20Sans%20SC) appears to have a CFF table and no loca table. Typr appears to support both schemes - see Typr.U.glyphToPath as an example for the forking logic. However we aren't following that same logic in the FontParser_Typr adapter, we just call Typr.glyf._parseGlyf, which fails when there's no loca table present.

@lojjic
Copy link
Collaborator Author

lojjic commented May 4, 2020

Changing the code to just walk the glyph coordinates rather than trying to call into Typr.glyf._parseGlyf fixes the issue. Proof of that, using the aforementioned font:

image

@lojjic lojjic closed this as completed in 0114ea6 May 4, 2020
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

No branches or pull requests

1 participant