我需要做类似的事情:
paper.text(Left, Top, " " + this._p.Label + ":");
paper.text(Left, Top, " " + this._p.Label + ":");
但前置空格不会显示或显示为
在文本中。
我试过了:
label.attr({"xml:space": "preserve"});
...没有效果。
无论如何,有没有办法访问 Raphael JS 中的 SVG 节点,以便我可以设置
setAttributeNS("http://www.w3.org/XML/1998/namespace","space","preserve");
(或者有其他方法可以解决这个问题吗?)
是的,您绝对可以将该命名空间属性直接应用于 Raphael 管理的 SVG 元素。就这么简单:
paper.canvas.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space","preserve");
经证明具有功能性here http://voidblossom.com/testTextSpacing.php.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)