In Writer, different line height between empty and non-empty lines

Hey there,

I noticed a strange behavior: in Writer, empty lines and non-empty lines have a different height. At least it seems to happen when the line spacing is not set to 1. Is this an expected behavior?

I attached an example (54.7 KB) with line spacing set to 99%, separated in 2 sections:

  1. Text separated by empty lines
  2. The same text separated by non-empty lines

As a consequence of the behavior I’m reporting, the first text has 3 lines on its second page, while the second text has only 2 lines.

Please note that a simple blank space (e.g. " ") also counts as a non-empty line.

In this specific case, no. Your document should have identical height for all lines. We have a special compatibility mode, where space height doesn’t affect line height (as in Word); and in that mode, it is possible, that there is a space, which height should be X, but the actual line height is smaller; but this is not applicable to your file (and the actual behavior looks opposite).

On the other hand…
Selecting all; clearing direct formatting; then changing default paragraph style to be Liberation Mono 12.2 - makes it all look as expected. So maybe there actually is a DF problem there, not readily visible.
No, it is repro anyway - I initially forgot to apply 99% line spacing. Seems like the proportional line spacing is not applied to completely empty lines (maybe we use text height there, and skip when there’s no text - anyway, it looks like a bug).

Your sample file is an excellent ewample of the dangers of direct formatting. This combines with rounding off occurring in integer arithmetics used inside Writer.


You chose an uncommon font size of 12.2 pt which certainly is not in integer proportion with print area height, opening the possibility of hesitation about layout of the last line (this page or next page?).


Your line spacing is 99%. This setting does not change character size but forces the distance between baselines instead of using “native” spacing encoded in the font. Note that this setting acts inside the paragraph. Add spacing above and below to get total paragraph height (in your case, these spacing are zero).


Your document is direct formatted. This means that you get several anonymous paragraph styles, depending on your editing history. Here, you have 4 (four) different styles. I rule out P3 because it requests a Page Break Before (start of page 2). This leaves 3 (three) styles for the same usage.


It is possible that when switching from one style to another, running space computations are halted and restarted, meaning the last position is converted to “display units” with all the consequent rounding (particularly with font size of 12.1999998pt as encoded in the XML). In particular, an empty paragraph, as you point out, is not the same as a non-empty paragraph.


Empty paragraphs are non-sense in a document: they contain no information; they are invisible to readers. Consequently, there should be no empty paragraphs. Vertical spacing must not be done with empty paragraphs because they disturb the allocation algorithm as you experience.

Vertical spacing is a semantic property of a paragraph, contributing to show visually its significance, just like font face, size or weight.

If you want to have a predictable layout, exempt of the behaviour you complain (rightfully) about, ban direct formatting (including empty paragraphs, sequences of spaces or tabs) and use exclusively styles. Refrain from patching styles with manual actions like size change, bold, italic, … Design a minimal consistent set of styles. Don’t underestimate the value of built-in styles. They are a very good base. All you have to do is customise their configuration. From experience, you rarely need to add more than 5 user paragraph or character styles. It is not the same with page styles because layout varies too much across users to provide a common set.

1 Like

Note that the problem is totally unrelated to DF. Here is a FODT demonstrating it (obviously renamed to ODT): decreased-line-spacing.odt (2.7 KB)

@mikekaganski I suspected such a thing but did not dare to state it. No character in paragraph, no line spacing ajustment according to parameter.

  1. What you (@yarma22)call lines are paragraphs.
  2. Page wrapping in your example makes precise comparison difficult.
  3. After reducing the exmple text and its twin both to one page the “visual effect” can be refuted: It was an optical deception.

Look at the returned example. I didn’t even change anything in the (bad) direct formatting, but it shows two precisely comparable pages side by side…

disask122203_empty_PARAGRAPH_height_bug_OR_NOT.odt (36.9 KB)

=== ===
Sorry this seems to have crossed other posts.