Readability and Language

Typography Fundamentals

Course 1 · Chapter 7 · Readability and Language

In Typography Fundamentals 6 you got a typeface onto the reader's screen, with a sensible fallback if the file arrived late. But "it appears" is not the same as "it can be read". Some of your readers have tired eyes, small phones, dim rooms, dyslexia or low vision. Others read in a language your first font never planned for. This chapter is about making type work for the widest range of people: enough contrast, sizes that respect the reader, and fonts that actually contain the letters a text needs.

What was run, and what was not
The two Python scripts in this chapter were run on Windows with Python 3.14.0, using only the standard library; the output shown is exactly what each printed. The contrast thresholds quoted here follow the WCAG guidelines as I understand them (check the current version before relying on them for a compliance claim). The CSS snippets were not tested across several browsers, and the font names in them are invented placeholders.

Contrast: Can the Text Be Seen?

The most common readability failure on the web is not an odd typeface; it is pale grey text on a white background. Contrast is the difference in brightness between text and its background, and the Web Content Accessibility Guidelines (WCAG) turn it into a number: the contrast ratio, written like 4.5:1. It runs from 1:1 (identical colours, invisible text) to 21:1 (black on white).

Text kindMinimum ratio (level AA)Higher target (level AAA)
Body text4.5:17:1
Large text (roughly 24px, or 19px bold; check the exact definition)3:14.5:1
Icons and interface outlines3:1(no separate target; check)

Calculating a Ratio Yourself

The formula looks scary but is short: convert each colour's red, green and blue values to a "relative luminance" (how bright the eye perceives it, with green counting most), then divide the brighter by the darker, each with a small offset added. This script does exactly that for a handful of colour pairs.

"""Contrast ratio checker (WCAG formula). py contrast.py """ def channel(v): v = v / 255 return v / 12.92 if v <= 0.03928 else ((v + 0.055) / 1.055) ** 2.4 def luminance(hexcol): r, g, b = (int(hexcol[i:i + 2], 16) for i in (1, 3, 5)) return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b) def ratio(fg, bg): a, b = sorted((luminance(fg), luminance(bg)), reverse=True) return (a + 0.05) / (b + 0.05) pairs = [ ("Black on white", "#000000", "#ffffff"), ("Dark grey on white", "#595959", "#ffffff"), ("Mid grey on white", "#999999", "#ffffff"), ("Light grey on white", "#cccccc", "#ffffff"), ("Soft text on dark page", "#c9d1d9", "#0f1117"), ] print(f"{'Pair':<24}{'Ratio':>8} Body (4.5) Large (3.0)") for name, fg, bg in pairs: r = ratio(fg, bg) print(f"{name:<24}{r:>6.2f}:1 {'pass' if r >= 4.5 else 'FAIL':<10} {'pass' if r >= 3 else 'FAIL'}")
Pair Ratio Body (4.5) Large (3.0) Black on white 21.00:1 pass pass Dark grey on white 7.00:1 pass pass Mid grey on white 2.85:1 FAIL FAIL Light grey on white 1.61:1 FAIL FAIL Soft text on dark page 12.23:1 pass pass

Notice that #999999, a grey many designers reach for because it "looks subtle", fails even the large-text threshold. And notice the dark-theme row: this course's own page colours pass comfortably. Light-on-dark text can be perfectly readable, though very bright white on pure black can shimmer for some readers, which is why many dark themes use a soft off-white (check).

Passes: 7:1

Dark grey on white reads comfortably, even in a bright room.

Fails: 2.85:1

Mid grey on white looks tidy but tires the eye, and vanishes in sunlight.

Live text with fixed colours, so you can judge the difference on your own screen.

Contrast is more than the ratio
A passing ratio does not guarantee good reading: a hairline-weight font can fail in practice even at a good ratio, and text over a photograph may change contrast from one word to the next. Never use colour alone to carry meaning (a red word with no other cue is invisible to some colour-blind readers), and test with real devices and real people where you can.

Choices That Help Readers with Dyslexia or Low Vision

