Enum SvgTextMode
How SvgCanvas writes text.
public enum SvgTextMode
Fields
Outlines = 0Each glyph's outline, written once in
defsand placed withuse, so the file looks the same everywhere with no fonts installed. The default.Text = 1textelements with the font's family, weight, style and size and each cluster's position, so the text stays selectable and searchable; the viewer draws it with its own copy of the font, or with the subset EmbedSubset embeds.
Examples
// By default text is glyph outlines, each written once and reused, so the file needs no fonts.
// SvgTextMode.Text writes text elements instead, searchable and selectable; EmbedSubset adds the glyphs used as a font.
SvgWriteOptions options = new() { Text = SvgTextMode.Text, EmbedSubset = true };
using (SvgCanvas canvas = new(file, 300, 60, options))
{
canvas.DrawText("Hello, SVG", new Vector2(10, 40), new Font(face, 28), new Rgba8(20, 20, 20, 255));
}