These functions are accessible from SourceText.style
after AE 17.0.
For more info on working with text styles, see:
- Use Expressions to Edit and Access Text Properties on helpx.adobe.com
- After Effects 2020: Express Yourself (and Your Text) on blog.adobe.com
Description
This is used when you want to define (or inherit) a text style, while setting the text content separately.
For example, to inherit the text style and content from another layer:
const referenceText = thisComp.layer("source layer name").text.sourceText;
const style = referenceText.getStyleAt(0,0);
style.setText(referenceText);
Or to create a custom style and then set the text within the expression:
text.sourceText.createStyle().setFontSize(300).setFont("Impact").setText("Hello world!")
Parameters
value |
String. The text to set |
---|---|
Type None |
|
yle.fontSize: |
|
TextStyle. | fontSize |
**Descript |
ion** |
Returns th Type Number |
e value of Font Size for a text layer. |
yle.setFontSize: |
|
TextStyle. | setFontSize(value ) |
**Descript |
ion** |
Used to se |
t the font size to a specified value. |
**Paramete |
rs** |
========= | ================================ |
value |
Number. The font size to set to. |
Type
None
Description
Returns the font name for a text layer.
Type
String
Description
Used to set the font to a specified value.
Parameters
value |
String. The font to set to. |
---|---|
Type None |
|
yle.isFauxBold: |
|
TextStyle. | isFauxBold |
**Descript |
ion** |
Returns wh Type Boolean |
ether faux bold is enabled |
yle.setFauxBold: |
|
TextStyle. | setFauxBold(value ) |
**Descript |
ion** |
Used to se |
t the faux bold status |
**Paramete |
rs** |
========= | =============================================== |
value |
Boolean. Whether to enable or disable faux bold |
Type
None
Description
Returns whether faux italic is enabled
Type
Boolean
Description
Used to set the faux italic status
Parameters
value |
Boolean. Whether to enable or disable faux italic |
---|---|
Type None |
|
yle.isAllCaps: |
|
TextStyle. | isAllCaps |
**Descript |
ion** |
Returns wh Type Boolean |
ether all caps is enabled |
yle.setAllCaps: |
|
TextStyle. | setAllCaps(value ) |
**Descript |
ion** |
Used to se |
t the All Caps status |
**Paramete |
rs** |
========= | ============================================== |
value |
Boolean. Whether to enable or disable all caps |
Type
None
Description
Returns whether small caps is enabled
Type
Boolean
Description
Used to set the small caps status
Parameters
value |
Boolean. Whether to enable or disable small caps |
---|---|
Type None |
|
yle.tracking: |
|
TextStyle. | tracking |
**Descript |
ion** |
Returns th Type Number |
e value of Tracking for a text layer. |
yle.setTracking: |
|
TextStyle. | setTracking(value ) |
**Descript |
ion** |
Used to se |
t the tracking to a specified value. |
**Paramete |
rs** |
========= | ===================================== |
value |
Number. The tracking value to set to. |
Type
None
Description
Returns the value of leading for a text layer.
Type
Number
Description
Used to set the leading to a specified value.
Parameters
value |
Number. The leading value to set to. |
---|---|
Type None |
|
yle.isAutoLeading: |
|
TextStyle. | isAutoLeading |
**Descript |
ion** |
Returns wh Type Boolean |
ether auto leading is enabled |
yle.setAutoLeading: |
|
TextStyle. | setAutoLeading(value ) |
**Descript |
ion** |
Used to se |
t the auto leading status |
**Paramete |
rs** |
========= | ================================================== |
value |
Boolean. Whether to enable or disable auto leading |
Type
None
Description
Returns the value of baseline shift for a text layer.
Type
Number
Description
Used to set the baseline shift to a specified value.
Parameters
value |
Number. The baseline shift value to set to. |
---|---|
Type None |
|
yle.applyFill: |
|
TextStyle. | applyFill |
**Descript |
ion** |
Returns wh Type Boolean |
ether text fill color is enabled |
yle.setApplyFill: |
|
TextStyle. | setApplyFill(value ) |
**Descript |
ion** |
Used to se |
t whether text fill is enabled |
**Paramete |
rs** |
========= | ================================================ |
value |
Boolean. Whether to enable or disable apply fill |
Type
None
Description
Returns the text fill color, RGB values on a scale from 0 - 1.0
Type
Array of numbers
Description
Used to set the text fill color
Parameters
value |
Array of numbers. [R, G, B] with each value between 0.0 to 1.0 |
---|---|
Type None |
|
yle.applyStroke: |
|
TextStyle. | applyStroke |
**Descript |
ion** |
Returns wh Type Boolean |
ether text stroke is enabled |
yle.setApplyStroke: |
|
TextStyle. | setApplyStroke(value ) |
**Descript |
ion** |
Used to se |
t whether text stroke is enabled |
**Paramete |
rs** |
========= | ================================================= |
value |
Boolean. Whether to enable or disable text stroke |
Type
None
Description
Returns the text stroke color, RGB values on a scale from 0 - 1.0
Type
Array of numbers
Description
Used to set the text stroke color
Parameters
value |
Array of numbers. [R, G, B] with each value between 0.0 to 1.0 |
---|---|
Type None |
|
yle.strokeWidth: |
|
TextStyle. | strokeWidth |
**Descript |
ion** |
Returns th Type Number |
e stroke width value for a text layer. |
yle.setStrokeWidth: |
|
TextStyle. | setStrokeWidth(value ) |
**Descript |
ion** |
Used to se |
t the stroke width to a specified value. |
**Paramete |
rs** |
========= | ============================================= |
value |
Number. The value to set the stroke width to. |
Type
None