Objectmix
Tags Register Mark Forums Read

Center text horizontally and vertically on composition? : Adobe After Effects

This is a discussion on Center text horizontally and vertically on composition? within the Adobe After Effects forums in Adobe Tools category; Hello, I'm working on a short projects (15 minutes length). Every 30 seconds a title fade in/out against a blank (grey) composition. How do I go about easily centering the text (single word) on the composition both horizontally and vertically? I know I can horizontally center via the paragraphs pallet, but how do I center on the vertical at the same time? Right now I'm modifying the Anchor Point of the text so it's in the center (visually) of the text, and then set the Position to the center of the composition, but every time I increase the type size, ...


Object Mix > Adobe Tools > Adobe After Effects > Center text horizontally and vertically on composition?

Adobe After Effects Adobe After Effects discussion forums

Reply

 

LinkBack Thread Tools
  #1  
Old 10-01-2008, 11:35 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Center text horizontally and vertically on composition?

Hello,

I'm working on a short projects (15 minutes length). Every 30 seconds a title fade in/out against a blank (grey) composition. How do I go about easily centering the text (single word) on the composition both horizontally and vertically? I know I can horizontally center via the paragraphs pallet, but how do I center on the vertical at the same time?

Right now I'm modifying the Anchor Point of the text so it's in the center (visually) of the text, and then set the Position to the center of the composition, but every time I increase the type size, I have to go through this all over again...and with different titles coming up every 30 seconds or so, a simple text size change turns into a lot of work.

I can only image there's a better way to do this and would appreciate any advice for an AE newb!

Thanks,
Kristin.
  #2  
Old 10-02-2008, 12:49 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

No. Text alignment is determined by the properties of the text layer, meaning that the actual rendered pixels are derived from the contours in relation to the glyph bounding box and kerning info found in the font file. Hence the placement of the anchor point or other text-specific stuff is derived from the true typographical data, which in effect means that the anchor point will almost never be placed in the vertical center because the text engine will respect baseline settings and line spacing. Therefore aligning text automatically is not even possible with the Align&Distribute palette. You could only coerce AE by creating the text in Photoshop and importing the pixel data. In that case you could use Align&Distribute to center the text by creating a comp size solid as reference. You can always convert such text to editable text later.

Mylenium
  #3  
Old 10-02-2008, 08:03 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

A, bummer.
Well, here's to hoping CS4 will bring better text box options from InDesign... (I know, I won't hold my breathe... <G>).
Thanks!
k.
  #4  
Old 10-02-2008, 08:54 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

It is possible to do this via scripting, but it won't be "live", i.e. you would have to run a script to grab the dimensions of the text layer each time you want to update its vertical alignment.

It is also possible to roughly align text vertically using expressions given three limitations:

1) You'll have to be willing to consider the height of the text layer to only extend from the cap height of the first line to the baseline of the last line, meaning descenders and ascenders wouldn't be counted as part of the height of the text layer.

2) You'll have to manually locate the center of the first line of text.

3) You'll have to be happy with one point size for your your top line of text, and a consistent line spacing throughout..

Given those limitations, vertical alignment can be done as follows:

Add a Position animator to your text layer. Delete the default range selector – you won't need it. Next add the Line Spacing property to the newly-created animator (using its "Add" menu). In the Character panel, set your text layer's line spacing to 0 (it will really be set to .01, but the difference shouldn't be noticeable once we're done). In the Line Spacing animator, set the desired line spacing (unfortunately, "Auto" isn't an option).

Now set your Text layer's anchor point such that it falls in the center of the text's cap height (the height of a capital letter with no ascender or descenders).

Next, add the following expression to the Position property of the text animator (NOT the Position property of the text layer's Transform group):

STA = text.sourceText.split("\r");





value - [0, (STA.length-1)*propertyGroup(countUp = 2).property.lineSpacing[1]]/2




And with that, you should be done.
  #5  
Old 10-02-2008, 09:10 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

Nice, Aaron. It looks like you've done this one before.
  #6  
Old 10-02-2008, 09:12 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

Thanks!
  #7  
Old 10-02-2008, 12:00 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

BTW, for all folks interested: CS4 scripting will introduce some new methods (not for expressions, unfortunately) that deal with matters of getting the text bounding box, setting font sizes and a few other things, so this might become a bit easier.

Mylenium
  #8  
Old 10-02-2008, 04:42 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

Where'd you hear about the scripting additions? Is there any information on the web?
  #9  
Old 10-05-2008, 09:39 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?



Where'd you hear about the scripting additions?




A little bird that works in my building probably told him.

Is there any information on the web?




That same little bird is working on a summary of changes to scripting for After Effects CS4. Stay tuned.
  #10  
Old 10-05-2008, 05:29 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Center text horizontally and vertically on composition?

Awesome. Thanks!
Reply

Thread Tools



All times are GMT -5. The time now is 01:02 AM.

Managed by Infnx Pvt Ltd.