FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    GlyphRun

    struct · ferroui-base · v0.5.0

    struct GlyphRun
    

    Represents a sequence of glyphs from a single face of a single font at a single size, and with a single rendering style.

    View source

    Members

    from_glyph_indices

    fn from_glyph_indices(glyph_typeface: Rc<GlyphTypeface>, font_rendering_em_size: f64, characters: ReadOnlyMemory<u16>, glyph_indices: &[u16], baseline_origin: Option<Point>, bidi_level: i32) -> Rc<Self>
    

    Creates a glyph run from glyph indices: every glyph is its own cluster and gets the font's horizontal advance.

    Source

    new

    fn new(glyph_typeface: Rc<GlyphTypeface>, font_rendering_em_size: f64, characters: ReadOnlyMemory<u16>, glyph_infos: GlyphInfoList, baseline_origin: Option<Point>, bidi_level: i32) -> Rc<Self>
    

    Creates a glyph run.

    Source

    glyph_typeface

    fn glyph_typeface(self: &Self) -> &Rc<GlyphTypeface>
    

    Gets the glyph typeface for the glyph run.

    Source

    font_rendering_em_size

    fn font_rendering_em_size(self: &Self) -> f64
    

    Gets the em size used for rendering the glyph run.

    Source

    set_font_rendering_em_size

    fn set_font_rendering_em_size(self: &Self, value: f64)
    

    Sets the em size used for rendering the glyph run.

    Source

    bounds

    fn bounds(self: &Self) -> Rect
    

    Gets the conservative bounding box of the glyph run.

    Source

    ink_bounds

    fn ink_bounds(self: &Self) -> Rect
    

    Gets the ink bounds of the glyph run.

    Source

    metrics

    fn metrics(self: &Self) -> GlyphRunMetrics
    

    Gets the metrics of the glyph run.

    Source

    baseline_origin

    fn baseline_origin(self: &Self) -> Point
    

    Gets the baseline origin of the glyph run.

    Source

    set_baseline_origin

    fn set_baseline_origin(self: &Self, value: Point)
    

    Sets the baseline origin of the glyph run.

    Source

    characters

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

    Gets the list of UTF-16 code points that represent the Unicode content of the glyph run.

    Source

    set_characters

    fn set_characters(self: &Self, value: ReadOnlyMemory<u16>)
    

    Sets the list of UTF-16 code points that represent the Unicode content of the glyph run.

    Source

    glyph_infos

    fn glyph_infos(self: &Self) -> GlyphInfoList
    

    Gets the list of glyphs to use to render this run.

    Source

    set_glyph_infos

    fn set_glyph_infos(self: &Self, value: GlyphInfoList)
    

    Sets the list of glyphs to use to render this run.

    Source

    bidi_level

    fn bidi_level(self: &Self) -> i32
    

    Gets the bidirectional nesting level of the glyph run.

    Source

    set_bidi_level

    fn set_bidi_level(self: &Self, value: i32)
    

    Sets the bidirectional nesting level of the glyph run.

    Source

    is_left_to_right

    fn is_left_to_right(self: &Self) -> bool
    

    Returns true if the text direction is left-to-right. Otherwise, returns false.

    Source

    build_geometry

    fn build_geometry(self: &Self) -> crate::Ref<crate::media::Geometry>
    

    Obtains geometry for the glyph run.

    Source

    try_build_geometry

    fn try_build_geometry(self: &Self) -> Option<crate::Ref<crate::media::Geometry>>
    

    Obtains a complete monochrome outline suitable for converting text to editable paths. Returns None if the platform cannot verify completeness or a glyph requires bitmap or colour rendering. An available empty outline (for example, a space) is a successful empty geometry.

    Source

    get_distance_from_character_hit

    fn get_distance_from_character_hit(self: &Self, character_hit: CharacterHit) -> f64
    

    Retrieves the offset from the leading edge of the glyph run to the leading or trailing edge of a caret stop containing the specified character hit.

    Source

    get_character_hit_from_distance

    fn get_character_hit_from_distance(self: &Self, distance: f64) -> (CharacterHit, bool)
    

    Retrieves the character hit information that corresponds to the specified distance into the glyph run. The flag tells whether the distance was inside the run.

    Source

    get_next_caret_character_hit

    fn get_next_caret_character_hit(self: &Self, character_hit: CharacterHit) -> CharacterHit
    

    Retrieves the next valid caret character hit in the logical direction in the glyph run.

    Source

    get_previous_caret_character_hit

    fn get_previous_caret_character_hit(self: &Self, character_hit: CharacterHit) -> CharacterHit
    

    Retrieves the previous valid caret character hit in the logical direction in the glyph run.

    Source

    find_glyph_index

    fn find_glyph_index(self: &Self, character_index: i32) -> usize
    

    Finds a glyph index for given character index.

    Source

    find_nearest_character_hit

    fn find_nearest_character_hit(self: &Self, index: i32) -> (CharacterHit, f64)
    

    Finds the nearest character hit at given index. Also returns the width of the found cluster.

    Source

    dispose

    fn dispose(self: &Self)
    

    Releases the platform resources of the run.

    Source

    get_intersections

    fn get_intersections(self: &Self, lower_limit: f32, upper_limit: f32) -> Vec<f32>
    

    Gets the intersections of specified upper and lower limit.

    Source

    try_create_immutable_glyph_run_reference

    fn try_create_immutable_glyph_run_reference(self: &Self) -> Option<Rc<dyn IImmutableGlyphRunReference>>
    

    Creates an immutable reference to the platform resources of this run.

    Source

    Trait implementations

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

    Availability

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