Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Graphic Design

Reply
 
LinkBack Thread Tools Display Modes
Old 08-17-2011, 07:26 PM   #1
Super Moderator
 
Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
Default Scripts and Illustrator

I'm not sure how many of you use scripts within Illustrator but if you do I thought I would share one that I modified from Adobe. This script creates a smooth downward scale of any text object. The effect is simple, but one that many people seem to want to do. It will work with any text object.

Text Scaling
Code:
ChangeSize();

function ChangeSize()
{
    selectedItems = selection;
    // check to make sure something is selected.
    if (selectedItems.length == 0)
    {
        alert("Nothing is selected");
        return;
    }

    endIndex = selectedItems.length;

    for (index = 0; index < endIndex; index++)
    {
        pageObject = selectedItems[index];
        pageItemType = pageObject.typename;

            if (pageItemType == "TextFrame")
            {
                // get the paragraphs from the selection.
                theTextRange = pageObject.textRange;
                paraTextRange = theTextRange.paragraphs;
                numParagraphs = paraTextRange.length;

                   for (i = 0 ; i < numParagraphs ; i++)
                   {
                         aParagraph = paraTextRange[i];

                         charTextRange = aParagraph.characters;
                         charCount = charTextRange.length;

                         if (charCount > 1)
                         {
 
                               beginFontSize = 50;
                               endFontSize = Math.round(beginFontSize*0.2);
                               fontChange = Math.round((beginFontSize - endFontSize)/(charCount-2));
                               for (j = 0 ; j < charCount; j++)
                               {
                                      theChar = charTextRange[j];
                                      theChar.size = currentFontSize;*** 
                                      currentFontSize = currentFontSize - fontChange;
                               }
                         }
                   }
             }
      }
}
__________________
John Darling
Graphic / Web Designer
SmarterTools Inc.
(877) 357-6278
www.smartertools.com

Last edited by PixelPusher; 08-17-2011 at 07:46 PM. Reason: Damn asterisks!!!!!!!********
PixelPusher is offline   Reply With Quote


Old 08-17-2011, 07:59 PM   #2
Super Moderator
 
Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
Default

If anyone knows more about reserved names in AI, let me know. I would love to take this script one step further and have the "beginFontSize" be whatever site the text is set to.

I will have to look around to see if I can find out more.
__________________
John Darling
Graphic / Web Designer
SmarterTools Inc.
(877) 357-6278
www.smartertools.com
PixelPusher is offline   Reply With Quote
Old 09-27-2011, 01:39 PM   #3
Silver Member
 
Join Date: Mar 2011
Posts: 231
Default

wow.. .this is great information.. .will definitely try this one.. .thanks a lot.. .
computerGeek is offline   Reply With Quote
Old 10-09-2011, 06:35 PM   #4
New Member
 
Join Date: Oct 2011
Posts: 5
Default

A good exchange of information. Thank you!
shiva is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:07 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.