FORUMS: list search recent posts

Font autoresizes to fit bounding box

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Enrique Rovira
Font autoresizes to fit bounding box
on Jun 21, 2016 at 12:39:14 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?



Return to posts index

Kalle Kannisto
Re: Font autoresizes to fit bounding box
on Jun 21, 2016 at 7:07:49 pm
Last Edited By Kalle Kannisto on Jun 21, 2016 at 7:13:53 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:

Return to posts index

Enrique Rovira
Re: Font autoresizes to fit bounding box
on Jun 28, 2016 at 1:48:20 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.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved