zenthra-text 0.1.0

Typography, font shaping, and text layout for the Zenthra UI framework
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::types::glyph::RasterizedGlyph;
use crate::types::shaped_glyph::ShapedGlyph;

/// A trait for components that can rasterize glyphs into pixel data.
pub trait Rasterizer: Send + Sync {
    /// Renders a single shaped glyph into a bitmap.
    /// Returns None if the glyph could not be rasterized.
    fn rasterize(&mut self, glyph: &ShapedGlyph) -> Option<RasterizedGlyph>;
}