score 0speed 0.0state running
arrows move | space pause | enter restartMeasure multiline text without touching the DOMSource: cocktailpeanut/asciisnake
AI stream layout, high-performance frontend, Web Vitals, Core Web Vitals, LCP, CLS, INP, FID, SEO, streaming text, dynamic width reflow, obstacle wrapping, SSR, static generation, virtual list, Canvas text, layout, measureText, no reflow, Pretext, multiline layout, chenglou, pretextonline.
Pretext (@chenglou/pretext) uses the browser font engine for ground-truth widths, then does line breaking and height math in pure data—great for virtual lists, Canvas text, and stable layouts.
Performance
prepare() measures once; layout() re-runs in microseconds for new widths.
Capabilities
Many languages, emoji, mixed bidi; optional pre-wrap; line-by-line APIs for Canvas and ragged widths.
Open source
MIT licensed at chenglou/pretext. pretextonline is maintained separately.