pub trait SystemFontProvider {
// Required methods
fn font_info(&self) -> SystemFontInfo;
fn rasterize(&self, key: GlyphKey) -> Option<RasterizedGlyph>;
// Provided methods
fn rasterize_batch(&self, keys: &[GlyphKey]) -> Vec<Option<RasterizedGlyph>> { ... }
fn rasterize_into(
&self,
key: GlyphKey,
dst: &mut Vec<u8>,
) -> Option<(u32, u32, u32)> { ... }
}Expand description
Abstraction for native OS and deterministic glyph rasterization providers.
Required Methods§
Sourcefn font_info(&self) -> SystemFontInfo
fn font_info(&self) -> SystemFontInfo
Sourcefn rasterize(&self, key: GlyphKey) -> Option<RasterizedGlyph>
fn rasterize(&self, key: GlyphKey) -> Option<RasterizedGlyph>
Provided Methods§
Sourcefn rasterize_batch(&self, keys: &[GlyphKey]) -> Vec<Option<RasterizedGlyph>>
fn rasterize_batch(&self, keys: &[GlyphKey]) -> Vec<Option<RasterizedGlyph>>
Sourcefn rasterize_into(
&self,
key: GlyphKey,
dst: &mut Vec<u8>,
) -> Option<(u32, u32, u32)>
fn rasterize_into( &self, key: GlyphKey, dst: &mut Vec<u8>, ) -> Option<(u32, u32, u32)>
Rasterizes key directly into a caller-owned reusable dst alpha8 staging buffer without allocating a fresh bitmap vector.
§Arguments
&Self- Font provider reference.GlyphKey- Quantized glyph descriptor.&mut Vec<u8>- Reusable destination staging buffer cleared and overwritten with row-major alpha8 pixels.
§Returns
Option<(u32, u32, u32)>- Tuple(width, height, advance)when rasterization succeeded.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl SystemFontProvider for NativeSystemFont
SystemFontProvider implementation delegating to OS native APIs with batched and zero-alloc staging paths.