Previous Message
Next Message

Font stack article

Sent by Bruno Fassino on 12 January 2009 08:08

On Mon, Jan 12, 2009 at 4:41 AM, Richard Mason wrote:

> shows the
> parameters that can be read, by a call to the appropriate Operating
> System function, for an installed font. Note "otmsXHeight" which is the
> x-height and the comment further down "Not supported". It's immaterial
> whether the OS is just being awkward, or the x-height is not stored in
> the font file - if the OS can't _directly_ retrieve a value then neither
> can a browser. For a browser to get a value for x-height the only
> logical choices would be seem to be some sort of Look-Up-Table or
> rendering and measuring the character.

In the Firefox source I see this
    DWORD len = GetGlyphOutlineW(dc, PRUnichar('x'), GGO_METRICS, &gm,
0, nsnull, &kIdentityMatrix);
    mMetrics->xHeight = gm.gmptGlyphOrigin.y;

I know nothing about this (I'm not even sure to have identified the
correct place in the code), anyway this looks like a sort of rendering
and retrieving of the data for a character.

> I'll never quite understand why CSS spec writers put in a requirement
> that browser authors determine x-height and then, instead of leaving the
> programmers to implement the requirement, they tell them what the
> answers going to be  - and get it wrong.

But the CSS specs don't really tell this. If you mean the table at , it is just an
example, surely not something the browsers must use.
And yes, something in that table looks wrong, I seem to remember that
this has been noticed more than once.


Bruno Fassino
css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
List policies --
Supported by --
Previous Message
Next Message

Message thread: