Skip to main content
Inspiring
March 18, 2022
Answered

Change text size without transform tool [SOLVED]

  • March 18, 2022
  • 4 replies
  • 5478 views

UPDATE: The user @jazz-y provided a great script that allows us to achieve this. Please go to the following answer and copy the script after the sentence "I rewrote the script with this in mind, try":
https://community.adobe.com/t5/photoshop-ecosystem-discussions/change-text-size-without-transform-tool/m-p/12831039#M631455

 

Meanwhile, you can also upvote this idea to become a native feature, here:
https://community.adobe.com/t5/photoshop-ecosystem-ideas/resize-different-text-proportionally-inside-text-box/idi-p/12823685

 

------

I have a text box with different text sizes and I want to resize all of them proportionally, but I don't want to use the Transform Tool, because that will change the size of the text box itself, which is not what I want.

 

Is there a way to achieve this? When I select all text, the text size field is empty (obviously, because it has a lot of sizes to process) and I can't use that technique of dragging the T icon horizontally to increase/decrease the size.

 

Any tips?

 

 

This topic has been closed for replies.
Correct answer jazz-y

Unfortunately, this does exactly the same as increasing the text by X amount of points using (on a Mac) the Shift + CMD + < or > shortcut (or Shift + Ctrl + CMD + < or >).

Your script gives the option to set the number of points manually, but the script itself is not resizing proportionally (as I mentioned here: https://community.adobe.com/t5/photoshop-ecosystem-discussions/change-text-size-without-transform-tool/m-p/12823614#M630772).

 

Basically it's just adding X amount of points to all text, so a text at 50 and a text of 25, by adding 50 points will become 100 and 75, which is not a proportion of 50 and 25 (which should be 100 and 50 in the end).


@TiagoRocha, i had a feeling that I understood something wrong 🙂

 

In your description, I see one problem - there is no definition of what exactly should act as the basis for determining the multiplier. Let's say, we have two lines 50 pt and 25 pt. If we take the first one as the base and add 50 pt, then we get the multiplier (50+50)/50 = 2. If we have the second one as the base, then the multiplier is different (25+50)/25= 3. We can, of course, use a fixed multiplier, but it will be difficult for you to get the desired symbol size. 

I rewrote the script with this in mind, try:

 

#target photoshop
var w = new Window('dialog{orientation:"column"}'),
    g1 = w.add("group"),
    st = g1.add('statictext{text:"base:"}');
dl = g1.add("dropdownlist{preferredSize: [120,-1]}"),
    g2 = w.add("group"),
    bnInc = g2.add('button{text:"+"}'),
    bnDec = g2.add('button{text:"-"}'),
    et = g2.add('edittext{preferredSize: [40,-1]}');
g1.add('statictext{text:"pt"}');
g2.add('statictext{text:"pt"}');
et.text = $.getenv('size') ? $.getenv('size') : 50
et.onChange = function () { $.setenv('size', this.text) }
bnDec.onClick = bnInc.onClick = function () {
    var base = Number(dl.selection.text),
        scale = this.text == '+' ? (base + Number(et.text)) / base : (base - Number(et.text)) / base;
    if (scale >= 0) {
        changeFontSize(scale)
        w.onShow();
        try { app.refresh() } catch (e) { w.close() }
    }
}
dl.onChange = function () { $.setenv('base', this.selection.index) }
w.onShow = function () {
    var o = getFontSize();
    dl.removeAll()
    for (a in o) { dl.add('item', a) }
    dl.selection = $.getenv('base') && Number($.getenv('base')) < dl.items.length ? Number($.getenv('base')) : 0
}
w.show();
function changeFontSize(scale) {
    var s2t = stringIDToTypeID;
    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('textKey'));
    r.putEnumerated(s2t('layer'), s2t('ordinal'), s2t('targetEnum'));
    if (executeActionGet(r).hasKey(p)) {
        var textKey = executeActionGet(r).getObjectValue(p),
            styles = textKey.getList(s2t('textStyleRange'));
        var l = new ActionList();
        for (var i = 0; i < styles.count; i++) {
            var cur = styles.getObjectValue(i),
                textStyle = cur.getObjectValue(s2t('textStyle'));
            var curSize = textStyle.getUnitDoubleValue(s2t('impliedFontSize')),
                curLeading = textStyle.hasKey(s2t('impliedLeading')) ? textStyle.getUnitDoubleValue(s2t('impliedLeading')) : null;
            textStyle.putUnitDouble(s2t('impliedFontSize'), s2t('pointsUnit'), curSize * scale);
            if (curLeading) textStyle.putUnitDouble(s2t('impliedLeading'), s2t('pointsUnit'), curLeading * scale);
            cur.putObject(s2t('textStyle'), s2t('textStyle'), textStyle);
            l.putObject(s2t('textStyleRange'), cur)
        }
        textKey.putList(s2t('textStyleRange'), l);
        (r = new ActionReference()).putEnumerated(s2t('layer'), s2t('ordinal'), s2t('targetEnum'));
        (d = new ActionDescriptor()).putReference(s2t('null'), r);
        d.putObject(s2t('to'), s2t('textLayer'), textKey);
        executeAction(s2t('set'), d, DialogModes.NO);
    }
}
function getFontSize() {
    var s2t = stringIDToTypeID,
        fontSizeList = {};
    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('textKey'));
    r.putEnumerated(s2t('layer'), s2t('ordinal'), s2t('targetEnum'));
    if (executeActionGet(r).hasKey(p)) {
        var sList = executeActionGet(r).getObjectValue(p).getList(s2t('textStyleRange'));
        for (var x = 0; x < sList.count; x++) {
            var k = sList.getObjectValue(x).getObjectValue(s2t('textStyle'))
            if (k.hasKey(s2t('impliedFontSize'))) {
                var size = Math.round(k.getUnitDoubleValue(s2t('impliedFontSize')) * 100) / 100
                if (fontSizeList[size]) fontSizeList[size].push(i) else fontSizeList[size] = [i]
            }
        }
    }
    return (fontSizeList)
}

 

 * better to use .jsx file extension, not .js. @Stephen Marsh wrote a good instruction on working with scripts Downloading and Installing Adobe Scripts 

