Pretext Text Measurement & Layout Skill by ara.so — Daily 2026 Skills collection. Pretext is a pure JavaScript/TypeScript library for fast, accurate, DOM-free multiline text measurement and layout. It avoids and (which trigger expensive layout reflows) by implementing its own measurement logic using the browser's font engine as ground truth. Installation Core Concepts - / — one-time analysis: normalize whitespace, segment text, measure via canvas. Cache and reuse this result. - / etc. — cheap hot path: pure arithmetic over cached widths. Call this on every resize, not . - Font string format —…