Skip to main content

euv_core/font/system/
trait.rs

1use super::*;
2
3/// Abstraction for native OS and deterministic glyph rasterization providers.
4pub trait SystemFontProvider {
5    /// Returns metadata describing this font provider's active backend and capabilities.
6    ///
7    /// # Arguments
8    ///
9    /// - `&Self` - Font provider reference.
10    ///
11    /// # Returns
12    ///
13    /// - `SystemFontInfo` - Provider capabilities and family metadata.
14    fn font_info(&self) -> SystemFontInfo;
15
16    /// Rasterizes a quantized `GlyphKey` into an alpha8 coverage bitmap.
17    ///
18    /// # Arguments
19    ///
20    /// - `&Self` - Font provider reference.
21    /// - `GlyphKey` - Quantized character, font size, bold flag, and family.
22    ///
23    /// # Returns
24    ///
25    /// - `Option<RasterizedGlyph>` - Rasterized glyph bitmap if supported by this provider.
26    fn rasterize(&self, key: GlyphKey) -> Option<RasterizedGlyph>;
27}