Struct usvg::TextSpan

source ·
pub struct TextSpan {
    pub visibility: Visibility,
    pub fill: Option<Fill>,
    pub stroke: Option<Stroke>,
    pub font: Font,
    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.

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 &gt; or &#x50;. So this text should be rendered as is, without any postprocessing.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.