-
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 #811
Cross script kerning #811
Conversation
df0267b
to
779e0d1
Compare
I think this is ready for review. |
779e0d1
to
6644c87
Compare
Several implementations can apply kerning cross-script, so instead of splitting cross-script kerning pairs, we now keep all kerning for scripts which have common kerning pairs in one lookup and split the rest.
6644c87
to
c017a0d
Compare
c017a0d
to
eba8fab
Compare
... as long as they have the same horizontal script direction, that is. Mixed script directions still aren't allowed in the same lookup, and that's ok. |
} kern_Grek; | ||
|
||
lookup kern_Latn { | ||
@kern1.Cyrl_Grek_Latn_Orya.bar = [a-cy]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if these class names may get too long, I believe FEA imposes some limits on the length. Maybe it's fine and we do already take care of ensuring the names are compliant and unique?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, feaLib has a limit of 63 char limit on class names, but makeotf does not. fonttools/fonttools#3424 should fix this (and #588 as well).
We already make sure names are unique.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor comments
These were implemented to follow FEA spec, but makeotf does not seem to have a length limit on class names, and the glyph names limit (if it still has it, I didn’t check) seems like an implementation detail we don’t have to enforce. Fixes googlefonts/ufo2ft#588 See also googlefonts/ufo2ft#811 (comment)
Co-authored-by: Cosimo Lupo <clupo@google.com>
Co-authored-by: Cosimo Lupo <clupo@google.com>
Co-authored-by: Cosimo Lupo <clupo@google.com>
These were implemented to follow FEA spec, but makeotf does not seem to have a name length limit any more (or it has a very large one, I tested a 600-character name and it was accepted). Fixes googlefonts/ufo2ft#588 See also googlefonts/ufo2ft#811 (comment)
These were implemented to follow FEA spec, but makeotf does not seem to have a name length limit any more (or it has a very large one, I tested a 600-character name and it was accepted). Fixes googlefonts/ufo2ft#588 See also googlefonts/ufo2ft#811 (comment)
It would also be nice to add some logging that reports if/when kerning pairs between glyphs from different scripts get merged into the same kern lookup, because it might be unintentional and the font developer may be inadvertently getting a sparser (and potentially larger?) GPOS table simply because some glyphs are being used in multiple script contexts (either because doubly cmapped or because substituted to by GSUB rules that make their script-ness ambiguous). |
Thanks, lgtm. Feel free to merge when you're ready. |
Since several implementations can apply cross-script kerning, instead of splitting cross-script kerning pairs, we now keep all kerning for scripts which have common kerning pairs in one lookup and split the rest if any.
Fixes #808