Skip to main content

rasterize

Function rasterize 

Source
pub fn rasterize(
    font: &Font,
    glyph: GlyphId,
    px: f32,
    x_offset: f32,
) -> GlyphBitmap
Expand description

Rasterizes glyph at px pixels per em, shifted right by x_offset pixels (use a fraction in 0..1 for subpixel positioning).

Glyphs without an outline, or outlines that fail to draw, yield an empty bitmap: a broken glyph renders as nothing rather than taking the frame down.