home *** CD-ROM | disk | FTP | other *** search
- // change size of paragraph text
-
- //$.bp();
-
- 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 == "TextArtItem")
- {
- // 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)
- {
- halfWay = Math.round(charCount/2);
- fontSizeChanger = 36/halfWay;
- currentFontSize = 48;
- for (j = 0 ; j < halfWay-1; j++)
- {
- theChar = charTextRange[j];
- theChar.size = currentFontSize;
- currentFontSize = currentFontSize - fontSizeChanger;
- }
-
- for (j = halfWay; j < charCount ; j++)
- {
- theChar = charTextRange[j];
- theChar.size = currentFontSize;
- currentFontSize = currentFontSize + fontSizeChanger;
- }
- }
- }
- }
- }
- }