Prices crossed out, a shadow behind the title

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.

What this example shows

  • An old price crossed out, standing beside the new one.
  • A sum with a line over the top, the way a total is added up.
  • A title and a slanted mark, each set a second time behind itself.

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

Examples near this one

Breaking an overlong word

A word longer than the column that holds it: the library leaves it whole, or cuts it at the column's edge.

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.

A font behind the font

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.

Every example, by subject