Skip to main content
dublove
Legend
October 22, 2026
Question

How to correct errors? When calculating the height of a text box using line height, font size, and number of lines.

There is a premise here: do not modify the baseline offset of the first line, let it default to 0.

The offset type of the sample is' full angle box height '. The same problem exists when switching to other types.

I used the formula in the picture, but I feel that the font size and line spacing have improved, and the correction I provided is also unreliable.

Do you have any better suggestions?

Thank you .

I can't upload pictures

    13 replies

    Participant
    October 24, 2026

    I think the tricky part is that line height and font size alone won't give an exact frame height in InDesign. Even at the default, the first baseline offset (Ascent) and the font's own metrics affect where the text starts, so the first line isn't positioned by leading alone.

    I'd test the formula with a few different fonts and line counts and compare the calculated height with the actual frame bounds. A simple way to separate the causes: compare a 1-line frame and a 2-line frame. The 1-line result shows the first-baseline/ascent part, and the difference between the two shows the leading part. Then the formula becomes roughly: top inset + first-line offset + (lines − 1) × leading + descent/bottom inset, with the first-line offset measured per font rather than guessed.

    If you need predictable results across fonts, set First Baseline Offset to Leading, or use Auto-Size Height and read the resulting frame height instead of calculating it.

    Translate
    dublove
    dubloveAuthor
    Legend
    October 24, 2026

    Hi ​@Jubilant_student93af 

    top inset + first-line offset + (lines − 1) × leading + descent/bottom inset

    top inset, irst-line offset, descent/bottom inset

    What are these and how did you get them, such as when you currently selected some text.

    Translate
    Participant
    October 24, 2026

    Good question. The three values come from different places:

    Top inset and bottom inset: these are set in the frame, not the text. Select the frame and go to Object > Text Frame Options > General > Inset Spacing. Nothing needs to be selected inside the text.

    First-line offset: the distance from the top inset to the first baseline. It’s controlled by Text Frame Options > Baseline Options > First Baseline > Offset (Ascent, Cap Height, Leading, x Height, Em Box Height, Fixed). InDesign doesn’t display this number, so it has to be measured. With Ascent it depends on the font and size, roughly ascent ratio × font size.

    Descent: the space below the last baseline, which comes from the font’s metrics. InDesign doesn’t show it either.

    How to measure them:

    1. Set the top and bottom insets to 0, use one line of text, and turn on Auto-Size Height (Text Frame Options > Auto-Size). The frame height is then first-line offset + descent. Call it H1.
    2. Add a second line, so the frame auto-sizes again, and call that H2. Then H2 − H1 = leading, which should match the Leading value in the Character/Control panel for the selected text.
    3. To split H1 into its two parts, convert a copy of the line to outlines (Type > Create Outlines) and measure from the frame top to the bottom of a flat-bottomed letter like “H”. That distance is the first-line offset (the baseline). Then descent = H1 − first-line offset.

    The only values you can read directly from a selected piece of text are the font size and leading in the Control panel. The rest are frame settings or font metrics that have to be measured once per font and size. If that’s too much work, set First Baseline Offset to Leading, or use Auto-Size Height and read the resulting frame height instead of calculating it.

    Translate
    rob day
    Community Expert
    Community Expert
    October 22, 2026

    I also can’t post captures, see attached INDD

    Translate
    leo.r
    Community Expert
    Community Expert
    October 22, 2026

    I also can’t post captures, 


    Hi Rob, as you may already know by now, the option to post images was disabled due to a worldwide PHP vulnerability discovered recently:
    https://www.bbc.com/news/articles/c3qjnwye0ep5o

    There’s also a thread on our Slack about it.

    Translate
    rob day
    Community Expert
    Community Expert
    October 22, 2026

    Thanks ​@leo.r I did not know.

    Translate
    rob day
    Community Expert
    Community Expert
    October 22, 2026

    There is a premise here: do not modify the baseline offset of the first line, let it default to 0.

     

    Why not? The default First Baseline Offset in the western version of InDesign is the Ascent line—the first baseline is not at 0.

     

    If you want to adjust the position of the first line, then you have to choose a different First Baseline Offset. For most fonts Ascent or Cap Height positions the top of capitals close to the top of the frame, but the font’s designer sets the font’s metrics (Ascent, cap height, x-height):

     

    Translate
    dublove
    dubloveAuthor
    Legend
    October 23, 2026

    Because in the vast majority of cases, I do not adjust the baseline of the first row.

    Translate
    rob day
    Community Expert
    Community Expert
    October 23, 2026

    Then you will have to accept the default. It’s a text frame preference setting because not everyone agrees where the first baseline should start. The baseline is not the same as the cap height line.

    Translate