Nicheloom

Market intelligence for builders — see what's gaining traction before it's crowded.

I built a zero-browser, pure-JS typesetting engine for bit-perfect PDFs

Details

External ID
47206082
Source
HN
Company
—
Product
I built a zero-browser, pure-JS typesetting engine for bit-perfect PDFs
Website domain
github.com
Launched
March 1, 2026
Cohort
—
Upvotes
78
Upvotes percentile
0.8819188191881919
Tags
—
Fetched at
Sept. 7, 2026, 9:26 p.m.
Updated at
Sept. 7, 2026, 9:26 p.m.

Description

Hi HN, I'm a film director by trade, and I prefer writing my stories in plain text rather than using clunky screenplay software. Standard markup like Fountain doesn't work for me because I write in mixed languages, so I use Markdown with a custom syntax I invented to resemble standard screenplay structures.This workflow is great until I need to actually generate an industry-standard screenplay PDF. I got tired of manually copying and pasting my text back into the clunky software just to export it, so I decided to write a script to automate the process. That's when I hit a wall.I tried using React-pdf and other high-level libraries, but they failed me on two fronts: true multilingual text shaping, and complex contextual pagination. Specifically, the strict screenplay requirement to automatically inject (MORE) at the bottom of a page and (CONT'D) at the top of the next page when a character's dialogue is split across a page break.You can't really do that elegantly when the layout engine is a black box. So, I bypassed them and built my own typesetting engine from scratch.VMPrint is a deterministic, zero-browser layout VM written in pure TypeScript. It abandons the DOM entirely. It loads OpenType fonts, runs grapheme-accurate text segmentation (Intl.Segmenter), calculates interval-arithmetic spatial boundaries for text wrapping, and outputs a flat array of absolute coordinates.Some stats:Zero dependencies on Node.js APIs or the DOM (runs in Cloudflare Workers, Lambda, browser).88 KiB core packed.Performance: On a Snapdragon Elite ARM chip, the engine's "God Fixture" (8 pages of mixed CJK, Arabic RTL, drop caps, and multi-page spanning tables) completes layout and rendering in ~28ms.The repo also includes draft2final, the CLI tool I built to convert Markdown into publication-grade PDFs (including the screenplay flavor) using this engine.This is my first open-source launch. The manuscript is still waiting, but the engine shipped instead. I’d love to hear your thoughts, answer any questions about the math or the architecture, and see if anyone else finds this useful!--- A note on AI usage: To be fully transparent about how this was built, I engineered the core concept (an all-flat, morphable box-based system inspired by game engines, applied to page layouts), the interval-arithmetic math, the grapheme segmentation, and the layout logic entirely by hand. I did use AI as a coding assistant at the functional level, but the overall software architecture, component structures, and APIs were meticulously designed by me.For a little background: I’ve been a professional systems engineer since 1992. I’ve worked as a senior system architect for several Fortune 500 companies and currently serve as Chief Scientist at a major telecom infrastructure provider. I also created one of the world's first real-time video encoding technologies for low-power mobile phones (in the pre-smartphone era). I'm no stranger to deep tech, and a deterministic layout VM is exactly the kind of strict, math-heavy system that simply cannot be effectively constructed with a few lines of AI prompts.

Enrichment

Theme
document processing and generation tools
Vertical
Horizontal
Function
Dev tools
Audience
Developer
AI stance
Not AI
Project type
Hobby / open-source project
Normalized one-liner
javascript typesetting engine for pdfs
Manually corrected
False

Could you build this?

No Creating a bit-perfect pure-JS typesetting engine requires deeply specialized domain knowledge of OpenType font parsing, Knuth-Plass line breaking, glyph layout/kerning, and raw binary PDF serialization without headless browser dependencies.

What it would actually take: Such an engine requires writing a custom typography pipeline from scratch: an OpenType parser to extract glyph outlines and kerning metrics, a multi-pass layout engine executing the Knuth-Plass paragraph breaking algorithm, and a low-level PDF generator emitting raw PostScript/PDF binary syntax and stream compression. This requires specialized expertise in digital typography, font rendering mechanics, and the ISO 32000 PDF standard.

Discussion

20 comments analyzed.

Competitors mentioned: Scrivener, WeasyPrint, Prince

Concerns raised: UI too complicated, Screenplay support not perfect, AI writing undermines natural talent, Missing support for numerical solvers (PDE/ODE), Lacks browser dependencies clarity

Feature requests: Better screenplay/manuscript output formatting, Deep tech numerical solvers for PDE and ODE support, Support for specialized PDF formats

Competitors

Other products that read as similar to this one — 261 launches clear the similarity bar, closest 8 shown.

Attention rank: #38 of 262 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).

Launched 117 days after the earliest competitor.

Other launches for this product

Same idea, different domain

Nobody's really built a dev tools tool for Sales yet.