Struct usvg_tree::TextSpan

source ·
pub struct TextSpan {
Show 18 fields pub start: usize, pub end: usize, pub fill: Option<Fill>, pub stroke: Option<Stroke>, pub paint_order: PaintOrder, pub font: Font, pub font_size: NonZeroPositiveF32, pub small_caps: bool, pub apply_kerning: bool, pub decoration: TextDecoration, pub dominant_baseline: DominantBaseline, pub alignment_baseline: AlignmentBaseline, pub baseline_shift: Vec<BaselineShift>, pub visibility: Visibility, pub letter_spacing: f32, pub word_spacing: f32, pub text_length: Option<f32>, pub length_adjust: LengthAdjust,
}
Expand description

A text style span.

Spans do not overlap inside a text chunk.

Fields§

§start: usize

A span start in bytes.

Offset is relative to the parent text chunk and not the parent text element.

§end: usize

A span end in bytes.

Offset is relative to the parent text chunk and not the parent text element.

§fill: Option<Fill>

A fill style.

§stroke: Option<Stroke>

A stroke style.

§paint_order: PaintOrder

A paint order style.

§font: Font

A font.

§font_size: NonZeroPositiveF32

A font size.

§small_caps: bool

Indicates that small caps should be used.

Set by font-variant="small-caps"

§apply_kerning: bool

Indicates that a kerning should be applied.

Supports both kerning and font-kerning properties.

§decoration: TextDecoration

A span decorations.

§dominant_baseline: DominantBaseline

A span dominant baseline.

§alignment_baseline: AlignmentBaseline

A span alignment baseline.

§baseline_shift: Vec<BaselineShift>

A list of all baseline shift that should be applied to this span.

Ordered from text element down to the actual span element.

§visibility: Visibility

A visibility property.

§letter_spacing: f32

A letter spacing property.

§word_spacing: f32

A word spacing property.

§text_length: Option<f32>

A text length property.

§length_adjust: LengthAdjust

A length adjust property.

Trait Implementations§

source§

impl Clone for TextSpan

source§

fn clone(&self) -> TextSpan

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TextSpan

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.