W3C home > Mailing lists > Public > www-style@w3.org > November 1999

Re: font-size and accents, again

From: Erik van der Poel <erik@netscape.com>
Date: Sat, 27 Nov 1999 08:45:00 -0800
Message-ID: <38400A8C.24B65735@netscape.com>
To: "L. David Baron" <dbaron@fas.harvard.edu>
CC: www-style@w3.org
"L. David Baron" wrote:
> 
> On Sat, 27 Nov 1999 00:13:51 -0800, erik@netscape.com (Erik van der
> Poel) wrote:
> >
> > Assuming that the font-size is 12pt, the line-height is 14pt and that
> > 1pt should be added above and below, I think that the vertical alignment
> > should be (1pt + ascent), not (1pt + max ascent), since the 12pt
> > font-size does not include the max ascent and max descent.
> 
> I agree that you should use ascent, because otherwise it wouldn't be
> aligned correctly from the bottom (i.e., centered).  (The way you
> propose to do things, ascent + descent = font-size, right?

Yes. I couldn't think of any better terms. I guess I mean the "ascent
part" of the em height, and the "descent part" of the em height.

Actually, I'm now not sure that on X this would be XFontStruct.ascent +
descent, since the XLFD spec says that they indicate the recommended
spacing between lines. The TrueType spec [1] has separate fields for
typographical ascent, descent and leading. Perhaps on X I'm supposed to
use one or more of the height fields in the long font name itself to
specify the em height, and then assume that they've already added the
half-leading to ascent and descent. I.e. I would have to subtract their
half-leading values, and then add CSS's line-height-based half-leading
values. I'll do some more investigation using stock X fonts next week.

I will also look into the Windows metrics more closely to see if it's
true that Windows does not indicate where the "internal leading" lies.
I.e. at the top, bottom or partly both. If the Windows APIs don't give
us this info, I'm pretty sure that we can use GetFontData() to parse the
info out of the TrueType file itself. (I've already used that API to
parse cmap subtables, so it's not entirely foreign to me.)

> And I
> assume by "vertical alignment" you mean the distance from the top of
> the inline box to the baseline of the text.)

Yes, that's what I mean. I should have made myself more clear.

Erik

[1] http://www.microsoft.com/typography/tt/ttf_spec/ttch02.doc
Received on Saturday, 27 November 1999 11:46:12 GMT

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