-
Notifications
You must be signed in to change notification settings - Fork 219
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
Full script font support. #61
Comments
Fontkit does support OpenType and AAT layout. It may be that you just need to enable the right feature, or it could be a bug. Can you send over a link to the font you're using and the code you're using to render? Thanks! |
I'm using Pacifico Regular as my test font. It can be downloaded from Google Fonts. Some example code is below:
I've tried to enable all of the available features for the font but none of them seem to do the trick. The available features according to the font file are:
|
Based on previous work with a different library that had the same issue: if the features toggling is not doing the trick, this might be a left-side bearing issue, with the glyphs placed at (0,0) rather than at (-glyph.lsb,0) |
I just reproduced this exact problem in my own shaper. My shaper is independent from FontKit but as far as I can tell the cause of the problem is the same. The problem in my shaper was the GSUB 'calt' feature in the Pacifico font. The 'calt' feature contains two type 6 (chaining contextual substitution) lookups:
The problem is that the shaper considers a lookup match with no substitution records (case 1 above) a non-match and because of this case 2 above is executed for all glyphs. The problem can be emulated in the Crowbar OpenType debugger by disabling the 'calt' feature and enabling the 'fina' feature. Edit: I've now looked at the relevant FontKit code and I can not see that it has the problem my code had. fontkit/src/opentype/OTProcessor.js Line 218 in a5fe0a1
|
Some script fonts draw different glyphs depending on the previous or next glyph and it appears that this library doesn't take that into account. Here's an example using the font Pacifico.
Rendered using Fontkit:
Same font in Sketch:
Notice how the Fontkit rendering is just drawing individual glyphs without "tails" to connect to the next glyph while in Sketch everything connects. Are there any plans to/is it possible to add support for this?
The text was updated successfully, but these errors were encountered: