FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    HorizontalMetricsTable

    struct · ferroui-base · v0.5.0

    struct HorizontalMetricsTable
    

    The hmtx (horizontal metrics) table. Metrics are read lazily from the table data; lookups never allocate.

    The lookups return Err when the table is shorter than the header counts promise (the reference implementation throws there).

    View source

    Members

    TAG_NAME

    const TAG_NAME: &'static str
    

    Source

    TAG

    const TAG: OpenTypeTag
    

    Source

    load

    fn load(font: &dyn IFontMemory, number_of_h_metrics: u16, glyph_count: i32) -> Option<HorizontalMetricsTable>
    

    Loads the table; None when the font has no hmtx table.

    Source

    try_get_metrics

    fn try_get_metrics(self: &Self, glyph_index: u16) -> Result<Option<HorizontalGlyphMetric>, FontTableError>
    

    The metrics of a glyph; Ok(None) when the glyph index is out of range.

    Source

    try_get_advance

    fn try_get_advance(self: &Self, glyph_index: u16) -> Result<Option<u16>, FontTableError>
    

    The advance of a glyph; Ok(None) when the glyph index is out of range.

    Source

    try_get_advances

    fn try_get_advances(self: &Self, glyph_indices: &[u16], advances: &mut [u16]) -> Result<bool, FontTableError>
    

    Reads the advances of a batch of glyphs.

    Ok(false) when advances is shorter than glyph_indices or a glyph index is out of range (the advances before it are already written).

    Source

    try_get_metrics_batch

    fn try_get_metrics_batch(self: &Self, glyph_indices: &[u16], metrics: &mut [HorizontalGlyphMetric]) -> Result<bool, FontTableError>
    

    Reads the metrics of a batch of glyphs.

    Ok(false) when metrics is shorter than glyph_indices or a glyph index is out of range (the metrics before it are already written).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug

    Availability

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