Skip to main content
Participant
August 6, 2020
Question

Text scaling on each line (smart sizer)

  • August 6, 2020
  • 2 replies
  • 409 views

Hi

 

I would like the text to be scaled up and the leading correct on each line. (see photos)
I am using a ukramedia script, but this only applies to a text box and not a text line.
I don't have much experience with after effects, which is why I also use this script in the first place.

I want to make this a template for premiere, so that it has to be dynamic.

 

 

 

This is the smart sizer script:

try {
sizeOptions = effect("Smart Sizer 1.0")("Size Options").value;
customTime = sourceTime(effect("Smart Sizer 1.0")("Custom Time").value);
layerSizeAt = effect("Smart Sizer 1.0")("Layer Size at").value;
customTimeSource = effect("Smart Sizer 1.0")("Custom Time Source").value;
switch(layerSizeAt) {
	case 1:
	finalSize = sourceTime(time);
	break;
	case 2:
	finalSize = inPoint;
	break;
	case 3:
	finalSize = inPoint + outPoint/2;
	break;
	case 4:
	finalSize = outPoint;
	break;
	case 5:
		if (customTimeSource == 1) {
			finalSize = sourceTime(customTime);
		} else {
			finalSize = customTime;
		}
	break;
	default:
	finalSize = sourceTime(time);
	break;
}
sizeAtTime = sourceRectAtTime(finalSize, true);
xMargin = effect("Smart Sizer 1.0")("X Margin (px)").value * 2;
yMargin = effect("Smart Sizer 1.0")("Y Margin (px)").value * 2;
xSize = effect("Smart Sizer 1.0")("Width (px)").value - xMargin;
ySize = effect("Smart Sizer 1.0")("Height (px)").value - yMargin;
x = xSize / sizeAtTime.width * 100;
y = ySize / sizeAtTime.height * 100;
fitToWidth = Math.min(x, y);
fitToHeight = Math.max(x, y);
switch(sizeOptions) {
	case 1:
	[x, x];
	break;
	case 2:
	[y, y];
	break;
	case 3:
	[fitToWidth, fitToWidth];
	break;
	case 4:
	[fitToHeight, fitToHeight];
	break;
	case 5:
	[x, y];
	break;
	default:
	[x, y];
	break;
}
}
catch (err) {
	value;
}

 

Thanks in advance!

This topic has been closed for replies.

2 replies

evab2486117
Participant
March 16, 2021

Is there a more detailed explanation? I do not understand how this script works or where I have to put it.

Mylenium
Legend
August 6, 2020

You can't use paragraph text in that way. If you realyl want to match different lines of text, the have to be separate. There's only so much expressions can do. Other than that you can always rig it up with scale text animators set to per line mode. Easy enough to do and eliminates using any expressions from the equation.

 

Mylenium