W3C home > Mailing lists > Public > www-style@w3.org > November 2012

Re: [css21] line-height, problem?

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 26 Nov 2012 23:52:42 -0800
Message-ID: <CALRQH79-CQS0poigT94-1XdaTw18pddB_bmxth+Vb9S-6sNHMA@mail.gmail.com>
To: Stephen Zilles <szilles@adobe.com>
Cc: "www-style@gtalbot.org" <www-style@gtalbot.org>, www-style mailing list <www-style@w3.org>
On Mon, Nov 26, 2012 at 9:46 PM, Stephen Zilles <szilles@adobe.com> wrote:
>
> -----Original Message-----
> From: a.fedoniouk@gmail.com [mailto:a.fedoniouk@gmail.com] On Behalf Of Andrew Fedoniouk
> Sent: Monday, November 26, 2012 8:35 PM
> To: www-style@gtalbot.org
> Cc: www-style mailing list
> Subject: Re: [css21] line-height, problem?
>

> SZ: you noted that there are three characters. It is these 3 characters which inherit 'line-height' which defines the "leading" (1/2 above and 1/2 below) that applies to each of them. It is then these "leaded" characters (or more appropriately their corresponding glyphs) that determine the line height. The 'line-height' value on the paragraph also determines the minimum height of each line needed to display the content of the paragraph. In this case, it is most likely that all three characters appear on the same line and each characters 'line-height' is the same as that of the paragraph, so the height of the line that contains them is the same as line height. If the 'font-size' were 20px, then the "leading" would be negative (-5px above the text and -5px below) so the height of the line would be 10px which is exactly what you asked for (although you, perhaps, did not see it that way).

OK, it appears that you are trying to explain this:

<quote src="http://www.w3.org/TR/CSS21/visudet.html#leading">
Still for each glyph, determine the leading L to add, where L =
'line-height' - AD. Half the leading is added above A and the other
half below D, giving the glyph and its leading a total height above
the baseline of A' = A + L/2 and a total depth of D' = D + L/2.

Note. L may be negative.

The height of the inline box encloses all glyphs and their
half-leading on each side and is thus exactly 'line-height'. Boxes of
child elements do not influence this height.
</quote>

So line-height property in CSS defines *not* the height of line-box
but rather glyph-height - height of place where glyph is rendered.

It is not clear then what does "enclose" mean here:

"The height of the inline box encloses all glyphs and their half-leading"

when half-leading is negative. How box can enclose all glyphs and be
less than their height
at the same time?


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Tuesday, 27 November 2012 07:53:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT