Skip to content

Commit 17196d3

Browse files
author
John Colombo
committed
Add PropertyGroup.addVariableFontAxis doc
1 parent 3085d73 commit 17196d3

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

docs/property/propertygroup.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,83 @@ Boolean.
129129

130130
---
131131

132+
### PropertyGroup.addVariableFontAxis()
133+
134+
`app.project.item(index).layer(index).propertyGroupSpec.addVariableFontAxis(axisTag)`
135+
136+
!!! note
137+
This functionality was added in After Effects (Beta) 26.0 and is subject to change while it remains in Beta.
138+
139+
#### Description
140+
141+
Creates and returns a Property object for a variable font axis, and adds it to this property group. This method can only be called on the "ADBE Text Animator Properties" property group within a text animator.
142+
143+
Common axis tags include (but are not limited to):
144+
145+
- `"wght"` - Weight (100-900 typical range)
146+
- `"wdth"` - Width (percentage of normal width)
147+
- `"slnt"` - Slant (angle in degrees)
148+
- `"ital"` - Italic (0-1 range)
149+
- `"opsz"` - Optical Size (point size)
150+
151+
Fonts may also include custom axes with 4-character uppercase tags (e.g., `"INFM"` for Informality).
152+
153+
#### Variable Font Spacing
154+
155+
When animating Variable Font axes, individual characters can change width. The Variable Font Spacing property (found in the "More Options" section of a text animator) controls how After Effects handles character spacing compensation for these width changes.
156+
157+
The Variable Font Spacing property can be accessed via its matchName `"ADBE Text Variable Font Spacing"` and is a dropdown control property. This property appears only when at least one variable font axis is active in the animator.
158+
159+
160+
!!! tip
161+
Axes must exist on the font to have any impact. To discover what axes a font supports, use [FontObject.designAxesData](../text/fontobject.md#fontobjectdesignaxesdata).
162+
163+
#### Parameters
164+
165+
| Parameter | Type | Description
166+
| --------- | ------ | -----------------------------------------------------------------------------------------------------|
167+
| `axisTag` | String | The 4-character tag identifying the variable font axis (e.g., `"wght"`, `"wdth"`, `"slnt"`, `"ital"`).
168+
169+
#### Returns
170+
171+
[Property object](property.md) representing the variable font axis.
172+
173+
#### Examples
174+
175+
```javascript
176+
// Create a comp
177+
var comp = app.project.items.addComp("Create Axis Comp", 1920, 1080, 1, 30, 30);
178+
comp.openInViewer();
179+
180+
// Create a text layer
181+
var textLayer = comp.layers.addText("Hello World!");
182+
183+
// Set the font to variable font
184+
var textDocument = textLayer.property("Source Text").value;
185+
textDocument.font = 'ShantellSans'; // Must be a variable font
186+
textLayer.property("Source Text").setValue(textDocument);
187+
188+
// Get the text property and animators group
189+
var textProp = textLayer.property("Text");
190+
var animators = textProp.property("Animators");
191+
192+
// Add a new animator
193+
var animator = animators.addProperty("ADBE Text Animator");
194+
var animatorProps = animator.property("ADBE Text Animator Properties");
195+
196+
// Add the Weight axis
197+
var axisProp = animatorProps.addVariableFontAxis("wght");
198+
199+
// Set a static value
200+
axisProp.setValue(700);
201+
202+
// Set keyframes
203+
axisProp.setValueAtTime(0, 300); // Light at 0 seconds
204+
axisProp.setValueAtTime(2, 900); // Heavy at 2 seconds
205+
```
206+
207+
---
208+
132209
### PropertyGroup.property()
133210

134211
`app.project.item(index).layer(index).propertyGroupSpec.property(index)`

0 commit comments

Comments
 (0)