← Field Notes
EN/ES

The invisible ruler for text on screens

April 1, 2026via github · @chenglou
open-sourcetoolsworkflow

What's going on

Somewhere in every app you use — a chat window, a document editor, a feed — there's a moment where the software needs to ask: how tall is this block of text going to be? It sounds trivial. It isn't.

Every time a browser answers that question the traditional way, it has to pause, recalculate the entire page layout, and then respond. Do that hundreds of times as someone scrolls through a long list of messages, and things get slow and janky fast. The kind of slow that makes users quietly stop trusting your product.

A developer named Cheng Lou — who has a history of building things that quietly become infrastructure for half the web — just released a small library called Pretext that sidesteps this entirely. Instead of asking the browser's layout engine, it does the math itself using the browser's drawing tools. Same answer, no stutter.

It picked up nearly 25,000 stars on GitHub in a matter of weeks, which in developer culture is roughly the equivalent of a restaurant going from zero to a two-hour queue overnight.

Why it matters for your business

If you're building anything with a lot of text on screen — a customer portal, an internal tool, a messaging feature — the people building it now have a cleaner way to make it feel fast. That smoothness isn't decoration. It's the difference between a tool people trust and one they quietly resent.

Worth knowing this exists when you're talking to your team.

Words worth knowing

DOM — the browser's internal model of a webpage. Think of it as the live blueprint the browser is always updating. Reading from it too often is expensive.

Layout reflow — when the browser has to recalculate the size and position of everything on the page. Happens more than you'd think, and it's slow.

Open-source library — a tool built by developers and shared freely. Other developers drop it into their projects the way you'd use a shared recipe instead of inventing a dish from scratch.

GitHub stars — a rough proxy for how much the developer community cares about something. 25k in a few weeks is genuinely unusual.

Check it out →

Written by David at AC0.AI. Follow on @ac0hero

Want us to audit your site? Takes 60 seconds →