pub struct NativeSystemFont { /* private fields */ }Expand description
Cross-platform native system font provider backed by direct OS font APIs.
Implementations§
Source§impl NativeSystemFont
Construction and lazy-binding telemetry helpers for NativeSystemFont.
impl NativeSystemFont
Construction and lazy-binding telemetry helpers for NativeSystemFont.
Sourcepub fn system() -> Self
pub fn system() -> Self
Creates a NativeSystemFont descriptor with zero synchronous OS font probes, binding native faces lazily on first glyph miss.
§Returns
Self- Native OS font provider with automatic deterministic fallback.
Sourcepub fn deterministic() -> Self
pub fn deterministic() -> Self
Creates a deterministic cross-platform font provider guaranteeing identical pixels on every OS.
§Returns
Self- Deterministic bitmap/stroke font provider.
Sourcepub fn thread_primary_font_binds() -> usize
pub fn thread_primary_font_binds() -> usize
Returns the number of lazy primary OS font face binds performed on the current thread.
§Returns
usize- Cumulative lazy primary font bind count on this thread (0right afterNativeSystemFont::system()).
Sourcepub fn thread_fallback_font_loads() -> usize
pub fn thread_fallback_font_loads() -> usize
Returns the number of lazy native fallback font loads (such as CJK or symbol cascades) performed on the current thread.
§Returns
usize- Cumulative lazy fallback font load count on this thread.
Source§impl NativeSystemFont
impl NativeSystemFont
pub fn get_info(&self) -> &SystemFontInfo
pub fn get_deterministic_only(&self) -> bool
Trait Implementations§
Source§impl Clone for NativeSystemFont
impl Clone for NativeSystemFont
Source§impl Debug for NativeSystemFont
impl Debug for NativeSystemFont
Source§impl Default for NativeSystemFont
Default NativeSystemFont uses deterministic cross-platform rasterization.
impl Default for NativeSystemFont
Default NativeSystemFont uses deterministic cross-platform rasterization.
Source§impl SystemFontProvider for NativeSystemFont
SystemFontProvider implementation delegating to OS native APIs with batched and zero-alloc staging paths.
impl SystemFontProvider for NativeSystemFont
SystemFontProvider implementation delegating to OS native APIs with batched and zero-alloc staging paths.
Source§fn font_info(&self) -> SystemFontInfo
fn font_info(&self) -> SystemFontInfo
Source§fn rasterize_batch(&self, keys: &[GlyphKey]) -> Vec<Option<RasterizedGlyph>>
fn rasterize_batch(&self, keys: &[GlyphKey]) -> Vec<Option<RasterizedGlyph>>
Batch-rasterizes keys in a single OS/Web pass (<= 1 readback on Web software fallback) with deterministic fallback.
§Arguments
&Self- Font provider reference.&[GlyphKey]- Slice of missing glyph keys to rasterize.
§Returns
Vec<Option<RasterizedGlyph>>- Rasterized glyph results aligned 1:1 withkeys.
Source§fn 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 caller-owned reusable dst alpha8 staging buffer without per-glyph vec![0; ...] allocation.
§Arguments
&Self- Font provider reference.GlyphKey- Quantized glyph descriptor.&mut Vec<u8>- Reusable destination alpha8 staging buffer.
§Returns
Option<(u32, u32, u32)>- Tuple(width, height, advance)when rasterization succeeded.