W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: Font Metrics

From: John Daggett <jdaggett@mozilla.com>
Date: Tue, 10 Aug 2010 18:03:48 -0700 (PDT)
To: Charles Pritchard <chuck@jumis.com>
Cc: www-style <www-style@w3.org>
Message-ID: <2123893207.243212.1281488628774.JavaMail.root@cm-mail03.mozilla.org>
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.


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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:49 UTC