[whatwg] Text APIs on <canvas>

Vladimir Vukicevic vladimir at pobox.com
Fri May 9 11:57:15 PDT 2008

On May 5, 2008, at 8:10 PM, Ian Hickson wrote:
> I have introduced the following APIs:
>   context.font

I think this should be "textStyle" -- both to match existing fillStyle/ 
strokeStyle, and for consistency with the rest of the text functions.

> I haven't provided a way to render text to or along a path, nor a  
> way to
> do vertical text, nor a way to measure anything but the nominal layout
> width of text (e.g. there's no way to measure bounding boxes or get
> baseline metrics). I also haven't provided a way to render document
> fragments straight to a canvas.

Rendering text to a path or along a path are both useful operations;  
why were they omitted?  Bitmap fonts can pose problems here, but their  
bitmaps can be traced if necessary (and would need to be for  
strokeText anyway).  Text to a path allows for clipping to text, which  
is useful, and text along a path allows for effects that couldn't be  
obtained any other way.

I'm not super excited about maxWidth and the implementation getting to  
condense the font, but roc convinced me that it's a useful feature to  

I'm happy to see text added to canvas (and createImageData, though I  
don't think the restriction that "putImageData" must only work with  
objects returned by create/get is a good one), but it would be good to  
have some way to mark sections of the spec as stable/unstable --  
otherwise someone's liable to take a snapshot and implement it, and  
then have it change under them if a portion is still in flux.

     - Vlad

More information about the whatwg mailing list