Sub topic 6
Finding the shared structure
Contrast makes a pairing readable, because the reader can tell which text is which. Shared structure makes it feel intentional, because the two faces look like they were drawn with the same hand or the same tools. This chapter covers how to find that shared structure, how to measure it, and how to use it to choose between candidates.
This chapter assumes you know the anatomy terms from earlier in the tutorial: x-height, stroke, axis, and modulation. It also assumes you can write basic CSS for font-family and font-size.
What "shared structure" means
Shared structure means two typefaces agree on the properties that determine how letters are built and how they sit on a line. It does not mean they look alike. A serif and a sans serif can share structure, and two serifs can fail to.
Four properties do most of the work:
- x-height ratio: the height of the lowercase letters relative to the font size.
- Proportions: the width of round letters such as o and e, and of the capitals, relative to their height.
- Stroke modulation: how much the thickness of a stroke changes along its length.
- Axis: the angle of the imaginary line through the thinnest part of a round stroke, such as the o.
When two faces match on at least two of these, the eye reads them as relatives. When they differ on all four, the pairing usually looks arbitrary, even if the classifications contrast nicely.
The four properties in practice
X-height
X-height is the most important property to match because it controls apparent size. Two fonts set at 16px can look like 15px and 18px if their x-heights differ. Mixing such fonts forces you to nudge sizes by hand everywhere, and the nudges break when a fallback font loads.
Compare faces by the ratio of x-height to the em square. A ratio near 0.45 is modest, and one near 0.55 is large. A difference of about 0.03 or less is usually invisible. A difference above 0.06 is obvious in running text.
Proportions
Proportions describe the width of the letters. A face with wide, circular rounds (a geometric design such as Futura or Montserrat) pairs smoothly with a serif that has fairly round, open forms. It pairs poorly with a narrow, condensed serif, because the rhythm of the letters is different. Look at the lowercase o. If one face has a nearly circular o and the other has an oval o, the pair will show it in every line.
Stroke modulation
Modulation is the difference between thick and thin parts of a stroke. Didone serifs such as Playfair Display have extreme modulation. Most sans serifs have almost none. That gap is usually fine, because the contrast in classification is the point. Trouble starts when the faces differ in modulation but have no other link. The strong face then looks fragile or the weak face looks plain next to it.
A useful rule is to let the two faces differ strongly on one dimension of contrast and stay close on the structural ones. Modulation is often the dimension where you accept a difference. The x-height and proportions are where you ask for agreement.
Axis
The axis is the tilt of the stress. Old-style serifs have a slanted axis, with the thin parts of the o at upper left and lower right. Modern serifs have a vertical axis. Most sans serifs have no visible axis because their strokes are uniform, but their construction still implies one. Humanist sans serifs such as Source Sans have a faint calligraphic slant in their curves, and grotesque and geometric sans serifs have a vertical or no axis.
Matching axes is a quiet way to unify a pair. A slanted-axis serif looks natural beside a humanist sans. A vertical-axis Didone looks natural beside a grotesque or geometric sans.
A decision workflow
Check structure in a fixed order, from the properties that are cheapest to fix to the ones that are hardest.
The order matters. An x-height mismatch can be corrected in code, so it should not by itself reject a pair. Proportions and axis cannot be corrected. If both disagree, no CSS will make the pair feel related.
Measuring x-height instead of guessing
Judging by eye is a good start, but numbers settle disagreements. Font files store the x-height in the OS/2 table, and the em size in the head table. This Python script reads both with the fontTools library (install it with pip install fonttools).
import sys
from fontTools.ttLib import TTFont
def x_height_ratio(path):
font = TTFont(path)
units_per_em = font["head"].unitsPerEm
x_height = font["OS/2"].sxHeight
return x_height / units_per_em
for path in sys.argv[1:]:
print(f"{path}: {x_height_ratio(path):.3f}")Run it as python xheight.py Display.ttf Text.ttf. The script prints one ratio per file. Some older fonts store sxHeight as 0, which means the value was never set. In that case, measure the height of the lowercase x in a design tool and divide by the em size.
The table below shows the kind of output to expect. The numbers are illustrative, so measure your own files.
| Pair | Display ratio | Text ratio | Difference | Action |
|---|---|---|---|---|
| Serif and sans A | 0.514 | 0.486 | 0.028 | Acceptable as is |
| Serif and sans B | 0.440 | 0.530 | 0.090 | Correct with font-size-adjust |
| Serif and sans C | 0.470 | 0.475 | 0.005 | No action |
Correcting mismatches in CSS
The font-size-adjust property scales each font so its x-height equals a fixed fraction of the font size. If you give both faces the same value, their lowercase letters come out at the same visual size, whatever the font files say. It also applies to the fallback fonts in the stack, which matters while web fonts are loading.
body {
font-family: "Source Sans 3", system-ui, sans-serif;
font-size-adjust: 0.5;
}
h1, h2, h3 {
font-family: "Playfair Display", Georgia, serif;
font-size-adjust: 0.5;
}Choose a value close to the typical ratio of your faces, so the correction stays small. Setting 0.5 on a font whose natural ratio is 0.42 enlarges it by almost 20 percent, which can change line lengths and wrapping. You can also use font-size-adjust: from-font, which takes the ratio from the first available font in the stack. This keeps the size of that font unchanged, but it does not equalize two different faces by itself. For a pairing, a shared numeric value on both is the reliable choice.
Reading a candidate pair
Take a concrete example. You are considering Playfair Display for headings and Source Sans 3 for body text.
- X-height: the two are close, within a few hundredths. No large correction is needed.
- Proportions: Playfair has fairly round, generous bowls. Source Sans has open, moderately wide rounds. They are compatible.
- Axis: Playfair has a vertical axis, and Source Sans has a quiet, mostly upright structure. They agree.
- Modulation: they differ strongly. This is the intended contrast, together with the serif and sans classification.
The pair passes. Its contrast is carried by classification and modulation, and its link is carried by x-height, proportions, and axis.
Now take a weaker example: a condensed grotesque headline face with a wide, geometric body face. The x-heights might match, but the proportions are far apart, and the two faces will read as strangers. You would likely replace one of them.
Edge cases
- Weight changes the structure. A bold weight often has a larger apparent x-height and wider letters than the regular weight of the same family. Measure the weights you will actually use.
- Optical sizes. Some fonts, such as variable fonts with an
opszaxis, change modulation and spacing by size. A display cut of a serif can have much sharper contrast than its text cut. Check the cut you will use at each size. - Fallback fonts. If the web font fails to load, the fallback has its own structure. Georgia has a large x-height, and Times New Roman has a small one. Pick fallbacks whose ratios resemble your chosen faces, and rely on
font-size-adjustfor the rest. - Small caps and numerals. Figures can be old-style or lining, and the two styles sit differently against a companion face. Check that numerals do not clash when they appear beside body text.
Summary
Shared structure is the part of a pairing you can measure and verify. Compare x-height ratio first, then proportions, then axis, and treat modulation as the place where difference is allowed. Correct x-height in CSS when the gap is small, and reject the pair when proportions and axis both disagree.
Exercise
You are pairing a serif for headings with a sans serif for body text. The serif has an x-height ratio of 0.43, a narrow oval o, and a slanted axis. The sans serif has a ratio of 0.52, a nearly circular o, and a vertical axis. Which structural properties disagree, and should you fix the pair with font-size-adjust or choose a different face?
Show answer
All three properties disagree: the x-height differs by 0.09, the proportions differ (narrow oval against circular), and the axes differ (slanted against vertical). The font-size-adjust property can correct only the x-height, so it cannot make the pair feel related. Because proportions and axis both disagree, reject the pair and try a different candidate, for example a sans serif with a slightly slanted, humanist construction and a ratio nearer 0.45.
Exercise
Why is modulation the property where a difference between two faces is usually acceptable, while x-height is not?
Show answer
A difference in modulation, such as a high-contrast serif next to a uniform-stroke sans serif, is part of the intended contrast between classifications, and it does not change how big or how wide the text looks. A difference in x-height changes the apparent size of the text in every line, and it also makes fallback fonts behave unpredictably, so it needs to be matched or corrected.