daegun

Rasterizing

let glyph = font.rasterize_glyph(gid, 32.0, &[]).expect("has ink");
glyph.metrics.width;          // usize
glyph.metrics.height;         // usize
glyph.metrics.xmin;           // i32, left edge in device pixels
glyph.metrics.advance_width;  // f32, already in pixels
glyph.bitmap;                 // Vec<u8>, one coverage byte per pixel

None means the glyph draws nothing. A space is an answer, not a failure.

Options

use daegun::{HintMode, RasterOptions};

let opts = RasterOptions::default().with_hinting(HintMode::Auto).with_gamma(1.8);
let glyph = font.rasterize_glyph_with(gid, 32.0, &[], &opts).expect("has ink");
BuilderEffect
with_layoutGrayscale, RGB or BGR stripes, or your own filter weights.
with_gammaCoverage raised to 1/gamma at byte conversion.
with_transformAn affine in font units, applied before rasterizing.
with_hintingNone, Subpixel (v40), Classic (v35), Auto, AutoForce.
with_strokeStroke the outline instead of filling it.
with_emboldenSynthetic bold. Widens the advance too.
with_obliqueSynthetic slant, as a tangent from vertical.

Type to search.