PeachBrackets
PeachBrackets.Svg
SvgGlyphPainter Class
Draws the SVG artwork of an OpenType SVG glyph (an emoji, say) through the SVG renderer, onto a canvas. A render context hands one out
from CreateSvgGlyphPainter, so text in a font with SVG glyphs draws as vector artwork rather than as the glyph’s outline.
public sealed class SvgGlyphPainter : PeachDrawing.Core.ISvgGlyphPainter
Inheritance System.Object → SvgGlyphPainter
Implements ISvgGlyphPainter
Remarks
A drawing is built once per glyph, palette and text colour and kept, so a repeated glyph is built once. On a canvas that writes a document the artwork is shared by every occurrence at one size; on a bitmap canvas it is painted into directly, so a filter, a shadow or a flattened region sees the real glyph. A glyph whose artwork cannot be built is remembered as such and drawn as its outline.
| Constructors | |
|---|---|
| SvgGlyphPainter(Canvas, RenderContext) | Makes a painter for glyphs drawn on host. |
| Methods | |
|---|---|
| TryPaint(Typeface, ushort, SvgGlyph, double, double, double, PaintColor, int, IReadOnlyDictionary<int,PaintColor>) | Draws the glyph with its origin at (originX, baselineY), in the units of the graphics. |