Centering text within image canvas

TM
Posted By
Taxed_Mind
May 1, 2007
Views
321
Replies
7
Status
Closed
It should be so simple, but I just can’t work it out. I am trying to make some buttons for a web page in PS CS2 say 160×33 pixels and I want only one word of text on the left margin but centred in the rectangle. How do I get this to work so that no matter how many I make the text will always be in the same place?

I have tried using the text justify, etc, buttons but they are only for left and right and take my text off the canvas, any idea why?

Thanks in advance

A taxed mind

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

DM
Don_McCahill
May 1, 2007
If you click, it is hard to click in the middle of the image. I recommend dragging from the left side of the image to the right side, and then having center justification.
DP
Daryl_Pritchard
May 1, 2007
By saying "text on the left marging but centered in the rectangle", do you mean vertically centered? If so, the only way I know to do that is by selecting the text layer in conjunction with possibly just the background layer, then performing Layer > Align > Vertical Centers. As for the justification of the text, there is indeed a Center justify option, which is the center of the three justification options in the Options Palette. Or, in the Paragraph palette you also have a centered text option. Regardless of the justification, you can also left- or right-edge align layers to get a left or right justification appearance, but only for single lines of text rather than paragraphs.

Regards,

Daryl
JJ
John Joslin
May 1, 2007
And, in case you hadn’t thought of it yourself, don’t recreate the button n times. Save Button 1, then do a "Save as" Button 2 and just edit the text. Save again, then "Save as" Button three and so on.

These will be PSDs which need saving for the web as JPEGs. Keep the originals!
TM
Taxed_Mind
May 1, 2007
John, thanks very much for your reminder, I was indeed planning on doing that, but your help is very much welcomed anyway.

Daryl, That layer align was exactly what I needed, thanks very much.

Any idea why when I go through the options palette that you mentioned and press "centre" it takes my text just off to the left of my canvas, "left align" brings my text to the very left edge of the canvas (correct) and the "right align" takes my text so far off the canvas that I have no idea where it has gone?

Thanks for your help
MD
Michael_D_Sullivan
May 2, 2007
It is centering in the text box you dragged out, which should be highlighted in dotted lines. If you didn’t create a text box, and just clicked to start typing, it probably centers it based on the image or canvas size, but I haven’t tried centering something text didn’t have a defined boundary.
DP
Daryl_Pritchard
May 2, 2007
I think what is happening when you don’t use a text box, is that left-justification was the default option or last-left option. So, the text anchor is the left end of the text. When you then select center justification, the text is shifted so that anchor is now centered, in essence shifting the text left of a fixed anchor position and beyond your left margin. Hope that makes sense.

Daryl
NB
Neil_Barnden
May 2, 2007
Just to confirm what Daryl is saying (as I was just about to answer your question and found two replies already!), when you click to begin typing, that sets an anchor point for the justification of your text (which is ‘left justified’ by default) – so if you do this at the left edge of the canvas and then change the justification to right after you’ve typed, the text will disappear as you described.

Another way of making sure your text is always centred would be: Bring up the rulers and position a couple of guides on the exact centre of the canvas. Select ‘centred justification’ before you click to set your text anchor point, and then click you anchor point on the marked centre of your canvas. You’ll then find your text is generated correctly from this point.

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Related Discussion Topics

Nice and short text about related topics in discussion sections