Auto Font Size by Length

Shrinks font once text exceeds a character limit to avoid overflow.

Code

// Text > Source Text
var maxChars = 90;
var startSize = 60;
var step = 10;
var chars = text.sourceText.length;
var shrink = Math.floor(chars / maxChars);
style.setFontSize(Math.max(30, startSize - shrink * step));
textfontresponsive

How to Use

Paste into Source Text. Increase `maxChars` if you want to allow longer lines before shrinking.