Question

Is there a way to set letter-spacing in raphael js text? It can be done easily in CSS, how can I do it in raphael? Any hacks would also do..

Was it helpful?

Solution

It can be done with normal css. take a look here : http://tutorials.jenkov.com/svg/text-element.html . The css is applied to svg too.
Here's a live demo that shows svg text with letter-spacing.

OTHER TIPS

Paper.print() has a letter-spacing attribute:

var txt = r.print(10, 50, "O HAI", r.getFont("Comic Sans"), 30, 'middle', 1).attr({fill: "#fff"});
                                                                          ^
                                                           this is the letter spacing

See the docs on that.

Note that this needs "cufon-style" font files to be included and will render a non-selectable path object instead of real text.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top