I am using variables in Illustrator CC.

As the text comes into my design, I want the font size to change to make the text fit, without the size of the text area box changing.

So, a short word that comes from the variable might have a font size of 14, but a long word that comes in to the same box from the variable would have a font size of 8. Whatever font size lets the word fit in the text box.

Thank you

  • It could be scripted but it would take some hours (for me at least). I could manually scale many words during those hours. What is your case? Do you have many many words?
    – Wolff
    Feb 3, 2017 at 17:07
  • Hi @Mads, yes, I have many many words, need an automated solution to work with the rest of the automation using variables.
    – Jason
    Feb 3, 2017 at 17:41
  • I have come across the term OVERSET TEXT and I think that is what my case is referring to. Although still searching for a solution. Thanks.
    – Jason
    Feb 3, 2017 at 17:42
  • Overset text is when there is not enough room in the textbox for the text contained. The part of the text not shown is the overset text. Illustrator warns you with a red +.
    – Wolff
    Feb 3, 2017 at 18:49
  • From a user-experience point of view, that's a less-than-optimal solution. Much less. It would be far better to size the type for the longest word and simply allow the whitespace to vary.
    – MMacD
    Feb 3, 2017 at 20:41

2 Answers 2


You can use the script and technique described in the LinkedIn article here. The method there would be to add the referenced script be ran during your batch export actions process. To have it run during your batch action, it's got to reside in the [Menu > Scripts] menu item.


Don't do it. It'll look terrible and your users won't like it. Size the text for the longest word, and let the whitespace vary naturally.

  • 2
    Whilst true in most cases I don't think you can say this without knowing the context. There are definitely valid reasons to do this
    – Cai
    Feb 3, 2017 at 20:51
  • @Cal: what valid reasons would those be? I've been around quite awhile and can't imagine any such reasons, but I'm always happy to learn.
    – MMacD
    Feb 3, 2017 at 21:04
  • pinterest.com/mvyas91/type-stacking
    – Cai
    Feb 3, 2017 at 21:08
  • 1
    Nothing I linked to is limited to the 19th C, it's a common use now and you have no idea in what context or why OP is asking this. The GDSE question I linked is talking about infographics — a perfect use case for using variables; which is the only context OP gave. Like I said, I completely agree with you in most cases but the fact is there are perfectly good reasons to do what OP wants.
    – Cai
    Feb 3, 2017 at 22:57
  • 1
    I don't know why you're arguing. All I said is that there are valid use cases for doing what OP wants. Second guessing what OP may possibly be doing to lead to this question and saying "don't" isn't really an answer.
    – Cai
    Feb 4, 2017 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.