FORUMS: list search recent posts

Can I limit only the width of a text box without creating a fixed size?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Stephen Pickering
Can I limit only the width of a text box without creating a fixed size?
on Oct 24, 2018 at 2:55:46 pm

Hi there,

I created a mogrt that works almost perfectly for what I need. I need multiple lines (sometimes only a single line, other times 5 lines). Here's an example:




It auto centers both x and y and resizes based on the text. However, because the text is not constrained in a text box, a single line of text width could extend the borders of the composition. Is there a way to allow it to have an unconstrained height (so it resizes for 1 line or 5 lines) but limit the width?

The reason is that when I paste text into the mogrt (or if it's a dynamically linked ae comp) I have to paste some of the text into the first line, then more text into the next line, and so on. I have to guess on where the line break should be and while it's not too tedious, it does take a bit of time when I have several of these to do.

Is it possible?

Thank you,
Stephen



Return to posts index

Jeff Kay
Re: Can I limit only the width of a text box without creating a fixed size?
on Oct 24, 2018 at 7:36:29 pm

When creating the text layer, instead of simply clicking, click and drag to create a bounding box.


Return to posts index

Stephen Pickering
Re: Can I limit only the width of a text box without creating a fixed size?
on Oct 24, 2018 at 7:48:46 pm

Thanks for the suggestion. That's what I would normally do, however, I have the white background "box" scaling to match the text size, so if there is a single line, the background box is a long, short box. A 5-line paragraph would autoscale the background box to fit a much larger text block. Does that make sense?



Return to posts index


Stephen Pickering
Re: Can I limit only the width of a text box without creating a fixed size?
on Oct 24, 2018 at 8:00:17 pm

We found this post: https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=2764... where Dan Ebberts posted a helpful expression:
txt = value;
if (thisComp.layer("Overlay TXT Here").text.sourceText.length >= 61){
for (i = 61; i > 0; i--) if (txt[i] == " ") break;
if (i > 0)
txt.substr(0,i) + "\r" + txt.substr(i+1)
else
txt.substring(0,61) + "\r" + txt.substring(62,999);
}else{
txt
}

Dan's expression adds a break at 61 characters, but only for the first line. We can't figure out how to add a break for line 2, 3, etc.

Any ideas?



Return to posts index

Kalleheikki Kannisto
Re: Can I limit only the width of a text box without creating a fixed size?
on Oct 25, 2018 at 8:20:02 am

Here's a link to a fairly convoluted solution for a similar situation, will need some adjustment for your needs. Haven't tested in recent versions, don't know it if works in CC2019.

https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=3341...

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Stephen Pickering
Re: Can I limit only the width of a text box without creating a fixed size?
on Oct 25, 2018 at 4:01:00 pm

[Kalleheikki Kannisto] "Here's a link to a fairly convoluted solution for a similar situation, will need some adjustment for your needs. Haven't tested in recent versions, don't know it if works in CC2019.

https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=3341....."


Thanks so much for posting this. We're trying it out now but have some other expressions going on which is a bit tricky.

Thank you again and I'll update if I get it working the way we are hoping.

-Stephen



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]