Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
6

New Scripting Hooks for Variable Fonts

Adobe Employee ,
Aug 14, 2023 Aug 14, 2023

Copy link to clipboard

Copied

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:

 

variableFontsScriptingHooks.gifexpand image

 

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!

TOPICS
Feature request , Performance

Views

12.0K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 14, 2023 Aug 14, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Aug 14, 2023 Aug 14, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 05, 2023 Sep 05, 2023

Copy link to clipboard

Copied

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,

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 06, 2023 Sep 06, 2023

Copy link to clipboard

Copied

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

 

 

 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 06, 2023 Sep 06, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 07, 2023 Sep 07, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 07, 2023 Sep 07, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 19, 2023 Sep 19, 2023

Copy link to clipboard

Copied

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? 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 19, 2023 Sep 19, 2023

Copy link to clipboard

Copied

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: 

ChangingTextExpression.pngexpand image

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 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 22, 2023 Sep 22, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 19, 2023 Oct 19, 2023

Copy link to clipboard

Copied

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

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 26, 2023 Oct 26, 2023

Copy link to clipboard

Copied

Thanks for reply.

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 26, 2023 Oct 26, 2023

Copy link to clipboard

Copied

That is not the beta version - it would be 24.1

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2024 Mar 29, 2024

Copy link to clipboard

Copied

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?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 30, 2024 Mar 30, 2024

Copy link to clipboard

Copied

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 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 29, 2025 Jan 29, 2025

Copy link to clipboard

Copied

I have updated the origial script to support offset values like a text animator. This new version only works with AE25 and higher.

 

remove the .txt and put the file in After Effects/Scripts/ScriptUI Panels

 

ExampleExampleexpand imageSettingsSettingsexpand image

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 04, 2025 Feb 04, 2025

Copy link to clipboard

Copied

Hi Greg, I tried your script but I get the following error 

"Function supportedAxes.indexOf is undefined"

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 05, 2025 Feb 05, 2025

Copy link to clipboard

Copied

That font seems to have alot of Axes that i may not have tested for. It looks like one of the apple SF fonts but I cant find it. Can you tell me where i can?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 05, 2025 Feb 05, 2025

Copy link to clipboard

Copied

Hi Greg, it's an internal font based on SF. I tried with other system fonts (Skia and Noto Sans) with one or two axes and I get the same error. Screenshot 2025-02-05 at 7.15.32 PM.pngexpand imageScreenshot 2025-02-05 at 7.15.10 PM.pngexpand image

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 06, 2025 Feb 06, 2025

Copy link to clipboard

Copied

LATEST

I dont get an error with my Noto Sans but it also dont see anyhting when i change the weight. The original script also does not make any changes to this font.

 

Have you tried the original: 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 22, 2024 May 22, 2024

Copy link to clipboard

Copied

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?

 

scrozier_2-1716416270854.pngexpand image

 

 

 

 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 23, 2024 May 23, 2024

Copy link to clipboard

Copied

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

 

scrozier_0-1716491970920.pngexpand image

 

 

It ram previews fine but can't export. 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 23, 2024 May 23, 2024

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines