Measuring Text
Typography Fundamentals
Course 1 ยท Chapter 3 ยท Measuring and Setting Text
In Typography Fundamentals 2 you learned to sort typefaces into families and classes. Choosing a typeface is only half the job, though: the same font can look elegant or exhausting depending on how it is set. Setting text means deciding how big the letters are, how long each line runs, how far apart the lines sit, and how tightly the letters are packed. Those four dials are what make a paragraph feel comfortable. This chapter gives you the units to measure them, the names of the dials, and sensible starting values for body text.
The Units: Points, Picas, Pixels, Ems and Rems
Type has been measured since long before screens existed, so you meet two families of units. Print units come from metal type: the point (pt) and the pica (pc), where 1 pica is 12 points. Screen units are the CSS ones: the pixel (px), and the two relative units em and rem that scale with a font size rather than being fixed.
CSS defines these so that they fit together: 1 inch is 96px, and also 72pt, so 1pt is 1.333px and 1pc is 16px (check on MDN for the precise wording). Note that a CSS "pixel" is a reference unit and not always one physical dot on the screen, because high-density displays squeeze several device dots into one CSS pixel (check). So "16px" means a consistent, readable size across devices rather than a number of dots.
| Unit | Kind | What it is relative to | Typical use |
|---|---|---|---|
| pt | Absolute | 1/72 inch (CSS: 1.333px) | Print stylesheets, word processors |
| pc | Absolute | 12pt (CSS: 16px) | Page layout, column widths in print |
| px | Absolute (reference) | The CSS reference pixel | Borders, hairlines, fine details |
| em | Relative | The font size of the element itself (and, for font-size, the parent's) | Spacing that should scale with the text |
| rem | Relative | The font size of the root element | Font sizes and layout widths that follow the user's setting |
| ch | Relative | The width of the digit 0 in the element's font | Line length (the measure) |
| % | Relative | The parent's value | Fluid widths; line-height and font-size percentages |
A small script prints the same sizes in several units, and shows the one trap with em: it compounds. If each nested element says font-size: 1.2em, every level is 20 percent bigger than its parent, so the sizes grow quickly.
A browser's default root size is 16px (check), so 1rem is 16px unless the user has changed it. That last point is the reason to prefer rem for font sizes: if a reader raises their browser's default size to 20px because their eyes tire, 1rem becomes 20px and your whole page follows. A px font size ignores that preference. Compare the two:
html { font-size: 62.5%; } so that 1rem equals 10px for easy sums. It is a popular trick, but it works against a reader who has chosen a larger default, and it makes every rem value that is not set explicitly look tiny (check). Keep the root at 100% and do the arithmetic once, in a stylesheet comment.
Dial 1: Font Size
There is no universal "right" size, because apparent size depends on the typeface. Remember the x-height from Typography Fundamentals 1: two fonts set at 16px can look quite different because one has a taller x-height and so looks bigger. Georgia and Times New Roman at the same size are a good example; Georgia looks larger. For web body text, 16px to 20px is a common comfortable range (check), and print body text is often set between 9pt and 12pt (check). Treat these as starting points, then judge by eye, at the real reading distance, on the real device.
Hamburgefonstiv: the same size on paper, a different size to the eye.
Hamburgefonstiv: the same size on paper, a different size to the eye.
Hamburgefonstiv: the same size on paper, a different size to the eye.
Dial 2: Line Length (the Measure)
The measure is the length of a line of text. If it is too long, the eye struggles to find the start of the next line after finishing one; too short, and the reader is forced to jump from line to line constantly, breaking the rhythm. A widely quoted guideline is about 45 to 75 characters per line, with around 66 as the ideal for single-column body text (check). The guideline is in characters, not pixels, because the number of pixels needed for 66 characters depends on the font and size.
The next script measures this for four fonts. It adds up the real advance widths (the hmtx table from Typography Fundamentals 2) for a sample sentence, divides by the number of characters to get the average letter width in ems, and works out how many pixels 66 characters need at 18px, and what that would be in ch units.
Read the table row by row. A letter in Times New Roman averages 0.382 em, so 66 characters need only about 453px at 18px; Georgia, with its wider letters, needs about 499px. Consolas, a monospace font with a fixed 0.550 em per character, needs 653px. The lesson: the same character count takes different pixel widths in different fonts, so a fixed pixel width is a poor way to control the measure.
One more detail from the last column: ch is the width of the digit 0, and in Georgia that digit is unusually narrow because Georgia uses old-style figures (check), which is why the Georgia row says 45 ch and not 66. In a font where 0 is about as wide as an average letter, 66ch is a good rough starting point; in Georgia the digit is narrow and so 66ch would give noticeably fewer than 66 characters. This is another case where you should test with real text.
max-width rather than width matters: on a phone the column simply fills the screen, and the line length falls to whatever fits (often around 35 to 45 characters, which is acceptable (check)). We return to small screens in Typography Fundamentals 7.
Dial 3: Leading (Line-Height)
Leading (pronounced "ledding") is the vertical distance from one baseline to the next. The name comes from the strips of lead that compositors placed between lines of metal type (check). In CSS it is the line-height property. The distance is not the gap between lines but the whole step, so a 16px font with line-height: 1.5 advances 24px per line; the extra 8px is split above and below each line.
| line-height | 16px text steps by | Feel | Where it fits |
|---|---|---|---|
| 1.0 to 1.2 | 16 to 19px | Tight, compact | Large headings, short labels |
| 1.4 to 1.6 | 22 to 26px | Comfortable | Body paragraphs |
| 1.8 and up | 29px and up | Loose, airy | Large pull-quotes; can make a paragraph fall apart |
Two rules of thumb help. First, longer lines need more leading, because the eye has further to travel back to the next line start. Second, bigger type needs less, because the gaps grow in proportion with the letters. A heading at 40px with 1.5 looks detached; at 1.15 it holds together.
line-height: 1.5, not 1.5em or 150%. A unitless value is inherited as a multiplier, so a child element with a different font size calculates its own line height. An em or percentage value is computed once on the parent and inherited as a fixed length, which can squash larger child text (check).
Does changing these dials really change the shape of a page? Here is a script that wraps a paragraph with real Georgia glyph widths, using a simple greedy rule (put each word on the current line if it fits, otherwise start a new line), and reports how many lines and how much height results for five different settings.
Compare the rows. Going from line-height 1.2 to 1.5 on the same 640px measure leaves the paragraph at four lines but grows its height from 77px to 96px. Narrowing the measure from 640px to 280px at the same 16px size turns four lines into eight, and the paragraph doubles in height (96px to 192px), with only 33 characters per line, below the guideline. The last row, bigger text at 20px, shows how size, measure and leading are linked: raising one changes how much room the others need. You will rarely change just one dial.
Dial 4: Tracking and Kerning
The last two dials work on the horizontal space between letters, and they are often confused.
| Tracking (letter-spacing) | Kerning | |
|---|---|---|
| What it changes | The space between all letters in a run of text, evenly | The space between one specific pair of letters |
| Who sets it | You, in the stylesheet | The font designer, stored in the font file; the browser applies it |
| CSS | letter-spacing | font-kerning (and font-feature-settings: "kern") |
| Example pairs | Not applicable: it affects everything | AV, To, Te, LT (the shapes leave a hole that looks like extra space) |
Compare a few settings on live text. Notice how pairs such as "AV" and "To" fit together when kerning is on, and how the headline in capitals reads better with a little added tracking:
AVATAR Toy
AVATAR Toy
Quiet Harbour
Guidelines that hold up well: keep kerning on and leave it alone; use no tracking change on lowercase body text; add a little tracking (around 0.05em to 0.15em (check)) to all-capitals and to very small text; and avoid negative tracking on small text because the letters begin to touch. Specify tracking in em so it scales with the size. Never track out lowercase text to make it "look designed": it breaks the word shapes that readers recognise (check).
Does your font even have kerning data? A font file can hold kerning in the older kern table or, more commonly now, as a kern feature inside the GPOS table. This script checks four installed fonts.
Times New Roman and Arial carry both; Georgia keeps its kerning only as a GPOS feature; and Consolas has none at all. That is sensible: in a monospace font every letter sits in an identical box, so there is nothing to adjust between pairs. It also shows kerning is a property of the font, not something the page adds. (The feature list also includes cpsp, capital spacing, which tells the browser it may add space automatically around capitals (check).)
Putting the Dials Together: A Body-Text Recipe
Here is a sensible starting stylesheet for a column of body text that applies everything so far. It is a starting point: change one value at a time and look.
Hands-On Exercises
Three exercises: a code task that judges text settings, a written design task that diagnoses three problem paragraphs, and a CSS task that builds a complete text style. Each has a solution file that opens in a new tab.
Write a script that takes a paragraph and a list of text settings (font, size in px, measure in px, line-height multiplier), wraps the paragraph with real glyph widths from Windows fonts (as the wrapping script above does), and prints for each setting the number of lines, the average characters per line, and a verdict: is the line length within 40 to 80 characters on average, and is the line-height between 1.3 and 1.8? Try it on three settings: one too wide and tight, one balanced, one too narrow and loose.
๐ View solutionDiagnose three paragraphs, and say which dial to turn and in which direction. (a) A news article set at 14px across a 1100px column with line-height: 1.1; readers lose their place at the end of each line. (b) A museum caption set at 22px in a narrow 200px column with line-height: 2, so each line holds only a few words. (c) A heading in capitals, 12px, with letter-spacing: -0.05em, on a leaflet; the letters seem to collide. Also convert two sizes by hand: 9pt to px, and 1.25rem to px with the default root.
Write a stylesheet for a long-form article page. Use rem for font sizes, a measure in ch with max-width, a unitless line-height for body text and a tighter one for headings, a small-capitals label with added tracking, and kerning left on. Add a comment beside each line that says which of the four dials it controls and why you chose that value. Then add a media query that raises the body font size a little on very wide screens and say in a comment what else must change with it.
Chapter 3 Quick Reference
- Units: 1in = 96px = 72pt; 1pc = 12pt = 16px;
emis relative to the element's font size,remto the root,chto the width of the digit 0 - Font sizes in
remso they follow the reader's browser setting;emcompounds when nested - Size: apparent size depends on x-height; roughly 16 to 20px for web body text (check)
- Measure: aim for about 45 to 75 characters per line (about 66 ideal (check)); control it with
max-widthinch, and test with real text - Leading:
line-heightas a unitless number; about 1.4 to 1.6 for body, 1.0 to 1.2 for big headings; longer lines need more - Tracking (
letter-spacing) changes all letters evenly: none for lowercase body text, a little for capitals and small text - Kerning adjusts specific pairs and lives in the font file: leave it on
- The dials are linked: change one at a time and look again