Skip to content

TextFont

app.textFonts[index]

Information about a font in the document, found in a CharacterAttributes object.


app.textFonts[index].family

The font’s family name.

String; read-only.


app.textFonts[index].name

The font’s full name.

String; read-only.


app.textFonts[index].parent

The object’s container.

Object; read-only.


app.textFonts[index].style

The font’s style name.

String; read-only.


app.textFonts[index].typename

The class name of the object.

String; read-only.


// Sets the font of all the text in the document to the first font
if ( app.documents.length > 0 ) {
// Iterate through all text art and apply font 0
for ( i = 0; i< app.activeDocument.textFrames.length; i++) {
textArtRange = app.activeDocument.textFrames[i].textRange;
textArtRange.characterAttributes.textFont = app.textFonts[0];
}
}