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

Scale Text based on its length

Explorer ,
Dec 19, 2018 Dec 19, 2018

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

TOPICS
Expressions
1.1K
Translate
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

correct answers 1 Correct answer

Community Expert , Dec 19, 2018 Dec 19, 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

Translate
Community Expert ,
Dec 19, 2018 Dec 19, 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

Translate
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
Explorer ,
Dec 20, 2018 Dec 20, 2018

Thanks Dan. That's works fine.

Regards,

Sasikumar

Translate
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
Explorer ,
Dec 21, 2018 Dec 21, 2018

Hello Dan,

         How to change font size based on text length using expression?

Regards,

Sasikumar

Translate
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
Community Expert ,
Dec 21, 2018 Dec 21, 2018

As far as I know, there isn't a way to control font size with an expression.

Dan

Translate
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 ,
Jan 06, 2022 Jan 06, 2022
LATEST

@Dan Ebberts Works great -- how could you add a max and minimum scale cap to this?

 

Translate
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