← HomeLogin
Pure JavaScript/TypeScript library for multiline text measurement & layout
~dev.sourcebrowserstypescript
github.com Mar 29, 2026

Summary

Pretext side-steps the need for DOM measurements (e.g. getBoundingClientRect, offsetHeight), which trigger layout reflow, one of the most expensive operations in the browser. It implements its own text measurement logic, using the browsers' own font engine as ground truth (very AI-friendly iteration method).