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

OpenType.js can't read Google fonts' kerning, eg. EB Garamond #515

Open
Typogram opened this issue May 24, 2022 · 8 comments · May be fixed by #557
Open

OpenType.js can't read Google fonts' kerning, eg. EB Garamond #515

Typogram opened this issue May 24, 2022 · 8 comments · May be fixed by #557
Labels

Comments

@Typogram
Copy link

Typogram commented May 24, 2022

Download the ttf from https://fonts.google.com/specimen/EB+Garamond. use it as a test. The fonts have kerning info, and can be used as regular desktop fonts with proper kerning. However, OpenType.js can't read its kerning data. letter AV kerning should be -140, but OpenType.js returns 0

Steps to Reproduce (for bugs)

  1. go to https://codepen.io/wendyz/pen/PoQJyoX?editors=0011
  2. open the console
  3. OpenType.js return AV Kerning to be 0, where it should be -140
    image

When I open the EB Garamond font with Robofont, I can see there is kerning info in the kern center. AV kern should be -140
image

Extra info: I download EB Garamond 8pt (another version) from the type designer's Bitbucket repo, and OpenType.js output proper kerning for that font. Included in the codepen example. cc. @davelab6

It may affect other Google Fonts as well, eg.

  • DM Serif Text

Your Environment

@Typogram
Copy link
Author

@davelab6 could you provide some insight on this as well? The happens with Google Fonts' version of EB Garamond, but not with the type designer's version of EB Garamond on their bitbucket repo.

@Typogram
Copy link
Author

@fdb @fpirsch could you help take a look into this issue?

@Connum
Copy link
Contributor

Connum commented Feb 5, 2023

Could this be related to #546 @ILOVEPIE, or is it something different?

@Typogram
Copy link
Author

@Connum to help narrow down the problem area, maybe this information helps:
I tested fontkit to read the same problem font (EB Garamond from Google Fonts), the kerning data can be read correctly.
Here is fontkit's code for getting kerning data in below link. I think opentype.js must have missed one of the scenarios that were covered by fontkit:
https://github.com/foliojs/fontkit/blob/master/src/layout/KernProcessor.js#L16

@ILOVEPIE
Copy link
Contributor

This has already been fixed in the upcoming version.

@ILOVEPIE
Copy link
Contributor

Nevermind, apparently google has changed their fonts they're hosting.

@ILOVEPIE
Copy link
Contributor

I suspect #557 will fix this issue.

@ILOVEPIE
Copy link
Contributor

The issue is the font is missing the old KERN table and has GPOS 9 and 4 entries. This will be fixed by #557.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants