Achieve letter-spacing in RaphaelJs
-
05-07-2021 - |
Вопрос
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..
Решение
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
.
Другие советы
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.
Не связан с StackOverflow