Typography That Sells: Type Scale, Line Length and Free Font Pairings
Free fonts that do not look free: a type scale with base 1rem and ratio 1.25, lines of 65ch, three Google Fonts pairings for editorial, product and friendly pages, and a font selector in DESIGN.md.
What you will learn
- Build a type scale from one base size and a 1.25 ratio as CSS variables
- Keep paragraphs between 45 and 75 characters with max-width: 65ch
- Pair a heading font and a body font from Google Fonts on purpose
- Write a font selector into DESIGN.md so AI agents stop defaulting to Inter
Before you start
- Basic HTML and CSS
- Visual Hierarchy, Spacing and the 8-Point Grid
Most AI-built pages use random font sizes: 18 here, 27 there. They also use Inter for everything. The page feels a bit messy and a bit generic, and it is hard to say why.
Typography fixes both, and it is cheaper than you think. All the fonts in this article are free from Google Fonts. What makes them look like a paid design is a few rules: a type scale, a sensible line length, and a pairing chosen on purpose.
Pick a ratio, then every size is a step
Pick one base size and one ratio. Here the base is 1rem and the ratio is 1.25. Each step is the one below it times 1.25:
In code these are just variables, written once in :root. This is from the project's scale.html:
:root {
/* one base size, one ratio (1.25): every size is a step */
--step--1: 0.8rem;
--step-0: 1rem;
--step-1: 1.25rem;
--step-2: 1.563rem;
--step-3: 1.953rem;
--step-4: 2.441rem;
}
body { font-family: "DM Sans", sans-serif; font-size: var(--step-0); line-height: 1.5; max-width: 720px; margin: 32px auto; color: #1e293b; }
h1 { font-size: var(--step-4); line-height: 1.1; margin: 0 0 .4em; }
h2 { font-size: var(--step-3); line-height: 1.15; margin: 0 0 .4em; }
h3 { font-size: var(--step-2); line-height: 1.2; margin: 0 0 .4em; }
.lead { font-size: var(--step-1); }
small { font-size: var(--step--1); color: #64748b; }
Body text sits on step zero. Headings get a tight line height (1.1 to 1.2), body text gets a relaxed one (1.5). No more random sizes.
Keep a line between 45 and 75 characters
Imagine a paragraph that runs across a whole wide screen, more than a hundred characters per line. Your eyes lose their place every time they jump back to the start of the next line, and most people give up before the end. At about 65 characters per line, your eyes find the next line without effort.
The CSS for it is tiny. From measure.html:
.too-long { max-width: none; } /* about 110 characters per line on a wide screen */
.right { max-width: 65ch; } /* 45 to 75 characters per line */
The ch unit is the width of one character, so max-width: 65ch keeps the line length in range by itself, whatever the font size.
One font with character, one that stays quiet
Three rules for pairing two fonts:
- Two families, no more. One for headings, one for body text.
- Different, but friendly. A serif with a sans, or a sans with a different feel.
- Not the default. If every AI tool picks Inter, your site looks like everybody else's site.
The project has three sample pages, one for each kind of product.
Editorial: Playfair Display and Source Sans 3

The heading has a lot of character and the body is calm and clear for long paragraphs. Best for blogs, magazines and anything people read slowly. The fonts are set once as variables:
:root { --heading: "Playfair Display", Georgia, serif; --body: "Source Sans 3", system-ui, sans-serif; }
Product: Space Grotesk and DM Sans

Space Grotesk has a modern, slightly technical shape, and DM Sans is very clean. Best for apps, dashboards and tech products.
Friendly: Fraunces and Nunito Sans

Fraunces has soft, round letters, and Nunito Sans keeps the body warm and easy. Best for local shops, food, schools and friendly brands.
Write it into DESIGN.md
AI agents love to default to Inter. To stop that, write a font selector into the design system file the agent reads, DESIGN.md. This is the project's typography section:
# DESIGN.md (typography section)
## Font selector (the agent must follow this before writing any CSS)
Never default to Inter, Roboto or Arial. Pick the pairing that matches the product, then use it everywhere.
| Product feel | Heading font | Body font |
|-------------------------|--------------------|----------------|
| Editorial, trustworthy | Playfair Display | Source Sans 3 |
| Modern product, techy | Space Grotesk | DM Sans |
| Warm, friendly, local | Fraunces | Nunito Sans |
Rules:
- Load the fonts from Google Fonts. Two families only: one for headings, one for body.
- Type scale: base 1rem, ratio 1.25 (0.8, 1, 1.25, 1.563, 1.953, 2.441 rem) as CSS variables.
- Body line-height 1.5 to 1.65. Headings 1.1 to 1.2.
- Paragraphs: max-width 65ch (45 to 75 characters per line).
- Define --heading and --body in :root and never write a font name anywhere else.
It opens with one blunt line, never default to Inter, Roboto or Arial. Then a table that maps the product feel to a pairing, and the rules: two families, the 1.25 scale, body line height 1.5 to 1.65, paragraphs at 65ch, and the fonts in two variables, --heading and --body. Now the agent picks from your list instead of falling back to Inter. This is the typography level from why AI-built sites all look the same, written down so the agent cannot skip it. To build a whole DESIGN.md from a site you like, see reference-driven design.
Common mistakes
- Three or four font families. The rule is two: one for headings, one for body.
- Two loud fonts together. A display serif with a display sans fight each other. One font has character, the other stays quiet.
- Full-width paragraphs. Without a
max-width, a wide screen gives you 100+ characters per line. - Font names scattered through the CSS. Put them in
--headingand--bodyand never write a font name anywhere else.
Six things to check before you ship
| Check | Rule |
|---|---|
| Type scale | One base (1rem), one ratio (1.25) |
| Line length | 45 to 75 characters, max-width: 65ch |
| Two fonts | One for headings, one for body |
| Free fonts | From Google Fonts, chosen on purpose |
| Font selector | Written into DESIGN.md |
| Line height | About 1.5 for body, about 1.1 for headings |
You do not have to memorise any of this. Learn the foundations, and let AI do the typing. Try it yourself: pick the pairing that fits your own product, paste the DESIGN.md section into a prompt and ask for a landing page. Then check the result against the six rows above.
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
The Python Architect Masterclass: Full Stack to AI Engineer
Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)Related posts
One Request, Two Answers: the Same Post as an HTML Page and as JSON
Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.
A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.
How a Web Page Works: HTML Tags, Elements and Attributes
A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.
Semantic HTML: header, nav, main, aside and footer as Page Landmarks
The same page written as div soup and with semantic tags looks identical, but only one gives screen readers and search engines landmarks and an outline. Plus tables, div, span and the one-main rule.
