FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    GlyphDrawingOptions

    struct · ferroui-base · v0.5.0

    struct GlyphDrawingOptions
    

    Options that influence how a single glyph is drawn, independent of variable-font axis configuration: which CPAL palette to use for color glyphs, and which bitmap strike size to prefer for bitmap-based glyphs.

    All properties are optional. None means "use the font's default" (palette 0 for color glyphs; no bitmap strike preference). Concerns specific to variable fonts (axis coordinates, named instances) live on FontVariationSettings.

    A record with init-only properties: a value is built from GlyphDrawingOptions::new with GlyphDrawingOptions::with_palette_index and GlyphDrawingOptions::with_pixel_size, which validate as the property initialisers do.

    View source

    Members

    DEFAULT

    const DEFAULT: GlyphDrawingOptions
    

    The instance representing "use the font's defaults".

    Source

    new

    const fn new() -> GlyphDrawingOptions
    

    Creates options that use the font's defaults.

    Source

    palette_index

    fn palette_index(self: &Self) -> Option<i32>
    

    Gets the optional CPAL palette index used to resolve colors for COLR v0 / COLR v1 glyphs.

    When None, the font's default palette (palette 0) is used.

    Source

    with_palette_index

    fn with_palette_index(self: Self, value: Option<i32>) -> GlyphDrawingOptions
    

    Returns a copy of the options with the given palette index.

    Panics

    When the value is negative (ArgumentOutOfRangeException).

    Source

    pixel_size

    fn pixel_size(self: &Self) -> Option<i32>
    

    Gets the optional pixel size used to select a bitmap strike from sbix, CBDT or EBDT tables.

    When None, no bitmap strike is selected and the font's outline (or color-layer) representation is used instead.

    Source

    with_pixel_size

    fn with_pixel_size(self: Self, value: Option<i32>) -> GlyphDrawingOptions
    

    Returns a copy of the options with the given pixel size.

    Panics

    When the value is less than 1 (ArgumentOutOfRangeException).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • Default
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Hash

    Availability

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