Re: Line layout in browsers

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 UTC