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 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TextSpan
impl !RefUnwindSafe for TextSpan
impl Send for TextSpan
impl Sync for TextSpan
impl Unpin for TextSpan
impl !UnwindSafe for TextSpan
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)