Re: the *precise* definition of 1em
From: "David Perrell" <email@example.com>
Date: Mon, 21 Jul 1997 10:40:32 -0700
X-Mailer: Microsoft Internet Mail 4.70.1161
Content-Type: text/plain; charset=ISO-8859-1
Joel N. Weber II wrote:
> I think that in general, 1em for things other than font-size ought to
> 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?
As far as I know, no mechanism has every been proposed for css1
to specify how much variation is allowed.
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.
The CSS1 spec allows up to a 20% variation from what the user specified.
However, it is possible for a UA to make this configurable.
My understanding is that a UA can conform to the spec as long as it
will never use a font which is more than a 20% difference from the
user-specified size. So if a UA usings 10% or 5% or 0%, that's fine.
> 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.
That depends entirely on how the X server is configured.
For the particular NCD X11R5 terminal I'm thinking about, here's the
output of `xlsfonts':
10x20 8x13 cursor fixed
6x10 9x15 fg-22 vtsingle
I suspect there is a way to add fonts, but I don't know how to do that.
There are 732 fonts avaialbe on my GNU/Linux system. Here are a
(Obviously there are many more than these. But I think the whole
list is a bit long to mail to everyone.)
In short, it's hard for me to tell you that you're going to reliably
get any particular set of fonts on X11.
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.
Something like this is doable. I can get the size of each character,
and I can read the off-screen buffer back.
But I'm not sure how to scale something. For example, take this 5x7:
So how do we convert that to a 6x8? I suppose we could duplicate the
middle row and column, like this:
But I think the 5x7 looks better than the 6x8 with this algorithm.