Breaking a Paragraph up, and Aligning It
A paragraph broken into lines, then laid out four ways: left, right, centred, justified.
The report of the example next door lays itself out: the engine chooses where each page breaks. Sometimes the boxes are yours to choose instead — a column beside a picture, a panel on a form, the room left under a letterhead — and the text has to go into them one after another.
Here a delivery slip is poured into a first box too short for it. The box says where it stopped, and the second box takes up from exactly there, so nothing is written twice and nothing is lost. A poster whose picture is taller than any box is refused outright rather than cut in half. Under each box a line gives the height taken and where it starts and ends: figures a program can check before it goes on.
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library.
Read the Rust source Read the Python source
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
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, cuts it at the column's edge, or cuts it and closes the line on a hyphen.
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 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 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.