pub struct TextSpan { /* private fields */ }Expand description
A text style span.
Spans do not overlap inside a text chunk.
Implementations§
Source§impl TextSpan
impl TextSpan
Sourcepub fn start(&self) -> usize
pub fn start(&self) -> usize
A span start in bytes.
Offset is relative to the parent text chunk and not the parent text element.
Sourcepub fn end(&self) -> usize
pub fn end(&self) -> usize
A span end in bytes.
Offset is relative to the parent text chunk and not the parent text element.
Sourcepub fn paint_order(&self) -> PaintOrder
pub fn paint_order(&self) -> PaintOrder
A paint order style.
Sourcepub fn font_size(&self) -> NonZeroPositiveF32
pub fn font_size(&self) -> NonZeroPositiveF32
A font size.
Sourcepub fn small_caps(&self) -> bool
pub fn small_caps(&self) -> bool
Indicates that small caps should be used.
Set by font-variant="small-caps"
Sourcepub fn apply_kerning(&self) -> bool
pub fn apply_kerning(&self) -> bool
Indicates that a kerning should be applied.
Supports both kerning and font-kerning properties.
Sourcepub fn font_optical_sizing(&self) -> FontOpticalSizing
pub fn font_optical_sizing(&self) -> FontOpticalSizing
Font optical sizing mode.
When Auto (default), the opsz axis will be automatically set
to match the font size for variable fonts that support it.
This matches the CSS font-optical-sizing: auto behavior.
Sourcepub fn decoration(&self) -> &TextDecoration
pub fn decoration(&self) -> &TextDecoration
A span decorations.
Sourcepub fn dominant_baseline(&self) -> DominantBaseline
pub fn dominant_baseline(&self) -> DominantBaseline
A span dominant baseline.
Sourcepub fn alignment_baseline(&self) -> AlignmentBaseline
pub fn alignment_baseline(&self) -> AlignmentBaseline
A span alignment baseline.
Sourcepub fn baseline_shift(&self) -> &[BaselineShift]
pub fn baseline_shift(&self) -> &[BaselineShift]
A list of all baseline shift that should be applied to this span.
Ordered from text element down to the actual span element.
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
A visibility property.
Sourcepub fn letter_spacing(&self) -> f32
pub fn letter_spacing(&self) -> f32
A letter spacing property.
Sourcepub fn word_spacing(&self) -> f32
pub fn word_spacing(&self) -> f32
A word spacing property.
Sourcepub fn text_length(&self) -> Option<f32>
pub fn text_length(&self) -> Option<f32>
A text length property.
Sourcepub fn length_adjust(&self) -> LengthAdjust
pub fn length_adjust(&self) -> LengthAdjust
A length adjust property.