4 replies

Semaphoric
Community Expert
Community Expert
March 20, 2022

Maybe a script?

Inspiring
March 21, 2022

That could maybe be an option for someone with that skill level, which is not my case, unfortunately... 😕😕

Semaphoric
Community Expert
Community Expert
March 22, 2022

Unfortunately, not mine either, but you could try asking around on this Forum. There are a lot of posters here who do know it, and are quite willing to help.

Earth Oliver
Legend
March 19, 2022

You could duplicate the text layer, transform/scale that container, then copy the contents back into the original text container. There's always a way. =D

Inspiring
March 19, 2022

I doubt you tried that yourself... because that doesn't work. I just tested it...

I was hoping it would work, because it seemed like a decent workaround, but it doesn't.

But if you like the idea of having this as a feature, please upvote it here:

https://community.adobe.com/t5/photoshop-ecosystem-ideas/resize-different-text-proportionally-inside-text-box/idi-p/12823685

Earth Oliver
Legend
March 20, 2022

Hmm, strange. That should work but you're right, it doesn't.

didiermazier
Community Expert
Community Expert
March 19, 2022

Why not using shortcuts?

Select the text to affect in the box (may be adjacent or not) and then

Command+Shift +> or > on MAc

Ctrl+Shift +> or > on PC

for 2 points increase or decrease

And if you are smart you can even find a shortcut for 10 points increase 

jane-e
Community Expert
Community Expert
March 19, 2022

I agree with @didiermazier .

 

Microsoft has buttons to increase/decrease the overall size, but Adobe does not. Use the shortcuts.

 

 

Jane

 

Derek Cross
Community Expert
Community Expert
March 18, 2022

What about using: Windows > Character panel?

 

 

Semaphoric
Community Expert
Community Expert
March 18, 2022

The character panel will do it. You can't seem to use any math in the size field, but entering identical values into vertical and horizontal scaling works great.

Inspiring
March 18, 2022

Thanks for the suggestion, and not trying to be rude, but this is so wrong! Not a good suggestion at all for these reasons:

The font size will not change so I can have a huge text and it will still say 12px for example.

Also, when you do that, the text doesn't grow inside the text box. Here: