跳转到内容

文本字体

app.textFonts[index]

文档中字体的信息,可在 CharacterAttributes 对象中找到。


app.textFonts[index].family

字体的家族名称。

字符串;只读。


app.textFonts[index].name

字体的完整名称。

字符串;只读。


app.textFonts[index].parent

对象的容器。

对象;只读。


app.textFonts[index].style

字体的样式名称。

字符串;只读。


app.textFonts[index].typename

对象的类名。

字符串;只读。


// 将文档中所有文本的字体设置为第一个字体
if ( app.documents.length > 0 ) {
// 遍历所有文本艺术并应用字体 0
for ( i = 0; i< app.activeDocument.textFrames.length; i++) {
textArtRange = app.activeDocument.textFrames[i].textRange;
textArtRange.characterAttributes.textFont = app.textFonts[0];
}
}