tags:

views:

168

answers:

5

Is it possible to write text on HTML5 canvas? I've googled for that, found some workaround but no good description...

Please advise, thanks!

+2  A: 

It is but it's support is very limited at present.

Have a look here.

Marko
I would say support for it is good enough to get by. All the latest releases of Chrome, FF, Safari and Opera, support it and with an additional script so does IE. The only problem is that they don't all have consistent positioning, so depending on the browser the text can be a few pixels out of place.
Castrohenge
A: 

Depends on what you want to do with it I guess. If you just want to write some normal text you can use .fillText()

Ian Devlin
+5  A: 

I would recommend reading through the diveintohtml5 site, it has it's own chapter about text. It's a very good read.

chelmertz
+1 I just love that article. Best one I've read on HTML5. That and Remy Sharp's one.
Marko
A: 

In addition to the other answers if you want to write text using excanvas (for IE support) you'll need an additional script, available here:

http://code.google.com/p/explorercanvas/issues/detail?id=6

The default download (http://code.google.com/p/explorercanvas/downloads/list) doesn't include the fillText and strokeText method.

Castrohenge
A: 

i want to write text on canvas in similar way as we write in an ms paint selecting the cursor dragging and writinf the text into the box. how do we do it?

Nitesh