Hacker ApprovedDepartments

Pretext

Hacker Approved

Ranked 2 of 4 text rendering libraries by recommenders

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.

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.

21 people gave an opinion

recommend it
17
criticize it
4
approval share
81%
Each figure is one person. RecommendsCriticizes

Recommended in 5 of 13 months

  1. November 2025: not recommended
  2. December 2025: not recommended
  3. January 2026: not recommended
  4. February 2026: not recommended
  5. March 2026: recommended
  6. April 2026: recommended
  7. May 2026: recommended
  8. June 2026: recommended
  9. July 2026: recommended
  10. August 2026: not recommended
  11. September 2026: not recommended
  12. October 2026: not recommended
  13. November 2026: not recommended (month in progress)

Why it carries the badge

  • 17 people recommend itNeeds 10 or more, met.
  • 4.3 recommenders for every criticNeeds 2 to 1 or better, met.
  • Recommended in 5 of 13 monthsNeeds 4 or more, met.

The same three rules apply to every product, and the badge can’t be bought. How the badge works

What people say about it

The reasons people give, with the number of comments that give each one. Open a reason to read what they said.

Why people recommend it

Each mark is one comment

  • Impressive, long-missing features

    “This is incredibly impressive, many of this things have been missing for forever!”

    Comment from 29 Mar 2026 in “Pretext”

    “This thing is very impressive.”

    Comment from 29 Mar 2026 in “Pretext”
  • Shape-based text reflow

    “w/ sampling each frame, detecting light/dark regions, then reflowing text into those shapes in realtime”

    Comment from 29 Mar 2026 in “Using pretext to make video masks – The Matrix (1999) example”

    “Love this. I especially liked shape based reflow example.”

    Comment from 29 Mar 2026 in “Pretext”
  • Useful for virtualization and masonry

    “Use justif and pretext for better typesetting and masonry columns”

    Comment from 27 Jul 2026 in “Paywall-free News Aggregator”

    “For example Pretext for rendering virtualization”

    Comment from 17 Jun 2026 in “Show HN: ctx is now open source, a hackable desktop workbench for coding agents”
  • Big for GUI frameworks and editors

    “If the author is right, this is going to be huge for GUI web frameworks and for future rich text editors.”

    Comment from 29 Mar 2026 in “Pretext”

    “The iterative line generation feature here is huge”

    Comment from 30 Mar 2026 in “Pretext”

What people warn about

Each mark is one comment

  • Slower than alternatives

    “passing a million lines of code through pretext is unlikely to be very efficient”

    Comment from 29 May 2026 in “On Rendering Diffs”

    “for ASCII text, mine finishes in 80ms, while pretext takes 2200ms”

    Comment from 30 Mar 2026 in “Pretext”

    “right now pretext is significantly slower”

    Comment from 30 Mar 2026 in “Pretext”
  • Demos render wrong or unclear

    “if the basic Latin text in the Pretext demo is deficient”

    Comment from 30 Mar 2026 in “Pretext”

    “the demos all render wrong on my system”

    Comment from 29 Mar 2026 in “Pretext”

Other text rendering libraries people recommend

The three most recommended other text rendering libraries, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.

Pretext compared with 3 alternatives
ProductRecommendCriticizeApprovalMonthsOwnedBadge
Slug text rendering algorithm24196%6—Approved
PretextThis page17481%5—Approved
HarfBuzz8280%6——
FreeType5456%5——
See all 4 text rendering libraries, ranked

What people said

All 24 comments that mention it, newest first. Each links to the original comment.

“Use justif and pretext for better typesetting and masonry columns”

RecommendsComment from 27 Jul 2026 in “Paywall-free News Aggregator”

“For example Pretext for rendering virtualization”

MixedComment from 17 Jun 2026 in “Show HN: ctx is now open source, a hackable desktop workbench for coding agents”

“passing a million lines of code through pretext is unlikely to be very efficient”

MixedComment from 29 May 2026 in “On Rendering Diffs”

“the project has turned out really well”

RecommendsComment from 2 Apr 2026 in “Pretext”

“It gave nice resize responsiveness which is cool, but pretext is not a requirement for this effect”

MixedComment from 31 Mar 2026 in “Textstring”

“right now pretext is significantly slower”

MixedComment from 30 Mar 2026 in “Pretext”

“It's rendering the text to a canvas and then measuring that.”

CriticizesComment from 30 Mar 2026 in “Pretext”

“if the basic Latin text in the Pretext demo is deficient”

CriticizesComment from 30 Mar 2026 in “Pretext”

“I'm having a hard time seeing this on a production web page.”

MixedComment from 30 Mar 2026 in “Pretext”

“I am skeptical getting row height of many items only once is the intended behavior”

MixedComment from 30 Mar 2026 in “Pretext”

“The iterative line generation feature here is huge”

RecommendsComment from 30 Mar 2026 in “Pretext”

“it is not clear from the API/docs how i would use prepare() once on one text and then use layout() for completely different text.”

CriticizesComment from 30 Mar 2026 in “Pretext”

“the difference in perf is significant”

RecommendsComment from 30 Mar 2026 in “Pretext”

“for ASCII text, mine finishes in 80ms, while pretext takes 2200ms”

CriticizesComment from 30 Mar 2026 in “Pretext”

“the demos all render wrong on my system”

CriticizesComment from 29 Mar 2026 in “Pretext”

“it's great that we now have it”

RecommendsComment from 29 Mar 2026 in “Pretext”

“This is incredibly impressive, many of this things have been missing for forever!”

RecommendsComment from 29 Mar 2026 in “Pretext”

“This effort feeds back to the DOM, making it far more useful than my efforts”

RecommendsComment from 29 Mar 2026 in “Pretext”

“w/ sampling each frame, detecting light/dark regions, then reflowing text into those shapes in realtime”

RecommendsComment from 29 Mar 2026 in “Using pretext to make video masks – The Matrix (1999) example”

“I feel hopeful this will make it much easier”

RecommendsComment from 29 Mar 2026 in “Pretext”

“This thing is very impressive.”

RecommendsComment from 29 Mar 2026 in “Pretext”

“If the author is right, this is going to be huge for GUI web frameworks and for future rich text editors.”

RecommendsComment from 29 Mar 2026 in “Pretext”

“I guess pretext is not a technical breakthrough, just the right things assembled to make layouting as a pure JS API.”

MixedComment from 29 Mar 2026 in “Pretext”

“Love this. I especially liked shape based reflow example.”

RecommendsComment from 29 Mar 2026 in “Pretext”

Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.