-
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
Split kerning by script, not by direction (third attempt) #679
Conversation
This makes the KernFeatureWriter independent of the globally declared languagesystems.
This also requires a change to FeatureCompiler to catch feature compilation errors in setContext.
This prepares making KeringPairs immutable later. It also removes some direct tests of the getKerningPair API which we won't need going forward.
4184c41
to
981ac08
Compare
* This paves the way to removing scripts and bidiTypes from KerningPair. * Pairs are now sorted in one place instead of in getKerningPairs, which was undone later during splitting * Rewrite some tests that were testing now obsolete APIs * Restore test_ambiguous_direction_pair to assert that nothing is generated. This was wrong before. * Remove unused _intersectPairs method
This also literalises all classes. See code comments.
This cuts out the need to convert types into feature AST early; instead do it in _makePairPosRule. This makes the code more straightforward.
0a5cdab
to
7cede79
Compare
On a certain project, reduces time spent in _makePairPosRule from 1.79s to 240ms. A small win, but still.
ce42619
to
df07e90
Compare
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.
mostly LGTM, thanks!
One thing before I think we can merge is, we should try to keep using named FEA classes in the generated feature code, either for the original classes that needed no split and for the split ones that occurred more than once; having no named classes (repeatedly spelling out all the [a b c]
and such) makes the feature code harder to debug; and the alleged feaLib bug whereby some pairs may get lost if one mixes named and unnamed classes isn't sufficient to warrant ditching the named classes altogether, and we need to fix that on its own.
Co-authored-by: Cosimo Lupo <clupo@google.com>
while reading old issues, I stumbled on a long comment of mine that details the way the ufo2ft kernFeatureWriter worked: unified-font-object/ufo-spec#16 (comment) It would be nice to have a similar write up for the newly porposed split-by-scripts algorithm.. |
f4bb10e
to
bd805d5
Compare
a531ca0
to
ab38764
Compare
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!
I propose we merge and cut a pre-release and ask users to test this with their fonts to prevent the need to revert this once again.
Thanks a lot to both Simon and Nikolaus for working on this!
This is a clean-up PR for #667.
This implements:
Note that for reasons I have not investigated, various Noto Serif Tamil sources have some errant kerning, but they have the same problem with the current mainline kern writer.
Closes #658