What problem does it solve?
This Skill provides a pure JavaScript/TypeScript library for efficient, accurate text measurement and layout, overcoming the limitations of DOM-based methods and enabling high-performance text processing in AI applications.
Core Features & Use Cases
- DOM-Free Text Measurement: Avoids layout reflow for faster, more efficient text measurement.
- Multilingual Support: Handles text layout for all major languages, including CJK, Arabic, Thai, and more.
- Custom Rendering: Supports rendering text to DOM, Canvas, SVG, and server-side.
- Use Case: Imagine you need to dynamically size text within a UI component or measure text for a virtualized list. This Skill allows you to calculate text height and layout without the overhead of DOM operations, improving performance and responsiveness.
Quick Start
Use the pretext skill to measure the height of the text 'AGI 春天到了. 开始了旅程 🚀' with font '16px Inter' and maximum width 400.