Pergunta

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..

Foi útil?

Solução

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.

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top