Skip to main content
Participant
February 9, 2024
Question

Bounding a paragraph to a shape

  • February 9, 2024
  • 2 replies
  • 223 views

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 has been closed for replies.

2 replies

Adobe Employee
February 12, 2024

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

Mylenium
Legend
February 10, 2024

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