# Pretext

17 Hacker News commenters recommended Pretext and 4 criticized it, November 2025 to November 2026. It was recommended in 5 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** A pure JavaScript API for text layout that people find impressive for reflow, masonry and virtualization. Main caveat: it is slower than some alternatives, and its demos and fit for production pages are questioned.

## Why people recommend it

- Impressive, long-missing features (2 comments): "This is incredibly impressive, many of this things have been missing for forever!" ([source](https://news.ycombinator.com/item?id=47566419)) "This thing is very impressive." ([source](https://news.ycombinator.com/item?id=47566216))
- Shape-based text reflow (2 comments): "w/ sampling each frame, detecting light/dark regions, then reflowing text into those shapes in realtime" ([source](https://news.ycombinator.com/item?id=47566314)) "Love this. I especially liked shape based reflow example." ([source](https://news.ycombinator.com/item?id=47566097))
- Useful for virtualization and masonry (2 comments): "Use justif and pretext for better typesetting and masonry columns" ([source](https://news.ycombinator.com/item?id=49064924)) "For example Pretext for rendering virtualization" ([source](https://news.ycombinator.com/item?id=48570614))
- Big for GUI frameworks and editors (2 comments): "If the author is right, this is going to be huge for GUI web frameworks and for future rich text editors." ([source](https://news.ycombinator.com/item?id=47566151)) "The iterative line generation feature here is huge" ([source](https://news.ycombinator.com/item?id=47569477))

## What people warn about

- Slower than alternatives (3 comments): "passing a million lines of code through pretext is unlikely to be very efficient" ([source](https://news.ycombinator.com/item?id=48328992)) "for ASCII text, mine finishes in 80ms, while pretext takes 2200ms" ([source](https://news.ycombinator.com/item?id=47568878)) "right now pretext is significantly slower" ([source](https://news.ycombinator.com/item?id=47572206))
- Demos render wrong or unclear (2 comments): "if the basic Latin text in the Pretext demo is deficient" ([source](https://news.ycombinator.com/item?id=47570381)) "the demos all render wrong on my system" ([source](https://news.ycombinator.com/item?id=47568458))

## Alternatives hackers recommend

- [Slug text rendering algorithm](https://hackerapproved.com/p/slug-text-rendering-algorithm.md): 24 recommend
- [HarfBuzz](https://hackerapproved.com/p/harfbuzz.md): 8 recommend
- [FreeType](https://hackerapproved.com/p/freetype.md): 5 recommend

## Cite as

Hacker Approved, "Pretext", https://hackerapproved.com/p/pretext/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
