Fonts that hold still
A web font that arrives late can move a page under its reader. How we found that this site moved on every page while its fonts loaded, why the fallbacks meant to prevent it never loaded on some systems, what we changed, what it measured afterwards, and what the October regression on WPAgency.xyz taught us.
- Astro
- Software Architecture
Open a page on a slow connection and the words often arrive twice: first in a font the device already has, then, a moment later, in the one the designer chose. If the two are not the same size, lines break in new places, paragraphs grow or shrink, and whatever you were about to tap has moved.
Instrument Serif, downloaded
Before: your device’s serif, as it comes
Now: this site’s fallback on your device
The same words three times, drawn by your browser as you read, each underlined to its own width. First in Instrument Serif, the font this site downloads for its headings. Then in the fonts its old stack fell back to whenever the old adjusted face did not load, a serif the device already has at its own size, which is what Android and many Linux systems showed. Last in the fallback this site uses now, sized for your device’s serif. On the Linux machine we measured on, the middle line is about a fifth wider than the first, and the last within a few pixels of it.
- Before
- 6
- of 100 page-widths moved more than 0.1 as the fonts arrived, and none stayed still
- After
- 0
- of 100 moved more than 0.05, in each of the four font environments we tested
- Worst, after
- 0.030
- down from 0.164, where Google counts 0.1 or less as good
Every page in this site’s sitemap at 390 and 1440 pixels, in Chromium, with the web fonts held back 400 milliseconds, on 3 November 2026. The tables below have the method for every figure in this entry.
The jump has a name
Google measures it as Cumulative Layout Shift, one of the three Core Web Vitals: the largest burst of unexpected movement while a page is open, where a shift is any visible element whose starting position changes from one frame to the next. A score of 0.1 or less is good and anything above 0.25 is poor, judged at the 75th percentile of real page loads.
A late font is an easy way to cause one, because it does not move one element. It moves every line below the text that changed.
Three ways a fallback is wrong
Width. The fallback sets the same words wider or narrower than the web font, so lines break in different places. A heading that fits on one line in one font takes two in the other, and everything below it moves by a line.
Height. Every font carries its own ascent, descent and line gap, the space it asks for above and below its letters. Swap the font and each line box can grow or shrink, even where every line breaks in the same place.
Measures. The CSS ch unit is the width of the character
0 in the
font being used to draw it. Until the web font arrives, that is the
fallback’s 0, so a reading column set to so many ch changes width as the
fonts swap, and every paragraph in it rewraps.
The first two are answered by sizing the fallback:
size-adjust
scales a local font to the web font’s width, and three overrides give it the
web font’s ascent, descent and line gap. Safari applies the size adjustment
but not the overrides.
The third is answered by not using ch at all.
October: a fix that lived in one stylesheet
We learned all three on WPAgency.xyz, the agency’s own site, before we
looked here. On 24 October we gave it fallbacks sized against every run of
its own text, one for each width, weight and style, and moved its measures
from ch to em, with a test that failed on any ch. Held back by 2.5
seconds, the fonts’ swap went from a mean layout shift of 0.019 to 0.002 over
17 pages at six widths.
Then its type changed twice in four days, and each change meant measuring
again, because a fallback’s numbers describe the difference between two
particular fonts and nothing else. By 28 October the build we were refining
had new fallbacks for the approved design’s Manrope. That day the approved
design’s own build became the site, and the calibrated faces, and the test
that guarded ch, were in the files it replaced. Nothing failed, because on
a fast connection the fonts usually arrive before anyone sees the fallback.
We found it two days later, while checking that a seasonal decoration caused
no layout shift: with the fonts held back 400 milliseconds, /approach/ at
phone width moved by 0.248 as its title grew from 42 to 51 pixels tall, with
or without the decoration. The fix the next day measured the fallbacks against
the site’s own words again, weight by weight, and took the page-widths moving
more than 0.1 from 21 of 212 to 2. Those two have titles on a line-break
boundary that no single adjustment could hold, and we left them, and wrote
them down.
The lesson was not about fonts. A fix that lives in one stylesheet, with nothing that checks it by name, does not survive a change of build.
This site: a fallback that never loaded
This site sets its type in Instrument Serif and Instrument Sans, and until this month it let Astro’s font pipeline make its fallbacks. The pipeline reads each web font’s file, takes the average width of its letters, weighted by how often each occurs in English, and writes one adjusted face against Times New Roman for a serif or Arial for a sans-serif. Layout shift was 0 on every page we audit, because the audit lets the fonts arrive at their own pace.
On 3 November we ran the test that had found WPAgency.xyz’s regression: every page in this site’s sitemap, 50 of them, at 390 and 1440 pixels, with the fonts held back 400 milliseconds, in Chromium on Linux. Six of the 100 page-widths moved by more than 0.1, and not one of them stayed still. With the fonts let through at once, every one measured 0.
The adjusted faces had never loaded. They name their fonts with local(),
which matches a font’s own full or PostScript
name and never an alias,
and the machine had neither Times New Roman nor Arial. Windows ships
both, and
Apple lists them among macOS’s fonts. Android does not: its font
configuration
sends a request for Times New Roman or Georgia to Noto Serif and one for
Arial to Roboto; local() does not follow that, because it asks for a font
by its own name. Many Linux systems lack both fonts too. So on those devices
the page fell through to whichever serif they had, at its own size: the title Most of the work was
deleting set 21% wider in it and took two lines instead of one.
What we changed
Our own fallbacks, measured on our own words. The site now carries fallbacks for three groups of fonts, tried in order: Times New Roman and Arial, with the fonts drawn to the same widths (Liberation on Linux, Tinos and Arimo on ChromeOS); Noto Serif and Roboto, Android’s own; and DejaVu, a common Linux default. Each is sized by a script that opens every page of the built site, collects every run of text set in a web font (299 runs of upright Instrument Serif, 61 of italic and 1,891 of Instrument Sans), sets each at the same size in the web font and in the local font, and divides the totals. The ascent, descent and line gap are the web font’s, divided by the same figure.
Measured that way, Instrument Serif’s headings are 82.89% of Times New Roman’s width, where the pipeline’s average letter had put them at 88.37%, 70.28% of Noto Serif’s and 65.44% of DejaVu Serif’s. The pipeline’s own fallbacks are switched off, so nothing competes with these.
No measure in ch. Every reading width that was set in ch is now set
in em, at the width of the figure 0 in the web font itself (0.666 em in
Instrument Sans, 0.46 em in Instrument Serif), so a column is as wide before
the fonts arrive as after. With the fonts loaded, nothing on the page moved:
of 55,464 element boxes on every page at three widths, 58 widths changed by
less than a pixel, and no position or height by more than half of one.
How we tested it
The same measurement, before and after, in four font environments built for Chromium with fontconfig, the library Linux uses to find fonts:
- the test machine’s own fonts, Liberation and DejaVu;
- Windows and macOS fonts: Times New Roman, Arial and Georgia, stood in for by fonts drawn to the same widths and renamed to those names (Liberation Serif and Sans, and Gelasio);
- Android’s fonts, Noto Serif and Roboto, from Google Fonts;
- DejaVu alone.
| Fonts | Before: median, worst, over 0.1 | After: median, worst, over 0.1 |
|---|---|---|
| The test machine’s | 0.014, 0.164, 6 | 0.0001, 0.030, 0 |
| Windows and macOS (stand-ins) | 0.011, 0.168, 2 | 0.0001, 0.030, 0 |
| Android | 0.021, 0.206, 8 | 0.0003, 0.031, 0 |
| DejaVu only | 0.034, 0.213, 14 | 0.0004, 0.030, 0 |
After the change no page-width moved more than 0.05 in any of the four, where before 12 to 33 did. The dark theme measured the same as the light. The Windows and macOS row improved too: there the old faces did load, but sized from the font files rather than from the site’s words.
Every figure in this entry, with its method:
| Date | What we measured | Result |
|---|---|---|
| 24 Oct | WPAgency.xyz: 17 pages at six widths, fonts held back 2.5 s | Mean 0.019 before, 0.002 after |
| 30 Oct | WPAgency.xyz, /approach/ at 390 px, fonts held back 400 ms |
0.248, with the calibration gone |
| 31 Oct | WPAgency.xyz: every sitemap page at 390 and 1440 px (212 page-widths), fonts held back 400 ms | Over 0.1: 21 before, 2 after |
| 3 Nov | This site: every sitemap page at 390 and 1440 px (100 page-widths), fonts held back 400 ms, four font environments | As in the table above. With the fonts let through at once, 0 on all 100 |
The October and November figures were taken in different ways and on different sites, so each is compared only with its own before.
What still moves
Titles on a line-break boundary. One adjustment per face is an average over the site’s text, and a title that sits right on the edge of its column can still break differently. Most of the work was deleting now holds still at 1440 pixels (0.151 before, 0.004 after), but at 390 pixels it still takes two lines in the Times New Roman group’s fallback and one in Instrument Serif, for a shift of 0.023. The worst page-width left, a song’s title at 390 pixels, measures 0.030.
What we did not test. All of this is Chromium. We have not measured Firefox, or Safari, which applies the size adjustment but not the vertical overrides. We stood in for the Windows and macOS fonts rather than measuring on Windows or a Mac, and we used Google Fonts’ copies of Noto Serif and Roboto, which can differ by version from the ones on a phone. A device with none of the three groups still falls through to an unadjusted font.
The text changes. The adjustment is an average over the words on the site the day it was measured. New pages move it a little, so it is worth measuring again now and then, not only when a font changes.
Keeping it
October’s lesson, applied. The measurements live in two files beside the
stylesheet, and a test in the site’s build names them. It fails when a font
is added, removed or given a new weight without a new measurement, when the
stylesheet drifts from the record, when a built font file is not the one the
fallbacks were measured against, when the fallbacks are missing from the
build, and when any measure is set in ch. We checked each of those by
breaking it on purpose and watching the test fail. What it cannot know is
what fonts a reader’s device has; that takes a measurement like the one
above.
How to check your own site
You do not need our tools to see this on your own pages. In a browser’s
developer tools, slow the network or block the font files, reload, and watch
the text. To put a number on it, record the page’s layout-shift entries
with a PerformanceObserver while the fonts are held back for a fraction of
a second, at a phone width and a desktop width, and compare the result with
the same page when the fonts are let through at once. Then look at your
longest headings in both fonts, side by side. If they break in different
places, no score will tell you more than that.
Where to go next
- See it: this page and WPAgency.xyz, on a slow connection.
- How October’s regression was found: A season you notice, a system you don’t, the seasonal work whose checks caught it.
- The rule behind the measurements: Publish only what you can measure.