pub enum Hinting {
None,
GridFit,
}Expand description
How a glyph’s outline is snapped to the pixel grid.
Hinting is a discretion, not a default: unhinted rendering is what a modern rasteriser wants, and grid fitting is what reproduces a bitmap-era look. Both are offered, and neither is applied behind the caller’s back.
Variants§
None
Leave the outline where the scale puts it. Every edge gets antialiased coverage, and a stem that should be 1.3 px wide is 1.3 px wide. The default.
GridFit
Snap every outline point — control points included — to the nearest pixel boundary, and round advances and bearings to whole pixels.
This is a coarse integer-grid fit, not TrueType’s interpreter: it snaps points, it does not walk instructions. What it buys is crisp stems and integer advances at the small sizes where hinting matters.
Implementations§
Source§impl Hinting
impl Hinting
Sourcepub const fn is_grid_fit(self) -> bool
pub const fn is_grid_fit(self) -> bool
True for Hinting::GridFit.