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

The <tspan> element defines a sub-string or sub-group of text that can be independently positioned or styled inside an SVG text flow. Common usage includes changing the color, weight, or position of a portion of text within a "<text>" element.

<text x="20" y="40">
You are
<tspan dx="10" fill="red" font-weight="bold">
NOT
</tspan>
a banana.
</text>

You are NOT a banana.

Attribute Default Description
x 0 Absolute X position(s) for the first (or each) glyph
y 0 Absolute Y position(s) for the first (or each) glyph
dx (none) Relative X shift(s) for glyphs
dy (none) Relative Y shift(s) for glyphs
rotate (none) Rotation(s) for each glyph in degrees