chenglou/pretext
View on GitHub ↗ ★ 50,985 TypeScript
Fast, accurate & comprehensive text measurement & layout
13 mentions on Hacker News by 11 people: 4 stories, 9 comments · first 2026-03-28 · latest 2026-10-26
20082026
-
▲ 2
Show HN: Calm Web – Print magazine style readerstory by niraj-agarwal · 2026-10-26 · 2 comments
-
…justif and pretext for better typesetting and masonry columns https://github.com/lyallcooper/justif https://github.com/chenglou/pretext About 6 hours on Claude Code in two sessions.
comment by niraj-agarwal · 2026-07-27 · in Paywall-free News Aggregator -
…to handle this efficiently? https://pretextjs.dev/pretext-demo/showcase-mesmerizing-anim... https://github.com/chenglou/pretext
comment by hankbond · 2026-07-17 · in Just Do Things -
…Some claude came up with by itself and some were based on my guidance. You can see the result here: https://github.com/chenglou/pretext/issues/2 The original isCJK, also written by AI (I assume), was fast. It wasn't obviously slow like…
comment by kjksf · 2026-04-09 · in Code Is Cheap Now, and That Changes Everything -
…tomorrow. But until then, you can use the site to see all the potential buddies. Uses pretext ( https://github.com/chenglou/pretext ) for the text layout
comment by open-paren · 2026-03-31 · in Claude Code Buddy Creator -
…do well. let's see how close pretext can get to 80ms (or better) without adopting the same tricks. https://github.com/chenglou/pretext/issues/18 there are already significant perf improvement PRs open right now, including one done using…
comment by leeoniya · 2026-03-30 · in Pretext: TypeScript library for multiline text measurement and layout -
…not, at some point I really want to understand what's the real insight in the library, their https://github.com/chenglou/pretext/blob/main/RESEARCH.md is interesting, they seem to have just done the hard work, of browser discrepancies to…
comment by Trufa · 2026-03-29 · in Pretext: TypeScript library for multiline text measurement and layout -
…tests the resulting library against real browsers using a wide variety of long text documents, see https://github.com/chenglou/pretext/tree/main/corpora and https://github.com/chenglou/pretext/blob/main/pages/accuracy...
comment by simonw · 2026-03-29 · in Pretext: TypeScript library for multiline text measurement and layout -
That's in there too: https://github.com/chenglou/pretext/blob/53a065b8a345fc29831...
comment by simonw · 2026-03-29 · in Pretext: TypeScript library for multiline text measurement and layout -
…with pure arithmetic to count lines and compute height. Call on every resize. ~0.0002ms per text. https://github.com/chenglou/pretext/blob/main/src/layout.ts
comment by rattray · 2026-03-29 · in Pretext: TypeScript library for multiline text measurement and layout - ▲ 3
-
▲ 397
Pretext: TypeScript library for multiline text measurement and layoutstory by emersonmacro · 2026-03-28 · 69 comments
-
▲ 6
Pretext: JavaScript/TypeScript library for multiline text measurement and layoutstory by davidbarker · 2026-03-28 · 0 comments