pub struct TextSpan {
pub visibility: Visibility,
pub fill: Option<Fill>,
pub stroke: Option<Stroke>,
pub font: Font,
pub baseline_shift: BaselineShift,
pub decoration: TextDecoration,
pub text: String,
}
Expand description
A text span.
tspan
element in SVG.
Fields
visibility: Visibility
Element visibility.
fill: Option<Fill>
Fill style.
stroke: Option<Stroke>
Stroke style.
font: Font
Font description.
baseline_shift: BaselineShift
Baseline shift.
decoration: TextDecoration
Text decoration.
Unlike text-decoration
attribute from the SVG, this one has all styles resolved.
Basically, by the SVG text-decoration
attribute can be defined on tspan
element
and on any parent element. And all definitions should be combined.
The one that was defined by tspan
uses the tspan
style itself.
The one that was defined by any parent node uses the text
element style.
So it’s pretty hard to resolve.
This property has all this stuff resolved.
text: String
An actual text line.
SVG doesn’t support multiline text, so this property doesn’t have a new line inside of it.
All the spaces are already trimmed or preserved, depending on the xml:space
attribute.
All characters references are already resolved, so there is no >
or P
.
So this text should be rendered as is, without any postprocessing.