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

SourceText expression disabled when adding a font selection expression

New Here ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

Hey!

 

I'm building out a template right now for a client and trying to add font-change capabilities via slider expression where they can easily change the slider amount to change the font in all comps.  The slider expression works properly, but when I added it into the source text section it seems to now only read that expression and stops reading the other expression. 

The other expression is just a simple pick whip to a master text layer where the client can change the text and have all text layers auto-update to whatever they change it to. 

So basically, I am trying to get every text layer to 1. auto-update based on the master text layer and 2. give the client the ability to change fonts via the slider selection expression. 

 

But it seems that the text layer is only reading the expression that is last. So if I put the font change expression last, then I can change fonts but the text won't update when I change the word in the master comp. And vice versa. 

Here is my current expression within the text layer (text layer contains a Slider effect control as well):

var fontArray=[ "UARugged-Regular", "UARugged-Fill", "UARugged-Outline", "LegendSansSerif", "LegendScript" ] ;

 

v=Math.round(effect("Slider Control")("Slider")); style.setFont(fontArray[v]);

 

comp("EDIT INFO/COLORS").layer("Touchdown").text.sourceText;


Any ideas on what to do? I'm not super experienced when it comes it to using multiple expressions on layers, so I'm not sure if it's possible to use two different expressions within the Source Text area. Any help is welcome!

Thanks!

TOPICS
Expressions

Views

156

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

correct answers 1 Correct answer

Community Expert , Apr 19, 2024 Apr 19, 2024

I haven't tested this, but I think if you just rearrange things a bit, it should work:

var txt = comp("EDIT INFO/COLORS").layer("Touchdown").text.sourceText;
var fontArray=[ "UARugged-Regular", "UARugged-Fill", "UARugged-Outline", "LegendSansSerif", "LegendScript" ] ;
v=Math.round(effect("Slider Control")("Slider"));
style.setText(txt).setFont(fontArray[v]);

Votes

Translate

Translate
Community Expert ,
Apr 19, 2024 Apr 19, 2024

Copy link to clipboard

Copied

I haven't tested this, but I think if you just rearrange things a bit, it should work:

var txt = comp("EDIT INFO/COLORS").layer("Touchdown").text.sourceText;
var fontArray=[ "UARugged-Regular", "UARugged-Fill", "UARugged-Outline", "LegendSansSerif", "LegendScript" ] ;
v=Math.round(effect("Slider Control")("Slider"));
style.setText(txt).setFont(fontArray[v]);

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 ,
Apr 22, 2024 Apr 22, 2024

Copy link to clipboard

Copied

LATEST

Dan! As always, you are a genius. Thank you so much! It worked and saved me a ton of time. REALLY APPRECIATE your 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