Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
"<text>"

Defines a graphics element consisting of text.

<text x="50" y="60">Hello, SVG text!</text>
@ SVG
"<svg>", SVG root element.

Hello, SVG text!

Attribute Default Description
lengthAdjust spacing "spacing" or "spacingAndGlyphs". Indicates how the text may stretch (extra letter spacing only, or glyph-stretch as well).
x 0 If a single value is provided, sets the absolute x-position of the first character. If multiple values, sets positions per glyph.
y 0 Similar to x, but for y-position.
dx (none) One or more relative x shifts (optional).
dy (none) One or more relative y shifts (optional).
rotate (none) A list of rotation values per character (optional).
textLength (none) Author-specified total text advance length for calibration.
Note
For multi-value attributes (x, y, dx, dy, rotate), additional entries beyond the number of glyphs do nothing. If fewer entries than glyphs exist, the final value is reused for the remaining glyphs (for rotate), or the shift stays at 0 if no dx/dy is available.