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

Fontkit produces invalid .ttf files? #149

Closed
AlexandraK opened this issue Jan 17, 2018 · 4 comments
Closed

Fontkit produces invalid .ttf files? #149

AlexandraK opened this issue Jan 17, 2018 · 4 comments

Comments

@AlexandraK
Copy link

I was testing the code form the homepage with the subset and it looks like the .ttf file that is produced by it is not loaded by Chrome.

Chromes throws this error:

OTS parsing error: incorrect entrySelector for table directory

@TylerBarnes
Copy link

I get this as well but I'm trying to make a subset of a woff file.

@roydukkey
Copy link

Glyphr Studio show an error for this file (remove the txt extension).

screen shot 2018-10-10 at 12 12 53 pm

@Pomax
Copy link
Contributor

Pomax commented Oct 10, 2018

do you have a PoC/minimal code that'll generate a bad TTF to test this?

@Pomax
Copy link
Contributor

Pomax commented Oct 10, 2018

Ahh, I see what's going on. This line computes the "maximum power of 2 <= numtables" incorrectly, invalidating the searchRange and entrySelector values.:

https://github.com/foliojs/fontkit/tree/master/src/tables/directory.js#L47

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

4 participants