-
Expression relating paragraph lines with font size
Hello everyone,
I am trying to create a script that links the font size in a paragraph with the number of lines of the same paragraph, in the following way:
If the number of lines is 3 or less leave the font-size value the way it is, otherwise decrease the font size until it reaches 3 lines.
I found Andrei Popa’s line counter, which works great, and I tried to use it with a for statement in with a setFontSize script but I kept getting error messages.
Any suggestions?
Andrei Popa’s script is this one:
L = thisComp.layer("Text Layer");
var newStyle = L.text.sourceText.style;
var myLeading = newStyle.autoLeading ? newStyle.fontSize * 1.2 : newStyle.leading;
H = L.sourceRectAtTime(time, false).height;
rowNo = Math.ceil(H / myLeading);
rowNo;
Sorry, there were no replies found.