2

In Indesign, you can double-click the text frame corners and your text field will crop so the frame is the same size as the text. Do any of you know if you have a similar function in Photoshop?

  • Unless I'm reading you incorrectly, the text frame in Photoshop is always the size of the text's bounding box. Resizing the box resizes the text, not just the frame. – Tetsujin Nov 1 '18 at 13:54
  • @Tetsujin The OP refers to a text box frame with text inside, not a regular "click and type text frame". – Danielillo Nov 1 '18 at 14:10
  • @Anne there's a script that makes it, but isn't free, maybe somebody here knows it. – Danielillo Nov 1 '18 at 14:10
  • InDesign can do more than that by the way, you can set text boxes to Auto Height so they always fit the content, whatever edits are being made. Photoshop's typesetting abilities cannot be compared to InDesign's. – Lucian Nov 1 '18 at 16:26
3

You can sort of do it by converting the paragraph text to point text and then back to paragraph text. Type > Convert to point text and Type > Convert to paragraph text. This method isn't very accurate. It leaves some of empty space in the text frame.


You can get something a bit more usable with scripts. I've made this script just for my own use so it's a bit rough around the edges:

  • This part: active.textItem.height = 10000; (line 9) essentially just makes the text frame ridiculously tall before finalizing the text frame resize, so that hidden text is included in the resize. If removed, the script will just resize to what is visible, leaving hidden text alone.

  • Text flow may sometimes shift around a little.This happens in the gif on the 4th run time before I move the panel. Because of that the text box doesn't resize perfectly but running the script again in that situation solves that.

enter image description here


// Fit Text Frame To Content.jsx

var rulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.POINTS;

var doc = app.activeDocument;
var active = doc.activeLayer;

active.textItem.height = 10000;

var bounds = active.boundsNoEffects;
var top = bounds[1].value;
var right = bounds[2].value;
var bottom = bounds[3].value;
var left = bounds[0].value;

var width = right - left;
var height = bottom - top;

active.textItem.width = width;
active.textItem.height = height;

app.preferences.rulerUnits = rulerUnits;
-1

Anne. This is a known and asked feature that we, editorial designers, keep expecting in other programs as illustrator or photoshop. Is not featured in them. You either have to manually adapt the box

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.