pretext

Measure and layout text on canvas using the @chenglou/pretext TypeScript library.

Updated Oct 23, 2024
One-click install
npx skills add https://github.com/lenadlm/docker --skill pretext-lenadlm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pretext
Source: https://github.com/lenadlm/docker/tree/main/hermes-skills/skills/creative/pretext
Command: npx skills add https://github.com/lenadlm/docker --skill pretext-lenadlm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @chenglou/pretext, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill empowers users to create engaging text-based visual experiences, such as kinetic typography, ASCII art, and text-as-geometry games, without needing to write complex code.

Core Features & Use Cases

  • Text Layout: Measure and layout text using canvas measurement, without reflow.
  • Generative Art: Generate text-based visuals with motion and animation.
  • Use Case: Visualize poetry or manifestos in a kinetic typography format that flows around shapes or morphs over time.

Quick Start

Use the pretext skill to create a text reflow effect around a moving orb. Run the following command: pretext orb-flow.html.

Frequently Asked Questions about pretext

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

FAQPage Schema
How do I measure text dimensions for kinetic typography without triggering page reflow?

You can measure text dimensions for kinetic typography without reflow by using canvas measurement. This TypeScript library calculates text positions dynamically, enabling the generation of text-based visuals that morph over time or flow around shapes.

What is the best way to generate ASCII art and text-as-geometry visuals in a TypeScript environment?

Generating ASCII art and text-as-geometry visuals in TypeScript is achieved by using a canvas-based text measurement library. This approach enables the creation of dynamic generative visuals where text interacts seamlessly with geometric shapes and animations.

Can I use canvas measurement to layout text around moving geometric shapes?

Yes, canvas measurement allows you to layout text around moving geometric shapes. By dynamically calculating text dimensions and positions, you can create reflow effects where typography flows seamlessly around animated objects like a moving orb.

Do I need the @chenglou/pretext package to create text-based visual experiences?

Yes, the @chenglou/pretext package is required to create these text-based visual experiences. It provides the core TypeScript functions needed to measure text dimensions and calculate positions for generating dynamic layouts and animations.

How do I create a text reflow effect around a moving orb using canvas?

You can create a text reflow effect around a moving orb by running the command `pretext orb-flow.html`. This leverages canvas-based measurement to dynamically adjust text layout and positioning as the animated shape moves across the screen.

What are the limitations of using canvas measurement for dynamic text layout?

Using canvas measurement for dynamic text layout is specialized for visual rendering and generative art contexts. It is designed specifically for creative projects where text interacts with geometric shapes or animations, rather than for standard HTML text flow applications.