People read differently, and no single setting suits everyone. Research on "dyslexia-friendly" fonts has been mixed, and claims that one special typeface fixes reading difficulty should be treated with caution (check current studies). What does have wide agreement is that a handful of ordinary choices help many readers at no cost to anyone else:

ChoiceWhy it helpsIn practice
Clear letter shapesLetters like I, l and 1, or b and d, are easily confused if the design makes them near-identicalLook at a sample of your typeface with those characters side by side
Generous spacingCrowded letters and lines blur togetherLine-height around 1.5 and a little extra word spacing for long text (check ranges)
Left-aligned, ragged-right textJustified text can open uneven "rivers" of white spacetext-align: left for body copy
Sturdy weightHairlines fade for low-vision readersRegular or medium for body text
Avoid long italic and all-caps passagesBoth slow down readingKeep them to short emphasis (Typography Fundamentals 4)
Short, plain paragraphsGives the eye regular places to restBreak long blocks up with subheads
Let the reader decide
The strongest accessibility feature is flexibility. Readers who need larger text, a different font or custom colours already set them in their browser or operating system. Your job is mostly to not get in the way: do not force pixel sizes, do not lock colours with hard-coded overrides where a preference would do, and do not disable zoom.

Size and Zoom

Typography Fundamentals 6 recommended rem for text. Here is the accessibility reason. If the reader raises their browser's default font size, rem and em values grow with it, while fixed px text may ignore the setting (check how your target browsers behave). Page zoom is the other tool: pressing Ctrl and plus should enlarge everything, up to 200% and beyond, without hiding or cutting off any content.

<!-- Good: lets readers pinch-zoom --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Bad: blocks zoom for people who need it --> <meta name="viewport" content="width=device-width, user-scalable=no, maximum-scale=1"> /* Good: scales with the reader's settings */ body { font-size: 1rem; line-height: 1.5; } small { font-size: 0.875rem; } /* still readable: not smaller than about 14px (check) */

A useful test: zoom your page to 200%, then resize the window to phone width. Does any line need sideways scrolling? Is anything overlapping? If so, a fixed-width layout is working against the reader.

Line Length on Small Screens

Typography Fundamentals 3 gave you a comfortable measure of roughly 45 to 75 characters. On a phone the screen is narrow, so lines can become too short: with large text at 200% zoom you may see only 20 or 25 characters per line, which makes the eye jump back constantly and leaves words hyphenated or broken awkwardly. The remedy is not to shrink the type but to let the column fill the width with sensible margins, and use a max-width in ch units so that on wide screens the lines do not become too long.

.article { max-width: 65ch; /* cap the measure on wide screens */ margin-inline: auto; /* centre the column */ padding-inline: 1rem; /* breathing room on phones */ hyphens: auto; /* needs a lang attribute on the page */ overflow-wrap: break-word; /* never let a long word break the layout */ }

Diacritics: The Marks Above and Below

So far the chapter has assumed readers can see your letters. The other half is making sure they can see the right letters. Many languages add marks, called diacritics, to a base letter: the acute in é, the tilde in ñ, the cedilla in ç, the double acute in the Hungarian ő. These marks change the meaning and the pronunciation, so they are not decoration: dropping them can turn one word into another.

Good typography treats a letter with a mark as a designed character, not a letter with a mark stuck on. Marks need room, which affects line-height (tall capitals with accents can collide with the line above if leading is too tight, as seen in Typography Fundamentals 3), and the mark's position should be refined for each base letter. Inside the computer, text is stored as numbered code points from the Unicode standard, and a character with a mark can be stored in two ways. This script shows both.

