Re: font-size and accents, again

Erik van der Poel wrote:
...

> > piece of text is centered vertically, it can be centered
with respect to
> > at least 3 distinct things:
> >
> >   1. the font's em square
> >   2. the font's bounding box (max ascent + max descent)
> >   3. the text's vertical height

...

> 2. is the only one left. It does not suffer the same problem
as 3, and
> it can be implemented, at least on Windows (tmAscent and
tmDescent) and
> X (max_bounds.ascent and descent).

In one respect I'm inclined to agree with you. It may be that
ascender height and descender depth are not relevant for
unicameral and non-latin bicameral fonts. Centering on the
bounding box of the font would be relevant to all fonts.

In another respect, this doesn't seem like a good idea. If
two-case text is centered relative to the bounding box, fonts
are likely to appear to be too low in their block element.
This can be particularly ugly in inline boxes with a colored
background, where descenders might even extend below the box
if a font has prominent accents over cap letters.

There is a fourth possibility you neglected: centering
relative to the x-height. Since most of a bicameral font's
lower-case weight lies in the x-height, centering on x-height
is more likely to give the appearance of vertical centering
than the options you offer. And this is a pretty simple
formula:

  baseline from top of em square = font-size/2 + x-height/2

The problem here is that descenders are typically shorter than
ascenders. The font looks a mite too high.

For two-case latin fonts, I think that vertical centering on
the ascender to descender height looks best.

I posted an example at
http://www.hpaa.com/css1/font-position.html

David Perrell

Received on Wednesday, 1 December 1999 17:36:13 UTC