Skip to main content
Participant
Feb 9, 2024 9:28 PM UTC
Question

Bounding a paragraph to a shape

I am working on creating a AE template that will pull information from an Excel spreadsheet and place that information in various locations within the comp. One of the cells in Excel will be a comments section and this section can get lengthy at times. So, what I am trying to do is setup a text box that is W:1300pix by H:720pix, and when the texts reaches W:1300pix it will break and start a new line below it and when it reaches the max height of 720pix it will auto scale down so that the paragraph will fit inside the box. 

 

The text box works great with adding the line breaks but as soon as the texts go past the max height it gets cut off. Is there an expression that I can add to the text box or source text that when the paragraph reaches it max height it will auto scale down? 

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Adobe Employee
Feb 12, 2024 12:56 AM UTC

This might be useful to you, or at least to try and see if it addresses part of your workflow.

 

https://community.adobe.com/t5/after-effects-beta-discussions/new-text-box-options-available-in-scripting/td-p/14409110

 

TextDocument.boxAutoFitPolicy

 

It only grows the bottom/height at this point, so not super flexible, but sounds like it might work here for your case.

 

The functionality is only exposed in Scripting, and in the Beta.

 

Douglas Waterfall

After Effects Engineering

Translate
Mylenium
Legend
Feb 10, 2024 8:12 AM UTC

The usual sourceRectAtTime() stuff will work, though it's notoriously unreliable with paragraph text due to the same limitations you already experience. It might be better to use line text or handle the overflow in Excel. Either way, you will need a dummy text layer to measure what the full text would be and then do whatever scaling or reformatting.

 

Mylenium

Translate