Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support font palette overrides through SkFontArguments
Co-authored with Ben Wagner, [email protected]. 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] googlefonts/color-fonts#91 [2] googlefonts/color-fonts#92 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479616
- Loading branch information