W3C home > Mailing lists > Public > www-style@w3.org > July 1997

Re: the *precise* definition of 1em

From: David Perrell <davidp@earthlink.net>
Date: Mon, 21 Jul 1997 10:40:32 -0700
Message-Id: <199707211743.KAA13214@italy.it.earthlink.net>
To: "Joel N. Weber II" <devnull@gnu.ai.mit.edu>
Cc: <www-style@w3.org>
Joel N. Weber II wrote:
> I think that in general, 1em for things other than font-size ought to
be
> the biggest size of any one font, since we want to make sure we have
> enough space for the largest font.  For font-size, I'd prefer to use
> the approximated value if it's the same for all fonts, otherwise the
> user-specified value.

Mixing font-families in an element could be very unstylish. Mixing
sizes could be downright ugly. How do I specify to the user agent I
don't want mixed sizes? What's the percentage variation that can be
considered an approximation and not an abomination? I suspect it's
subjective. Some readers will see .5 pt variations as annoying,
especially if off-sized fonts are of a different family.

> Scalable fonts are supported, but not all fonts are scalable.

Do the non-scalable fonts have cross-platform font-family names that
can be specified in a stylesheet? What fonts are generally available on
an X11 terminal? Is there a full range of serif and sans-serif sizes?
Stylesheet writers wanting to be appreciated on X11 will need to know.

There are non-scalable fonts in Windows, and if "fixedsys" is specified
in a stylesheet, IE3.02 renders it at the fixed size, regardless of the
specified size. Navigator 4.01, however, is a bit more sophisticated.
It scales the 'non-scalable' font, so there will never be a size
discrepancy.

> If we can't scale the font, we still have to do something.

How does Navigator scale the non-scalable font? Dunno, but the simplest
approach would be to write your own simple font scaler by rendering the
entire font in an offscreen buffer, scaling the character offsets to
match the specified size. If you don't have font metrics, you could
take the size of your line-box as specified by the stylesheet, create a
display buffer at the scaled size, render your line of text in the
buffer, then scale the bitmap buffer to match the display (gets
complicated with inline elements and mixed fonts).

In any case, I think the unapproximated em value should be used for
computation. Font substitution may only occur in one of many
consecutive elements. If children of that one element are noticeably
changed as a result, it could change the visible structure of the
document.

David Perrell
 
Received on Monday, 21 July 1997 13:43:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:50 GMT