sourcetext
Source Text
Section titled “Source Text”text.sourceText
These functions are accessible on the Text.sourceText object in AE 17.0 and later.
Attributes
Section titled “Attributes”SourceText.isHorizontalText
Section titled “SourceText.isHorizontalText”text.sourceText.isHorizontalText
Description
Section titled “Description”Returns true
if the Text layer is horizontal and false
if it is vertical.
Boolean
SourceText.isParagraphText
Section titled “SourceText.isParagraphText”text.sourceText.isParagraphText
Description
Section titled “Description”Returns true
if a Text layer is Paragraph text. If the Text layer is a Point text, it returns false
.
Boolean
SourceText.isPointText
Section titled “SourceText.isPointText”text.sourceText.isPointText
Description
Section titled “Description”Returns true
if a Text layer is Point text. If the Text layer is Paragraph text, it returns false
.
Boolean
SourceText.isVerticalText
Section titled “SourceText.isVerticalText”text.sourceText.isVerticalText
Description
Section titled “Description”Returns true
if the Text layer is vertical and false
if it is horizontal.
Boolean
SourceText.style
Section titled “SourceText.style”text.sourceText.style
Description
Section titled “Description”Returns the Text Style object for a given sourceText
property.
Text Style object
Methods
Section titled “Methods”SourceText.createStyle()
Section titled “SourceText.createStyle()”text.sourceText.createStyle()
Description
Section titled “Description”Used to initialize an empty Text Style object in which you’d manually bake in specific values.
Returns
Section titled “Returns”Empty Text Style object.
Example
Section titled “Example”To create a new style with font size 300 and the font Impact:
text.sourceText .createStyle() .setFontSize(300) .setFont("Impact");
SourceText.getStyleAt()
Section titled “SourceText.getStyleAt()”text.sourceText.getStyleAt(charIndex[, time])
Description
Section titled “Description”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.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
index | Number | The index of the letter or character whose style is needed |
time | Number | Optional. The time within the composition to get the style from. Defaults to time . |
Returns
Section titled “Returns”Text Style object
Example
Section titled “Example”To get the style of the first character at the beginning of the timeline:
text.sourceText.getStyleAt(0,0);