Skip to main content
Inspiring
February 2, 2018
Question

Script to center text vertically in adobe illustrator?

  • February 2, 2018
  • 3 replies
  • 4459 views

Does anyone know of a script to do this?  I imagine the script will have to take the height of the text-box and divide it by two.  However, the size of the text will probably have to be taken into consideration as well.

This topic has been closed for replies.

3 replies

Mike_Gondek10189183
Community Expert
Community Expert
February 2, 2018

Or you may be content with double clicking here

to trim excess unused height from your text container. I added a descender so you can see how  important this is to consider.

Mike_Gondek10189183
Community Expert
Community Expert
February 2, 2018

If you goal is to get the type in the center of the text box, that is not possibly in Illustraro as in InDesign.

You can have the align palette to do this, but you need to do 2 things

  1. Add an effect >>Path >>  outline Object to your tyep element
  2. Turn on use preview bounds

The reason the align palette does not by default center text, is that it is centering upon the font (including the space above and below the ascenders and descenders, coded into the font. 

Not sure if this helps you, but please clarify or provide an example with more detail of what your end result you are looking to do.

Mike_Gondek10189183
Community Expert
Community Expert
February 2, 2018

The script would have to calculate something such as a baseline shift, and you would need to let us know what you want to do about ascenders and descender.

Might be better to post here, or I can move your post for you

Illustrator Scripting

There are ways to do this without scripting, of which will add a separate reply.

Inspiring
February 2, 2018

I have a hard time believing there isn't a script that auto-adjusts the baseline shift in the Character menu.

pixxxelschubser
Community Expert
Community Expert
February 3, 2018

Please no insults.

And then: again read my contribution, think meticulously and then answer.


https://forums.adobe.com/people/pixxxel%20schubser