用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vramrick/openclaw-skills --skill pretext-reporter-bao命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
全能高级前端研发工程师技能。擅长AI时代前沿技术栈(React最新 + shadcn/ui + Tailwind CSS v4 + TypeScript + Next.js),精通动效库与交互特效开发。采用Glue Code风格快速实现代码,强调高质量产品体验与高度友好的UI视觉规范。在组件调用、交互特效、全局Theme上保持高度规范:绝不重复造轮子,相同逻辑出现两次即封装为组件。具备安全意识,防范各类注入攻击。开发页面具有高度自适应能力,响应式设计贯穿始终。当用户无特殊技术栈要求时,默认采用主流前沿技术栈。
Read, write, append, and list local files in the session's working directory. Use when you need to persist output to disk, read input files, or manipulate file system safely. Supports text files, JSON, CSV, Markdown.
超级简历 WonderCV 出品,3000 万用户信赖。简历分析、段落改写、JD 岗位匹配、自动匹配职位、PDF 导出、AI 求职导师(面试准备/薪资谈判/职业规划/多版本简历策略)。 触发条件:用户提供简历、要求简历点评/打分/反馈、希望改写某个简历部分、 希望将简历与岗位 JD 或校招岗位匹配、咨询求职建议或面试准备,或提到 CV/简历/求职/校招。 不触发条件:用户讨论普通写作(非简历)、询问其他文档, 或讨论与求职和职业发展无关的话题。
基于 SOC 职业分类
正在显示 SKILL.md
| name | pretext-reporter-bao |
| description | 文本测量和Canvas布局报告工具 - 基于Pretext库,支持多语言文本测量、行布局计算、可视化报告生成 |
| compatibility | opencode |
基于 Pretext 库的文本测量和布局报告工具,支持多语言(包括表情符号、BIDI、CJK)、Canvas 可视化输出。
使用 Pretext 的核心 API:
// 用例1:简单测量
import { prepare, layout } from '@chenglou/pretext'
const prepared = prepare('你好世界 🚀', '16px Inter')
const { height, lineCount } = layout(prepared, 320, 24)
// 用例2:行级控制
import { prepareWithSegments, layoutWithLines } from '@chenglou/pretext'
const prepared = prepareWithSegments('你好世界 🚀', '16px Inter')
const { lines } = layoutWithLines(prepared, 320, 24)
// 用例3:流式布局
import { layoutNextLine } from '@chenglou/pretext'
let cursor = { segmentIndex: 0, graphemeIndex: 0 }
let y = 0
while (true) {
const width = y < image.bottom ? 300 : 320
const line = layoutNextLine(prepared, cursor, width)
if (line === null) break
ctx.fillText(line.text, 0, y)
cursor = line.end
y += 24
}
// 测量文本
import { measureText } from '@claw/skills/pretext-reporter-bao'
const result = await measureText('你好世界 🚀', {
font: '16px Inter',
maxWidth: 320,
lineHeight: 24
})
console.log(result)
// {
// text: '你好世界 🚀',
// characterCount: 5,
// lineCount: 1,
// height: 24,
// lines: [{ text: '你好世界 🚀', width: 87.5 }]
// }
// 生成Canvas可视化
import { generateCanvasReport } from '@claw/skills/pretext-reporter-bao'
const canvas = await generateCanvasReport('你好世界 🚀', {
font: '16px Inter',
maxWidth: 320,
lineHeight: 24,
backgroundColor: '#ffffff',
textColor: '#000000'
})
// 保存或使用Canvas
const png = canvas.toDataURL('image/png')
// 流式布局(支持图片环绕等)
import { createFlowLayout } from '@claw/skills/pretext-reporter-bao'
const layout = createFlowLayout('你好世界 🚀', {
font: '16px Inter',
lineHeight: 24
})
// 逐行布局
let line
while ((line = layout.nextLine(320)) !== null) {
console.log(line.text, line.width)
}
| 选项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
font | string | '16px Inter' | 字体(与CSS font属性格式一致) |
maxWidth | number | 320 | 最大宽度(像素) |
lineHeight | number | 24 | 行高(像素) |
whiteSpace | 'normal' | 'pre-wrap' | 'normal' | 空白处理方式 |
backgroundColor | string | '#ffffff' | Canvas背景色 |
textColor | string | '#000000' | Canvas文字颜色 |
# 文本测量报告
## 基本信息
- 文本:你好世界 🚀
- 字符数:5
- 行数:1
- 字体:16px Inter
## 布局信息
- 最大宽度:320px
- 计算高度:24px
- 行高:24px
## 行详情
| 行号 | 文本 | 宽度 |
|------|------|------|
| 1 | 你好世界 🚀 | 87.5px |
{
"text": "你好世界 🚀",
"font": "16px Inter",
"config": {
"maxWidth": 320,
"lineHeight": 24,
"whiteSpace": "normal"
},
"stats": {
"characterCount": 5,
"lineCount": 1,
"height": 24
},
"lines": [
{
"index": 0,
"text": "你好世界 🚀",
"width": 87.5,
"start":
| 操作 | 时间 | 说明 |
|---|---|---|
prepare() | ~19ms | 500个文本批次(一次性分析) |
layout() | ~0.09ms | 热路径(纯算术计算) |
layoutWithLines() | ~0.12ms | 包含行信息返回 |
@chenglou/pretext - 核心文本测量库(需手动安装)前置步骤:Pretext 还未发布到 npm,需要手动安装:
# 方式1:从 GitHub 克隆
git clone https://github.com/chenglou/pretext.git
cd pretext
npm install
npm link # 全局链接
# 方式2:在项目中本地引用
# 将 pretext 目录复制到 node_modules/@chenglou/pretext
然后安装本 Skill:
cd skills/pretext-reporter-bao
npm install