Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating <canvas> based HTML5 text editor [closed]

I am making a text editor using HTML5 canvas by which I can update text, change fonts, move fonts and move background images.

I need help regarding moving text in canvas - how can it be done using context with mouse move events?

like image 205
Vishal Avatar asked Sep 14 '12 12:09

Vishal


1 Answers

The w3c draft for canvas itself recommends not to do this. You can read this in canvas best practices

Authors should avoid implementing text editing controls using the canvas 
element. Doing so has a large number of disadvantages

[...]

This is a huge amount of work, and authors are most strongly encouraged 
to avoid doing any of it by instead using the input element, the textarea 
element, or the contenteditable attribute.

If you need a text editor, you could look at other free initiatives like CodeMirror

like image 100
jbalsas Avatar answered Sep 21 '22 12:09

jbalsas