Why Type Matters

Typography Fundamentals ๐Ÿ†

Course 1 ยท Chapter 1 ยท Text as a Designed Object

You read thousands of words a day: messages, signs, menus, packaging, web pages. Almost none of it was left to chance. Somebody chose the shape of the letters, how big they are, how far apart the lines sit and how wide the column is, and those choices decide whether you read the thing happily, struggle through it, or skip it. That craft is called typography. The word comes from Greek roots meaning "impression" and "writing" (check), a leftover from the days when letters were pressed into paper from metal blocks.

This course is for the curious beginner. You do not need design experience. Because you are also a web-development student, we will keep tying ideas back to CSS, but the ideas belong to paper and signs as much as to screens. This first chapter does three things: it shows that text is designed, it teaches the vocabulary for talking about a single letter, and it peeks inside a letter to see what a font really contains.

What was run, and what was not
The two Python scripts in this chapter were run on Windows with Python 3.14.0 and fontTools 4.63.0, reading the fonts that come with Windows (Times New Roman, Georgia, Arial, Consolas). The output shown is exactly what they printed. Your numbers can differ if your copies of those fonts are different versions. The CSS snippets and the live samples were not measured in several browsers: how a given browser draws them is the thing to check on your own screen.

Text Is Designed, Even When You Do Not Notice

Here is the same sentence set three ways. Nothing about the words changes. Everything about how it feels does.

A: a notice on a shop door

Closed for stocktaking. We will open again on Monday.

Serif letters, comfortable size, calm.

B: a warning sign

Closed for stocktaking. We will open again on Monday.

Heavy, capitals, tight lines: it shouts.

C: a terminal window

Closed for stocktaking. We will open again on Monday.

Every letter the same width: it sounds technical.

The point is that type carries a voice before anyone has read a word. A reader decides in an instant whether a page looks trustworthy, friendly, urgent or boring, and typography is a large part of that. It is also a practical craft: the right choices simply make text easier on the eyes.

Reading Versus Looking

There are two jobs text can do, and good designers know which one they are asking of it.

Looking (display)Reading (text)
ExamplesA shop sign, a poster headline, a logo, a book title on the coverA novel's pages, a news article, a manual, a long web page
What the reader doesTakes it in at a glance, from a distance, in a second or twoSettles in and moves along line after line, for minutes or hours
What it needsPersonality, impact, a shape you rememberEvenness, comfort, letters that disappear so the meaning shows through
Typical choicesLarge sizes, heavy or unusual shapes, tight spacingModerate sizes, regular weights, generous spacing, a sensible line length
CSS you would reach forBig font-size, font-weight: 800, a display fontline-height: 1.5, a limited max-width, a plain body font

Two words are worth separating now, because they get mixed up. Legibility is whether individual letters can be told apart (is that an l, a capital I or a 1?). Readability is how comfortable a whole stretch of text is to read: the size, spacing, line length and contrast working together. A letter-perfect font can still give unreadable text if the lines are far too long. Later chapters, especially Typography Fundamentals 3 and Typography Fundamentals 7, take both seriously.

Common mistake
Choosing a typeface because it looks interesting in a big heading, then using it for a whole page of body text. Display letters are built to be looked at, not read for ten minutes. If the text is long, pick something plain and let the layout do the talking.

The Vocabulary of a Letter

To talk about type you need names for its parts, the same way you need names for the parts of a bicycle before you can say what is wrong with it. Almost every term comes from a set of invisible horizontal lines that letters are built against.

ascender line cap height x-height baseline descender line serif stem crossbar counter bowl

A schematic: the letters are drawn as simple strokes so that the lines line up exactly, not copied from any real font.

TermWhat it isWhere you meet it
BaselineThe invisible line most letters sit on, like writing on ruled paperMixing sizes on a line: vertical-align: baseline and aligning text across columns
x-heightThe height of a plain lowercase letter such as x, measured from the baselineThe reason two fonts at the same font-size look different sizes; CSS even has an ex unit based on it
Cap heightThe height of a capital letter such as H, measured from the baselineHow tall capitals look next to lowercase; CSS has a cap unit (browser support: check)
AscenderThe part of a letter that rises above the x-height: the stem of d, b, h, lOften a little taller than the capitals, though not in every font
DescenderThe part that drops below the baseline: p, g, y, qThe reason lines of text need some room between them: descenders must not hit the ascenders below
CounterThe enclosed or partly enclosed empty space inside a letter: the hole in o, d, pOpen, generous counters keep small text legible; tiny closed ones fill in
BowlThe curved stroke that makes a counterThe round part of p, d, b
StemThe main upright stroke of a letterThe vertical of H, l, p
CrossbarA horizontal stroke linking two othersThe bar of H, A, e, t
SerifA small finishing stroke at the end of a main strokeThe reason for the words "serif" and "sans-serif" (sans is French for "without")
StrokeAny line that makes up a letter; its thickness is the stroke weightfont-weight is a request for thicker or thinner strokes

