a typesetting engine for game text
Line breaking for the words inside a game: dialogue boxes, signs, item descriptions. Instead of filling one line at a time, it looks at the whole paragraph before deciding where each line ends, so the spaces between words come out more even. It is made for pixel fonts, and it is quick enough to re-flow the text whenever a box changes size.
Very early: it started on 2026-10-22. Its first user is the dialogue box in tunacan, our game engine, which the Grocery Harrison game in progress talks through.
Line breaking for the words inside a game: dialogue boxes, signs, item descriptions. It uses the Knuth-Plass method from TeX, which compares the possible breaks across the whole paragraph instead of filling one line at a time, so the spaces come out more even. It works on whole pixels and reads pixel fonts made in font//litho, our pixel font editor, directly.
A game can re-break a paragraph every time the box changes size. It is portable C99 that never allocates, and the same code runs in a browser, on a desktop and on the Wii.
Very early. It started on 2026-10-22, and the four milestones done so far are the engine, hyphenation, the web build and a Wii demo. Since then it has learned centred and right-aligned lines, marks a talk box can act on as it reveals the text (a pause, a reading speed, a colour), and words set in a second font. tunacan's dialogue box is the first thing built on it.
The same paragraph, justified two ways by the engine running in this tab. First fit is what an ordinary word wrap does: fill each line, then spread its spaces. Total fit picks every break together. marks a space stretched past its natural width; the darker it is, the more it was stretched. Untick hyphenate to see how much the hyphens are buying.
Re-flowing a paragraph is quick enough to do whenever the text changes: about 3% of one frame on a Wii, measured in an emulator, and 5 to 20 millionths of a second in a browser.
| Wii, in Dolphin | about 300 µs on average for building the paragraph and running total fit, 563 µs at worst: around 3% of a 60 Hz frame. That is Dolphin's emulated clock; the demo has not run on a console yet |
| V8 | about 5 µs for a short dialogue line, about 20 µs for a hyphenated paragraph. The demo above measures it again in your browser |
After Lithosphere by Texas Hold’Em Lava Dome. It has nothing to do with magmascript, even though magmascript's memory tier is called the Asthenosphere.
PolyForm Noncommercial 1.0.0 · Copyright 2026 magmacrunch media · Litho Display and Litho Mono under the SIL Open Font License 1.1
lithosphere is developed in-house and its source is not public. The compiled engine on this page is the same build the tests run against.
For source access, licensing, or anything else, email info@magmacrunch.com.