FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextShaper

    struct · ferroui-base · v0.5.0

    struct TextShaper
    

    A class that is responsible for text shaping.

    View source

    Members

    current

    fn current() -> Rc<TextShaper>
    

    Gets the current text shaper.

    Panics when no text shaper backend is registered.

    Source

    shape_text

    fn shape_text(self: &Self, text: &ReadOnlyMemory<u16>, options: &TextShaperOptions) -> Rc<ShapedBuffer>
    

    Shapes UTF-16 text.

    Source

    shape_str

    fn shape_str(self: &Self, text: &str, options: &TextShaperOptions) -> Rc<ShapedBuffer>
    

    Shapes a string.

    Source

    shape_edited_text

    fn shape_edited_text(self: &Self, previous: &ShapedBuffer, text: &ReadOnlyMemory<u16>, options: &TextShaperOptions) -> Option<Rc<ShapedBuffer>>
    

    Shapes text, an edit of the text previous is the shaping of (with the same options and its concatenation flags, TextShaperOptions::with_concat_flags): the glyphs of previous the edit leaves as they were are kept and only the text around the change is shaped again. The result is the shaping of the whole of text with these options, with its own concatenation flags for the next edit. None when nothing of previous can be kept (a right-to-left text, a text that is a range of a longer one, a shaping without flags, a change at the start of the text): the caller shapes text whole.

    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

    Availability

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