Skip to main content
Sébastien Périer17107209
Community Manager
Community Manager
August 14, 2023
Question

New Scripting Hooks for Variable Fonts

  • August 14, 2023
  • 8 replies
  • 19956 views

Hi everyone,

 

We're happy to announce that starting in Beta build 24.0x25, we have added 7 new scripting hooks related to variable fonts.

You can see the full list here and their respective documentation:

 

We've also created a demo script panel that exercises these new hooks to inspect installed variable font axes and apply animation controls to create dynamic variable font animations:

 

 

The script is also attached to this post, but you must rename the file's extension from .jsx.txt to .jsx to run it inside AE.

We're excited to see what you'll be able to do with these new variable fonts hooks and to hear any feedback you may have!

8 replies

Inspiring
June 6, 2025

@Douglas_Waterfall @JohnColombo17100380 Is there a way to remove the linear expression mapping from the script? I tried chatGPT but had no luck. Obviosuly a native version of this would have been welcome yesterday but just trying to get something a little less cumbersome. 

 

I need to recreate type setting from figma and the linear mapping of the values actually makes it harder to just type in the actual variable font face values. I.e I need a weight of "500" but I type in 50 or something like 49.5 because the mapping is going from 1 to 100 instead of 0 to 500. I can manually edit each epxression but that is a big waste of time on the size of projects I am working on. 

Inspiring
June 6, 2025

Ok after banging my head against the wall this update to the script fixed my problem and straightened out the conversion. 

 

this.exprStrings.push(
        "const " + theTag + 'Slider = effect("' + ctrlName + '")(1);',
        "const " + theTag + "Min = " + theMin + ";",
        "const " + theTag + "Max = " + theMax + ";",
        "const " + theTag + "Interp = linear(" + theTag + "Slider," + theTag + "Min, " + theTag +  "Max, "  + theTag + "Min, " + theTag + "Max);",

 

Inspiring
May 22, 2024

I've been trying to use the demo script to make some animations with variable fonts but the expression overhead is pretty intense at 300-500ms! Will native variable font support ever come to AE?

 

 

 

 

 

Inspiring
May 23, 2024

Getting bad BIB errors when trying to render something with variable font controls enabled. 

 

 

 

It ram previews fine but can't export. 

Inspiring
May 23, 2024

Workaround for now seems to be using "current settings" in the render queue. 

New Participant
March 29, 2024

I don't see any option to enable per character variable font animation...is there a way to write that into this script? Or link it to an offset slider? I see in the animations for this, like with the wavy effects it must be possible?

JohnColombo17100380
Community Manager
Community Manager
March 30, 2024

Hi @Sean JS.,

Currently, per-character variable font animation is not supported on a single Text layer, since the variable axes are not piped through to the Text Animator system and expressions can only set a single typeface per layer. In creating the wavy animation in the GIF above, all the animation was done on a single Text layer and then pre-comped and offset using traditional animation techniques.

 

We are definitely aware of how important per-character animation is in After Effects. Any new functionality in this area will come first to Beta builds, so keep an eye on those.

 

Cheers,

- John, After Effects Engineering Team 

New Participant
October 19, 2023

HI, I have a problem. I want to use "app.project.usedFonts" in my script, but everytime I get alert with: "undefined".

Adobe Employee
October 19, 2023

Not running the Beta version perhaps? That would seem the most likely explanation.

 

Douglas Waterfall

After Effects Engineering

New Participant
October 26, 2023

Thanks for reply.

I am not sure. I am running version of AE 24.0.1 (Build 2)

Gucci Robot
Participating Frequently
September 19, 2023

This is awesome! One question: I'm trying to set a bunch of layers with this script applied be set to the same word, but since the script generates an expression in the source text field using the normal "thisComp.layer("MASTER TEXT").text.sourceText;" doesn't find a home anywhere in the expression, if I add it to the end, it changes the text but doesn't apply the expression. Am I missing something? 

JohnColombo17100380
Community Manager
Community Manager
September 19, 2023

Hi @Gucci Robot,

If I understand your question correctly, you'll want to modify the expression written by the script by adding a reference to your "MASTER TEXT" layer and then calling the "setText()" method to change the text of the variable font layer. Here's an example of what that might look like within the expression written by the script: 

Circled in green, I've made a reference to the "MAIN TEXT" layer.

Circled in yellow, I've added ".setText(...)" with a reference to the "MAIN TEXT" layer's Source Text property.

 

More info on setText() can be found here: https://ae-expressions.docsforadobe.dev/text-style.html#textstyle-settext-value 

 

Let me know if this isn't quite what you are going for or if you have additional questions.

 

Cheers,

- John, After Effects Engineering Team 

Gucci Robot
Participating Frequently
September 22, 2023

Thank you so much! We arrived at the same conclusion 🙂 I am starting my scripting journey here and I really appreciate the help

Adirai Maji
Inspiring
September 7, 2023

One more issue. If we apply font to the text layer with expression style.setFont("One")

app.project.usedFonts recognize "One"

 

But when we try to change the font by

app.project.replaceFont([One Font Object], [Two Font Object])

it doesn't change the expression style.setFont("Two") Fix that too if it possible.

Adobe Employee
September 7, 2023

Expressions do not work the same way as Scripting with respect to fonts. app.usedFonts does its work by visiting all the layers and asks them what fonts have been applied - it cannot look into the Expression to see what fonts might be applied.

 

This is a long standing difference due to Expressions being calculated on the fly during rendering and the fonts which are used by the Expression are not referenced on the Text Layer at all.

 

In a related way, fonts used via Expressions do not sync from Adobe Fonts on open - because they are not referenced in the Text Layer. This is the reason why folks create hidden Text Layers which DO reference the fonts used in their Expressions so on open they will get the automatically sync from Adobe Fonts.

 

I can understand why you want/need this but we have no obvious way to supply this information. One would have to render the whole project and watch what fonts were used along the way, which might not be a reliable list and change due to an Expression changing. It is an interesting problem. Hmm.

 

Douglas Waterfall

After Effects Engineering

Adirai Maji
Inspiring
September 6, 2023

app.project.usedFonts doesn't always pull all the used fonts in the project incase we made any changes in the project. It only works on first time. If we change add new font to text layers. We have to reopen the project to make it work. Please fix that,

Adobe Employee
September 6, 2023

I have not seen that behavior - and it does not cache any information - for every call it iterates all the layers and discovers what is used now.

 

We have had a report that if one is in the middle of editing a Layer that the change will not be recognized until the layer is committed (click out of the text box). In effect the call is seeing the original unchanged Text Layer, not the one that is in the middle of being changed.

 

Could that explain the behavior you are seeing?

 

Douglas Waterfall

After Effects Engineering

 

 

 

Adirai Maji
Inspiring
September 7, 2023

Sorry that's not what I'm talking about. The issue happens with duplicating text layer and changing it to new font. If we duplicate a text layer and change the font of either of the layers it won't detect the old font used in the original layer. Even if we remove the layer which have the new font. It always shows us the removed font. Not the font that remain in the project.

Inspiring
August 14, 2023

Standard AE text animator integration? Is that coming or will this be tied to a script panel?

Adobe Employee
August 14, 2023

This announcement is only about revealing scripting hooks which build upon the recently released Font and Fonts scripting objects to work with Variable fonts through the TextDocument scripting object.

 

The target audience is 3rd party developers.

 

Fonts (and most other text attributes) remain not animateable through the standard AE text animator.

 

Douglas Waterfall

After Effects Engineering