Skip to main content

SystemFontProvider

Trait SystemFontProvider 

Source
pub trait SystemFontProvider {
    // Required methods
    fn font_info(&self) -> SystemFontInfo;
    fn rasterize(&self, key: GlyphKey) -> Option<RasterizedGlyph>;
}
Expand description

Abstraction for native OS and deterministic glyph rasterization providers.

Required Methods§

Source

fn font_info(&self) -> SystemFontInfo

Returns metadata describing this font provider’s active backend and capabilities.

§Arguments
  • &Self - Font provider reference.
§Returns
  • SystemFontInfo - Provider capabilities and family metadata.
Source

fn rasterize(&self, key: GlyphKey) -> Option<RasterizedGlyph>

Rasterizes a quantized GlyphKey into an alpha8 coverage bitmap.

§Arguments
  • &Self - Font provider reference.
  • GlyphKey - Quantized character, font size, bold flag, and family.
§Returns
  • Option<RasterizedGlyph> - Rasterized glyph bitmap if supported by this provider.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl SystemFontProvider for NativeSystemFont

SystemFontProvider implementation delegating to OS native APIs with deterministic fallback.