pretext
CommunityDOM-free multiline text measurement, fast layouts.
Authoriinoshirozheng
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Pretext eliminates the overhead of DOM-based text measurement by providing a DOM-free, canvas-based workflow that computes text height and line counts with pure arithmetic, enabling faster rendering in dynamic UIs.
Core Features & Use Cases
- Efficient height calculation for multiline text without DOM reflow
- Supports measuring for canvases, SVG, and virtualized lists
- Real-world scenario: compute row heights for a long virtualized list to prevent layout jank.
Quick Start
Call prepare(text, font) and then layout(prepared, maxWidth, lineHeight) to obtain height.
Dependency Matrix
Required Modules
None requiredComponents
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 Download link: https://github.com/iinoshirozheng/SinoCloudChat/archive/main.zip#pretext Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.