Skip to main content
Participant
April 3, 2025
Answered

setFont error when trying to style specific words "setFont needs exactly 1 argument"

  • April 3, 2025
  • 1 reply
  • 260 views

I'm trying to accomplish what's explained on the page below: "CHANGE THE FONT FOR CERTAIN WORDS"

https://helpx.adobe.com/after-effects/using/expressions-text-properties.html

 

On the SourceText attribute, i have:

text.sourceText.style.setFont("Didot-Italic",2)

 I'm only trying to change the font style for the 2nd word. But I'm getting the following error: "setFont needs exactly 1 argument".

Correct answer Dan Ebberts

I think you'll get that error if you try to use the character range arguments in an older version of AE (2024 or earlier, I think). Also, the range specifies characters, not words.

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
April 3, 2025

I think you'll get that error if you try to use the character range arguments in an older version of AE (2024 or earlier, I think). Also, the range specifies characters, not words.