PeachDrawing.Text

PeachDrawing.Text.Outlines

SvgGlyph Class

The SVG document that draws a glyph in a font with an SVG table.

public sealed record SvgGlyph : System.IEquatable<PeachDrawing.Text.Outlines.SvgGlyph>

Inheritance System.Object → SvgGlyph

Implements System.IEquatable<SvgGlyph>

Remarks

A document can cover a range of glyphs. It draws one of them by the element whose id is ElementId, and a document that covers a single glyph may instead be drawn whole when it has no such element. The drawing is in the coordinate system of the glyph: the origin is the glyph’s origin on the baseline, one unit is a design unit, and y points down, so a shape above the baseline has a negative y.

The library returns the document and does not draw it, as it has no SVG renderer. The colours of the font’s CPAL palette are what the document’s var(--color0), var(--color1) and so on stand for, and the text colour is what context-fill and currentColor stand for. The document comes from the font file and is untrusted: a compressed one is inflated up to 4 MiB and no further.

Constructors  
SvgGlyph(string, string, int, int, int) The SVG document that draws a glyph in a font with an SVG table.
Properties  
CoversOneGlyph Whether the document covers just this one glyph, in which case it can be drawn whole when it has no element for it.
Document The text of the SVG document.
ElementId The id of the element that draws the glyph asked for: glyph and the glyph’s number.
FirstGlyph The first glyph the document covers.
LastGlyph The last glyph the document covers.
UnitsPerEm The number of design units in an em, which is how many units of the drawing an em is.