Re: font sizes

On Saturday, Feb 22, 2003, at 02:54 US/Pacific, Sigurd Lerstad wrote:

> 2.
>
> What is the em size of a font? Is 1em the same as font-size? Or Is it
> smaller or larger than font-size?
> If not the same, do you happen to know how to get the em height of a 
> windows
> font?

It is the same as font-size. Font designers reserve the right to 
determine the actual relationship of the character heights to the em 
height (the characters may exceed or fall short, so it's no use looking 
at glyph shapes), and I believe some display systems (Windows) further 
tend to pad the heights of "single-spaced/unleaded" lines beyond 1em in 
some cases.

> Also.
>
> The CSS2.1 specifies a table for absolute font sizes, and it also has a
> sample stylesheet for HTML4
> where it sais h1 {font-size: 2em} etc.
>
> This means that headings scale according to the parents font-size (But
> neither IE or Opera seem to do that)?

The em values given in the sample style sheet derive from my having 
counted pixels and done the math in a couple of popular UAs in 1997 
(with some bias toward Netscape's contemporary offerings, which all 
other UAs were effectively compelled to reverse engineer to some 
extent). The rendering behavior of said UAs can't be captured 
accurately in terms of CSS, so this was a bit of a fudge. I chose 
relative lengths because I observed that the values varied with the 
font size chosen by the user in prefs, which I deemed a behavior very 
worthy of note/preservation, so I came to conceive of the user-given 
size as equivalent to a user style sheet rule like html { font-size: n 
}. In simple cases at least (i.e., where no ancestor of Hn assigns 
another font-size value), this assumption and the em values for Hn 
given in the sample sheet do capture typical legacy HTML rendering 
reasonably well.

> Also. it doesn't seem that the table on absolute font-sizes in CSS2.1 
> is in
> accordance with the sample stylesheet, for instance, the scaling 
> factor for
> h6 is 3/5=0.6, but the sample stylesheet sais {font-size: .75em}
>
> What am I missing, and what is correct?
>
> And one last point, it sais that medium is the default for font-size. 
> But in
> IE and Opera, it looks like small is the default? What's with that?

Realizing the shortcomings of the sample sheet's account, and upon 
studying early CSS implementations with horror, I revisited the subject 
in 1999, and wrote this: 
<http://style.cleverchimp.com/font_size_intervals/altintervals.html>, 
which I think speaks to your remaining questions. The font-size: .75em 
= xx-small = h6 cases [should?] obtain when the base or user size is 
small enough that application of the .6 factor would result in text 
below a theoretical legibility threshold, typically 9px for bicameral 
character sets.

Note that current versions of Explorer correctly map "medium" to the 
default/user size when in "strict" rendering mode (DOCTYPE-sniffed at 
the moment).

Received on Friday, 21 February 2003 12:37:09 UTC