Skip to main content

rasterize_text_gray_cached

Function rasterize_text_gray_cached 

Source
pub fn rasterize_text_gray_cached(
    font: &Arc<Font>,
    text: &str,
    size: f64,
) -> CachedLcdText
Expand description

Grayscale (whole-pixel coverage) sibling of rasterize_text_lcd_cached.

Runs the identical AGG rasterization and caching, but box-averages the 3× horizontal gray buffer down to one coverage value per pixel and replicates it into all three channels (R = G = B = coverage). The result blits through the very same per-channel composite the LCD mask uses, so the GPU path is shared — but with equal channels there is no subpixel colour fringing. This is the anti-aliased text path for hi-DPI / touch displays where LCD subpixel order is unknown or the per-logical-pixel fringe would be visible (e.g. scaled desktops).