Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Font autoresizes to fit bounding box

  • Font autoresizes to fit bounding box

    Posted by Enrique Rovira on June 21, 2016 at 12:39 pm

    I have been trying to find a way to do this to no use.

    I am creating templates in AE to link to Premiere Pro so that other people with can change the text, problem is the text sometimes is 4 lines, sometimes 20 and it needs to fit inside the same space.

    Ideally I’m looking for an expression that changes font size to fit the width and height of the bounding box. Possible?

    Thanks!

    E

    Enrique Rovira replied 9 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kalleheikki Kannisto

    June 21, 2016 at 7:07 pm

    Possible, yes, but there are some problems with the simple approach.

    The easy way would be to get the width height for the text box and the rectangle it needs to fit in with sourceRectAtTime(), then scale the text layer to fit the smaller dimension.

    The problem is that you don’t reflow anything this way, just shrink it, so it’s not going to fit the rectangle nicely. You’re going to get uneven, in many cases VERY uneven, margins at the top and bottom versus left and right.

    Reflowing the text is a much more complex problem. It is possible, but complex. You would have to start with something like this and modify it further to suit your purposes:
    https://forums.creativecow.net/thread/227/29259#29269

  • Enrique Rovira

    June 28, 2016 at 1:48 pm

    Thanks I followed that link but my expressions knowledge is not good enough to modify if as needed and it creates a huge processing problem too which is not idea. So I did something slightly different and less fancier for now… and have put through a request to Adobe to include some formatting options in Premiere Pro for text boxes created on AE.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy