= Grid fitting
<Grid fitting> adjusts scaled <glyph> geometry relative to a target <pixel> grid before <rasterization>. <TrueType> <font hinting> can move outline points to preserve important strokes and alignment at small sizes. The result depends on the requested resolution and transformation.<TrueType Fundamentals by Microsoft>[From Font File to Paper; instructions and grid-fitting distortions]{ref}
A simple <area-coverage antialiasing> model shows the problem. A vertical stroke from horizontal coordinate 0.4 to 1.6 covers 60 percent of each of two neighboring <pixel> columns. An equal-width stroke from 3.9 to 5.1 covers 10 percent, 100 percent and 10 percent of three columns. Both geometries have width 1.2 <pixels>, yet their darkest columns differ. Snapping their boundaries to give each stroke one full column changes the outlines but gives consistent displayed stroke weights.
This is a tradeoff between geometric fidelity and small-size legibility, rather than a change to the stored <Unicode> text. <Grid fitting> operates on the geometry supplied to the <rasterization> step; <glyph substitution> and <glyph positioning> address the forms and layout that precede it.
\Image[/grid-fitting-stroke-coverage.png]
{title=<Pixel> coverage before and after <grid fitting>}
{description=Original ideal <area-coverage antialiasing> model of rectangular strokes, not measurements of a particular <computer font>. The unfitted strokes both have width 1.2 <pixels>, but their placements give different column coverage. The fitted strokes each occupy one full column; their changed geometry is explicit. Red dashed lines mark the geometric stroke boundaries.}
Back to article page