Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Editable Text in Raphaël

Is there a way to make a svg text editable in Raphaël JS as described in the SVG 1.2 Specifications (http://www.w3.org/TR/2004/WD-SVG12-20040226/#text-edit)?

textelement.attr("editable", "true");

does not add the editable attribute to the textelement as I had hoped.

If there is no way I guess I will have to work with hovering html textelements…

like image 375
treppo Avatar asked Aug 24 '11 09:08

treppo


2 Answers

The specification you link to is a working draft (a work in progress, subject to change). However, the SVG Tiny 1.2 spec does have almost the same thing, and it is a w3c Recommendation. Of course that doesn't magically make every implementation do what it says, but it's at least stable.

If you're looking for an implementation that does support 'editable' on svg text elements, then Opera is one example.

like image 196
Erik Dahlström Avatar answered Nov 17 '22 15:11

Erik Dahlström


Raphael isn't a 100% SVG implementation. It only uses SVG & VML as a base. Therefore somethings may work, while others don't work quite as you expect and somethings don't work at all.

like image 2
graham.reeds Avatar answered Nov 17 '22 15:11

graham.reeds