skia2/resources/fonts
Dominik Röttsches 01be94d7f1 Support font palette overrides through SkFontArguments
Co-authored with Ben Wagner, bungeman@google.com.

Similar to how we allow configuration of variable font configurations,
provide additional SkFontArguments to select a base palette and a set
of potentially sparse color overrides.

This is required for implementing CSS font-palette.

Modify the more_samples-glyf_colr_1.ttf to have two additional palettes,
and two additional test glyphs, one that draws with COLRv0 logic, one
that draws with COLRv1 logic and has a foreground palette index dot
in the middle. See [1] & [2] for the additions to the test font.

Add a GM which tests this on the SkFontMgr_custom using makeClone() and
makeFromStreamArgs(). The test displays the two glyphs in default
palette on the left, then with palette overrides (as in the title of the
test) on the right. The first row uses a typeface created with
makeFromStreamArgs(), the second uses one created with makeClone().

[1] https://github.com/googlefonts/color-fonts/pull/91
[2] https://github.com/googlefonts/color-fonts/pull/92

Bug: skia:12730, chromium:1170794
Cq-Include-Trybots: luci.skia.skia.primary:Test-Android-Clang-GalaxyS20-GPU-MaliG77-arm64-Release-All-Android_NativeFonts,Test-Debian10-Clang-GCE-CPU-AVX2-x86_64-Debug-All-NativeFonts
Change-Id: Ia1334f069240edc78fd4791969914e8a6f4fbaf9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479616
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-02-17 13:19:53 +00:00
..
abc Font resolution: all unit tests working 2019-11-08 17:24:14 +00:00
svg Add planet emoji font. 2019-03-19 17:49:22 +00:00
7630.otf
ahem.ttf Add ahem.ttf. 2020-05-13 16:32:52 +00:00
cbdt.ttf Add color fonts. 2018-03-28 20:14:44 +00:00
colr.ttf Add color fonts. 2018-03-28 20:14:44 +00:00
colrv1_samples.ttf Add base outlines to colrv1 test font 2021-06-28 23:59:26 +00:00
Distortable.ttf Add more variation support on Mac. 2019-12-13 18:16:13 +00:00
Em.ttf
fonts.xml Add support for fallbackFor in Android parser. 2018-11-27 20:20:38 +00:00
Funkster.ttf
HangingS.ttf
hintgasp.ttf
more_samples-glyf_colr_1.ttf Support font palette overrides through SkFontArguments 2022-02-17 13:19:53 +00:00
NotoSansCJK-VF-subset.otf.ttc Determine weight, width and slant from variable axes 2022-02-01 19:34:50 +00:00
planetcbdt.ttf Add planet emoji font. 2019-03-19 17:49:22 +00:00
planetcolr.ttf Add planet emoji font. 2019-03-19 17:49:22 +00:00
planetsbix.ttf Add planet emoji font. 2019-03-19 17:49:22 +00:00
ReallyBigA.ttf
Roboto2-Regular_NoEmbed.ttf
Roboto2-Regular.pfa
Roboto2-Regular.pfb
Roboto-Regular.ttf [skottie] GM exercising external font loading 2018-09-20 19:05:35 +00:00
sbix.ttf Add color fonts. 2018-03-28 20:14:44 +00:00
SpiderSymbol.ttf
Stroking.otf Skip degenerate contours in glyphs. 2020-02-13 16:22:42 +00:00
Stroking.ttf Skip degenerate contours in glyphs. 2020-02-13 16:22:42 +00:00
test.ttc
Variable.ttf Ensure variable font from data created at default. 2020-12-01 00:30:22 +00:00
VaryAlongQuads.ttf Ensure variable font from data created at default. 2020-12-01 00:30:22 +00:00