- June 1, 2021 at 2:12 pm
I’m currently working on an animation where i have to play with a text leading and size.
I’ver set the expressions
newStyle = style.setFontSize(effect(“Size”)(“Slider”));
newStyle = style.setLeading(effect(“Leading”)(“Slider”));
But when I connect them to the slider only one of the two works. Almost like it goes in conflict. Is there maybe a way to calculate and retain the leading/size ratio and attaching it to one slider only so it feels consistent all the way?
Here’s attached an image for reference https://imgur.com/a/aWAPYPm
- June 1, 2021 at 3:19 pm
Combine both values into the same style by chaining the methods:
newStyle = style.setFontSize(effect(“Size”)(“Slider”)).setLeading(effect(“Leading”)(“Slider”));
- June 1, 2021 at 3:43 pm
- June 1, 2021 at 3:46 pm
The website converted straight “quotes” to curly “quotes”.
- June 1, 2021 at 3:54 pm
that worked! Thank you so much!
- June 1, 2021 at 7:11 pm
You could also try this, which I did for a specific branded treatment that needed to retain the same font size to leading ratio at scale. This allows you to scale up the font size with the slider and the leading will follow.
You’ll need to do the math to come up with the ratio of size to leading and replace the ‘x’ with your number. Then, create a slider and then put your slider name in place of “Font Size”.
// Font size multiplied by x (x = the ratio of font size to leading)
style.setFontSize(effect("Font Size")("Slider")).setAutoLeading(false).setLeading(effect("Font Size")("Slider")*x).setFont("Axiforma-Black");
- June 2, 2021 at 8:29 am
Sounds awesome Wyatt! Will try now! Thank you!
Log in to reply.