A quick test of whether the vocabulary has stuck: find the letters in this sentence that have a descender, and the letters that have an ascender. (Descenders: the g, y, p and q kind. Ascenders: b, d, f, h, k, l. The dot of i and j counts for neither.) You will never read a page the same way again.

Why x-height matters most
Most letters in any line of text are lowercase, so your eye judges "how big is this text?" mostly by the x-height, not by the capitals or the em. That is the key idea behind the next section: font-size does not directly tell you how big the letters look.

Measure It: Same Size, Different Letters

A font file stores these measurements. The script below opens four fonts that ship with Windows and prints their x-height and cap height, as a fraction of the em (the font's own unit of size: when you ask for font-size: 16px you are really asking for an em of 16px). It uses the free fontTools package (py -m pip install fonttools).

"""Read the vertical measurements of a few installed fonts and compare them. py font_metrics.py """ from pathlib import Path from fontTools.ttLib import TTFont FONTS = { "Times New Roman": "times.ttf", "Georgia": "georgia.ttf", "Arial": "arial.ttf", "Consolas": "consola.ttf", } FONT_DIR = Path("C:/Windows/Fonts") print(f"{'font':<16}{'units/em':>9}{'x-height':>10}{'cap':>6}{'x/em':>7}{'cap/em':>8}") for name, filename in FONTS.items(): font = TTFont(FONT_DIR / filename) em = font["head"].unitsPerEm os2 = font["OS/2"] x_height, cap_height = os2.sxHeight, os2.sCapHeight print(f"{name:<16}{em:>9}{x_height:>10}{cap_height:>6}{x_height / em:>7.3f}{cap_height / em:>8.3f}")
font units/em x-height cap x/em cap/em Times New Roman 2048 916 1356 0.447 0.662 Georgia 2048 986 1419 0.481 0.693 Arial 2048 1062 1467 0.519 0.716 Consolas 2048 1004 1307 0.490 0.638

Read the x/em column. At the same font size, Arial's lowercase letters are about 16% taller than Times New Roman's (0.519 against 0.447). Same "16px", noticeably different letters. This is the single most common reason a font swap makes a page look suddenly bigger or smaller, and why a design that uses two fonts side by side often has to nudge one of their sizes. (Exercise 3 does the sum for you.)

You can see the effect live. These two lines are both set at exactly the same size:

Times New Roman, 22px

Handsome sphinx of black quartz

Arial, 22px

Handsome sphinx of black quartz

On a machine without those fonts the browser substitutes others and the difference may shrink or vanish: that is a lesson in itself (Typography Fundamentals 6 returns to fallbacks).

A First Look Inside a Glyph

A single letter as drawn in a font is called a glyph. A character is the idea ("the lowercase letter a"); a glyph is one particular picture of it, and one font can hold several glyphs for the same character (an italic and a regular a look different). A font is a collection of glyphs plus the measurements and rules that go with them; a typeface is the design as a whole, which can come in many fonts (regular, bold, italic). You will see the typeface/font distinction used loosely everywhere, including on this site.

Inside a modern font, a glyph is not a picture of pixels. It is an outline: a closed loop (or several) made of points joined by straight lines and smooth curves, drawn inside an invisible box called the em square. Because it is a set of instructions rather than a bitmap, the same glyph can be scaled to a tiny footnote or a billboard without going blocky. The em square is a grid of "font units" (2048 per em in the fonts above; fonts in the other common style use 1000 (check)), so the x-height of 1062 for Arial really means "1062 units up from the baseline, out of 2048".

Each loop is a contour. A letter like l needs one; a letter like o needs two: an outer loop and an inner loop for the counter. Curves are drawn with control points, which sit off the outline and pull it into a curve, as a magnet would. Let us count them for four letters:

"""Look inside the outline of a few letters of one font: how many contours, how many points? py glyph_outline.py """ from pathlib import Path from fontTools.ttLib import TTFont font = TTFont(Path("C:/Windows/Fonts/arial.ttf")) cmap = font.getBestCmap() glyf = font["glyf"] print("Arial, units per em:", font["head"].unitsPerEm) print(f"{'letter':<8}{'contours':>9}{'points':>8}{'off-curve':>11}") for letter in "lHog": glyph = glyf[cmap[ord(letter)]] coords, end_pts, flags = glyph.getCoordinates(glyf) off_curve = sum(1 for f in flags if not f & 1) print(f"{letter:<8}{glyph.numberOfContours:>9}{len(coords):>8}{off_curve:>11}")
Arial, units per em: 2048 letter contours points off-curve l 1 4 0 H 1 12 0 o 2 26 17 g 2 43 25

Read it as a story. The l is a plain rectangle: one contour, four corner points, no curves. The H is one contour too (the outline wraps around the whole letter shape) with twelve corners and still no curves. The o has two contours, the outer edge and the counter, and most of its 26 points (17) are off-curve control points: curves cost points. Arial's g also has two contours (its outer shape and the counter of its bowl) and is the most complicated of the four with 43 points. Counting points is a crude measure of drawing effort, but it shows that "simple" letters are not all equally simple.

What this tells you
The off-curve points are the ones this particular file uses for TrueType-style curves (quadratic curves). Another common outline format uses cubic curves with different control-point rules, so the same letter can have a different point count in another font file even if it looks identical. The measurements, the contours and the counters are the concepts to keep; the exact numbers belong to one file.

Print and Screen: The Same Ideas, Different Names

IdeaIn printIn CSS
Size of the em"Point size" (a point is 1/72 of an inch, in the common computer definition (check))font-size: px, rem, em, pt
Strokes thicker or thinnerChoosing a bold or light fontfont-weight
Space between linesLeadingline-height
Which design to useChoosing a typefacefont-family
How wide a column isMeasure (line length)max-width on the text container

The CSS side of a few of these, in miniature:

/* A readable body-text starting point. Each value is explained in later chapters. */ body { font-family: Georgia, "Times New Roman", serif; font-size: 1.125rem; line-height: 1.5; max-width: 40rem; } /* A display heading: looked at, not read. */ h1 { font-family: Arial, Helvetica, sans-serif; font-size: 2.5rem; font-weight: 800; line-height: 1.1; }

Notice the two jobs from earlier at work: the body asks for comfort (a moderate size, generous line-height, a limited width) while the heading asks for impact (large, heavy, tight). Those numbers are starting points, not rules. Typography Fundamentals 3 explains how to choose them properly.

Hands-On Exercises

Three exercises: a code task, a look-around-you design task, and a CSS task that connects them. Each has a solution file that opens in a new tab.

Exercise 1

Extend font_metrics.py to cover seven fonts (add Verdana, Calibri and Courier New) and rank all of them by x-height as a fraction of the em, largest first. Before you run it, predict which font will have the largest x-height and which the smallest.

๐Ÿ“„ View solution
Exercise 2

Pick one printed object near you (a packet, a bus timetable, a book cover). List each separate piece of text on it, say for each whether it is meant to be read or looked at, and name what the designer did to make that so. Use at least three terms from the vocabulary table.

๐Ÿ“„ View solution
Exercise 3

Make a small HTML page that shows the same sentence in Georgia and Arial at 18px. Using the x-height numbers from this chapter, work out what size Georgia needs to be to match Arial's lowercase height, and add a third line at that size. Then look up font-size-adjust as a way to let the browser do it.

๐Ÿ“„ View solution

Chapter 1 Quick Reference

  • Type has a voice before it is read: the same words set three ways say three different things
  • Looking versus reading: display text is built for impact at a glance; body text for comfort over time
  • Legibility = letters can be told apart; readability = a stretch of text is comfortable to read
  • The lines: baseline, x-height, cap height, ascender line, descender line
  • The parts: stem, bowl, counter, crossbar, serif, stroke, ascender, descender
  • x-height decides how big text looks: at the same font-size Arial's lowercase is about 16% taller than Times New Roman's (0.519 against 0.447 of the em)
  • A glyph is an outline of contours (loops) in an em square; counters are inner contours, and curves use off-curve control points