Skip to main content
Participant
March 26, 2022
Answered

Expressions constrain scale of text

  • March 26, 2022
  • 1 reply
  • 414 views

So my current lines are inside my scale.

 

maxW = thisComp.width*.9;
maxH = thisComp.height*.9;
r = sourceRectAtTime(time);
w = r.width;
h = r.height;
s = w/h > maxW/maxH ? maxW/w: maxH/h;
[100,100]*s;

 

This achieves universally scaling the text to the size of the comp.

What I want to achive is to as the text gets to the edge of the comp. Only the width scales, and height stays the same. Resulting in a squished horizontal text that gets more squished the more you type. And appears normal size until it hits the edge of the comp. Then would start squishing.

any help would be appreciated.

 

the attached picture is the look of the result im trying to achive. Incase "squish" was not clear.

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

If you're only concerned with the width, this should work:

maxW = thisComp.width*.9;
r = sourceRectAtTime(time);
w = r.width;
s = w > maxW ? maxW/w : 1;
[s*100,100];

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 26, 2022

If you're only concerned with the width, this should work:

maxW = thisComp.width*.9;
r = sourceRectAtTime(time);
w = r.width;
s = w > maxW ? maxW/w : 1;
[s*100,100];