8000 [colrv1] ensure base glyphs with equal layers share the same PaintColrLayers by anthrotype · Pull Request #2513 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[colrv1] ensure base glyphs with equal layers share the same PaintColrLayers #2513

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

Merged
merged 3 commits into from
Jan 24, 2022

Conversation

anthrotype
Copy link
Member

When building a colrv1 table and the input dictionary contains multiple base glyphs that map to the same layers (equal in content, not identity), we need to make sure the same PaintColrLayers is used for all of them.
Currently what happens is, the subsequent glyphs with same layers content get a new unique PaintColrLayers with only one child, i.e. the shared PaintColrLayers (see failing test).
Fix coming in a follow-up commit.
(Note the first commit eded208 is minor, unrelated change)

…PaintColrLayers

this test currently fails; currently the second, third, etc. base glyphs with the same layers gets a unique PaintColrLayers with NumLayers:1 that in turn contains the shared PaintColrLayers. They should instead all share the same PaintColrLayers. Fix in the next commit
We already filter len(layers)==1 out upfront, but these can sneak in after the layer reuse code when input contains two base glyphs that refer to the same list of layers. This ensure that duplicate base glyphs get the same PaintColrLayers, rather than a wrapper PaintColrLayers of length=1 pointing to the underlying shared PaintColrLayer...
@anthrotype
Copy link
Member Author

@anthrotype anthrotype requested a review from rsheeter January 21, 2022 19:15
@anthrotype anthrotype merged commit 48ffc7d into main Jan 24, 2022
@anthrotype anthrotype deleted the colrv1-duplicate-base-glyphs branch January 24, 2022 10:31
anthrotype added a commit to googlefonts/nanoemoji that referenced this pull request Jan 25, 2022
Includes fonttools/fonttools#2513

which ensures base glyphs with equal list of layers share the same PaintColrLayers
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.

1 participant
0