Re: Line layout in browsers

Jukka K. Korpela wrote:
> Yes, but are browsers allowed to peek at such information and use it?

Why not, exactly.

> I don't think they do. Using different fonts, the default (normal)
> line-height seems to remain the same, depending just on the font size.

With which browsers and which fonts?  Are you using fonts with different line-gaps?

If you care, the Gecko code for computing the normal line height in the default 
configuration works something like this, as far as I can tell:

1) Get the leading for the font (height - ascent - descent)
2) Get the line gap for the font
3) If both those values are 0, return 1.2 times the em height.  Otherwise
    return the em height plus the leading plus the line gap.

> This is somewhat odd: the initial value is by definition normal, but its
> meaning may vary by browser _and_ by font family.

That's correct.  In fact, it could also vary by font size, etc, depending on 
what information the font hands back.

-Boris

Received on Wednesday, 23 January 2008 16:46:35 UTC