Your e-reader fills each line until the next word will not fit, then breaks.
First-fit — the method typesetting abandoned when Knuth and Plass published optimal
line-breaking in 1981. Every browser does it. Every EPUB reader is a browser. A .fab
carries lines that were broken by minimising the badness of the whole paragraph, and
an optical margin CSS has no way to express.
The bench below is live: it runs both algorithms on your screen, on
word widths measured in the font you are looking at.
All this arithmetic serves one plain wish: that my books arrive the way I set them — Ginczanka's staircase still a staircase, Agustini's recto still a recto. Everything below is what that wish costs.
How to read the bench. The word gaps are shaded: the wider a gap is stretched beyond its natural width, the darker it prints. That shading is the measurement. First-fit takes the first break that fits and pays for it later — the slack it could not place piles up in one line, and your eye finds that line every time. Knuth–Plass considers every possible set of breaks and minimises the sum of the badness, so the slack is spread and no line stands out. It costs the same number of lines. It is the same arithmetic that makes a LaTeX page look like a book and a web page look like a web page.
The corpus agrees. Across the Fabylon catalogue the engine's worst non-final line went from 16.9% residual space to 10.0% — greedy to optimal — guarded by the wrap-quality gate, which fails on purpose if anything ever routes back to greedy. Your numbers, above, are computed here and now on this paragraph and this font, so they will differ. That is the point of a bench.
Line-breaking is one instrument of four. In the same pass the engine stretches glyphs on loose justified lines by up to 3% — the hz-program; inter-word stretch variance drops 19%. It hangs punctuation with protrusion factors derived from each embedded font's own ink geometry, so the optical edge tunes itself to fonts no hand-made table ever saw: edge error 2.41 pt down to 0.00. It kerns with its own GPOS reader plus an optical kern computed from the glyphs' silhouettes — six times the pair coverage of the font's own table, zero collisions. And it can spot a typographic river — word gaps lining up down the page, a defect no per-line optimiser can see — and re-break locally to drown it.
Text: from my foreword to Zuzanna Ginczanka, Over de centauren (Fabylon Klassiekers). Method: D. E. Knuth & M. F. Plass, “Breaking Paragraphs into Lines”, Software: Practice and Experience 11 (1981), 1119–1184.
An EPUB is a zip of web pages in a book costume. A .fab is a binary container: sixteen bytes of magic, two lengths, a compressed manifest, then an arena of sealed chunks — one per page, one per font, one per image. Every page chunk carries its own CRC32, so the book can tell you if a single byte of its text has been corrupted.
The manifest carries a copy of page one, so a book opens on its first page without decompressing the other twenty-three — in the lab fixture, first page on screen in 0.06 milliseconds.
And because those pages stay text rather than pictures of text, the Fabylon Reader can search the whole book and scan a poem's metre straight from the file — no companion database, nothing fetched. A per-page search index can be sealed in at export for the long books.
The compressor is handed a dictionary trained on the book itself — embedded in the file, so nothing external is ever needed — and the patterns a book repeats compress across the whole volume rather than page by page. Identical images are stored once; assets that are already compressed are kept raw when zstd would not help. A shared dictionary across books was tested in the lab and rejected: no gain.
Opening a stranger's .fab is guarded. Embedded fonts are structurally checked by Fabylon's own parser before they ever reach the system's; images are capped at 64 megapixels against decompression bombs; and a downloaded book carries its author's Ed25519 signature, verified before the file is accepted.
Below: the actual first thirty-two bytes of Over de centauren, the published edition. Open it in a hex editor; it will say the same thing.
When a book leaves Bookmaker the writer chooses. Keep it editable and it can be reopened forever — by a translator, for a second edition, at a different trim — because the file still holds the model that made the page. Lock it and you freeze the printed edition exactly, a book that will never shift again. Or keep both. Both states come out of the same pagination and the same layout plan; the difference is only what gets written down below.
Carries stanzas: the logical text with all of its typographic intent — indents, alignment, fonts, the poem's shape. Quire and Bookmaker can open it again and reset it. The Reader lays it out on open, as a spread, with the reading measure capped near 66 characters: 88–95% of lines land in the 45–80-character comfort band, where an uncapped browser manages 9–10%.
Twenty-four logical pages — one per poem. The book has not been committed to paper yet.
Carries draw_ops: baked glyph runs at absolute positions, plus the fixed_layout marker. The Reader places it; it does not recompute it. This is the printed book, in a file.
Forty-seven typeset pages. Same seven fonts, same eight images. Freezing the book costs 2% more bytes.
Because a locked .fab is that PDF — the same layout pass feeds both, and the glyphs land in the same places. The PDF twin comes from Fabylon's own writer: it draws by glyph id, so the font's real ligatures print, and a ToUnicode map leads every ligature back to its letters, so copy-paste and search survive; with the fonts subsetted for print, a real book comes to about 36 KB where the previous backend produced 244 KB. The question is what you keep besides the picture. A PDF is a frozen rendering: to get the book back out of it you reverse-engineer your own work. An editable .fab is the model that produced the rendering — blocks, tables, lists, run styling, even the citation graph, preserved at a measured segmentation score of 0.9994 — so it can be reopened and reset. And the notes you make while reading go in a sidecar next to the book, never into it; when a second edition replaces the first, the Reader re-anchors them block by block and marks any uncertain match for review. The file you were given stays the file you were given.
A format that promises to keep your book should be able to prove it. Fabylon measures fidelity with a character multiset: count every alphanumeric character in the source, count every one in the result, subtract. The metric is deliberately blind to reflow, hyphenation and ligatures — the three things that make line-by-line comparison lie.
It runs against the published books themselves — thirty-six editions in eleven languages, Amharic and Geez, Georgian, Polish among them. The languages survive because export falls back per character: a glyph the span font lacks is drawn from the first bundled font that has it, and stays extractable instead of vanishing as a .notdef box.
The scoreboard, unflattered: from source to .fab, zero characters lost, in all thirty-six editions, on every stored run. The rendered PDF is close but not yet clean — a mean residual of 0.15%, fourteen editions fully lossless, and two, the Georgian and the Amharic, still under investigation for what look like glyph-extraction artefacts in the measurement itself. Those numbers stay on the board until they read zero.
Reproduce it: Bookmaker/tools/compare_fab_vs_weasyprint.py. Most pipelines never measure themselves. This one does, on every build.
Everything above, written out properly: the algorithm, the badness function, the gates, the container, and a section on what may not be claimed. Nine pages.
It is typeset by the engine it describes. Every line break in it was chosen by the Knuth–Plass dynamic program of §2. Every hanging comma is the protrusion of §3. A paper about a typesetter, set by anything else, is an advertisement; set by its own subject it is a specimen — any failure of the engine would be visible on the page making the claim.
Built from one BookDocument: the PDF and both .fab files come out of a single layout pass. Then measured with the metric from §5 — the character multiset between the .fab and the rendered PDF:
The 88 are the folios and the running heads. The paper passes the test it proposes.
The same paper in all three states. Compare them: the PDF and the locked .fab place their glyphs identically, because they came out of the same pass.
A page that has just spent three sections measuring things owes you the measurement that does not flatter. .fab is not an open format. There is no public specification, no validator, no registered media type. Fabylon keeps a written ladder for this, and .fab is standing on the bottom rung.
The plan forbids itself the word open until a specification, a validator, a licence and ten public fixtures exist. It also forbids the size claim — the “far smaller than EPUB” numbers come from two small lab fixtures, and no corpus of a hundred titles has replicated them. So they are not on this page.
Three more things that are true today: the fonts are embedded but not subsetted; non-Latin embedding is bundled but not finished; and one reader is not an ecosystem. A format with a single implementation is a private arrangement. The way out is a public spec and a second implementation, in that order.
Your book never lives only in .fab. Every Fabylon book also exports to PDF, EPUB and Word — ordinary files that need nothing from Fabylon to open, today or in thirty years. The editable .fab holds the full model of the book, so the work itself is never trapped inside a rendering. And the decoder still reads every version of the format since the first: a FABYLON_REALM_01 file from day one opens today. Whatever happens to the format, or to me, your archive walks out in files you own.
I was chess champion of North Brabant at eleven, and the only one in the country who found the error in the national mathematics exam. I say that not as a boast but as a diagnosis: I am a poet with a mathematical eye, and the two have never agreed to separate.
There were years in software — Equest Automatisering, then my own company, Myrmex Media, founded in 2004 — and then a return to poetry, with the eye still attached. Twenty books later it is obvious why Fabylon has its own typesetting engine rather than a wrapper around someone else's: if you are going to claim your books are set properly, you must be able to produce the number.
The format was never the ambition. I wanted my books to arrive the way I set them, exactly — the wish at the top of this page. The format is just where the arithmetic had to live.
Which is also why every Fabylon book exports to EPUB and PDF as well. EPUB does have a fixed-layout mode; it is a picture-book format — absolute positions, patchy reader support, text a reader can neither resize nor search well. The day it can carry a set page and its instruments, I will drop .fab in an afternoon and be glad.
Each one on its own page, answered by reading the source.
Written by Bookmaker, read by the Fabylon Reader — both Free · Windows first, macOS and Linux to follow · beta starts October 2026. Waitlists: fabylon.net/bookmaker · fabylon.net/reader. Both are part of Fabylon.