9 Replies Latest reply on Mar 31, 2017 7:30 AM by rob day

    Equal line leading with different font sizes in each line

    mojo-risin Level 1

      Hi all,

       

       

      I'm having trouble finding out a quick and easiest way to evenly distribute lines that contain text of different font sizes. I was trying with styles alone but failed. The closest I got is the example below where I set text frame auto-size in created object style, and distribute the chosen lines by Align function:

       

       

      But even this doesn't give me the perfect result due to this "phantom" space above font in every text frame:

       

       

      Any help appreciated!

        • 1. Re: Equal line leading with different font sizes in each line
          vladan saveljic Level 4

          you could try yhis:

          text frame options > baseline options and choose  Cap Height

           

          Schermata 2017-03-30 alle 08.34.02.png

          1 person found this helpful
          • 2. Re: Equal line leading with different font sizes in each line
            Willi Adelberger Most Valuable Participant

            If each text is only a single line, it is simple, specify in the used paragraph styles (never work without!) space before and after and make them equal.

            If the text is multiple line, the space between these lines is defined by the leading in character properties.

            • 3. Re: Equal line leading with different font sizes in each line
              Laubender Adobe Community Professional & MVP

              Hi Willi,

              if we can deduce from the second screenshot of the OP all lines of text are in different text frames.
              The distance from the bottom ( baseline ) to the top of the next line ( maybe the cap height? ) should be equal after redistributing the text frames.

               

              I think, permio_oscar has it right.
              For all text frames that have formatted text with capitals (uppercase letters).
              And where the fitting options for vertical fitting are made.

               

              If all the lines would be in one single text frame this would be a different matter.
              Then no automatic or semi-automatic solution would be thinkable. That would require a scripting solution that would calculate distances and change the leading accordingly. Based on some factors we should discuss with the OP.

               

              There is a different solution without using the distribution of text frames:

              1. All text frames are stacked and aligned on top.

              2. All text frames have a text wrap.

              3. All text frames have an inset at the bottom that would dictate the distance from each other.

               

              See this for stacking order and text wrap:

               

              StackedFrames-Using-TextWrap-FittingOptions-BottomInset.png

               

              EDIT: Forgot to mention

              4. All text frames fitting options are set to top vertical alignment.

              5. I used cap height as Oscar suggested.

               

              Regards,
              Uwe

              1 person found this helpful
              • 4. Re: Equal line leading with different font sizes in each line
                rob day Adobe Community Professional & MVP

                I'm having trouble finding out a quick and easiest way to evenly distribute lines that contain text of different font sizes.

                You don't have to cut the text into different frames to adjust the leading on individual lines of text. In Preferences uncheck Apply Leading to Entire Paragraphs:

                 

                Screen Shot 2017-03-30 at 7.56.01 AM.png

                 

                Now I can select line 2 (triple-click) and adjust its leading relative to line 1 without affecting the other lines.

                Screen Shot 2017-03-30 at 7.54.55 AM.png

                2 people found this helpful
                • 5. Re: Equal line leading with different font sizes in each line
                  mojo-risin Level 1

                  Hi again,

                   

                  I found vladan saveljic post the most useful. The cap height setting solved the uneven frames problem, and then vertical distributing does the job by equal frame spacing.

                   

                  Although the former method seems more intuitive, Laubender method also works, only problem with this one is I don't get how the order of these lines gets settled when using this set up. When I move one line over the other and align to top, then they get rearranged differently. So I don't have control over the order.

                   

                  @rob day, Hi, the point was to avoid setting up leading manually to each line one by one.

                  I guess there is no method that allows to do this fast in one frame.

                   

                  Thank You all!

                  1 person found this helpful
                  • 6. Re: Equal line leading with different font sizes in each line
                    Laubender Adobe Community Professional & MVP

                    Hi,

                    for stacking order with my sample see the screenshot where the Layers panel is open.
                    It's from right to left if you see the not aligned row of text frames:
                    On top of the stack is the frame to the right, then down the stack follows the centered one, finally the left one.

                     

                     

                    Regards,
                    Uwe

                    1 person found this helpful
                    • 8. Re: Equal line leading with different font sizes in each line
                      rob day Adobe Community Professional & MVP

                      @rob day, Hi, the point was to avoid setting up leading manually to each line one by one.

                      I guess there is no method that allows to do this fast in one frame.

                      Generally I like to avoid cutting text up into frames, but you are right manually adjusting leading in this case would take some time.

                       

                      It is possible to script running text by getting each line's ascent. So the AppleScript (OSX only) below does this to the selected text:

                       

                      Screen Shot 2017-03-31 at 9.28.56 AM.png

                       

                      Screen Shot 2017-03-31 at 9.29.04 AM.png

                      The s variable in the first line of the script adds space in points

                      Screen Shot 2017-03-31 at 9.29.42 AM.png

                       

                       

                      ------------------------------------

                      set s to 2

                      tell application "Adobe InDesign CC 2014"

                          set properties of view preferences of active document to {horizontal measurement units:points, vertical measurement units:points}

                          set use paragraph leading of text preferences of active document to false

                         

                          set ls to object reference of every line of selection

                          repeat with x in ls

                              set a to ascent of x

                              set b to point size of x

                              set leading of x to a - (b / 10) + s

                          end repeat

                      end tell

                      1 person found this helpful
                      • 9. Re: Equal line leading with different font sizes in each line
                        rob day Adobe Community Professional & MVP

                        Here's a JavaScript version:

                         

                         

                        var s=0;
                        main(); 
                        function main(){ 
                           
                            app.activeDocument.viewPreferences.horizontalMeasurementUnits=MeasurementUnits.POINTS;
                            app.activeDocument.viewPreferences.verticalMeasurementUnits=MeasurementUnits.POINTS;
                            app.activeDocument.textPreferences.useParagraphLeading=false;
                           
                            var ls=app.activeDocument.selection[0].lines;
                           
                            for (var i = 0; i < ls.length; i++){
                                var a = ls[i].ascent;
                                var b = ls[i].pointSize;
                                ls[i].leading = a - (b / 10) + s;   
                            }
                        } 
                        
                        1 person found this helpful