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.
Members
DEFAULT
const DEFAULT: GlyphDrawingOptions
The instance representing "use the font's defaults".
new
const fn new() -> GlyphDrawingOptions
Creates options that use the font's defaults.
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.
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).
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.
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).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceKeyObjectPropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopyDebugDefaultStructuralPartialEqPartialEqEqHash
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.