1

例如,我想在矩形顶部放置一些文本。

<rect x="0" y="0" width="800" height="600" />
<text x="0" y="0">
    text text text text text text text text text text text text ... so on
</text>

但问题是当文本越来越长时,会超过矩形的原始宽度。

在 HTML 中我们可以使用 div 来包裹文本,在 SVG 中我们如何处理呢?

4

1 回答 1

1

您可能想要使用 svg1.2 草案规范的 flow* 部分。

http://www.w3.org/TR/2004/WD-SVG12-20041027/flow.html

例如 :

<flowRoot>
<flowRegion>
<rect x="0" y="0" width="800" height="600" />
</flowRegion>
<flowDiv>
<flowPara>text text text text text text text text text text text text ... so on</flowPara>
</flowDiv>
</flowRoot>

今天,只要正确设置了 svg 版本,它就可以与inkscape 和蜡染一起使用。

编辑:@Robert Longson 它可能不是标准的,但它可以节省你的时间(等待一个体面的 svg 2.0 实现),因为事实上 inkscape 和 batik 在 Windows 和 linux 上都可用,并且能够从 CLI 转换/光栅化...

于 2013-08-23T10:37:28.600 回答