Intent to prototype: COLRv1 (enhanced color font format) support

120 views
Skip to first unread message

Jonathan Kew

unread,
Aug 15, 2022, 8:24:58 AM8/15/22
to dev-pl...@mozilla.org
Summary:

COLRv1 is a new format for full-color OpenType fonts, building on the
original COLR (v0) format for simple colored layers and providing a
richer graphic model including gradients and transformations.

This format provides font designers with graphic expressiveness
comparable to SVG-in-OpenType, but with a much more concise and
efficient representation; it also provides new flexibility via the use
of OpenType variations to dynamically modify the glyphs.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1740525

Specification:

- https://docs.microsoft.com/en-gb/typography/opentype/spec/colr
- https://github.com/googlefonts/colr-gradients-spec

Standards Body:

Part of the OpenType (Microsoft) / Open Font Format (ISO SC29/WG3) specs.

Platform coverage: All

Preference: gfx.font_rendering.colr_v1.enabled

DevTools bug: n/a

Other browsers:

- Blink: partial implementation (without variations support) shipping;
full implementation behind "Variable COLRv1 Fonts" flag in Canary.

- WebKit: no current plans AFAIK

web-platform-tests:

Not yet in place; experimental fonts for interoperability testing are
being created at https://github.com/googlefonts/color-fonts, and I
expect in due course an agreed test suite will emerge (though
interoperably testing the precise rendering of complex graphic
compositions is tricky...)

As an interim measure, I propose to include some basic reftests in our
tree, per https://phabricator.services.mozilla.com/D154586.


- Jonathan

Tom Ritter

unread,
Aug 15, 2022, 1:21:54 PM8/15/22
to Jonathan Kew, dev-pl...@mozilla.org
It looks like OTS does not support sanity-checking COLR[0] so I am curious if we have fuzz coverage for this feature?

-tom


--
You received this message because you are subscribed to the Google Groups "dev-pl...@mozilla.org" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev-platform...@mozilla.org.
To view this discussion on the web visit https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/647d1ea4-4e13-7364-1ce0-6f44178a3bb0%40gmail.com.

Christian Holler

unread,
Aug 15, 2022, 1:25:02 PM8/15/22
to dev-pl...@mozilla.org

We've looked into this and Tyson pointed out to me that freetype2 has fuzz coverage for this feature on oss-fuzz:

https://github.com/freetype/freetype2-testing/tree/master/fuzzing#colrv1-methods

If there is other code we should look at, please let us know.

- Chris

Jonathan Kew

unread,
Aug 15, 2022, 1:28:56 PM8/15/22
to Tom Ritter, dev-pl...@mozilla.org
On 15/08/2022 18:21, Tom Ritter wrote:
> It looks like OTS does not support sanity-checking COLR[0] so I am
> curious if we have fuzz coverage for this feature?
>

Not yet (at least not to my knowledge); it'd be good to get started on that.

Also, I am intending to look at adding COLR support to OTS, as an
element of defence-in-depth here.

JK


> -tom
>
> [0] https://github.com/khaledhosny/ots/issues/202
> <https://github.com/googlefonts/color-fonts>, and I
> expect in due course an agreed test suite will emerge (though
> interoperably testing the precise rendering of complex graphic
> compositions is tricky...)
>
> As an interim measure, I propose to include some basic reftests in our
> tree, per https://phabricator.services.mozilla.com/D154586
> <https://phabricator.services.mozilla.com/D154586>.
>
>
> - Jonathan
>
> --
> You received this message because you are subscribed to the Google
> Groups "dev-pl...@mozilla.org <mailto:dev-pl...@mozilla.org>"
> group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to dev-platform...@mozilla.org
> <mailto:dev-platform%2Bunsu...@mozilla.org>.
> <https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/647d1ea4-4e13-7364-1ce0-6f44178a3bb0%40gmail.com>.
>

Jonathan Kew

unread,
Aug 15, 2022, 1:41:59 PM8/15/22
to Christian Holler, dev-pl...@mozilla.org
On 15/08/2022 18:24, Christian Holler wrote:
> We've looked into this and Tyson pointed out to me that freetype2 has
> fuzz coverage for this feature on oss-fuzz:
>
>
https://github.com/freetype/freetype2-testing/tree/master/fuzzing#colrv1-methods
>
> If there is other code we should look at, please let us know.
>
> - Chris

We're not using freetype2's implementation (as we don't have freetype in
Gecko at all on Windows or macOS).

So in bug 1740530 there'll be new code landing (in
gfx/thebes/COLRFonts.{h,cpp}) to handle the COLR table; it'd be good to
have our fuzzers poking at that before it heads to release. (Initial
landing will be behind a pref, enabled by default only on Nightly.)

JK
>> <mailto:dev-platform%2Bunsu...@mozilla.org>.
>> To view this discussion on the web visit
>>
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/647d1ea4-4e13-7364-1ce0-6f44178a3bb0%40gmail.com.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "dev-pl...@mozilla.org" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to dev-platform...@mozilla.org.
>> To view this discussion on the web visit
>>
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CADua4_twjUTdodbReU8oxfw%3DeZbynMAwLWurJyhONgqfEc9d4A%40mail.gmail.com

>>
<https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/CADua4_twjUTdodbReU8oxfw%3DeZbynMAwLWurJyhONgqfEc9d4A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "dev-pl...@mozilla.org" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dev-platform...@mozilla.org
> <mailto:dev-platform...@mozilla.org>.
> To view this discussion on the web visit
>
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/a77484fb-dc77-642c-7e4e-5044d2facf8b%40mozilla.com

>
<https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/a77484fb-dc77-642c-7e4e-5044d2facf8b%40mozilla.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages