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 

Inspiring
March 19, 2022

Thank you so much for this. So far, this has been the best alternative.

Just a correction:

The increase/decrease is actually 1 point, or 5 points, instead of 2 and 10 as you mentioned.

 

Also, as much as this is a good alternative, there's an issue. This is not really changing the text proportionally. Example:

Title at 50pts

Sub title at 25pts

So basically the subtitle is half of the title size

 

Now let's say I select the text and I use the shortcut to add 50pts:

Title is now 100pts

Sub title is now at 75pts (when it should be at 50pts to be half of the title)

 

For certain scenarios it can be an option if the relationship between the different texts is not that relevant, but in general, it's not going to work as expected.

 

Thank you for sharing that tip anyway. I will put it in my notes (and yay, I guess I am smart, because I found the shortcut for the 10 - aka 5 - points)

 

 

 

 

["it's going to work" edited by moderator to "it's not going to work" as per following comment]

 

Conrad_C
Community Expert
Community Expert
March 23, 2022

Thank you for correcting it, Jane.

I created a new Feature Request about this feature (resizing the text proportionally).

 

Regarding the "editing post" thing, I don't really know what could be considered "miusing" the feature, but I think it could at least allow the user to edit or even delete the post (or reply) within a certain time window, let's say 5 or 10 minutes for example, to allow us small corrections, instead of creating new posts for that.



@TiagoRocha wrote:

Regarding the "editing post" thing, I don't really know what could be considered "miusing" the feature, but I think it could at least allow the user to edit or even delete the post (or reply) within a certain time window, let's say 5 or 10 minutes for example, to allow us small corrections, instead of creating new posts for that.


 

The problem is, that suggestion would not have solved the problem, but continued to enable it.

 

The problem, which is widespread across web forums, goes like this:

 

Comment spam is a plague on forums, with spammers filling thread after thread with posts that do nothing but posts links to promote this or that scam. To prevent this, many forums delay the approval of someone’s first post until a moderator can look at it and verify it is not spam. To get around that, the scammers simply write a first post that looks like a very innocent request for help. And then, after that first post is approved and becomes publicly visible, the spammer turns around and edits the post to insert their ad and spam link.

 

Forum moderators got fed up with that tactic, so they came up with new ways to fight it. But it’s difficult to come up with a good defense against that without also inconveniencing people posting genuine questions. One approach on the Adobe forum, for now, is to disallow editing of posts from users with very low post counts, at least for a while. Users who can edit their posts tend to have a longer track record of legitimate posts. (How it works changes all the time in response to the latest attacks, so don’t assume it has always or will always work like this.)

 

I got hit on a different (non-Adobe) forum by a different defense. I posted a question, realized I made a mistake, quickly edited it, and then my post disappeared. It got canned as spam. Why? Because although that forum allowed editing and my post was innocent, the defense they had programmed into the site was if a new user edited their post within a short time after the first post was approved, that was assumed to be a spam attempt and resulted in immediate deletion of that post.

 

It might seem that there isn’t a spam problem on this or that forum if you don’t see a lot of it. But the reality is that if you are on a good forum with little comment spam, it actually means there is a small army of moderators and volunteers marking and removing spam posts, reprogramming the site to defend against the latest techniques, constantly trying to hold off the spam invasion that never ends.

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: