Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I would like to design a paragraph (full of text) where the font size for EACH new sentence changes in font size and gradually get smaller and smaller with each new sentence. It would probably look best if each new sentence font size and the leading were proportional in percentage as well. I want to keep text from filling from previous sentences and no Hyphenation (if that makes any sense)? i.e. each new sentence has a new font size, no text auto fills/ hyphenates into new sentences, and the leading is proportional with each 'new' font size.

Would this be done manually or through something like "Paragraph Styles" in ID or AI ? Any tips for a similar technique?

share|improve this question
    
Is there any rules (algorhytm) you wish to apply for each sentence? You have to disable hyphination in paragraph style, set alignment to Justify all, then look deeply into GREP for character styles. –  amrok Oct 9 '13 at 8:08

1 Answer 1

Try this: in menu window > utility > script In script panel open Application > Javascript and right-click on one file (example AddGuides.jsx) and select Show in Finder. Duplicate the file in Finder and rename in decreaseParagrph.jsx and now open it with simple text editor. Paste this code:

mySel = app.selection;
    var myArray = new Array();
    var myP = prompt("Choose your % of decrease","80");
    var myPercentile = myP/100;

    // this grep find all the sentences : [^.!?\s][^.!?]*(?:[.!?](?!['"]?\s|$)[^.!?]*)*[.!?]?['"]?(?=\s|$)
    var a = "[^.!? ][^.!?]*(?:[.!?](?!['"
    var b = '"';
    var c = "]? |$)[^.!?]*)*[.!?]?['";
    var d = "]?(?= |$)";

    // you must select text (or more texts)
    if(mySel.length>0){
        for(var i=0;i<mySel.length;i++){

            //clear find/replace preferences
            app.findGrepPreferences = NothingEnum.nothing; 
            app.changeGrepPreferences = NothingEnum.nothing;

            //find the grep
            app.findGrepPreferences.findWhat = a+b+c+b+d;

            //and put into array
            var myArray = mySel[i].parentStory.findGrep();

            //for all elements of array (exept the first)
            for(var o=1;o<myArray.length;o++){

                //take the prevoius sentence point size
                var myNewMeasure = myArray[o-1].pointSize;

                //and transform it
                myArray[o].pointSize = myNewMeasure*myPercentile;
                }
            }
        }

Save decreaseParagrph.jsx file and return in InDesign, open the file with paragraph, choose the text box with text you want and double click on decreaseParagrph.jsx (in script panel), choose % of decrease and enjoy ;)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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