Forum How do I...?

Difference between line-height CSS property and line spacing in Word?

_savage
In the original Word document, the paragraph's line spacing is set to 1.15. After conversion of that same document into XML, I set the CSS line-height property to 115%. Font size is the same, 11pt, and so are the dimensions of the page and borders.

However, looking at the PDF generated by Word and the PDF generated by Prince I notice visible differences: the line spacing is much denser in the Prince version?

Why is that?
mikeday
Are they using the same fonts? Does the Prince output look similar to what you would see in a web browser?
_savage
Yes, they both use "Palatino." At first I thought they might use different implementations of the font, but there's only one installed on my system as far as I can tell.

It's hard to tell how much different the generated PDFs are because the words themselves are more dense. I've attached three snapshots of a paragraph. One seems more spacious than the next :-)

Interestingly, the browser font has a different shape to the "J", and the word spacing per line is most generous with Word. Is it all just optics?

Word:
word.jpg

Prince:
prince.jpg

Browser:
safari.jpg
  1. prince.jpg23.5 kB
    Snapshot of the Prince generated .pdf
  2. safari.jpg22.4 kB
    Snapshot of Safari
  3. word.jpg24.6 kB
    Snapshot of the Word generated .pdf

Edited by _savage

mikeday
Does Word put a minimum limit on line-spacing? For example, can you reduce it to 0.85 and make the lines actually overlap? I'm wondering if you increase the line-spacing to 2.0 or 3.0, would it then look identical to the Prince output.

(Of course, CSS line-spacing is relatively well-defined by open specifications, while Word is not, so it's difficult to know exactly what Word is doing here).
_savage
I played around a little bit, and it looks like a line-spacing of 130% approximates Word's 1.15 line spacing quite well. The number of pages in both books is now almost identical (354 vs 357) which is a good indicator that we're pretty close.

As for Word, I was able to overlap lines at 0.70 or 0.50 line spacing. Interestingly though, at 0.50 there was an overlap of just about 20% of the lines, if that. So perhaps you're right: Word's interpretation of a 1.15 line spacing isn't quite what Prince uses :)

Thanks!