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

Re: Line layout in browsers

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 23 Jan 2008 10:46:43 -0600
Message-ID: <47976F73.2030903@mit.edu>
To: "Jukka K. Korpela" <jkorpela@cs.tut.fi>
CC: www-style@w3.org

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.

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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC