Open dfrg opened 1 year ago
FWIW, the corresponding HarfBuzz API https://harfbuzz.github.io/harfbuzz-hb-paint.html
FWIW, the corresponding HarfBuzz API https://harfbuzz.github.io/harfbuzz-hb-paint.html
Thanks for this! It looks like there are a lot of similarities, particularly around how composite nodes are handled.
Separately, as discussed in b/301562314 and as the HarfBuzz API does it, it is probably useful to add a bitmap drawing / placement method to the ColorPen
interface - but that can be a separate step.
Separately, as discussed in b/301562314 and as the HarfBuzz API does it, it is probably useful to add a bitmap drawing / placement method to the
ColorPen
interface - but that can be a separate step.
Since landing googlefonts/fontations#609 and googlefonts/fontations#637 I have some ideas about how to support this. Let’s discuss f2f.
@dfrg please feel free to amend, quick summary for this particular topic off the top of my head from our f2f:
fill_path
, but TBD whether we call it for PaintGlyph
+ PaintTransform
+ PaintSweep
- maybe yes?Scaler
or a successor to Scaler
, such as ScalerInstance
(Skia has a stage where it does bounding box calculation before, then only later calls into drawing.)Among the reasons for keeping the callback interface restricted to COLR:
@drott thanks for the summary. This all sounds good to me.
Regarding the stop normalization, it turns out we can only do that level of stop normalization and preparation that does not involve color interpolation.
Per f2f, this sounds like a great compromise to provide as many useful transformations as possible without doing color interpolation.
Discussion also touched on using a SmallVec
like container to avoid some allocations for the color stop array. Skrifa already has one that might be useful, possibly with modifications.
Proposed interface for implementation of color outlines in skrifa.
rendered