Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Make text work automatically

Tagged: 

  • Make text work automatically

    Posted by Hau Trinh on November 27, 2020 at 3:51 pm

    I have a source text import from a spreadsheet.
    I want it to be in a paragraph text box.
    “If the length of text is longer than 450 px then the font size is 55
    if the length of text is shorter than 450 px the font size is 75.”
    How do i make impression for this?
    Or is there any other way without expression?
    Thank you all very much.

    Walter Soyka replied 5 years, 5 months ago 3 Members · 4 Replies
  • 4 Replies
  • Graham Quince

    November 29, 2020 at 10:26 am

    Unfortunately, you cannot adjust the font size directly, but you can adjust the scale.

    Try this expression on your text layer’s scale:

    y=thisLayer.sourceRectAtTime().height;
    s = linear(y,450,1000,55,75);
    [s,s]

    y is the height of the text layer.

    linear is AE’s range mapper expression. 450 is the lower threshold, 1000 the top and then 55 and 75 are the percentages to output. Between 450 and 1000 the scale will be somewhere inbetween 55 and 75.

    [s,s] puts the same scale value for the width and height.

  • Hau Trinh

    November 30, 2020 at 3:54 pm

    Thanks but when I tried this, but nothing changes when i input any amount of text.

  • Hau Trinh

    November 30, 2020 at 3:56 pm

    How’s about changing it to number of words?

  • Walter Soyka

    November 30, 2020 at 10:17 pm

    Graham’s expression was looking at height, but it sounds like you want to use width. Graham’s expression also very elegantly scaled as the width increased, but if you really want it to just click over, set the type size to 75 and try this instead:

    if (thisLayer.sourceRectAtTime(time).width <= 450) { [100,100] } else { [73.33, 73.33] };

    It’ll work like this:

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy