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

Dynamically Change Font Size based on a defined safe zone area, with expressions

New Here ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

Looking for a solution to having the text scale via another expression that is driving a slider control.

When using this in the layers Source Text, the layer will no longer display the text from txt variable, and the size will revert to the default set on the text object. When setting the .setFontSize() where the variable scaler is not driven by an expression, everything works as it should. Need to be able to use 'scaler' as an expression driven value.

 

//Set Text Source
let txt = comp("_Update Copy Here").layer("Artist Name_TEXT").text.sourceText;
 
//Set Text Scale
let scaler = effect("Text Size")("Slider").value;
 
//Text Style
text.sourceText.style
.setText(txt);
.setFontSize(scaler)
 
 
 
TOPICS
Expressions , How to , Scripting

Views

120

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
Advocate ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

Remove the semicolon at the end of .setText(txt);

//Set Text Source
let txt = comp("_Update Copy Here").layer("Artist Name_TEXT").text.sourceText;
//Set Text Scale
let scaler = effect("Text Size")("Slider").value;
//Text Style
style
    .setText(txt)
    .setFontSize(scaler)

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 ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

LATEST

Apologies a type on my part

still doesn't fix the issue

need to purge the ram every frame to have it update when the value is linked to an expression on another slider

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