Activity › Forums › Adobe After Effects Expressions › Set the auto leading by script.
-
Set the auto leading by script.
Posted by Andrei Popa on October 7, 2020 at 8:54 amDo you guys know if there is any way to set the leading of the text to auto by script?
If I set it to 120% of the font size, which would be auto, it just sticks with that value. If I later modify the font size, the leading does not follow.
Andrei Popa replied 5 years, 6 months ago 4 Members · 5 Replies -
5 Replies
-
Andrei Popa
October 8, 2020 at 7:55 amThanks Dan!
That coming from you pretty much assures me there is not a way to do that 😀
-
Tomas Bumbulevičius
October 9, 2020 at 10:29 pmAndrei, I kind of did on hack in the past, which might help you as well:
1. Apply Line Spacing from Text Animator.2. Grab whole text height by sourceRect.
3. Get number of lines in the text, by finding line breaks.
4. Either set expression or set value by script, to calculate approximate value needed.
Not 100% sure if this will do what you need to, but I used this approach to space out text in a fixed height container, when number of lines varies (different thing, though)
-
Filip Vandueren
October 12, 2020 at 8:27 pmI guess the script can’t add it to the layer via an expression ?
-
Andrei Popa
October 28, 2020 at 5:27 pmAdding to the expression may be the only way. Some texts have complicated expressions and not that easy to modify but I’ll have to give it a try.
I think the best solution would be to put the value on the last row in every expression. Then the script could split the expression, get the last row and put it into something like style.setText(“last row”).setAutoLeading(true).
Thanks for the suggestion.
Reply to this Discussion! Login or Sign Up