Re: On which font size is line-height based?

On Sat, 20 Feb 1999 19:35:17 -0500 (EST), you wrote:

>In the definition of line-height [1], the spec defines <number> values
>to depend on the "element's font size" and <percentage> values to
>depend on the "element's computed font size".  This difference was
>recently pointed out to me, and I'm wondering why it exists.
>Furthermore, I also wonder if, instead of computed font size, actual
>font size was meant.  These terms are explained in the definition of
>font-size [2]:
>
>  The actual value of [font-size] may differ from the computed value
>  due a numerical value on 'font-size-adjust' and the unavailability of
>  certain font sizes.

This passage in it self qualifies for a rewrite. To me it's not even
clear if it is the "actual value" or the "computed value" that changes
due to...

"a numerical value on 'font-size-adjust' and the unavailability of
certain font sizes"

>It doesn't make sense to me that if a font was specified as 10px but only
>available as 16px, then a line-height of 1.2 (or 120%) should result in
>a line-height of 12px.

My interpretation of this example would be that...

line-height: 1.2   should result in 12px and,
line-height: 120%  would become ~19px

but that's my view based on what I think I can understand from that
previous passage.

>I think both these statements should be changed so that line-height
>depends on the actual font-size, not the computed font-size.  (Even if
>it should be computed, I definitely think they should be the same,
>unless there was some reason I don't see.)

I can second that, with a slight emphasis on going for the "computed
value" (finally rendered value, as I read that) of font-size. It seems
to me as a UA that finds reason to change a font-size due to suggested
size not being available, should also use that new font-size as the base
for calculating line-height. The alternative seems to lead to a
possibility for overlapping lines of text.

-- 
Jan Roland Eriksson <rex@css.nu> .. <URL:http://css.nu/>

Received on Sunday, 21 February 1999 20:10:38 UTC