Skip to content
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

COLRv2 #3244

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

COLRv2 #3244

wants to merge 9 commits into from

Conversation

behdad
Copy link
Member

@behdad behdad commented Aug 6, 2023

This branch implements various proposed paints for COLRv2.

Currently it has PaintTemplate's:
googlefonts/colr-gradients-spec#371

And PaintGlyphSelf/PaintGlyphDelta:
googlefonts/colr-gradients-spec#370

HarfBuzz counterpart: harfbuzz/harfbuzz#4363

@behdad behdad requested a review from rsheeter August 6, 2023 01:40
@behdad
Copy link
Member Author

behdad commented Aug 6, 2023

Copying templatization results from googlefonts/colr-gradients-spec#371 (comment):

The savings unfortunately are meager. It saves 2.84% of the COLR table size, which translates to only 0.63% of the total font. This is expected since most glyphs do not templatize in a full emoji repertoire. Here's the tools output:

$ time fonttools colorLib.CORLv1ToCOLRv2 NotoColorEmoji-Regular.ttf 
3719 glyph paints
67532 layer paints
Original COLR table is 1058175 bytes
294 unique templates for 1246 glyphs
Skipped 23 templates as they didn't save space
Building templatized font
3719 glyph paints
58905 layer paints
Reconstructed COLR table is 1028118 bytes
Templatized COLR table is 2.84% smaller.
Saving NotoColorEmoji-Regular.templatized.ttf

real	0m14.381s
user	0m14.126s
sys	0m0.197s

@behdad
Copy link
Member Author

behdad commented Aug 6, 2023

For PaintGlyphSelf / PaintGlyphDelta:

$ fonttools colorLib.COLRv1ToCOLRv2 Nupuram-Color.colrv1.ttf 
841 glyph paints
1682 layer paints
Original COLRv1 table is 27016 bytes
Detecting self/delta glyph paints.
2 unique templates for 841 glyphs
Skipped 2 templates as they didn't save space
Building COLRv2 font
841 glyph paints
4 layer paints
Constructed COLRv2 table is 5192 bytes
COLRv2 table is 80.8% smaller.
Saving Nupuram-Color.colrv1.COLRv2.ttf

cc @simoncozens

Otherwise it messes up templatizing...
A font I'm testing with has that for the empty space glyph...
Increases savings from 2.88% to 3.2% in COLR table of
NotoColorEmoji.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant