[whatwg] Canvas lack of drawString method

Stefan Haustein wrote:
> I think it is very important to be able to determine the rendered size 
> of the text.

Can't you determine the size from the accessible version you are 
doubtless creating inside the <canvas> element? ;-)

(This assumes that if you draw a string in 8px Monaco on a <canvas>, and 
do the same thing in a <span>, the span will have the same size as the 
canvas version. But that seems to make sense to me.)

> context.drawText(x,y,string); context.getFontAscent();
> context.getFontDescent();
> context.getFontLeading();

Hang on; can we even get these for existing text styled with CSS in web 
pages?

Gerv

Received on Wednesday, 25 October 2006 02:06:19 UTC