: How to center text vertically within a textbox in Photoshop It's pretty annoying that you can't center text vertically in Ps automatically, like you can in Indd. It's even more annoying that
It's pretty annoying that you can't center text vertically in Ps automatically, like you can in Indd. It's even more annoying that the bounding box of text can't be 'collapsed' or 'fit to text', like in Indd.
I could convert the text to shape, but then I lose coloring. I could convert to smart object, but then its not vector anymore, for when I export to pdf.
Is there a work around anyone knows of that would make it easier to center text vertically?
More posts by @Alves566
6 Comments
Sorted by latest first Latest Oldest Best
Thank you for the head start - there's an even easier way I stumbled upon while following the above instructions: (I have PhotoShop CC 2015.1.1)
You can use a draggable bounding box, just tighten it up to the top and bottom of the text within.
Using the Rectangular Marquee Tool drag the rectangle into which you would like to center the text
Click and select just the Text Layer in the Layers Window
Pull down Layer -> Align Layers to Selection and press both Vertical centers and Horizontal Centers
I found a way today that I didn't know, it is partly as Michael Osterhus says, but I didn't really get what he meant to begin with.
You need to write your text with just a single click, not a draggable bounding box. This can be placed wherever you want.
Next step you create a box, I used the Rectangle tool to create a box of the area where I wanted my text to be aligned both vertically and horizontal with.
Then I selected both the text layer and the rectangle layer and with both of them selected I went up into Layer -> Align and pressed both Vertical centers and Horizontal centers
This simple tactic gave me the exact result that I was out after, so this nifty trick is very very useful when you need to center text in someway.
If that wasn't obvious before, the text aligns horizontal and vertical relatively to the rectangle that you draw, so if you want your text to be vertical aligned over the whole document, you need to have a rectangle at that size and so on.
For positioning text you don't need a bounding box.
I never use bounding boxes for text in PS. I click the text tool without dragging and set the text cursor without a box. Once the text is entered, I can center it vertically or horizontally just like any other shape using the align buttons--assuming I have something to align it to.
I do the same thing in Illustrator. As an example, I was making an award ribbon, a circle with text in the center. I made the circle, then wrote three lines of text, center aligned with no bounding box, not even close to the center of the circle. I then selected both the circle and the text, and hit vertical align center, horizontal align center, and the text is perfectly centered in the circle.
Here's a script I wrote that might work. I've not tested it yet however.
centerTextVertically( app.activeDocument.artLayers.getByName( 'Text-Layer-Name' ) );
/**
* @param {ArtLayer} textLayer The text layer to apply the vertical centering.
*/
function centerTextVertically( textLayer ) {
if ( textLayer.kind !== LayerKind.TEXT ) {
return; // No-op: Not a text layer
}
var verticalCenterOffset = textLayer.textItem.height / 2;
var textCenterOffset = textLayer.textItem.size / 2;
textLayer.textItem.baselineShift = verticalCenterOffset - textCenterOffset;
}
I'd love to be proven wrong on this, but you can't vertically center text in Photoshop automatically. Just like you can't do it in Illustrator. You're stuck with manually adjusting the baseline shift.
Here is the inevitable...
but you can do this is InDesign.
Yes, and it's awesome. But PS and AI are stuck without it. :(
EDIT: Dang! I thought @Yisela 's answer was part of the question. Sorry about that.
Although it's not automatic (you need to adjust it manually for each text), you can use Baseline Shift to 'imitate' a vertical centering:
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.