1

I have a layer of text in illustrator. All text has a fill and an outline stroke. However, all text/words are different font size. i want to scale all text by 33% for example. I have tried, select a word (all other layers locked) - select same fill (also same fill and stroke) - transform - transform each. This does scale text but it shifts the text to different position. Any suggestions appreciated! Thanks!

2 Answers 2

2

As @paulmz points out, the transformation point is critical for scaling to work the way you expect. However you're right to have tried to use Transform Each.

After selecting all the text objects to transform (perhaps with the direct selection tool if any of your text is in groups), you can actually set the transformation point of the Transform Each function. For left-justified text you want to select the bottom-left point, bottom-right for right-justified, etc.

Transform Each transform point


The above straightforward solution will work great if the text all has the same justification.

However, if your text has different justification settings, you can use Illustrator's scripting facility to scale text sizes.

Paste the following into a plain text file called "scale-text.js". Select the text objects you want to scale, then drop scale-text.js onto your document to run the script.

This works similarly to Transform Each, but will only affect text objects. When it runs, it asks for a percentage to scale the selected text by.

function scaleTextRecursively(collection) {
    for (var i=0; i<collection.length; i++) {
        var t = collection[i];
        if (t.typename == "TextFrame") {
            t.textRange.characterAttributes.size *= (scale/100);
        } else if (t.typename == "GroupItem") {
            // also search inside groups for more text frames
            scaleTextRecursively(t.pageItems);
        }
    }
}

var doc = app.activeDocument;

var scale = prompt("Scale selected text\nScale factor:", "100%");

if ( scale !== null ) {
    scale = parseFloat(scale);

    if (isNaN(scale)) {
        alert( "Invalid scale. Try '100%'." );
    } else {
        scaleTextRecursively(doc.selection);
    }
}
1
  • Thank you Aidan. That script worked perfectly!! Excellent.. Cheers!
    – Jim
    Nov 13, 2015 at 13:11
1

This sounds like you might just need to set your transformation point.

enter image description here

If your transformation point (on the left of the image above) isn't set to the center, the object won't remain in the same place when scaled. Granted, this will scale a group of objects on the center of the entire group. To scale individual items and keep them in the same position, you will need to scale them individually -or- copy the whole group, scale the new group and then realign the new scaled versions to the objects in the old group.

1
  • Thank you Paul. It didn't work for me but the script suggested by the other commentor worked. Thanks for your help anyways!
    – Jim
    Nov 13, 2015 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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