What problem does it solve?
Pretext removes the guesswork of measuring and wrapping text by providing exact line breaks and per-grapheme positions, enabling layouts that behave like real geometry rather than approximate DOM reflow.
Core Features & Use Cases
- DOM-free text measurement and layout: compute line breaks, widths, grapheme positions, and total height from text + font + width without relying on layout thrash.
- Text reflow around obstacles: flow paragraphs through variable-width corridors defined by moving shapes (circles, rectangles, sprites, or ASCII masks).
- Text-as-geometry effects: build typographic games and kinetic typography where per-glyph positions drive canvas rendering and animation.
- Single-file HTML demo output: produce shippable, self-contained browser demos by default.
Use cases: a moving orb that paragraph-flow wraps around, a text-powered Breakout/Tetris-style game where “bricks” are measured words, and kinetic typography where each grapheme becomes a particle in motion.
Quick Start
Use the pretext skill to create a single-file HTML demo that flows a real paragraph around a moving orb using fixed-width row-by-row measurement and rendering.