W3C home > Mailing lists > Public > www-style@w3.org > May 2013

Re: [css3-fonts] Minor Comments Part II

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 20 May 2013 17:15:38 +0800
Message-ID: <5199E9BA.40301@inkedblade.net>
To: www-style@w3.org
On 05/20/2013 02:10 PM, John Daggett wrote:
> fantasai wrote:
>>>> http://dev.w3.org/csswg/css-fonts/#font-size-prop
>>>>      # This property indicates the desired height of glyphs from the font.
>>>> Shouldn't that be "desired size"? Because in vertical typesetting
>>>> with proportional or non-square glyphs, it's not necessarily the
>>>> height.
>>> It's generally the height of glyphs and I don't think changing
>>> this to "size" adds an clarity to the spec.
>> I was going more for accuracy than clarity here. If it's not always
>> the height, then we shouldn't use the term height here.
> Thinking about your original comment a little more, the 'font-size'
> property specifies the height of glyphs before layout operations, it's
> no different for proportional and/or non-square glyphs.  So I think
> the existing text is just fine, I don't see the need to bring in a
> discussion of the complexities of vertical text rendering here.  It
> doesn't add clarity and it doesn't affect what implementations will do.

I'm not sure it's a complexity of vertical text. It's just that if
you have a non-square font, in horizontal text its will be 1em tall
and narrower than 1em wide, and in vertical text they will be 1em
wide and shorter than 1em tall. Right?

>>>>      # The actual value of this property may differ from the computed
>>>>      # value due a numerical value on ‘font-size-adjust’ and the
>>>>      # unavailability of certain font sizes.
>>>> I suspect we want to specify here that the availability of font
>>>> sizes doesn't affect layout or unit conversions. (Alternately,
>>>> specify that they do.)
>>> This is the same text that is used in 2.1.  The definition of value units
>>> belongs in the Values spec, no?
>> It is implicit in the Values spec, yes. But since you're talking about
>> the difference between computed values and actual values here, I think
>> it's also worth pointing out whether
>>     - availability of font sizes affects unit conversions
>>     - availability of font sizes affects layout
> It seems to me the underlying issue is whether units are calculated
> based on computed vs. actual used value and *that* issue should be
> addressed in the Values spec since it applies beyond the set of
> properties defined in this spec. My gut feeling is that it should be
> based purely on computed value, so 1em == computed value of
> 'font-size' regardless of 'font-size-adjust'.

Units are definitely calculated against the computed values, because
they are needed to result in the computed value of a <length>. :)
The open question is which computed values do we take into account:

The font-relative units (with the possible exception of 'em') are
computed against both property values ('font-size') and the metrics
of the "first available font". So availability of fonts is a factor
in the computed values already.

Let's take, for example, the 'ex' unit. It uses the font metrics
against the computed 'font-size' to figure out the value of an 'ex'.
Suppose we have a 16px bitmap font being substituted in for a 14px
font-size. What size is the 'ex'? Is it the 16px x-height, or is
it 7/8 of that?

> The computed value of 'font-size-adjust' and issues of available font
> sizes (including platforms that only support integer font sizes)
> obviously affects layout but I'm not sure what you think the spec
> needs to say here about that.

I think it would be useful to explain the ways in which it does affect
layout. For example, if I substitute in a 16px bitmap font for a layout
done with font-size: 14px, will the line-height be affected? will the
size of the inline box's border-box be affected? These things are not
totally obvious unless you understand how value computation and inline
layout works in CSS, so are probably useful to point out. And some
issues aren't really clear to me, even; see above wrt x-heights. :/

Received on Monday, 20 May 2013 09:16:10 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:28 UTC