freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contributing COLRv1


From: Dominik Röttsches
Subject: Re: Contributing COLRv1
Date: Wed, 13 Jan 2021 19:14:24 +0200

Hi Werner,

On Mon, Jan 11, 2021 at 6:32 PM Werner LEMBERG <wl@gnu.org> wrote:
>
>
> Some questions.
>
> (1) How can your code be tested?  It should be eventually fuzzed, too.

Currently we have a test pipeline as part of
https://github.com/googlefonts/nanoemoji that builds a COLRv1 font
from SVG images, renders the COLRv1 font using the work-in-progress
FreeType with COLRv1 support and Skia, and compares the FreeType +
Skia rendering of the COLRv1 font. In the process of bringing this to
Chromium we will also make layout tests in Chrome at least for
regression testing and we'll probably also have some tests in Skia
once we get to integrating the rasterization changes into it.

> (2) Is a test font already available?  In this case, could you
>     contribute code to Armin's repository to enable fuzzing?
>
>       https://github.com/freetype/freetype2-testing

Yes, as Rod explained COLRv1 fonts are available here:
https://github.com/googlefonts/color-fonts/tree/master/fonts.

While developing, I made a simple test that traverses the graph of a
COLRv1 font using FreeType API and outputs the retrieved data. I will
contribute a fuzzer to freetype2-testing for COLRv1 based on that code
in order to exercise the COLRv1 API in fuzzing.

> (3) Is there a simple way to actually see COLR v1 fonts in action?
>     For example, would it be possible to have a Qt demo program?

We are aiming for having prototype-level support for COLRv1 in Chrome
soon (behind a flag). This would be an easy way to see COLRv1 in
action. We can depend on a custom FreeType branch for such a Chromium
version but having the code merged in upstream makes releasing such a
version with COLRv1 support behind a flag much easier.

Alternatively, a) see above for nanoemoji test rendering and b) if one
has a setup for building Chromium ready,
https://chromium-review.googlesource.com/c/chromium/src/+/2282815
contains a simple test application to output a COLRv1 font to an an
image. Currently requires some modifications to the Chromium checkout,
i.e. configuring third-party/freetype to be checked out to a FT
version with COLRv1 support and third-party/skia to have the Skia
rasterization implementation applied
(https://skia-review.googlesource.com/c/skia/+/300558).

Unfortunately, I don't think we can provide a Qt application, as this
would require new rasterization (on top of the FreeType API), and we
focus on the rasterization implementation in Skia.

> > One really minor nit, [...formatting changes, commit order...]
>
> I've noticed that, too.  However, Savannah git doesn't allow forced
> pushs to branches; I will fix this (and some other minor details) when
> merging into 'master'.

Alright.

In addition, I have one more change that I found while working on the
Chromium COLRv1 prototype:
https://github.com/drott/freetype2-colr/commit/d71b1d8240075ce5421103efc0387f2dbe0e3aaf
/ branch colrTablePresenceChecks

We need a couple of checks for whether face->colr exists, otherwise
when the API functions are called on a non-COLRv1 font, these can lead
to crashes. I'd be happy if you could include that in the merge.

Thanks in advance for working on the merge once you get to,

Dominik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]