Breaking a paragraph up, and aligning it
A paragraph broken into lines, then laid out four ways: left, right, centred, justified.
You have already paid for this. A font file carries far more than one glyph per letter, and most of it is never used: the shapes that only come out when two particular letters meet, the figures cut to sit among small letters, the small capitals that are not simply capitals made smaller. A document that ignores all of it reads like something typed rather than something set.
Four of them are set twice on the page below, plain and then activated, and each one has its own moment. Joined letters are for ordinary reading text: they clear the collision where an f runs into an i, and you want them everywhere except where each letter has to be counted on its own. Small capitals are for a name or a set of initials inside a sentence — capitals at full height shout, small ones say the same thing at the pitch of the words around them. Figures that rise and fall belong in a paragraph, where they read as part of the sentence; figures that all stand the same height belong in a column, where they have to line up. And closing up the pairs that sit badly together tells most at large sizes: a title, or a name across a cover, where a gap shows from the other side of the room. Each is activated only when it is asked for, so a document written before any of this existed comes out exactly as it always did.
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
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, or cuts it at the column's edge.
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 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.
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.
One line of statuses set twice: in a company font alone, where the characters it has no glyph for come out as empty boxes, then with a second font behind it that draws them.