What problem does it solve?
It solves the problem of building creative, typographic browser demos that need accurate text measurement and reflow without relying on DOM layout tricks or layout-shift-prone workarounds.
Core Features & Use Cases
- DOM-free text layout: measure multiline text, line breaks, per-grapheme positions, and heights using pretext instead of expensive DOM reads.
- Text flowing around obstacles: route text row-by-row around moving shapes (dragged sprites, orbits, editorial pull-quote spaces).
- Text-as-geometry generative effects: build kinetic typography and games where level geometry is made of measured text.
- Single-file HTML demos: produces lightweight, shippable demos that run directly in the browser by rendering your own canvas/SVG/WebGL from pretext’s measurements.
Use case example: A user wants a “cool pretext thing” where a paragraph flows around a moving orb—pretext provides the per-row corridor widths so you can draw the text with the right wrapping behavior in real time.
Quick Start
Use the pretext skill to generate a single-file HTML demo that flows a real paragraph around a moving obstacle using pretext’s layoutNextLineRange pattern.