Pairing Google Fonts by x-Height and Character Width
Why font pairings fail visually even when categories contrast, and how measuring x-height in em and average character width prevents mismatched headings and body copy.
Nominal font-size lies about perceived size
Two fonts set at 16px rarely look the same size. What the eye reads as size is largely the height of lowercase letters — the x-height — measured in the font binary as OS/2.sxHeight divided by head.unitsPerEm.
Inter has an x-height of 0.5455em, while Newsreader sits at 0.468em. Set side by side at the same pixel size, Inter looks noticeably larger and heavier. If you pair them without accounting for that 16% gap, subheadings and inline labels drift out of proportion.
How to match x-heights without guessing
Compute the ratio body_x_height / heading_x_height. When that number stays between 0.92 and 1.08, the two families feel optically aligned out of the box. Outside that band, multiply your heading scale by the ratio (clamped so display headings do not explode).
Second, check xAvgCharWidth / unitsPerEm. Pairing an unusually wide geometric sans (like Poppins at 0.504em) with a narrow editorial serif (like Source Serif 4 at 0.444em) changes line rhythm sharply between headings and body paragraphs.
opticalMultiplier = body.xHeightEm / heading.xHeightEm /* Example: Lora (0.496em) + Inter (0.5455em) => 0.909x */
Structural contrast still matters
Matching metrics does not mean picking two identical fonts. Putting Roboto next to Open Sans gives high metric similarity with almost zero structural contrast, which makes headings look like an accidental font load error. Combine different categories (serif + sans) or distinct sub-styles (geometric + humanist) while keeping x-height and width compatible.