pretext-reference

Community

Precise text layout reference and measurement.

Authorwk-j
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This library provides accurate, DOM-free measurement and layout of multiline text, enabling consistent rendering on canvas or SVG without triggering reflow.

Core Features & Use Cases

  • High-precision measurement of text height, line counts, and wrapping without relying on the DOM.
  • Layout APIs: prepare, layout, prepareWithSegments, layoutWithLines, and helpers for inline flow.
  • Use Case: perform shrink-wrap layouts, text animation, and obstacle-aware flows across custom render targets.

Quick Start

Install the library and import it in your project, then call prepare(text, font) to begin precise text measurement.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: pretext-reference
Download link: https://github.com/wk-j/krypton/archive/main.zip#pretext-reference

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.