PeachDrawing.Core
PeachDrawing.Core.ColorGlyphs
ColorGlyphPainter Class
Walks the color artwork of one glyph - a COLR v1 paint graph, else COLR v0 layers, else the plain outline in the
foreground color - and describes it to an IColorGlyphTarget as clipped fills. The walk itself is
backend-neutral: palette and font-palette override resolution, the “use the text color” sentinel, gradient stop
handling, transform composition, clip bounds and blend modes live here once, so every backend paints color fonts the
same way.
public sealed class ColorGlyphPainter
Inheritance System.Object → ColorGlyphPainter
| Constructors | |
|---|---|
| ColorGlyphPainter(Typeface, double, PaintColor, bool, int, IReadOnlyDictionary<int,PaintColor>) | Creates a painter for glyphs of typeface. |
| Methods | |
|---|---|
| Paint(ushort, Affine2x3, IColorGlyphTarget) | Paints glyph glyphId, placed by placement (see Placement(double, double)), to target. |
| Placement(double, double) | The placement that maps a glyph’s design units into a target whose baseline origin for the glyph is (originX, originY): scaled to the font size, with y flipped when the target’s y axis points down. |
| RequiresRasterFidelity(ushort) | Whether painting this glyph on a pure vector target loses something a pixel target keeps: a PLUS composite (a vector target has no additive blend) or a repeating/reflecting radial gradient between circles with different centers (a vector target can only pad it). A vector backend can draw such a glyph through a pixel target instead, passing CanvasColorGlyphTarget the matching Supports... flags. |