Skip to content
API

Live demos

fleuron claims a book paginates in hundreds of milliseconds, and that the preview matches the export. You can check both on your own machine, so check them here.

Everything below runs the real engine, compiled to WebAssembly, in a worker. The worker owns the module and never touches an element. The page owns the DOM and never sees the engine. What crosses between them is a display structure, and the SVG on screen is painted from it.

The playground

A chapter of Pride and Prejudice and the stylesheet that sets it. Change either and the book is laid out again, a fifth of a second after you stop typing. You can close the stylesheet editor from the settings. What you end up with is in the URL, so a question about the CSS subset can be a link.

CHAPTER IThe Plan of the Parliament of Erln their ruddy jackets of leather that reached to their knees theImen of Erl appeared before their lord, the stately white-hairedman in his long red room. He leaned in his carven chair andheard their spokesman.And thus their spokesman said."For seven hundred years the chiefs of your race have ruled uswell; and their deeds are remembered by the minor minstrels, livingon yet in their little tinkling songs. And yet the generations streamaway, and there is no new thing.""What would you?" said the lord."We would be ruled by a magic lord," they said.
page 1

The bench

Pride and Prejudice entire, fetched and laid out here. Each row says which stages the engine ran for it, taken from the engine's own counters, so you can tell a reused stage from one that ran. The machine is named, because a timing without one tells you nothing.

Diagnostics

A declaration outside the subset is reported at the line and column it was written at, and the book lays out anyway. Take one out, or put a new one in, and watch the report change.

Fetching the engine.

What this costs

The module weighs about 3.7 MB over the wire. It ships its own text face, its own hyphenation patterns and its own segmentation data, since the engine reads no files and asks its host for nothing. Nothing fetches it until a demo scrolls into view, and a page with no demo on it never does. If the browser reports a metered connection, you are asked first.