"""Look inside text: code points, names and normalisation. py chars.py """ import unicodedata samples = ["é", "ő", "ñ", "ß", "Ж", "ك", "あ", "한"] for ch in samples: print(f"U+{ord(ch):04X} {unicodedata.name(ch)}") print() composed = "\u00e9" # one code point decomposed = "e\u0301" # e plus a combining acute accent print("composed length: ", len(composed)) print("decomposed length:", len(decomposed)) print("same after NFC: ", unicodedata.normalize("NFC", decomposed) == composed)
U+00E9 LATIN SMALL LETTER E WITH ACUTE U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE U+00F1 LATIN SMALL LETTER N WITH TILDE U+00DF LATIN SMALL LETTER SHARP S U+0416 CYRILLIC CAPITAL LETTER ZHE U+0643 ARABIC LETTER KAF U+3042 HIRAGANA LETTER A U+D55C HANGUL SYLLABLE HAN composed length: 1 decomposed length: 2 same after NFC: True
A lesson from running this script
The first version of this script printed the characters themselves next to their code points. On the Windows console used here, the default text encoding could not display most of them and the script crashed with a UnicodeEncodeError. The fix was to print only the code point and the name. The takeaway applies to the web too: a character is only as visible as the whole chain behind it (file encoding, console or page encoding, and font) allows. On a web page, declare UTF-8 with <meta charset="utf-8"> so the browser reads the characters correctly.

Non-Latin Scripts and Why Coverage Matters

A single font file covers only the characters its designer drew. The set of characters a font includes is its coverage, and it is not the same for every font. Many popular fonts cover the basic Latin alphabet plus the accents of Western European languages, then stop. Central European languages, Greek, Cyrillic, Arabic, Hebrew, the scripts of India, and Chinese, Japanese and Korean each need their own glyphs, and each script has its own typographic traditions.

Script familyA typographic point worth knowing
Latin with diacriticsNeeds accent-aware spacing; check that a font includes the extended Latin range for languages such as Polish, Hungarian and Turkish
Cyrillic and GreekHave their own capitals, lower-case forms and italic traditions; not every Latin font includes them
Arabic and HebrewRead right to left; Arabic letters change shape depending on their position in a word, and the text flows in the opposite direction to the page's usual layout
Chinese, Japanese, KoreanThousands of characters; fonts are very large, so subsetting and web delivery need special care (check)
Indic scripts (Devanagari and others)Letters combine into joined forms, so the font and the browser together must apply the right substitutions (check specifics per script)

When a font lacks a character, the browser does not stop. It quietly borrows the character from the next font in the fallback stack, and, failing that, from another font on the system, or shows an empty box (often called "tofu"). The text is technically displayed, but with mismatched shapes and sizes in the middle of a word. This is why Typography Fundamentals 6 stressed fallback stacks and why subsetting is risky: if you strip a font down to English-only glyphs and a reader's name contains an accented letter, that one character will look wrong. This script checks coverage the way you might audit a font before choosing it.

"""Font coverage check: which characters in a text would fall back to another font? py coverage.py """ import unicodedata # A pretend font covering Basic Latin and Latin-1 Supplement (U+0020-U+00FF). FONT_RANGES = [(0x0020, 0x007E), (0x00A0, 0x00FF)] def covered(ch): return any(lo <= ord(ch) <= hi for lo, hi in FONT_RANGES) texts = { "English": "Good morning, everyone", "French": "Ça va très bien, merci", "Hungarian": "Köszönöm szépen, tűzoltó", "Polish": "Dzień dobry, zażółć gęślą jaźń", "Greek": "Καλημέρα", } for lang, text in texts.items(): missing = sorted({ch for ch in text if not covered(ch)}) if not missing: print(f"{lang:<10} OK: all {len(set(text))} distinct characters covered") else: names = ", ".join(f"U+{ord(c):04X}" for c in missing) print(f"{lang:<10} MISSING {len(missing)}: {names}") for c in missing[:2]: print(f" e.g. {unicodedata.name(c)}")
English OK: all 13 distinct characters covered French OK: all 15 distinct characters covered Hungarian MISSING 1: U+0171 e.g. LATIN SMALL LETTER U WITH DOUBLE ACUTE Polish MISSING 8: U+0105, U+0107, U+0119, U+0142, U+0144, U+015B, U+017A, U+017C e.g. LATIN SMALL LETTER A WITH OGONEK e.g. LATIN SMALL LETTER C WITH ACUTE Greek MISSING 7: U+039A, U+03AD, U+03B1, U+03B7, U+03BB, U+03BC, U+03C1 e.g. GREEK CAPITAL LETTER KAPPA e.g. GREEK SMALL LETTER EPSILON WITH TONOS

