|
|
#1 |
|
Super Moderator
![]() Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
|
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!!!!!!!******** |
|
|
|
|
|
#2 |
|
Super Moderator
![]() Join Date: Oct 2008
Location: Arizona, USA
Posts: 1,053
|
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 |
|
|
|
|
|
#3 |
|
Silver Member
![]() Join Date: Mar 2011
Posts: 231
|
wow.. .this is great information.. .will definitely try this one.. .thanks a lot.. .
__________________
Custom Web Design for Businesses |
|
|
|
|
|
#4 |
|
New Member
![]() Join Date: Oct 2011
Posts: 5
|
A good exchange of information. Thank you!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|