1---2name: fonts3description: Choose and implement web typography avoiding common rendering, pairing, and hierarchy mistakes.4---5
6## Display vs Text Fonts
7
8- Display fonts (Abril Fatface, Bebas Neue, Lobster) are for headings 24px+ only—using them for body text destroys readability
9- If a font looks decorative or has extreme thick/thin contrast, it's display—not for paragraphs
10- Text fonts (Inter, Roboto, Georgia) are designed for 12-18px—use these for body copy
11
12## Pairing Traps
13
14- Two fonts too similar look like a mistake—if you can't tell them apart instantly, use one font
15- Contrast in category works: serif heading + sans-serif body, or different weights of same family
16- Two decorative fonts clash—never pair Lobster with Pacifico
17- Safe pairs: same superfamily (Roboto + Roboto Slab) or proven combos (Playfair Display + Source Sans Pro)
18
19## Weight and Rendering
20
21- Thin weights (100-300) render poorly on Windows—avoid for body text, use 400+ for cross-platform
22- Light fonts on dark backgrounds look thinner—bump weight up one level for dark mode
23- Faux bold (browser-generated) looks wrong—only use weights the font actually includes
24- Check font has italic—faux italic (slanted roman) is noticeably worse than true italic
25
26## Line Height and Length
27
28- Body text needs 1.4-1.6 line-height—1.0 or 1.2 makes paragraphs unreadable walls
29- Headings need tighter line-height (1.1-1.3)—large text with 1.5 line-height has awkward gaps
30- Line length 45-75 characters max—wider than 75 chars causes readers to lose their place
31- Set `max-width` on text containers in ch units: `max-width: 65ch`
32
33## All Caps
34
35- ALL CAPS needs increased letter-spacing—without it, letters collide and look cramped
36- `text-transform: uppercase` + `letter-spacing: 0.05em` minimum
37- Never use all caps for more than a few words—extended caps text is significantly harder to read
38- Small caps (`font-variant: small-caps`) only if font supports it—faux small caps look amateurish
39
40## Widows and Orphans
41
42- Single word alone on last line of paragraph looks broken—adjust text or container width
43- `text-wrap: balance` (CSS) distributes lines more evenly in headings
44- `text-wrap: pretty` for body text—prevents orphans in browsers that support it
45- Manual fix: non-breaking space (` `) between last two words
46
47## Loading and Performance
48
49- `font-display: swap` prevents invisible text—without it, text is blank until font loads
50- Subset fonts to characters you need—Latin-only saves 60%+ over full Unicode
51- WOFF2 is the only format you need—universal support, best compression
52- Preload critical fonts: `<link rel="preload" href="font.woff2" as="font" crossorigin>`
53
54## System Font Stack
55
56```css
57font-family: system-ui, -apple-system, BlinkMacSystemFont,
58 'Segoe UI', Roboto, sans-serif;
59```
60- Zero load time, native look per platform—use for UI-heavy apps
61- `system-ui` is now widely supported—simpler than listing all fallbacks
62- Always end with generic fallback (`sans-serif`, `serif`, `monospace`)
63
64## Hierarchy Mistakes
65
66- Using too many font sizes—stick to a type scale (1.25 or 1.333 ratio), not random sizes
67- Headings not distinct enough from body—skip at least one scale step between h1 and body
68- Overusing bold—if everything is emphasized, nothing is emphasized
69- Color as only differentiator—size and weight should establish hierarchy before color