Break points after a slash or a hyphen

Break only at spaces and a file path becomes one very long word. So does a hyphenated compound, and so does a part reference full of slashes — and those are exactly what a technical document is made of. A column that is comfortable for prose is far too narrow for them, and widening it to suit the worst one ruins the page for everything else.

The break keeps the character on the line it belongs to: the slash stays at the end of the upper line rather than opening the lower one. No hyphen is invented anywhere, so nothing is added to the text that was not written in it.

What this example shows

  • Break points allowed after a slash and after a hyphen.
  • The breaking character kept at the end of the line it ends.
  • Long paths wrapped without inventing a hyphen.

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

Break points after a slash or a hyphen, first page

Optimised, this document weighs 11.9 kB — at least 85 % lighter than most PDF generators would write it

The document is lighter than it was, and every page still looks exactly the same. See this document's row in the table of every example.

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.

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.

What a font knows about its own letters

Four samples set twice each, once plain and once with a single setting activated: joined letters, small capitals, figures that hang below the line, and pairs moved closer together.

Every example, by subject