pretext

仓库创建 2026年7月27日最近提交 21 小时前SkillHot 收录 16 小时前
这个 Skill 做什么

用来做不依赖 DOM 的浏览器文本演示,借助 @chenglou/pretext 这类库,给出逐行断行、每行宽度、每个字形的位置和总高度等排版信息。适合需要精确文本测量或创意布局的 demo,比直接用 DOM 更可控、便于生成复杂文本效果。

▸ 展开 SKILL.md 英文原文

Build creative browser demos with DOM-free text layout.

0
Stars
0
Forks
40
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/trojan-lord/hermes-cuso/main/skills/creative/pretext/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/trojan-lord/hermes-cuso/main/skills/creative/pretext/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Pretext Creative Demos

## Overview

[`@chenglou/pretext`](https://github.com/chenglou/pretext) is a 15KB zero-dependency TypeScript library by Cheng Lou (React core, ReasonML, Midjourney) for **DOM-free multiline text measurement and layout**. It does one thing: given `(text, font, width)`, return the line breaks, per-line widths, per-grapheme positions, and total height — all via canvas measurement, no reflow.

That sounds like plumbing. It is not. Because it is fast and geometric, it is a **creative primitive**: you can reflow paragraphs around a moving sprite at 60fps, build games whose level geometry is made of real words, drive ASCII logos through prose, shatter text into particles w
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有