8.6 · Typography & shape

Even text sizes across fonts: font-size-adjust

Match the x-height of fallback fonts so text doesn’t jump when the web font loads.

Fonts at the same font-size can look very different in size, because their lowercase letters have different heights. When a web font replaces a fallback, text visibly jumps.

font-size-adjust: 0.5 scales each font so its x-height is half the font size. from-font takes the value from the first font in the list, so fallbacks match the web font.

Before
/* Tune font-size per fallback by hand */
@font-face {
  font-family: 'Fallback';
  src: local('Arial');
  size-adjust: 92%;
}
Now
body {
  font-family: 'Brand', Georgia, serif;
  font-size-adjust: from-font;
}