One-click install
npx skills add https://github.com/devMoez/titan --skill pretext-devmoez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pretext
Source: https://github.com/devMoez/titan/tree/main/skills/creative/pretext
Command: npx skills add https://github.com/devMoez/titan --skill pretext-devmoez

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It solves the challenge of building creative, browser-based text layouts (like word-games, ASCII-style typography, and text-as-geometry) without relying on DOM layout tricks or expensive reflows.

Core Features & Use Cases

  • Deterministic text measurement and line layout: uses DOM-free multiline measurement to compute line breaks, per-line widths, and grapheme positions for the exact font metrics you specify.
  • Flow around moving obstacles: routes text row-by-row around a variable-width corridor so paragraphs can wrap around sprites, shapes, or projected ASCII masks.
  • Creative primitive for custom rendering: returns geometry data so you can draw with canvas (or other coordinate systems) and apply kinetic typography, per-glyph effects, and generative compositions.

Use it when the user wants a “pretext demo,” text that flows around an orb/shape, text-as-collision/gameplay geometry, kinetic typography, or single-file HTML generative artwork using real prose (not lorem ipsum).

Quick Start

Create a single self-contained HTML file that imports @chenglou/pretext, prepares the user’s text with the exact canvas font string, then uses layoutNextLineRange to stream line segments around the obstacle each frame.

Frequently Asked Questions about pretext

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

FAQPage Schema
How do I make text flow around moving obstacles in an HTML canvas without causing DOM reflows?

Kinetic typography in single-file HTML requires computing deterministic, DOM-free text metrics to calculate exact grapheme positions and per-line widths. By streaming line segments around obstacles each frame, you can generate generative typographic animations and custom canvas layouts without relying on browser layout engines.

Can I build text-as-geometry games using real prose instead of placeholder text?

To ensure stable, accurate text reflowing, you must synchronize the exact canvas font string with the DOM-free measurement API and pin library versions. Correct font-string synchronization guarantees that computed line breaks and grapheme positions remain deterministic across renders.

What's the best way to generate ASCII art masks from text for creative coding projects?

The best way to generate ASCII art masks for creative coding is using DOM-free multiline measurement to project text as geometry. This technique computes per-line widths and grapheme positions, allowing you to route text row-by-row around projected ASCII masks and create custom typographic effects on canvas.

Why does my kinetic typography rendering shift or jitter between frames?

Kinetic typography rendering shifts between frames when font-string synchronization fails or library versions are not pinned during DOM-free text measurement. Accurate reflowed rendering requires deterministic grapheme positions, which break if the canvas font string does not exactly match the computed layout metrics.