Calculate number of lines in paragraph text

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
yuppster
Posts: 16
Joined: March 3rd, 2006, 4:01 pm

I've got a 'Paragraph Text' text block... and need to figure out how many lines the paragraph contains.

I know if it was 'Point Text' I could do something like txt.split("\r"); but it's got to remain paragraph text. Any ideas?
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

Not really. Doing this would require to access the glyph bounding box sizes, kerning and spacing parameters which is not possible. If you know the bounding box size of each letter at a given point size, you could use the sourceRectAtTime() method and add them all together, but it would still be a guesstimate rather than a correct calculation.

Mylenium
[Pour Mylène, ange sur terre]
yuppster
Posts: 16
Joined: March 3rd, 2006, 4:01 pm

Okay, that's kind of what I suspected. Thanks for your insight Mylenium.
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

You could always just read the text from a file, then assign it to a layer.

Then you would know how many lines of text you created.

Of course, you can not create paragraph text via jsx code in AE7. CS3 , I don't know?
Post Reply