Skip to main content
SasiKumarVVS
Inspiring
December 20, 2018
Answered

Scale Text based on its length

  • December 20, 2018
  • 1 reply
  • 1160 views

Hi all,

          I'm new to after effects. I need to scale text based on its length. I hope this can be done with expression. But i don't know, how to do this? Could anybody help me to do this?

Regards,

Sasikumar

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

There's more than one way to interpret your description, but as an example, if you wanted your text to be 200 pixels wide, you could use a scale expression like this:

w = sourceRectAtTime(time,false).width;

if (w > 0){

  s = (200/w)*100;

  [s,s];

}else

  value

Dan

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
December 20, 2018

There's more than one way to interpret your description, but as an example, if you wanted your text to be 200 pixels wide, you could use a scale expression like this:

w = sourceRectAtTime(time,false).width;

if (w > 0){

  s = (200/w)*100;

  [s,s];

}else

  value

Dan

SasiKumarVVS
Inspiring
December 20, 2018

Thanks Dan. That's works fine.

Regards,

Sasikumar