Re: Units, font sizing, and zoom suggestion for CSS 3

Ian Hickson wrote:
> 
> The definition of _em_ is _not_ vague. Section 4.3.2:
> 
> #  * em: the 'font-size' of the relevant font
> 
> The only minor vagueness is whether one should use the specified,
> computed, or actual value of font-size. I tend to believe we should
> use the actual value of font-size for the first available font in the
> font-family list, but this is not (AFAIK) specified in the spec.

The actual value of font-size can be quite different from the computed
value. For example, some font families on Unix only support bitmap
fonts. Some X servers can be asked to scale the bitmaps, but that is
generally ugly. CSS allows the implementation to select a different font
size, which may even be as high as 20% off (or higher). So, one wonders
whether "em" was supposed to refer to the computed or actual value.

> I think 'em' is implemented pretty well and consistently. Maybe
> font-size, and certainly line-height and vertical-align, but the 'em'
> unit is generally well supported. (I have a test case somewhere...)

But if the style sheet author expects the UA to use the actual value of
font-size for "em", and if the UAs don't currently do this, then we
still have a problem.

> Not many compared to the billions of document actually on the web, no,
> but in absolute terms we are still talking tens to hundreds of
> thousands, I expect. Maybe even millions. That is still a _lot_ of
> documents. (Sorry, no reference...)

How many of those CSS style sheets use "em"?

> > Also, when you pronounce the unit "em", it sounds like the letter M.
> 
> If we stick to the definition of font-size as given by Eric in his
> document (which IIRC the WG has agreed is correct),
> 
>    http://www.meyerweb.com/eric/css/inline-format.html
> 
> ...then the height of the em square is equal to the font-size. Since
> 'em' is equal to the font-size too, that means that 1em is the height
> of the em square of the element's first-choice font.
> 
> That makes sense to me, and explains why it is spelt 'em' not 'M'.

One can only accept that argument if one accepts the term "em square",
which is also defined by CSS. CSS may have adopted this term from some
other source (e.g. TrueType spec), but then one might question that
source too.

Certainly, when I first heard the term "em", it was in the context of
TeX, and it was the width of an M. I've also seen the word "em" in
Unicode. There is a character called EM DASH, usually used in horizontal
context.

I'm reminded of the days when the term "charset" was first introduced in
MIME. Several people objected to that term, but most of the working
group participants at that time were not internationalization experts,
so they didn't seem to understand why that term was inappropriate,
despite repeated explanations. After a while, they started saying that
it was too late to change it. Now we're stuck with this inappropriate
term not only in MIME, but also in HTTP and HTML.

After a while, people get used to the term "charset", and so, I suppose,
people will get used to the difference between CSS's em and TeX's em.
But the initial confusion would still be there, and I'm sure lots of
questions would be asked, in much the same way that questions about
charset are asked these days, from time to time.

However, if CSS goes with TeX's definition (width of M), then people
coming from a TrueType background might be confused.

I don't know. I guess I don't feel so strongly about this issue now,
though it would be a good idea to resolve the computed vs actual value
issue you mentioned.

> >> (For most other scripts, a suitable similar measure should not be
> >> too hard to find, I think. Perhaps Arabic/Mongolian are hard for
> >> this.)
> > We need to define what font-size means for all of those scripts
> > anyway.
> 
> Do they not have an em square?

The fonts probably have an em square, but the question is whether the
designers all use a single convention for deciding how much of the
glyphs actually should fit into the em square. Kent claims that some
European fonts fit more of the glyphs into the em square (i.e. the
accents above capital letters go inside), while many American fonts
appear to place the accents outside the em square.

The subjective size of text depends more on the actual glyphs than on
the em square that the designers use in an inconsistent way. In
particular, the subjective size appears to depend especially on the
x-height. Since the x-height has only a very rough relationship to the
em square, font-size-adjust was introduced. But if this property is
itself defined in terms of the unreliable em square, it is still
meaningless (or not as meaningful). The font-size-adjust property is
defined in terms of "aspect", which is itself defined in terms of
x-height and font size. So, if font size is ill-defined, then aspect is
ill-defined, thereby reducing the meaningfulness of font-size-adjust.

Erik

Received on Tuesday, 25 January 2000 16:17:09 UTC