pretext

Measure and lay out multiline text without DOM reflow using canvas measurement.

4|Updated May 18, 2026
One-click install
npx skills add https://github.com/ZardLi1115/zedclaw --skill pretext-zardli1115
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pretext
Source: https://github.com/ZardLi1115/zedclaw/tree/main/skills/creative/pretext
Command: npx skills add https://github.com/ZardLi1115/zedclaw --skill pretext-zardli1115

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Pretext measures and lays out multiline text without DOM reflow, so you can build creative browser demos where text behaves like geometry around obstacles and animations.

Core Features & Use Cases

  • DOM-free text measurement: Computes line breaks, per-line widths, and grapheme positions using canvas measurement (no layout thrash).
  • Variable-width streaming layout: Continuously routes text row-by-row using corridor widths, enabling text that flows around moving shapes.
  • Single-file HTML demos: Produces shippable browser demos that render immediately by doing layout math in JavaScript and drawing yourself on canvas.

Use cases include kinetic typography, ASCII/prose “text-as-geometry” games, reflow-around-orb/sprite editorial layouts, and multiline shrink-wrap quote cards where you need the exact wrapping width before rendering.

Quick Start

Use the pretext skill to generate a single-file HTML demo that flows a paragraph around a moving orb using Pretext’s row-by-row streaming layout.

Frequently Asked Questions about pretext

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

FAQPage Schema
How do I flow text around moving shapes without causing DOM reflow?

To flow text around moving shapes without DOM reflow, use canvas-based text measurement to compute variable-width line routing and draw the text manually on a canvas, avoiding layout thrash entirely.

What is kinetic typography and how does canvas text layout work for animations?

Kinetic typography animates text as geometry, and canvas text layout works by measuring per-line widths and computing corridor-based streaming rows to route text dynamically around moving obstacles.

How to build a single-file HTML demo for text-as-geometry games?

To build a single-file HTML demo for text-as-geometry games, compute layout math in JavaScript and render measured text directly on a canvas using row-by-row streaming layout.

Can I measure multiline text wrapping width without using the DOM?

Yes, you can measure multiline text wrapping width without the DOM by using canvas measurement APIs to calculate exact per-line widths and grapheme positions for shrink-wrapped layouts.

Does this text layout approach work for creating ASCII art and editorial layouts?

Yes, this text layout approach works for ASCII art and editorial layouts by continuously routing text row-by-row using corridor widths to flow around sprites or orbs.