FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextRun

    trait · ferroui-base · v0.5.0

    trait TextRun: 'static
    

    Represents a portion of a text line object.

    Upstream TextRun is an abstract class whose subclasses are tested with is/as. Here it is a trait: runs are handled as Rc<dyn TextRun> and recovered with dyn TextRun::downcast_ref / dyn TextRun::downcast_rc, or with the as_* hooks for the open base classes (DrawableTextRun, TextEndOfLine).

    View source

    Members

    length

    fn length(self: &Self) -> i32
    

    Gets the text source length (UTF-16 code units).

    Source

    text

    fn text(self: &Self) -> ReadOnlyMemory<u16>
    

    Gets the text run's text.

    Source

    text_span

    fn text_span(self: &Self) -> &[u16]
    

    Gets the text run's text as a slice. Runs with text override this together with TextRun::text; hot paths read the slice.

    Source

    properties

    fn properties(self: &Self) -> Option<&Rc<dyn TextRunProperties>>
    

    A set of properties shared by every character in the run.

    Source

    as_drawable

    fn as_drawable(self: &Self) -> Option<&dyn DrawableTextRun>
    

    The run as a drawable run (C# run is DrawableTextRun).

    Source

    as_text_end_of_line

    fn as_text_end_of_line(self: &Self) -> Option<&TextEndOfLine>
    

    The run as an end of line marker (C# run is TextEndOfLine).

    Source

    as_any

    fn as_any(self: &Self) -> &dyn Any
    

    The run as Any, for downcasting to a concrete run type.

    Source

    into_any_rc

    fn into_any_rc(self: Rc<Self>) -> Rc<dyn Any>
    

    The run handle as Any, for downcasting to a concrete run handle.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.