Re: Inconsistent treatment of "em" and "ex" unit when used to specify "font-size"

Philip TAYLOR wrote:

>> On that last sentence of the quoted text (which is marked as an
>> issue in the working draft): The WG currently believes that the text
>> of CSS 2.1 ("In the cases where it is impossible or impractical to
>> determine the x-height, a value of 0.5em should be used.") is still
>> the best and can be inserted unchanged at that point in the CSS3
>> module.
> 
> I am a little unhappy with "or impractical"; does this not leave a
> rather large loophole for browser inconsistencies ?

Practically speaking, no.  Fonts in CSS need to be defined independent of font type.  For some font types, it may be hard to determine the x-height but for the majority of font types (OpenType, TrueType, SVG, Type1) determining x-height is a simple matter.  The wording is fine I think.

John Daggett
Mozilla Japan
CSS3 Fonts editor

----- Original Message -----
From: "Philip TAYLOR" <P.Taylor@Rhul.Ac.Uk>
To: "Bert Bos" <bert@w3.org>
Cc: "W3C Style List" <www-style@w3.org>
Sent: Friday, October 30, 2009 8:09:25 AM GMT -06:00 Guadalajara / Mexico City / Monterrey
Subject: Re: Inconsistent treatment of "em" and "ex" unit when used to specify    "font-size"



Bert Bos wrote:

>> On Mon, Oct 26, 2009 at 9:59 AM, Philip TAYLOR<P.Taylor@rhul.ac.uk>

>>> Is there any reason why "ex" does not also reference
>>> the parent element's font size if set on the 'font-size'
>>> property, as if "ex" units are used to specify font-size,
>>> there would appear to be a problem of self-reference
>>> (see example below).
>
> The working group decided that this was an oversight and the ex
> definition will be changed to say the same as the em definition. We
> didn't check all implementations, but those we checked already do it
> this way. (Indeed, it would be hard to imagine how else it could work.)

Thank you for the confirmation, Bert.  It was certainly
the case in the past that browsers treated "ex" inconsistently,
as a result of which we [1] ceased using them, relying instead
(and with far greater success) on the use of "em" units
even in a vertical context where "ex"s would have been
preferable.  However, I am quite willing to believe that
the current generation of browsers now treat "ex" units
consistently.

> On that last sentence of the quoted text (which is marked as an issue in
> the working draft): The WG currently believes that the text of CSS 2.1
> ("In the cases where it is impossible or impractical to determine the
> x-height, a value of 0.5em should be used.") is still the best and can
> be inserted unchanged at that point in the CSS3 module.

I am a little unhappy with "or impractical"; does this not
leave a rather large loophole for browser inconsistencies ?

Philip Taylor
--------
[1] The Web team at Royal Holloway, University of London

Received on Friday, 30 October 2009 17:08:57 UTC