Breaking a Paragraph up, and Aligning It
A paragraph broken into lines, then laid out four ways: left, right, centred, justified.
A shop marking its shelf down does it with a pen: a stroke across the old price, the new one written beside it, and a line over the sum at the foot so nobody reads it as one more price. On a page a program writes, those strokes have to be put there — and putting them there by hand means choosing a height for each one. Choose badly and the stroke lands across the middle of the figures on one machine and under them on the next, because the font changed and the number you wrote did not.
The card below asks for the mark by name instead. A line under the words, a line through the letters, a line over the top: for each of the three, the font itself says how far from the words its own line belongs and how thick it is, and the three follow whatever size the text is set in. The title and the red words laid across the foot carry one more trick — each is set a second time behind itself, shifted a little and in a paler grey, which is what keeps large text readable over a photograph. The pale copy under the slanted words leans with them, so it falls on the page the same way as the one under the title.
The back of the card shows the other settings that space a text. One line is set twice, the second time with six points more at every space between its words. One paragraph is set twice side by side, its lines close together and then wide apart. A smaller figure is raised above the line, the way a note is called. And the words of the mark are hollow: only the outline of each letter is traced.
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.
Read the Rust source Read the Python source Read the JSON source
Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese
A paragraph broken into lines, then laid out four ways: left, right, centred, justified.
A word longer than the column that holds it: the library leaves it whole, cuts it at the column's edge, or cuts it and closes the line on a hyphen.
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.
A justified column set four times: file paths and compounds running past the edge with no break points, wrapping where a break after a slash or a hyphen is allowed, then wherever their punctuation allows one, and last with no-break hyphens that keep each compound whole.
A title, a rule, two paragraphs, a heading, a table of twenty-six rows and a footnote, handed over in reading order and broken across two pages by the engine.
A delivery slip poured into two boxes, the second taking up where the first stopped, and a poster whose picture no box can hold, each box saying what became of the stack in it.