ttf-parser icon indicating copy to clipboard operation
ttf-parser copied to clipboard

Support COLR v1 table.

Open RazrFalcon opened this issue 1 year ago • 13 comments

TODO:

  • [ ] ClipList table
  • [ ] Variations
  • [ ] PaintColrGlyph
  • [ ] Recursion detection
  • [ ] Documentation
  • [ ] Tests

RazrFalcon avatar Oct 08 '23 14:10 RazrFalcon

@laurmaedje beta quality, but seems to be working ok-ish. Here is font2svg output:

sample

Some stuff is hard to represent in SVG, like weird transforms order, sweep gradients, gradients rotation (?), some blending modes.

For you this just a progress report and you can try out the new API. PS: I've added colr::Table::is_simple to reject v1 tables in case you do not plan to support them yet.

RazrFalcon avatar Oct 08 '23 14:10 RazrFalcon

Some stuff is hard to represent in SVG, like weird transforms order, sweep gradients, gradients rotation (?), some blending modes.

About sweep gradients: https://github.com/Lorp/samsa-core/issues/3

With the stagnation of the SVG2 specification(issue), SVG can no longer keep up with the times.

yisibl avatar Oct 09 '23 04:10 yisibl

That hack would work only in a browser. And we can ignore sweep gradients completely for now. font2svg is just a demo. It doesn't have to be perfect.

RazrFalcon avatar Oct 09 '23 09:10 RazrFalcon

Maybe this helps, FYI. https://github.com/googlefonts/oxidize/pull/48

yisibl avatar Oct 12 '23 11:10 yisibl

It's a bit different, but thanks.

RazrFalcon avatar Oct 12 '23 13:10 RazrFalcon

@laurmaedje I've published a new ttf-parser with COLR v0. No timeline for v1.

RazrFalcon avatar Oct 15 '23 08:10 RazrFalcon

If you think you don't have time to finish it, I can look into finishing this in the next few weeks.

LaurenzV avatar Apr 15 '24 17:04 LaurenzV

Yeah, no plans for this month. And it's a tricky beast.

Maybe would have time to at least update the ttf-explorer.

Test font.

RazrFalcon avatar Apr 15 '24 18:04 RazrFalcon

Do you know if there is also some way I can view the "reference" of how each glyph is supposed to look to compare? Something like font2svg, but where we know that it (should) already work correctly.

LaurenzV avatar Apr 21 '24 15:04 LaurenzV

Okay, looks like hb-view supports it. I think I should be able to work with that.

LaurenzV avatar Apr 21 '24 15:04 LaurenzV

I was using Chrome.

RazrFalcon avatar Apr 22 '24 07:04 RazrFalcon

Could you tell me how exactly you used Chrome to test it? So how did you make it show the glyphs that you wanted to test?

LaurenzV avatar Apr 24 '24 18:04 LaurenzV

Via this page: https://fonts.google.com/noto/specimen/Noto+Color+Emoji/glyphs

RazrFalcon avatar Apr 25 '24 06:04 RazrFalcon

Superseded by #145

RazrFalcon avatar May 08 '24 14:05 RazrFalcon