April 6, 2026
When fonts go 3D, comments go 4D
Show HN: TTF-DOOM – A raycaster running inside TrueType font hinting
A tiny font plays 3D DOOM and the comments explode
TLDR: A tiny TrueType font draws a 3D maze by abusing font hinting, while JavaScript handles gameplay. The community is torn between awe at the tiny tech flex, bug reports of “green bars,” and a spicy debate correcting that classic DOOM wasn’t a raycaster—proving even fonts aren’t safe from pedants.
A font that renders a 3D maze? Hacker News lost its mind over TTF‑DOOM, a 6.5KB experiment that uses the tiny instructions inside a TrueType font (the thing that makes letters crisp) to draw a faux 3D scene. The dev swears the font is only the renderer; JavaScript moves the player and overlays enemies, but the walls are drawn by the font itself. Wild.
The crowd split fast. One camp is dazzled by the hacker wizardry: dividing before multiplying to dodge a weird font-math quirk, faking loops with recursive calls, then squeezing it all into a micro‑font. Emanuele‑em cheered the “DIV-before-MUL” hack and demanded: what’s the frame rate? Another camp hit bugs: tombert reports the demo is just static green bars in Brave and Chrome, even while enemies and the minimap behave—cue theories about Chrome’s glyph caching. The project notes it had to add per‑frame “jitter” to force re‑hinting, so cross‑browser gremlins feel very real.
Then came the pedantry cage match: Is DOOM even a raycaster? Tadfisher insists actual DOOM used different tech, quipping that “maybe your LLM wrote that.” The rest? Shrugging and memeing: “Next up: Skyrim in a PDF,” “I live in fear of my system fonts,” and “Helvetica Eternal.” Want to try? It’s on GitHub.
Key Points
- •TTF-DOOM embeds a 3D raycasting renderer in a TrueType font’s hinting VM, fitting the engine into 6,580 bytes.
- •It transforms a glyph into 16 vertical bar contours and uses SCFS to reposition bar heights based on raycast results to render a 3D view.
- •JavaScript supplies player position/angle via font-variation settings and handles game state; the font acts as a pure renderer.
- •Technical constraints were addressed with workarounds: pre-scaling for MUL truncation, recursion for loops (limited by FreeType), hit-flags for early exit, axis jitter for Chrome caching, and MPPEM for coordinate conversion.
- •Specs include 16 columns, up to 14 ray steps, a 67° FOV, a 16×16 map, 13 FDEF functions, and 795 storage slots; debug tools visualize variation axes, contours, and rays.