I have defined a text bonding box (275px x 153 px for example).
Now I need to set this text to AUTO fit (resize both spacing and font size) this bounding box.
How can i do this in Photoshop?
Just use the Type Tool and click anywhere in your photoshop document. Type your text, paragraph etc. Once you're done, simply hit enter. Now (make sure your text layer is selected in the layers menu) then hit CTRL-T for transform (or select it from the menu: Edit/Transform/Scale) and click and hold any corner of the bounding box, hold the SHIFT ket to preserve the proportions of your text unless you want to stretch it voluntarily, and just adjust it the size you want!
As simple as that.
I've come up with a solution that may work for some use cases.
I'm using text layer variables to populate the people's named on certificates from a CSV. Due to the time it would take to edit over 1100 names manually I though why not create images for each name and scale those. I saved these images and used the variable replacement for the image which can be scaled to a specific size using the "fit" option. This has made about 85% of my names viable (the average length names), leaving me to do the rest manually. It's not perfect but certificates are generally not compared to one another once received anyway. I wouldn't do it for business cards or anything you might see side by side or the viable percentage would have dropped to about 60%. Still better than doing it all by hand.