Font Metrics

Is there a currently accepted API for querying font metrics from CSS?

With web fonts support available in most browsers; and Canvas also 
supported,
we're now able to do quite a few interesting things with text.

One issue I'm coming across, however, has to do with measuring the 
descent of a font,
so that I may properly use the textBaseline attribute of the Canvas 2D 
Context.

Canvas 2D TextMetrics are very minimal, for good reason.

I can adequately process the height and width of text I'm displaying,
but I can't align two different font sizes on the same baseline without
hand-coding font metrics [mainly, descent].

It seems to me that an API for selecting such information may, most 
appropriately,
via CSS, and DOM methods like getComputedStyle.

I've been suggesting such information be added into Canvas 2D Context 
TextMetrics,
but having thought about it more, I think CSS is a more appropriate avenue.

-Charles

Received on Wednesday, 11 August 2010 00:49:21 UTC