foliojs / fontkit

An advanced font engine for Node and the browser
1.45k stars 213 forks source link

COLRv1 Support #270

Closed jlarmstrongiv closed 1 year ago

jlarmstrongiv commented 2 years ago

The COLRv1 is on the horizon, with gradients, compositing, blending, and more. Currently, fontkit supports COLRv0

Pomax commented 2 years ago

Note that the real spec is https://docs.microsoft.com/en-us/typography/opentype/spec/colr#colr-formats, though. The github repo is just the working location, inclusion in the OpenType spec is when things become official.

jlarmstrongiv commented 2 years ago

Great find @Pomax!

I haven’t worked much with parsers, but I think your svg example and restructure is interesting.

I can extract and post my existing COLRv0 code and then explore how to add support for the new features.

Pomax commented 2 years ago

In terms of the parser: we can probably hack something into existence, similar to what we did with the SVG parser, as COLRv1 isn't terribly complex, just "a lot more (linked) simple structures". The tricky bit will be in turning them into something you can actually see.

jlarmstrongiv commented 2 years ago

@Pomax it certainly sounds possible. If you’re able to hack together the parser, then I will be able to format and massage the data into a usable svg. I think it’d be useful to other people in the future too 😄

Pomax commented 2 years ago

stubbing something out over on https://github.com/Pomax/fontkit-colrv1, but it's a lot of small bits of code, so no promises on when I might finish (if ever, because "yet another repo" is exactly what my overloaded schedule needed ;)

Unless someone wants to commission this work, of course, then things become radically different =D

jlarmstrongiv commented 2 years ago

Thank you @Pomax ! That’s a great start. What’s the best way to contact you?

Pomax commented 2 years ago

Email's best, although I may be slow to respond (I think you already emailed me) because things have gotten a bit crazy and I'm currently balancing "having to use a keyboard" with "not actually being able to use a keyboard due to an injury" >_>

jlarmstrongiv commented 2 years ago

Ouch! Hope you make a full recovery @Pomax. I remember a few tips for hands-free coding from https://www.joshwcomeau.com/blog/hands-free-coding/ Feel free to followup in a few weeks or a few months, whenever you feel better with schedule permitting.

Lorp commented 1 year ago

This is @simoncozens’ PR for COLRv1 support: #298

jlarmstrongiv commented 1 year ago

Closing in favor of #298