Skip to main content
Participating Frequently
June 29, 2023
Answered

Is it possible to target fontSize but retain mixed font style?

  • June 29, 2023
  • 1 reply
  • 268 views

Is it possible to target and set a text layer's font size to a slider, but retain whatever styling it originally had including mixed font style/weights? I'm trying to set up a template and would like to lockdown the font size based off a controller's slider to make sure all text layers are consistent, but still allow for each to be editable to bold or italize various characters.

 

For example, one text layer may have this:
Last Name, First Name. Bold because Important. Italicized Title of Something. Date.

 

After reading through several other posts, this controls the size but doesn't retain the mixed style/weight.

mySize = effect("Font Size")("Slider");
srcText = thisLayer.text.sourceText;
srcTextStyle = srcText.style;

srcTextStyle.setText(srcText).setFontSize(mySize);

 

This topic has been closed for replies.
Correct answer Dan Ebberts

Unfortunately, once an expression touches it, every character gets the same styling.

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
June 29, 2023

Unfortunately, once an expression touches it, every character gets the same styling.