Photoshop: Auto expand/contract text to fit in text box

  • 2
  • Question
  • Updated 2 years ago
  • (Edited)
We create layout templates for student program pictures in Photoshop. In our designs, we layout text boxes for last names that are centered in the design and usually go across the majority of the width of the design. Our problem is that we continually have to expand or contract those names depending on total number of characters to fit our text box so they look consistent. We currently do this with the move tool and the right side middle handle of the text which works perfect. Does anyone know of a way that we can configure the text box to do this automatically when we paste their names in it. We currently use automation within Photoshop for other functions but have to do this several thousand times manually so they all look good. In short, we would like "LEE" to expand and "FITZGERALD" to contact to fit the same sized text box. We are currently using Elements, are expanding to CC and all are done on PC. Thank you for any light you can shed on this problem!Scott
Photo of scott stefka

scott stefka

  • 5 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 2
Photo of David

David, Official Rep

  • 2898 Posts
  • 419 Reply Likes
Hi Scott,

This might sound like a dumb question, but why don't you just use point type and allow the (center-justified) line be as long as it needs to be?  The bounding box doesn't display, so there's no real need to make it smaller after "Fitzgerald," is there?

If you really must shrink the bounding box, it's not sure-fire, but you could write a script that captures the number of characters in a text layer and use that to roughly set the bounding box size.

Photo of scott stefka

scott stefka

  • 5 Posts
  • 0 Reply Likes
David, thanks for your reply. My problem is that I want to design the text box to be the same size for each student regardless of name and to fully fill the width of that box regardless of size of name . These are large designs with large font stylized text. They are consistent width for each student . For example, I would want "LEE" stretched to fill the same space as "FITZGERALD" so it looks correct without all the empty space on the sides of LEE if it was center justified. As far as writing code, well I would be lost on that possibility. Thanks again David!
Photo of Kyle Kimsey

Kyle Kimsey

  • 2 Posts
  • 1 Reply Like
Just adding another use case that falls in line of what Scott is suggesting. One of the things I often do is hockey jerseys. These have a defined space allowance for the name plate. We use a .csv to automate the creation of every number/name combination needed.

Occasionally, you get a  few players with hyphenated names, like "Roman-Stamos" that doesn't fit within the box (thus, won't fit on the back of the nameplate). Having the ability to say "Here are the bounds, do not exceed these and do not wrap to next line" would be an excellent option. Photoshop would then recognize that the name fell outside of the bounding box and that it's being told not to wrap to the next line (like it's a paragraph), so it would auto-scale the font size percentage down to fit within the box confines.
Photo of Col Hinton

Col Hinton

  • 1 Post
  • 0 Reply Likes
This is done automatically in PaintShop. A much better program than Photoshop. I tried Photoshop cause everyone raves about it, but Corels Paintshop is by far a better program.