-
Notifications
You must be signed in to change notification settings - Fork 43
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
Cross-script kerning #808
Comments
Let's file an HB issue as well... |
Kindof related (in the sense that having one big lookup would help with this Adobe quirk, which according to this issue is not so much of a quirk and more of a good thing?)
In the GPOS optimization code, instead of creating one lookup per script, we create one subtable "per script" (and don't change the lookup structure) (not really per script, but per matrix block spotted by the clustering code, but I guess it ends up being per script). That achieves the exact same behaviour as before the optimization, and it gets almost the same file size savings as splitting by script. The trade-off is that it doesn't speed up compilation, because we still start with building the gigantic all-scripts-together lookup, then we spend extra time analyzing it to split it into subtables. Maybe the split-by-script code could try to split into subtables within the same lookup, instead of different lookups? The rules would be slightly different, as the subtables cannot apply to same glyph (first matching subtable wins), while several lookups can apply to the same glyph. |
I'd be inclined to opt for this latter solution. Would you like to work on a PR? |
Excellent. I’ll try to work on something in this direction. |
Since #679, kerning pairs are split per-script, under the assumption that OpenType layout is not applied across scripts.
As it turns out, there are more than one implementation that applies at least kerning across scripts (I have tested only Latin, Greek, Cyrillic, and Coptic, handling for other scripts might be different):
There are also more than one orthography that uses a mix of scripts, so the issue here has potentially practical implications and not only theoretical ones:
Since the motivation for #679 was to optimize lookup sizes, and optimizations shouldn’t break functionality, I suggest to either:
Here are three fonts that include a couple of Latin, Greek, Cyrillic, and Coptic glyphs, with class kerning between them (all first glyphs in one class, and all second glyphs in another). The first font has the kerning lookup under DFLT script as well as script-specific tags, the second does not have it under DFLT, and the third has it under DFLT only: CrossScriptKerningFonts.zip
If kerning is applied, the text should appear solid with no space between the triangular shapes.
Here are the testing results for the string “AVАVΑVⲀVAУАУΑУⲀУAΥАΥΑΥⲀΥAⲨАⲨΑⲨⲀⲨ”:
The text was updated successfully, but these errors were encountered: