Skip to main content
TamiBD661
Participant
September 9, 2012
Answered

How can I perfectly vertical center text with various font sizes

  • September 9, 2012
  • 5 replies
  • 28114 views

Hi,

I have the following frame:

http://www.flickr.com/photos/82397830@N03/7960870684/

I tried vertical centering by setting Text Frame Options > Vertical Justification > Align: Center, however my text still isn't getting vertical centered. When I put english words instead of hebrew ones the text does get vertical centered.

This topic has been closed for replies.
Correct answer Michael_Gianino

There is a sort-of invisible frame around characters of a font. The frame measures from the lowest portion of characters that dip below the baseline (like p and j) up higher than the tops of the capitol letters to accommodate diacritic marks like umlauts and accents. Since most characters don't go all the way to the highest ascender or down to the lowest decender, it can appear that text isn't centered between two vertical points.

If you need the text to be centered exactly, you can cheat it by applying baseline shift, but keep in mind that if you change the text, you may have to tweak the amount of baseline shift again. You can either apply baseline shift to the text itself, or edit the text frame options and change the Baseline Options. Also, in your screenshot, I see that you have rounded corners on your text frame. Vertical justification only works on rectangular text frames, so that's why that isn't working.

5 replies

Participant
November 25, 2024

Text Frame Options > Baseline Options > Cap Height

Michael_GianinoCorrect answer
Inspiring
September 9, 2012

There is a sort-of invisible frame around characters of a font. The frame measures from the lowest portion of characters that dip below the baseline (like p and j) up higher than the tops of the capitol letters to accommodate diacritic marks like umlauts and accents. Since most characters don't go all the way to the highest ascender or down to the lowest decender, it can appear that text isn't centered between two vertical points.

If you need the text to be centered exactly, you can cheat it by applying baseline shift, but keep in mind that if you change the text, you may have to tweak the amount of baseline shift again. You can either apply baseline shift to the text itself, or edit the text frame options and change the Baseline Options. Also, in your screenshot, I see that you have rounded corners on your text frame. Vertical justification only works on rectangular text frames, so that's why that isn't working.

TamiBD661
TamiBD661Author
Participant
September 9, 2012

Thank you very much for your explanation, really saved me the headache of wondering whether it is possible to automatically center this sort of text.

Community Expert
September 9, 2012

@Tami – Basically it is:
numeric way calculating even spacing  vs.   geometric oriented way calculating white space*

*and maybe taking into account the "grey level" of the font in contrast to the background color and some more subtle ingredients for decission making where a given set of background/foreground elements are positioned in a balanced way. Not to forget the surrounding elements and colors.

What I mean is: there is no easy formula for the right alignment of elements.

Uwe