googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
152 stars 43 forks source link

Cross script kerning #811

Closed khaledhosny closed 10 months ago

khaledhosny commented 10 months ago

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

khaledhosny commented 10 months ago

I think this is ready for review.

anthrotype commented 10 months ago

we now keep all kerning for scripts which have common kerning pairs in one lookup

... 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.

anthrotype commented 10 months ago

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).

anthrotype commented 10 months ago

Thanks, lgtm. Feel free to merge when you're ready. I'll cut the release tomorrow