![]() |
CSS3 x-heightfont-size-adjust has been reintroduced in the CSS3 Fonts Module. I think there are some dubious statements in this Specification - but I’ll focus on x-height.
The CSS3 Module: Fonts has a table giving aspect ratio values for some fonts, and it’s here they wander into some strange territory.
Measurement shows that the typefaces are “rasterized” at 12pt at 72ppi, not 11pt. Their table has aspect ratios for Mac fonts “Bernhard Modern”, “Caflisch Script Web”, and “Flemish Script”. If it’s meant to be a reference document why use fonts that are not common to Windows and Mac, as in Browser Safe Fonts? Single values are given for Aspect Ratio and, of the five fonts that I have on my computer, the table gets four of them wrong. In any event Aspect Ratio for a font isn’t a fixed value but varies with font size. So how do you get the x-height for a font? Eric Meyer says: Cascading Style Sheets The Definitive Guide - Eric A. Meyer There are two ways to get x-height. The first is the 'brute force approach' by actually rendering the 'x' character and counting pixels. Not very practical for a browser. The correct way is to use a Windows API function that retrieves character heights. The function, if your interested, is GetGlyphOutline. This is the function used by FireFox for getting x-height. It’s not always appreciated that every computer program is just an interface between the user and the Operating System so, if the Operating System can’t do it - then a browser can’t do it. If Windows fails to get a value for ‘x‘ then the browser makes up a value. Firefox will use an x-height that’s 56% of the font’s Ascent value. These program generated tables give the aspect ratio values for Verdana and Georgia for font sizes from 11px to 50px.
You can see that Aspect Ratio bounces around with font size. One thing I've had in mind is to create a Java Applet that draws graphs of Aspect Ratio v Pixel Size. One small detail is that I don't actually know any Java so I've been doing some swotting - with a bit of a surprise |
| © 2006 - 2010 Richard Mason |