pretext

Measure and lay out text on canvas without DOM reflows.

9|Updated Jul 1, 2026
One-click install
npx skills add https://github.com/Cyapstaye/Adame_ver.open --skill pretext-cyapstaye
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pretext
Source: https://github.com/Cyapstaye/Adame_ver.open/tree/main/skills/creative/pretext
Command: npx skills add https://github.com/Cyapstaye/Adame_ver.open --skill pretext-cyapstaye

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @chenglou/pretext, gsap, lil-gui, and includes references (resource) components.

What problem does it solve?

This Skill solves the performance bottleneck of browser-based text layout, allowing for complex, high-frequency typographic animations and geometric text flows that would otherwise cause layout thrashing.

Core Features & Use Cases

  • DOM-free Measurement: Calculate line breaks, widths, and heights without triggering browser reflows.
  • Creative Typography: Enable text to flow around moving obstacles, shatter into particles, or act as game geometry.
  • Use Case: Build a hero section where a paragraph of text dynamically reflows around a user-dragged sprite at 60fps, or create a game where the level geometry is composed of real, measured prose.

Quick Start

Use the pretext skill to generate a single-file HTML demo that flows a paragraph of text around a circular obstacle.

Frequently Asked Questions about pretext

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I do kinetic typography in the browser without causing layout thrashing?

Kinetic typography requires DOM-free text measurement to prevent layout thrashing. By calculating line breaks and text geometry on a canvas at 60fps, you can animate complex typographic effects without triggering browser reflows.

Can I flow canvas text around moving obstacles at 60fps?

Yes, you can flow canvas text around moving obstacles at 60fps. Using a DOM-free layout engine allows dynamic text reflow calculations to run smoothly in creative browser-based visualizations without impacting page performance.

Does GSAP work with DOM-free text layout for creative coding?

GSAP works with DOM-free text layout for creative coding. You can use GSAP to animate the calculated text coordinates and geometric properties generated by the layout engine, enabling high-performance kinetic typography.

What is the best way to use text as game geometry in creative coding?

The best way to use text as game geometry is through DOM-free measurement. By calculating real prose widths and heights on a canvas, you can transform measured text into interactive level geometry for browser-based games.

How to calculate text width and height without triggering browser reflows?

You can calculate text width and height without browser reflows by using a DOM-free measurement engine. This approach performs layout calculations independently of the document object model, preventing performance bottlenecks during high-frequency updates.

When should I not use DOM-based text layout for generative animations?

You should not use DOM-based text layout for generative animations when needing 60fps performance. Frequent DOM updates cause layout thrashing; a DOM-free canvas approach is necessary for shattering text or dynamic reflow.