Badges of One Size, Names of Every Length

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 rectangle 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 page 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.

What This Example Shows

  • Every rectangle keeps its size; only the words inside it move.
  • A short name is set at the size the design chose, and only a long one comes out smaller.
  • A floor is given with the rectangle: nothing is shrunk out of sight.

The Source Code, Complete

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

The Document Itself

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

Badges of One Size, Names of Every Length, first page

The Same Document in Other Languages

This document weighs 16.5 kB

Examples Near This One

Breaking an Overlong Word

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.

Break Points After a Slash or a Hyphen

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 Stack Laid out by Hand, One Box at a Time

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.

Every example, by subject