Re: Font Metrics

Charles Pritchard wrote:

> 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.

Not sure I agree because the metrics you're interested in are specific
to a given run of text.  Calls to getComputedStyle are going to tell
you the result of resolving style system rules, they aren't going to
return the results of font selection, glyph selection and placement
for a given run of text.

I think enhancements to the Canvas text API's might be more appropriate.

Cheers,

John Daggett

Received on Wednesday, 11 August 2010 01:04:22 UTC