Not listed
Verify or upgrade your startup to be featured on Startup Fame with « do-follow » links.
What is Pretext.js?
A small TypeScript-first library that measures and lays out multiline text using pure arithmetic. It runs a one-time prepare() step using Canvas measureText to capture real glyph widths, then layout() performs instant, DOM-free line breaking and height calculation. That makes it ideal for virtual lists, chat bubbles, and multilingual feeds where performance and accurate font metrics matter. No runtime dependencies, full TypeScript types, and wide script support.
Key features
- Measures multiline text with arithmetic and no DOM reads.
- Uses Canvas measureText to get real glyph advance widths.
- prepare() caches metrics once; layout() is pure math.
- Supports CJK, Arabic, Hebrew, Thai, Hindi, and Korean.
- Written in TypeScript with precise types and no deps.
- Enables fast virtual scrolls and precomputed chat heights.
Category
Website




