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
[colorLib] Sort paints by decreasing number of layers when encoding #3251
Conversation
Wait. My measurement might be flawed. |
In my testing with NotoColorEmoji-Regular, it saved a meager 824 bytes. Still, it's the right thing to do. |
The BaseGlyphList must be sorted by glyphID to be able to do the binary search, remember? https://learn.microsoft.com/en-us/typography/opentype/spec/colr#baseglyph-and-layer-records
If you really want to build the LayerList in that decreasing length order, you can do that but then you need to make sure that the baseGlyphs are sorted by glyphOrder at the end |
You are right. I'll fix up. |
d4bd0a8
to
5b6b1ac
Compare
@anthrotype PTAL. |
would also be nice to have a test that exercise this if not much trouble |
5b6b1ac
to
659f0a9
Compare
Good thing I did. Implementation was wrong. Building noto color emoji now to get new numbers. |
Need to update test expectations now. |
5d7bb5f
to
5d12e1a
Compare
@anthrotype PTAL again. Sorry about that earlier. |
Humm. I don't see this making any difference in NotoColorEmoji. Investigating. |
5d12e1a
to
007b43c
Compare
I fixed the culprit. However, now the font grows by a few hundred bytes. Maybe status quo is good enough. |
Something like this. Untested. Trying to test now.
Fixes #3250