W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: Line layout in browsers

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Wed, 23 Jan 2008 13:03:35 +0200
Message-ID: <00db01c85daf$9a757cb0$0500000a@DOCENDO>
To: <www-style@w3.org>

Bruno Fassino wrote:

> What I've always observed is that the 'normal' (default) line-height
> value really depends on the font, in most browsers.

Now I'm getting really confused, since I'm also getting such results. 
Apparently I had just observed the lack of any apparent difference and 
had not taken a closer look.

> [1] http://www.brunildo.org/test/aspect-lh-table2.html
> (This requires javascript and flash, and for some 'strange' fonts may
> not be reliable, but generally seems to work correctly.)

On IE 7, it shows all aspect ratios as 0.500, so it probably just 
divides ex by em, which gives wrong results on browsers where this 
proportion is all wrong (fixed to 0.5).

It shows e.g. a line-height of 1.341 for Arial Unicode MS (rather large, 
isn't it?), 1.108-1.133 for Times New Roman, and 1.126 for Verdana. I 
created a very simple test page
http://www.cs.tut.fi/~jkorpela/test/lh.html
that shows that there are differences indeed, but for Verdana, the 
"normal" line-height is _less_ than for Times New Roman. It gives the 
impression of tightly stacked lines of Verdana text, and probably I 
always assumed this is just because the browser uses a constant 
line-height. But it's apparently worse.

Excuse me while I panic.

This confusion reflects the looseness of the wording in CSS 
specifications, but the looseness might be intentional.

Anyway, if browsers actually vary the meaning of normal by font, the 
situation is rather odd: An author can use that value (by specifying or 
implying it), without knowing what it will really mean, but he cannot 
specify anything relative to it. That is, either take this as such, or 
use some completely different approach that has no considerations 
relative to the actual font face being used.

Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/ 
Received on Wednesday, 23 January 2008 11:03:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:58 GMT