Scripting support for Variable Font Axes

Last updated on Jan 21, 2026

Learn about some of the ExtendScript to access and control variable font axes in After Effects.

In After Effects, you can use ExtendScript to access and control variable font axes. This means you can automate changes to properties like Weight, Width, and Slant across text layers, making it easier to create dynamic animations without manually adjusting each setting.

Font Object API

Accessing Font Axes

// Get font object from text layer
var textLayer = comp.layer("My Text");
var sourceText = textLayer.property("Source Text");
var textDocument = sourceText.value;
var fontObject = textDocument.fontObject;

// Check if font has variable axes
if (fontObject && fontObject.designAxesData) {
var axes = fontObject.designAxesData;

for (var i = 0; i < axes.length; i++) {
var axis = axes[i];
$.writeln("Axis: " + axis.name);
$.writeln(" Tag: " + axis.tag);
$.writeln(" Min: " + axis.minValue);
$.writeln(" Max: " + axis.maxValue);
$.writeln(" Default: " + axis.defaultValue);
}
}

Adding Axis Animators via Script

Create a composition and text layer

// Create a composition and text layer
var comp = app.project.items.addComp("Variable Font Demo", 1920, 1080, 1, 30, 30);
var textLayer = comp.layers.addText("Hello World");

Set the font to a variable font

// Set the font to a variable font
var textDocument = textLayer.property("Source Text").value;
textDocument.font = "ShantellSans"; // or any variable font name
textLayer.property("Source Text").setValue(textDocument);

Get the text property and animators group

// Get the text property and animators group
var textProp = textLayer.property("Text");
var animators = textProp.property("Animators");

Add a new animator

// Add a new animator
var animator = animators.addProperty("ADBE Text Animator");
var animatorProps = animator.property("ADBE Text Animator Properties");

Add a variable font axis using its 4-character tag

// Add a variable font axis using its 4-character tag
// Common tags: "wght" (Weight), "wdth" (Width), "ital" (Italic), "slnt" (Slant)
var weightAxis = animatorProps.addVariableFontAxis("wght");

Set a value with no keyframe

// Set a value (no keyframe)
weightAxis.setValue(700);

Create keyframes

// Or create keyframes
var italicAxis = animatorProps.addVariableFontAxis("ital");
italicAxis.setValueAtTime(0, 0);
italicAxis.setValueAtTime(2, 1);

Checking Available Axes

function getAvailableAxes(textLayer) {
var sourceText = textLayer.property("Source Text");
var textDoc = sourceText.value;
var fontObj = textDoc.fontObject;

if (!fontObj || !fontObj.designAxesData) {
return [];
}

var axisInfo = [];
for (var i = 0; i < fontObj.designAxesData.length; i++) {
var axis = fontObj.designAxesData[i];
axisInfo.push({
name: axis.name,
tag: axis.tag,
min: axis.minValue,
max: axis.maxValue,
default: axis.defaultValue
});
}

return axisInfo;
}