On Mon, Jan 12, 2009 at 4:41 AM, Richard Mason wrote:
> http://msdn.microsoft.com/en-us/library/ms534014(VS.85).aspx 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
http://www.w3.org/TR/css3-fonts/#font-size-adjust , 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
--
Bruno Fassino http://www.brunildo.org/test
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/