Raphael JS/SVG中的自动换行 [英] Word Wrap in Raphael JS / SVG
问题描述
在RaphaelJS中,如何获取将单词包装在框中的文字?还是一般基于浏览器的SVG?
How do you get words to wrap inside a box in RaphaelJS? Or in browser-based SVG in general?
我在其上找到了此线程,但是这没有任何意义.他们说使用"widthToCharNum",但据我所知,此线程是这些词在互联网上唯一使用过的地方.他们建议使用宽度"属性,但这无效.
I found this thread on it, but it doesn't make any sense. They say to use "widthToCharNum" but as far as I can tell, this thread is the only place those words have ever been used on the internet. They suggest using a "width" attribute, but this has no effect.
推荐答案
文本包装不是内置的 Raphael或SVG规范.时期.来自HTML世界,我发现缺少文本环绕功能令人震惊.
Text-wrapping is not built into Raphael or the SVG spec. Period. Coming from the HTML world, I found the absence of text wrapping pretty shocking.
但是,您可以自己完成此任务,而不会遇到太多困难.参见
However, you can do it yourself without too much difficulty. See this question for details and an example. Unfortunately, you have to burn some client-side cycles to make it work dynamically.
这篇关于Raphael JS/SVG中的自动换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!