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

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.gif

 

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

3.3K

Translate

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

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

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

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

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

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

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

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

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.png

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

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

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

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

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

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

LATEST

That is not the beta version - it would be 24.1

 

Douglas Waterfall

After Effects Engineering

Votes

Translate

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
Resources