Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Vertical text centering

  • Vertical text centering

    Posted by Jerry Smith on April 6, 2016 at 10:51 am

    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.

    Thanks.

    Zach Meissner replied 6 years, 3 months ago 5 Members · 4 Replies
  • 4 Replies
  • Michael Szalapski

    April 6, 2016 at 2:07 pm

    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.

  • Kalleheikki Kannisto

    April 6, 2016 at 9:08 pm

    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?”

  • Ze’ev Gilad

    March 9, 2017 at 9:30 pm

    To center a text layer vertically, apply this expression to the Anchor of the text layer:

    s=sourceRectAtTime();[0,s.top+s.height/2]+value

    This will move the Anchor Point to the true vertical center of the text block. You can then tweak the values to adjust.

    This works for single lines, multiline, and even text blocks.

  • Zach Meissner

    April 10, 2020 at 8:02 pm

    Thanks so much Ze’ev! That worked brilliantly!!

    http://www.lab316.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy