Table of Contents

Enum SvgTextMode

Namespace
Egami.Svg
Assembly
Egami.Svg.dll

How SvgCanvas writes text.

public enum SvgTextMode

Fields

Outlines = 0

Each glyph's outline, written once in defs and placed with use, so the file looks the same everywhere with no fonts installed. The default.

Text = 1

text elements 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));
}