Text poured into columns

One long passage poured into three columns, each fitting the lines its height allows and handing the rest to the next.

One passage, three columns, and text that carries on from the foot of each into the head of the next. The passage is broken once to the column width, then set column by column: each column fits as many lines as its height allows, draws that slice, and the next one takes up where it stopped.

Breaking once and filling many times is what makes this cheap. The long work — measuring every word in the font — happens once for the whole passage, and each column then costs no more than a place in the lines already broken. A thin line surrounds each column, so the text can be seen reaching its foot and carrying on.

What this example shows

  • Text flowing from one column into the next, in order.
  • One breaking pass, shared by every column of the same width.
  • Each column taking exactly the lines its own height allows.

The code, in full

The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.

The document itself

The same document is written in each of these languages. Open the one you want to look at.

Open the document in English Open the document in French

Read the Rust source Read the Python source

First page of Text poured into columns

What this document weighs

Before 109,635 bytes
Now 38,993 bytes
Saved 64.4 %

Not one mark on the page changed. See every document measured.

Examples near this one

Soft hyphens and no-break spaces

A justified column set twice: the long words breaking at their soft hyphens with a hyphen shown, or left whole, and a figure a no-break space keeps together.

Break points after a slash or a hyphen

A justified column set twice: file paths and compounds running past the edge with no break points, then wrapping where a break after a slash or a hyphen is allowed.

Every example, by subject