So, if I have a word like: "Hijinks", how do I center it vertically in a box? I have been centering the segment that runs from the top of the "k" to the bottom of the "j". Is that how we do it? I guess the font guys say from the top of the ascender to the bottom of the descender is the font size. But is that also the relevant thing to center? It looks a bit high if the word doesn't have a descender in it.
That is the difficulty with vertical placement of text. But, you know, sometimes something that is technically correct can still look wrong. You should just judge it by eye in many cases.
If, however, you want to be technically accurate (and you're using AE version 13.2 or newer), you can use the sourceRectAtTime attribute in expressions to get the exact pixel height of your text layer.
- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')
No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.
Font's x-height that gives its visual height is determined by the height of the lower case letters that don't have descenders or ascenders. You generally want to center things vertically based on that. Additionally, visual center is slightly above the mathematical center, so you want a little more space below the text than above it.
And, like Michael points out, the final determining factor is "does it looks right?"