Skip to content

sourcetext

text.sourceText

These functions are accessible on the Text.sourceText object in AE 17.0 and later.


text.sourceText.isHorizontalText

Returns true if the Text layer is horizontal and false if it is vertical.

Boolean


text.sourceText.isParagraphText

Returns true if a Text layer is Paragraph text. If the Text layer is a Point text, it returns false.

Boolean


text.sourceText.isPointText

Returns true if a Text layer is Point text. If the Text layer is Paragraph text, it returns false.

Boolean


text.sourceText.isVerticalText

Returns true if the Text layer is vertical and false if it is horizontal.

Boolean


text.sourceText.style

Returns the Text Style object for a given sourceText property.

Text Style object


text.sourceText.createStyle()

Used to initialize an empty Text Style object in which you’d manually bake in specific values.

Empty Text Style object.

To create a new style with font size 300 and the font Impact:

text.sourceText
.createStyle()
.setFontSize(300)
.setFont("Impact");

text.sourceText.getStyleAt(charIndex[, time])

This function returns the Text Style object of a particular character at a specific time.

In case the style is keyframed and changes over time, use the second time parameter to specify the target time to get the style at.

ParameterTypeDescription
indexNumberThe index of the letter or character whose style is needed
timeNumberOptional. The time within the composition to get the style from. Defaults to time.

Text Style object

To get the style of the first character at the beginning of the timeline:

text.sourceText.getStyleAt(0,0);