• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Expression for Text auto line break and Leading

New Here ,
Jun 20, 2017 Jun 20, 2017

Copy link to clipboard

Copied

Hello there! I could use some help with an expression from someone who knows a thing or two about expressions, much unlike me.

I regularly create compositions with scrolling team names for various sports. Right now I'm trying to create a comp with 950+ team names, one per line. As you can imagine it's getting a little tedious. I'm using a single point text box, not fixed width, as I want the text to freely expand the text layer as needed. The text layer's font size is 156 and my line spacing is 850 so only one name is on the screen at a time as they scroll. However, if a team name is too long and falls outside TV safe, I have to manually insert a return then set that next line's spacing to 156 to match the font size so they form a nice two line block.

My question is, would there be an expression to insert a line break after X amount of characters and set that next line to 156 line spacing, all while maintaining 850 line spacing between each team name? This would save me so much time it's ridiculous, but I'm not particularly skilled at AE expressions. Does anyone know of an expression for this or even perhaps a script?

Thanks!

Views

7.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 20, 2017 Jun 20, 2017

Copy link to clipboard

Copied

How are you bringing the 950 lines of text into your comp at the moment - copy and paste, or are you referencing an external text file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2017 Jun 20, 2017

Copy link to clipboard

Copied

When I'm faced with this kind of a problem by far the fastest way to set the type is to use Adobe Illustrator. Create the list of names in AI, adjust the kerning and leading as needed, reset the artboard to the size of the text, save and import into AE as a single asset. Then set the anchor point's y value to zero and add a simple expression that moves the text up the screen precisely a whole number of pixels per frame so you don't get funky things happening with the top and bottom edges of the type and you don't get judder. You should be able to do the typesetting in AI in about 1/3 the time it would take in AE and get a better job and more accurate placement of the text.

If you are doing rolling or crawling text you should read these two articles from AE's FAQ list on this forum to avoid some serious visual problems this kind of motion graphics commonly have. I've even seen feature films in a theater that had end credits that you couldn't stand to watch because of judder because the designer didn't understand the basics of motion and frame rates.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2017 Jun 21, 2017

Copy link to clipboard

Copied

So I've tried this before, but several versions of Illustrator ago, so things may have changed. My artboard was so large it wouldn't fit its entirety in the canvas. Perhaps that's changed now. I've also tried Photoshop but I hit the vertical image size limit. I may also try InDesign, that would at least get me the Story Editor so I wouldn't have to interact directly with the formatted text.

I'm using an expression to scroll the Y position at a rate divisible by the comp's frame rate, so I've mostly solved the judder problems. Also, I'm at 59.94, which has helped.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2017 Jun 21, 2017

Copy link to clipboard

Copied

Right now I'm just copy and pasting from Excel. I had thought about using something like Templater or CompsFromSpreadsheet, but I don't think they'll accomplish what I need.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 21, 2017 Jun 21, 2017

Copy link to clipboard

Copied

My question is, would there be an expression to insert a line break after X amount of characters and set that next line to 156 line spacing, all while maintaining 850 line spacing between each team name?

Forget it. Expressions cannot access these detailed formatting options directly, which means you need a ton of text animators with expression selectors on top of processing the actual source text, which at 950+ lines is going to be problematic already, either. Since the selectors evaluate strictly per line/ word/ character based on the internal text index, they are slow as hog. Would it be possible to create such a setup? Absolutely. It's just that it's completely impractical to use. As Rick suggested, using a page-layout program and importing a PDF would be much more efficient. Nestred paragraph styles in InDesign could make this relatively straightforward. You may just need to experiment with the actual values and sizes to match points and inches to pixels...

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 21, 2017 Jun 21, 2017

Copy link to clipboard

Copied

LATEST

Mylenium, I do believe I'll have to go the PDF route. I'm running into exactly what you described. The amount of time it take AE to calculate each line of this single text layer is almost unbearable. I'm going to give InDesign or Illustrator a shot and see if that'll fix my woes.

Thanks everyone!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines