Articles

Words, beautifully composed

What makes long-form body text look calm on the page, and how to proof a book-style PDF before you print it.

By Palatine · Published · Updated

The text block comes first

Imagine you are turning a manuscript into a printed-size PDF. Before any fine typography, three numbers decide whether the page is comfortable to read: the type size, the line length and the line spacing. Get them wrong and no line breaking algorithm will save the page.

For a book set in a serif face, 10 to 12 points is the usual range. A line of 60 to 70 characters, spaces included, lets the eye find the start of the next line without effort; much longer and readers lose their place, much shorter and justified lines fill with gaps. Line spacing around 1.3 to 1.45 times the type size suits most text faces. Set the line length with the page margins or a max-width in em, so it follows the type size if you change it.

body {
  font: 11pt/1.4 "Body", serif;
}

p {
  margin: 0;
  text-align: justify;
}

/* Book convention: indent new paragraphs, not the first after a heading */
p + p { text-indent: 1.5em; }

Choose either a first-line indent or space between paragraphs, not both. Books use the indent, which keeps the text block solid; reports and manuals often use space. Load the font yourself and check that it has a real italic and bold: a synthetic bold or italic still renders, but it looks heavier and cruder than a designed one, and Palatine has to embed it in the PDF as outlines rather than as a compact font subset.

Paragraphs that look even

Body text is set justified, as in most books. With justified text, the way lines are broken decides whether a page looks calm or full of gaps. A simple line-by-line approach fills each line as it goes, and sometimes leaves one stretched line next to a tight one.

Palatine offers Knuth–Plass paragraph composition, but it is opt-in. It considers the whole paragraph at once and picks the set of breaks with the least overall strain. Turn it on for long-form body text and compare the result with the default on a few real pages. The Knuth–Plass article shows the difference side by side.

options: {
  pagination: true,
  typography: {
    justification: {
      algorithm: "knuth-plass",
      opticalMargins: true,
      // a last line at least a fifth of the measure, when it costs little
      lastLine: { minFill: 0.2, penalty: 500 }
    },
    hyphenation: { minWordLength: 7, maxConsecutive: 2 }
  }
}

Paragraphs the composer does not handle, such as right-to-left or vertical text, fall back to the line-by-line breaker instead of losing content. Do not assume it suits every element; judge captions and narrow columns separately.

Hyphenation

Hyphenation helps justified text, especially in narrow columns, because it gives the line breaker more places to break. Palatine’s automatic hyphenation currently covers ASCII English words with lang="en" or "en-US" and hyphens: auto. Other languages need manual break opportunities: a soft hyphen, ­, marks a place where a word may break and stays invisible otherwise.

<html lang="en">
  <style>p { hyphens: auto; }</style>
  ...
  <p lang="fr">Une phrase anti&shy;constitution&shy;nelle&shy;ment longue.</p>

The hyphenation options set how short a word may be and still break, how many letters must stay before and after the hyphen, and how many hyphenated lines may follow each other. Two in a row is a common house rule; a ladder of four hyphens down the right edge is the classic sign of a careless book. Check long words in your actual content before trusting a template: names, technical terms and URLs are where hyphenation goes wrong.

Optical margins

Optical margin alignment is the detail readers feel without noticing. A quote mark, a comma or a hyphen at the edge of a line is lighter than a letter, so a straight column of text looks dented wherever one sits at the edge. Hanging that punctuation slightly into the margin makes the edge look straight to the eye, even though it no longer is.

In Palatine this is opticalMargins: true, which needs Knuth–Plass: punctuation at either edge of a justified line protrudes by half its width. Try it on a page of dialogue, with several lines that start with a quote mark, and compare the left edge with and without it.

Headings, widows and orphans

A widow or orphan is a lone line stranded at the top or bottom of a page. One line of a paragraph on its own looks like a mistake. Set your widow and orphan limits to at least two lines, and keep headings with the text they introduce:

p { widows: 2; orphans: 2; }
h1, h2, h3 { break-after: avoid; }
h1 { break-before: right; }   /* chapters open on a right-hand page */

These rules cost something: a paragraph that moves to the next page leaves a short page behind. A page that ends a line or two early is accepted in book typesetting; a page that ends half empty is not, and usually means a figure or a block marked break-inside: avoid is too tall to move.

A proofing routine

Then proof like a reader. Pick ten pages at random, plus the first page of each chapter, and read the edges: line ends, page ends, heading positions. Look for:

  • loose lines, where the spaces between words open into holes, and rivers of white running down several lines;
  • more than two hyphens in a row, and hyphenated words split across a page turn;
  • a last line of a paragraph holding a single short word;
  • a heading at the foot of a page, and a chapter opening with only a few lines on it.

Include a long chapter title and a page with a footnote. Typography problems cluster around unusual content, so that is where your test pages should come from. Print a few pages at actual size, too: a page that looks fine zoomed to fit the screen can feel cramped or loose on paper.

Explore the rendering documentation


All articles