文本字体
app.textFonts[index]
文档中字体的信息,可在 CharacterAttributes 对象中找到。
TextFont.family
Section titled “TextFont.family”app.textFonts[index].family
字体的家族名称。
字符串;只读。
TextFont.name
Section titled “TextFont.name”app.textFonts[index].name
字体的完整名称。
字符串;只读。
TextFont.parent
Section titled “TextFont.parent”app.textFonts[index].parent
对象的容器。
对象;只读。
TextFont.style
Section titled “TextFont.style”app.textFonts[index].style
字体的样式名称。
字符串;只读。
TextFont.typename
Section titled “TextFont.typename”app.textFonts[index].typename
对象的类名。
字符串;只读。
设置文本的字体
Section titled “设置文本的字体”// 将文档中所有文本的字体设置为第一个字体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]; }}