pub struct FormattedTextSource { /* private fields */ }Expand description
The text source of a formatted text: one string with default properties and optional property overrides for ranges of it.
Implementations§
Source§impl FormattedTextSource
impl FormattedTextSource
pub fn new( text: ReadOnlyMemory<u16>, default_properties: Rc<dyn TextRunProperties>, text_modifier: Option<Rc<[ValueSpan<Rc<dyn TextRunProperties>>]>>, ) -> Self
Sourcepub fn create_text_style_run(
text: &[u16],
first_text_source_index: i32,
default_properties: &Rc<dyn TextRunProperties>,
text_modifier: Option<&[ValueSpan<Rc<dyn TextRunProperties>>]>,
) -> ValueSpan<Rc<dyn TextRunProperties>>
pub fn create_text_style_run( text: &[u16], first_text_source_index: i32, default_properties: &Rc<dyn TextRunProperties>, text_modifier: Option<&[ValueSpan<Rc<dyn TextRunProperties>>]>, ) -> ValueSpan<Rc<dyn TextRunProperties>>
Creates a span of text run properties that has modifier applied.
text— the text to create the properties for.first_text_source_index— the first text source index.default_properties— the default text properties.text_modifier— the text properties modifier.
Returns the created text style run.
Trait Implementations§
Source§impl Clone for FormattedTextSource
impl Clone for FormattedTextSource
Source§impl ITextSource for FormattedTextSource
impl ITextSource for FormattedTextSource
Auto Trait Implementations§
impl !RefUnwindSafe for FormattedTextSource
impl !Send for FormattedTextSource
impl !Sync for FormattedTextSource
impl !UnwindSafe for FormattedTextSource
impl Freeze for FormattedTextSource
impl Unpin for FormattedTextSource
impl UnsafeUnpin for FormattedTextSource
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more