Skip to main content
dublove
Legend
May 30, 2026 10:14 AM UTC
Answered

How to get the line height and font size of the selected text?

(Have I been muted? I can't reply to posts anymore.)

How is this line spacing calculated?

line height= font size + Line spacing

Is that right?

 

How do I get the font size and line spacing of the current line?

Thank you very much.

 

    rob day
    rob dayCorrect answer
    Community Expert
    May 30, 2026 11:39 AM UTC

    So:

     

    alert(app.selection[0].leading)

     

     

    6 replies

    dublove
    dubloveAuthor
    Legend
    May 30, 2026 11:50 AM UTC

    Hi rob day.

    Thank you.

    I only noticed that “leading” means “to be in the lead”; I didn't realize that its second meaning is “line spacing.”
    How do I get the font size?

    Translate
    rob day
    Community Expert
    Community Expert
    May 30, 2026 12:14 PM UTC

    This gets the point size of the first character in some selected text

     

    alert(app.selection[0].pointSize)

     

    Also if you are trying to set line leading you have to consider the Preferences>Type>Apply Leading to Entire Paragraphs setting

    Translate
    rob day
    Community Expert
    rob dayCommunity ExpertCorrect answer
    Community Expert
    May 30, 2026 11:39 AM UTC

    So:

     

    alert(app.selection[0].leading)

     

     

    Translate
    rob day
    Community Expert
    Community Expert
    May 30, 2026 11:31 AM UTC

    How is this line spacing calculated?

     

    InDesign does not have a line height or line spacing property. There is Leading, which is the measurement from baseline to baseline:

     

     

     

     

     

     

     

    Translate