Lab live
Type or pick a text. Both widths update as you type.
measureText–px, the referenceCanvas words
Blink shapes the text of a canvas one word at a time, so no kerning goes across two words. Each CJK character is a word alone. Select a word to see its glyphs.
Glyphs of the first word
| Char | Glyph | Advance | Kerning | px |
|---|
Advance and kerning are in font units. One em has – units. The px column has no rounding.
Sweep in this browser
The sweep measures the CI corpus in your browser: 40 texts for each script and length, at 6 sizes from 10 to 48 px.
No sweep yet. A sweep of Noto Sans takes a few seconds.
CI platforms recorded
Select a cell to see its count of texts and its worst text.
How it works
- The model reads
hmtx,HVAR,GSUBandGPOSof the font file. It adds the advances and the kerning of each canvas word. - The reference is
measureTextof a canvas, with the same file loaded as aFontFace. - An engine model is a row of rules for one text engine: the rounding of the variable-font deltas, the metrics of composite glyphs, the rounding of each advance and the precision of the sum.
- On macOS and Windows, Blink adds the widths of the words in single precision. The CoreText and DirectWrite models do the same.
- Arabic needs joining forms. The model applies them by the joining type of each letter, as HarfBuzz does.
- Devanagari needs the Indic shaper, with its clusters and reordering. The model does not do this yet, so its errors are large.
- The fonts come from
google/fontsat a pinned commit. Read docs/FONTS.md for the measurements.