Skip to main content
Participant
August 31, 2022
Answered

Set Font Style not working when sourcing text from different layer.

  • August 31, 2022
  • 1 reply
  • 362 views

Hello wizards

I'm being buffled by a simple expression somebody might help me with.

I am trying to .style.setFont()  a text layer which sources its text from a master layer from another comp.

Now, when I use this expression all works fine

but when I source the text from another layer,

It stops sourcing the right text and shows the actaual layer text instead,

meaning I lose the capacity to link it to external text sources, which makes it useless for me.

 

Any idea why this might be happening and/or how to fix it?

Thanks in advance for your help fellas

 

 

 

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

Try it this way:

txt = comp("XX").layer("YY").text.sourceText;
style.setFontSize(100).setText(txt)

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
August 31, 2022

Try it this way:

txt = comp("XX").layer("YY").text.sourceText;
style.setFontSize(100).setText(txt)
fabioBAuthor
Participant
August 31, 2022

great so i only missed teh ";"...

not sure if I feel better or worst ut thanks a lot