The Hungarian line is the sneaky one: the sample sentence is mostly fine, because ö and ó live in the Western European range, but ű is missing. A designer who tested a font only on French and Spanish would never notice. Always test a font with the real text of every language you serve.

Telling the Browser the Language

Browsers and assistive software need to know which language a page, or a stretch of it, is written in. The lang attribute does this, and it affects hyphenation, quotation marks, which regional variant of a character is drawn (check; some scripts share characters between languages but draw them differently) and what a screen reader pronounces.

<!-- The page language --> <html lang="en"> <!-- A passage in another language --> <p>The waiter said, <span lang="fr">Bon appétit</span>.</p> <!-- A right-to-left passage --> <p lang="ar" dir="rtl">...</p> /* CSS can then pick fonts and quotes per language */ :lang(ja) { font-family: "Example Gothic JP", sans-serif; } :lang(fr) { quotes: "«\00a0" "\00a0»"; }
Idea in this chapterAn idea you may already know
Contrast ratioA signal-to-noise ratio: how far the text stands above the background
Relative units (rem)Responsive design: values that adapt instead of being fixed
Unicode normalisationComparing strings after trimming and lower-casing them
Font coverageA library that supports only some of the locales your users need
The lang attributeA locale setting: it changes behaviour without changing the text
Common mistakes with readability and language
Pale grey body text; colour as the only signal; user-scalable=no; a pixel-locked layout that breaks at 200% zoom; justified text in narrow columns; subsetting a font until names with accents break; testing only with English; forgetting lang and charset; and assuming a "dyslexia font" replaces good spacing, sizing and contrast.

Hands-On Exercises

Three exercises: a written accessibility review of a flawed page, a code task that audits a stylesheet's colours, and a CSS task that builds a flexible, language-aware text style. Each has a solution file that opens in a new tab.

Exercise 1

A local library's event page uses light grey (#aaaaaa) 12px text on white, justified paragraphs about 120 characters wide, all-caps italic for every event description, blocks pinch-zoom with a viewport setting, and shows a red word for "sold out" with no other cue. On paper, write a review: list each problem, say who it affects and why, and give a specific fix for each (with numbers where you can). Finish by naming the three fixes you would make first and the reason for that order.

📄 View solution
Exercise 2

Write a Python script that holds a list of text and background colour pairs for a website (at least six, including headings, body text, links and a footer), calculates the WCAG contrast ratio for each, and prints a table showing the ratio, a pass/fail for body text (4.5:1) and for large text (3:1). For each failing pair, suggest a darker text colour by darkening the text step by step until it passes, and print the colour that works. Run it and show the output.

📄 View solution
Exercise 3

Write the CSS and the small HTML skeleton for a multilingual article page. Include the language declarations, a body style in rem that respects the reader's settings, a column capped in ch units that still fits a phone at 200% zoom, a fallback stack for Latin text, a different font stack for Japanese and for Arabic passages chosen with :lang(), right-to-left handling, and a prefers-reduced-motion rule. Add a comment on each part explaining its job.

📄 View solution

Chapter 7 Quick Reference

  • Contrast ratio runs from 1:1 to 21:1; aim for at least 4.5:1 for body text and 3:1 for large text (check the current guidelines)
  • Mid grey on white fails: #999999 on white measures 2.85:1; #595959 measures 7:1
  • Helpful for many readers: clear letter shapes, generous spacing, left-aligned body text, sturdy weights, short paragraphs; no single "dyslexia font" is a cure (check studies)
  • Respect the reader: size in rem, never block zoom, test at 200% and at phone width
  • Cap the measure with max-width in ch, with padding for small screens
  • Diacritics are letters, not decoration; Unicode can store them as one code point or as a base plus a combining mark, and normalisation makes them comparable
  • Coverage: a font draws only the characters it includes; missing ones fall back to another font or show as boxes; test with real text in every language you serve
  • Declare language and encoding: lang, dir and <meta charset="utf-8">
Coming next
In Chapter 8 (Typography Fundamentals 8, the final chapter) you put the whole course together: take a poor page and redesign its type step by step, using a checklist built from every chapter so far.