FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextCharacters

    struct · ferroui-base · v0.5.0

    struct TextCharacters
    

    A text run that holds text characters.

    View source

    Members

    from_str

    fn from_str(text: &str, text_run_properties: Rc<dyn TextRunProperties>) -> Self
    

    Constructs a run for text content from a string.

    Panics when the font rendering em size of the properties is not positive.

    Source

    new

    fn new(text: ReadOnlyMemory<u16>, text_run_properties: Rc<dyn TextRunProperties>) -> Self
    

    Constructs a run for text content from a memory region.

    Panics when the font rendering em size of the properties is not positive.

    Source

    run_properties

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

    The run's properties (never absent for text characters).

    Source

    get_shapeable_characters

    fn get_shapeable_characters(self: &Self, text: ReadOnlyMemory<u16>, bidi_level: i8, font_manager: &FontManager, previous_properties: &mut Option<Rc<dyn TextRunProperties>>, results: &mut Vec<Rc<dyn TextRun>>)
    

    Gets a list of UnshapedTextRun.

    Source

    try_get_shapeable_length

    fn try_get_shapeable_length(text: &[u16], glyph_typeface: &GlyphTypeface, default_glyph_typeface: Option<&GlyphTypeface>, default_can_shape_script: bool, require_full_cluster: bool) -> Option<usize>
    

    Tries to get a shapeable length that is supported by the specified typeface.

    • text — the characters to shape.
    • glyph_typeface — the typeface that is used to find matching characters.
    • default_glyph_typeface — the default typeface, or None when there is none to return to (the probe for the default typeface itself).
    • default_can_shape_script — whether the default typeface can shape this run's script. When false it only reclaims spacing whitespace, which needs no shaping.
    • require_full_cluster — when true, a grapheme cluster only counts as supported when the typeface has a glyph for every scalar it contains (base plus combining marks); when false, only the base scalar is tested.

    Returns the shapeable length, or None when it is zero.

    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

    Availability

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