Skip to main content

GlyphProvider

Trait GlyphProvider 

Source
pub trait GlyphProvider: Send + Sync {
    // Required method
    fn load_glyph(
        &self,
        font_stack: &str,
        codepoint: char,
    ) -> Option<GlyphRaster>;

    // Provided method
    fn render_em_pixels(&self) -> f32 { ... }
}
Expand description

Glyph raster source used to populate a glyph atlas.

Required Methods§

Source

fn load_glyph(&self, font_stack: &str, codepoint: char) -> Option<GlyphRaster>

Load or rasterize a glyph bitmap for the requested font/codepoint.

Provided Methods§

Source

fn render_em_pixels(&self) -> f32

Pixel size of 1 em as rasterized by this provider.

The symbol batch builder divides symbol.size_px by this value to compute the scale factor that maps glyph atlas pixels to world units. Default is 24.0 (matching the MapLibre ONE_EM convention).

Implementors§