# av.video.text 库模块帮助文档

## av.video.text 成员列表 <a id="av.video.text" href="#av.video.text">&#x23;</a>

### av.video.text.draw(g,lay,x,y,opt) <a id="av.video.text.draw" href="#av.video.text.draw">&#x23;</a>
把排版块画在 (x,y)（块左上角）。  
opt: color,emphColor,alpha,state=function(i,unit){return {alpha;dx;dy;scale;rotate}},shadow={color;dx;dy},glow={color;width}

### av.video.text.free(lay) <a id="av.video.text.free" href="#av.video.text.free">&#x23;</a>
释放排版结果中的路径

### av.video.text.getFamily(name) <a id="av.video.text.getFamily" href="#av.video.text.getFamily">&#x23;</a>
取 gdip.family（缓存；"FontAwesome" 取图标字体）

### av.video.text.icon(name) <a id="av.video.text.icon" href="#av.video.text.icon">&#x23;</a>
图标名转 FontAwesome 字符，未知名字报错并列出可选值

### av.video.text.icons <a id="av.video.text.icons" href="#av.video.text.icons">&#x23;</a>
图标名表（FontAwesome 4.7 字形，名字兼容 FA6 与 FA4 写法）

### av.video.text.layout(str,opt) <a id="av.video.text.layout" href="#av.video.text.layout">&#x23;</a>
排版：返回含 lines、units（每个单元有 runs 路径、ink 墨迹边界、cx,cy 中心、penX0/penX1 笔位）、width、height 的表。  
opt: font,size(像素),bold,style,lineHeight(默认 1.25),maxWidth(超宽换行),align("left"|"center"|"right"),  
split(null|"char"|"word"|"line")；文本支持 **强调** 与 `'\n'`，split="word" 时 | 为手动分词点

### av.video.text.measure(str,font,style,size) <a id="av.video.text.measure" href="#av.video.text.measure">&#x23;</a>
排版宽度

### av.video.text.metrics(font,style) <a id="av.video.text.metrics" href="#av.video.text.metrics">&#x23;</a>
字体度量（按 em 归一）：ascent,vc(视觉中心),capTop,capBottom

### av.video.text.parseMarkup(str) <a id="av.video.text.parseMarkup" href="#av.video.text.parseMarkup">&#x23;</a>
解析 **强调**，返回字符数组,强调标记数组

### av.video.text.pathBounds(path) <a id="av.video.text.pathBounds" href="#av.video.text.pathBounds">&#x23;</a>
路径墨迹边界 RECTF

### av.video.text.segmentWords(chars) <a id="av.video.text.segmentWords" href="#av.video.text.segmentWords">&#x23;</a>
把字符数组切成词，返回词起始索引数组
