Every number below was set against a measured distribution, and each one is shown with the distribution it came from. If a constant looks arbitrary, the chart under it is the argument.
Why font-size lies
Set a word in any font and you can draw two lines through it. One runs along the top of the lowercase letters that have no ascender. The x in "x-height" is literally the letter x. The other runs along the baseline. The distance between them is very nearly the whole of what your eye reads. Ascenders and descenders help you tell letters apart, but the part you scan lives in that band.
font-size does not set that band. It sets the em box, an invisible square the designer draws inside. Where the letters sit in that square is their choice, and they do not agree with each other. Across these 103 faces the x-height runs from 0.306 to 0.720 of the em.
x-height as a fraction of the em box. Same font-size, very different reading sizes.median 0.50 · 103 faces
In practice that means at font-size: 16px these fonts render their reading band anywhere from 4.9px to 11.5px, a spread of 135%. Correcting it closes the gap to 16%.
What 16px actually draws, before correction.median 8.0px · 103 facesAfter correction. The stragglers are cap-anchored faces, explained further down.median 8.2px · 103 faces
The measurements
Six numbers do most of the work. They are all ratios, so they hold at any size, and all of them come from the outlines rather than from what the font claims about itself in its metadata.
xHeightRatio
Height of the reading band over the em box. The single most important number here. Runs about 0.31 to 0.72 in the wild.
capHeightRatio
Height of a capital H over the em box. Used to catch faces whose capitals are unusually small for their kind.
inkRatio
Tallest ascender down to lowest descender, over the em box. This is the space a line of text physically needs, and it sets the floor on line height.
advanceX
Average letter width, measured in x-heights rather than ems so it is comparable across faces of different reading size.
gapBox
How much of a letter's own width is empty. Positive means air around the ink. Negative means the glyph overhangs its width, which connected scripts do on purpose.
gapStem
Space beside a letter measured at the height where its stems are, rather than at its widest point. Catches faces that are cramped where the strokes actually sit.
Two more are derived. Bounce is how much the flat tops and flat feet of the lowercase scatter, which separates hand-drawn faces from text faces without anyone declaring it. ascLetterRatio is how far the tallest ofb d h k l reaches above the x-height, which catches faces whose lowercase are really capital shapes.
The target, 0.54
Corrections need something to aim at. 0.54 is the x-height ratio faces get pulled towards. It is the middle of where well-regarded text faces already sit, rather than a number derived from theory. At a 16px base it puts the reading band at 8.64px.
Aim higher and most good faces grow for no reason. Aim lower and the small ones stay small. The median of this corpus is 0.502, close enough that most faces barely move.
The deadband, plus or minus 0.04
A face already between 0.50 and 0.58 is left exactly as drawn. This matters more than it sounds. Without a deadband every font gets nudged, so every font ends up slightly wrong in a way its designer did not intend, in exchange for a difference nobody can see. With it, 45 of 103 faces pass through untouched on size, and 18 come out needing nothing at all.
The band was half this wide to begin with. The narrow version kept correcting faces that did not need correcting.
left aloneInside the shaded band, nothing happens.median 0.50 · 103 faces
The size floor, 90%
Correction runs both ways. A face with a very large x-height gets shrunk, not just small ones grown. But shrinking has a limit. Below about 90% the text starts to look undersized next to everything around it that is not being corrected, like buttons and labels and form fields, and the fix reads as a bug.
How much each face is scaled. Above 100% means grown.median 101% · 103 faces
Line height
Scale a face up and its ink gets taller, so a fixed line height starts clipping. The line box comes from the corrected size and the face's own x-height, then gets floored at its actual ink extent plus 5px so descenders never touch the line below.
That 5px floor is not a taste call. It is the point below which a descender in one line and an ascender in the next start to collide.
By default the leading follows the face, so a font that grows gets a taller line. Pass lineMode: 'hold' and every face is pinned to a fixed box instead, with the ink floor as the only thing allowed to break it. 82 of 103 faces fit a 24px grid. These are the ones that do not:
face
category
needs
Sacramento
handwriting
38px
Homemade Apple
handwriting
34px
Great Vibes
handwriting
30px
Indie Flower
handwriting
30px
Marck Script
serif
30px
Dancing Script
handwriting
29px
Pacifico
handwriting
29px
Satisfy
handwriting
29px
Tracking
Letter spacing is the one place the ruleset is deliberately lopsided, because loosening and tightening are not the same problem.
Loosening keys off gapStem, the room beside a letter at the height where its stems are. Letters cramped where they are thickest need air.
Tightening keys off gapBox, how much of a letter's advance is empty. That distinction was learned the hard way. A high-contrast serif is narrow at mid-height and wide at the serifs, so it reads as airy on gapStem when it is merely thin:
face
gapStem
gapBox
what it really is
Montserrat
0.4558
0.2246
genuinely airy
Cormorant Garamond
0.6089
0.1211
not airy, just thin
Tightening also only fires where gapBox is positive. Connected scripts have negative values because their letters overhang their own advances on purpose, and tightening those makes them collide.
Air inside the character box. Everything left of zero is a script that overhangs itself.median 0.14 · 103 faces
The clamp, and the floor
No face moves more than 0.025em in either direction. Past that you have stopped correcting a font and started redrawing it. A 3% deadband skips trivial adjustments relative to the category ideal. On this corpus 35 faces loosened,27 tightened, and 25 hit the clamp.
Underneath sits an absolute floor of 0.003em, below which the value is dropped to zero and no declaration is written. Tracking is never read gap by gap — even at the clamp a single gap shifts 0.4px, and at 0.0008em it shifts 0.0128px. What you actually see is the accumulated width of the line, and 0.003em moves a 78-character line of Lora by 3.7px in 519, under 1%:
em
line width moves
as a %
per gap
0.0008
1.00px
0.19%
0.0128px
0.003
3.75px
0.72%
0.0480px
0.01
12.48px
2.41%
0.1600px
0.025
31.20px
6.01%
0.4000px
The deadband works on the input and is relative; the floor works on what actually ships and is absolute. Both are needed — the deadband still let eight faces through with output nobody could see. Type designers work in 1/1000 em and InDesign's default tracking step is 20/1000, so anything under 3/1000 is below the granularity the craft operates at.
The reason to drop it rather than ship it: a letter-spacing declaration overrides whatever the consumer inherited. A value this small takes their control over their own tracking and returns a change they cannot see.
effectively untouchedApplied tracking, in em. The piles at each end are the clamp doing its job.median 0.000 · 103 faces
Categories, and the bounce cutoff
A monospace face is supposed to have more air than a serif, so they cannot be judged against the same ideals. Asking the designer to declare the category is a rule nobody follows, so it gets measured instead.
Take the letters with flat tops (v w x z) and flat feet (i m n r u v w x z) and look at how much their tops and feet scatter. A face drawn for reading scores near zero because its letters line up. A face drawn by hand does not. Above 0.15 it gets treated as handwriting, which moves 11 faces out of serif and sans-serif: Architects Daughter, Bad Script, Caveat, Caveat Brush, Covered By Your Grace, Gloria Hallelujah, Gochi Hand, Indie Flower, Nanum Pen Script, Schoolbell, Shadows Into Light.
Letterform scatter. The three text categories cluster hard at zero.median 0.03 · 103 faces
Where this falls down. Bounce measures geometry, not intent. Comic Neue, Itim, Mali, Klee One and Patrick Hand are hand-drawn faces with perfectly regular letterforms, and Comic Neue scores below Noto Sans. No threshold separates them from sans-serif without dragging real sans-serifs across too, so none is attempted. Pass category yourself when it matters.
The cap anchor
A few faces cannot be fixed on x-height at all, because their x-height is the one dimension already correct. Nanum Pen is the clearest case. Its x-height sits near the corpus median, but its capitals, its letter widths and its ink extent are the smallest in the whole set. Normalize it on x-height and it still looks small, because everything else about it is.
Those faces get aimed at cap height instead, at 1.39 times the x-height target. Two tests catch them:
1.15, when the tallest of b d h k l reaches less than 1.15 times the x-height, meaning the lowercase are essentially capital shapes.
0.90, when cap height falls below 90% of the category median, meaning the capitals are small for the kind of face it is.
An earlier version gated this on bounce, which was wrong. Bounce does not predict which direction anchoring moves a face. Sacramento bounces seven times harder than Nanum Pen and has textbook-normal capitals, and anchoring it on caps would drop its x-height to 4.94px.
Ascender letters over x-height. Left of the line, the lowercase are capital shapes.median 1.45 · 103 faces
Anchored faces leave the x-height band. That is the trade. A face whose cap-to-x ratio is an outlier can match its neighbours on x-height or on apparent size, but not both. The gate exists to keep those exceptions few and named rather than to pretend they do not happen.
The other 87 faces hold a rendered x-height spread of 16%, from 8.0px to 9.3px, against 135% before correction.
Category tables
Four constants vary by category. GAP_IDEAL is what cramped faces get opened towards. BOX_IDEAL is the median air of the faces in that category that have any. GAP_FLOOR is where terminals start to crowd.CAP_MEDIAN is what a cap outlier gets judged against.
category
GAP_IDEAL
BOX_IDEAL
GAP_FLOOR
CAP_MEDIAN
sans-serif
0.397
0.1947
0.130
0.705
serif
0.483
0.1111
0.078
0.700
monospace
0.603
0.2833
0.223
0.700
handwriting
0.295
0.0797
−0.140
0.7344
Handwriting is really two groups. Connected scripts sit far below hand-lettered faces, and the classifier moves faces in and out of the category at runtime, so these are the least stable numbers on the page.
The corpus
103 faces, every family in the reference set with a static Latin 400 file, measured from the outlines by the same parser the package ships. The generator issite/scripts/corpus.mjs, and the figures in this text are computed from its output when the site builds rather than typed in by hand, so the prose cannot drift from the charts.