Trying to Scale font size down as words are added
- November 27, 2023
- 1 reply
- 225 views
I have a text layer in a text box. With fewer words I want the text to be at a maximum font size and as more words (and lines) are added I want the font size to scale down to a minumum size.
I have a null controller with a slider control (output) with this code
var driver = thisComp.layer("Display Text").sourceRectAtTime().height;
var dMin = 845;
var dMax = 1300;
var pMin = 305;
var pMax = 240;
linear(driver, dMin, dMax, pMin, pMax)
On the source text of text layer I have this code.
var FS = thisComp.layer("Controller").effect("Output")("Slider"); text.sourceText.style.setFontSize(FS).setLeading(FS)
When I add words and lines I can see in the properties panel that the font size is going down, but it still displays at the original (max) font size.
