SVG 1.2微小的添加文本换行,但大多数SVG的实现,你会在浏览器中找到(Opera除外)没有实现这个功能。通常由您,开发人员手动定位文本。
SVG 1.1规范提供了对此限制的一个很好的概述,以及克服它的可能的解决方案:
Each ‘text’ element causes a single
string of text to be rendered. SVG
performs no automatic line breaking or
word wrapping. To achieve the effect
of multiple lines of text, use one of
the following methods:
The author or authoring package needs
to pre-compute the line breaks and use
multiple ‘text’ elements (one for each
line of text).
The author or authoring
package needs to pre-compute the line
breaks and use a single ‘text’ element
with one or more ‘tspan’ child
elements with appropriate values for
attributes ‘x’, ‘y’, ‘dx’ and ‘dy’ to
set new start positions for those
characters which start new lines.
(This approach allows us