FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ShapedTextRun

    struct · ferroui-base · v0.5.0

    struct ShapedTextRun
    

    A text run that holds shaped characters.

    View source

    Members

    new

    fn new(shaped_buffer: Rc<ShapedBuffer>, properties: Rc<dyn TextRunProperties>) -> Self
    

    Source

    bidi_level

    fn bidi_level(self: &Self) -> i8
    

    The bidi level of the run.

    Source

    shaped_buffer

    fn shaped_buffer(self: &Self) -> &Rc<ShapedBuffer>
    

    The shaped glyphs of the run.

    Source

    run_properties

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

    The run's properties (never absent for a shaped run).

    Source

    text_metrics

    fn text_metrics(self: &Self) -> TextMetrics
    

    The metrics of the run's font at the run's em size.

    Source

    glyph_run

    fn glyph_run(self: &Self) -> &Rc<GlyphRun>
    

    The glyph run of the shaped glyphs (created on first use).

    Source

    add_ref

    fn add_ref(self: &Rc<Self>) -> Rc<Self>
    

    Registers another owner of the run; every owner calls ShapedTextRun::dispose once.

    Source

    try_measure_characters

    fn try_measure_characters(self: &Self, available_width: f64) -> Option<i32>
    

    Measures the number of characters that fit into available width.

    Source

    try_measure_characters_backwards

    fn try_measure_characters_backwards(self: &Self, available_width: f64) -> Option<(i32, f64)>
    

    Measures the number of characters that fit into available width when measuring from the end; returns the count and the width they take.

    Internal upstream; public so that the Skia unit tests reach it.

    Source

    dispose

    fn dispose(self: &Self)
    

    Releases one reference; the glyph run and the shaped buffer are disposed with the last one.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither
    • TextRun
    • DrawableTextRun

    Availability

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