pub struct GlyphDrawingOptions { /* private fields */ }Expand description
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.
Implementations§
Source§impl GlyphDrawingOptions
impl GlyphDrawingOptions
Sourcepub const DEFAULT: GlyphDrawingOptions
pub const DEFAULT: GlyphDrawingOptions
The instance representing “use the font’s defaults”.
Sourcepub const fn new() -> GlyphDrawingOptions
pub const fn new() -> GlyphDrawingOptions
Creates options that use the font’s defaults.
Sourcepub fn palette_index(&self) -> Option<i32>
pub fn palette_index(&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.
Sourcepub fn with_palette_index(self, value: Option<i32>) -> GlyphDrawingOptions
pub fn with_palette_index(self, value: Option<i32>) -> GlyphDrawingOptions
Returns a copy of the options with the given palette index.
§Panics
When the value is negative (ArgumentOutOfRangeException).
Sourcepub fn pixel_size(&self) -> Option<i32>
pub fn pixel_size(&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.
Sourcepub fn with_pixel_size(self, value: Option<i32>) -> GlyphDrawingOptions
pub fn with_pixel_size(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§
Source§impl Clone for GlyphDrawingOptions
impl Clone for GlyphDrawingOptions
impl Copy for GlyphDrawingOptions
Source§impl Debug for GlyphDrawingOptions
impl Debug for GlyphDrawingOptions
Source§impl Default for GlyphDrawingOptions
impl Default for GlyphDrawingOptions
impl Eq for GlyphDrawingOptions
Source§impl Hash for GlyphDrawingOptions
impl Hash for GlyphDrawingOptions
Source§impl PartialEq for GlyphDrawingOptions
impl PartialEq for GlyphDrawingOptions
impl StructuralPartialEq for GlyphDrawingOptions
Auto Trait Implementations§
impl Freeze for GlyphDrawingOptions
impl RefUnwindSafe for GlyphDrawingOptions
impl Send for GlyphDrawingOptions
impl Sync for GlyphDrawingOptions
impl Unpin for GlyphDrawingOptions
impl UnsafeUnpin for GlyphDrawingOptions
impl UnwindSafe for GlyphDrawingOptions
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more