Breaking a paragraph up, and aligning it
A paragraph broken into lines, set four ways: left, right, centred, justified.
A conference orders its badges weeks before it knows who is coming. The card is one size, and the guest list is not: two short words for one visitor, a double-barrelled surname and a middle name for the next. Pick a size that suits the longest name and the short ones sit lost in the middle of their cards; pick one that suits the short names and the long ones walk off the edge. The evening before the doors open, somebody is shortening names by hand.
Here the card decides. Each name is handed the exact box it has to live in and asked what size it fits at, on both counts at once: no line reaching past the sides, and the whole name ending above the bottom. The sizes come down a quarter of a point at a time and stop at the first one that holds, so a short name keeps the size the design chose and only a long one comes out smaller. The sheet prints under each badge the size it arrived at, and the last panel shows the one case worth knowing about: a luggage tag far too small for the name it carries, where a floor stops the shrinking and the printer decides what to do next.
Whole programs, hundreds of lines long, for whoever writes your software.
Read the Rust source Read the Python source
A paragraph broken into lines, set four ways: left, right, centred, justified.
A word too wide for its column: left whole, or cut to the 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 marks it has no glyph for come out as empty boxes, then with a second font behind it that draws them.