Re: the *precise* definition of 1em

   From: "David Perrell" <davidp@earthlink.net>
   Date: Sat, 19 Jul 1997 18:21:53 -0700

   Joel N. Weber II wrote:
   > But the above example may not be worth considering, since the 50
   point
   > font might be too far away to ever be considered.

   IMHO, 50pts is not an approximation for 11.

True.

I probably need to add code to not use a font if it's size is too far
away from what the author specified.

   > one is availible as 9 points and 12 points.  Thus we use 12 points.
   > 
   > two is available as 10 and 13 points.  The same is true for three,
   four
   > five, and six.  So for these 5 fonts, we use 10 points.
   > 
   > The average will be 62/6 = 10 points.
   > 
   > Thus, the 1em will cause the font named one to appear smaller, since
   > 10 (the average) is closer to 9 points than 12 points.

   I don't understand what you're saying. How can the 12pt font "appear
   smaller" than the 10pt font? If we're talking scalable fonts, there is
   no issue. For a non-scalable font, such as a bitmap screen font, the
   glyphs will the glyphs of a 12pt font, but all relative measurements
   will assume a 10pt font. Therefore, if the element's line-height were
   1em, the 12pt glyphs might very well overlap on subsequent lines.

My point is that when your approximation of the size for one is 12
points, and the approximation of the size for the average is 10 points,
then when you specify 1em, the child element will now have an approximated
size of 10 points, and so the closest match for font one will now be
nine points, where the parent size of one was 12 points.

   > These cases are obscure, but if we need to make sure that 1em
   > will give us the same size as he parent element, the average rule
   > won't always work reliably.

   If the element consists of a variety of font sizes, what is the
   font-size of the element? Whatever you decide that is, that is the em
   value for the element.

Hmm... if you're trying to make something as tall as the text, it would
need to take the size of the largest font, I think.

   You could simply take the metrics of the over/undersized font(s), scale
   them, use the over/undersized glyphs but space/overlap them in
   accordance with the scaled metrics. And forget about approximation, use
   the value specified by the author.

   But, isn't this so obscure as to be moot? Doesn't the opsys/GDI do most
   of the work of displaying text strings, including the scaling of bitmap
   screen fonts?

I don't think X11 can scale bitmap fonts.  You can have scalable fonts,
but some fonts can't be scaled.

Note that I'm basically thinking of X11R5, or maybe X11R6.  I haven't
bothered putting X11R6.1 or X11R6.3 on my machine; and the leader of
the GNU project uses an X terminal that runs X11R5....

There may be newer features in newer versions of X, but E-scape needs
to continue to run on X11R5.  I could probably make things conditional
if I need to.

But I'm not even sure what was added in X11R6.1 and X11R6.3

Received on Sunday, 20 July 1997 02:17:21 UTC