0
我需要將文字包裹在形狀中。這是我在參考中找到的代碼,但本身不起作用。誰能幫我?SVG形狀文字換行
<svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="600px" height="400px" viewBox="0 0 300 310">
<title>Basic textflow</title>
<rect x="0" y="0" width="100%" height="100%" fill="yellow"/>
<flowRoot font-size="16" fill="black" color="black">
<flowRegion>
<path d="M100,50L50,300L250,300L300,50z"/>
<flowText>Tomorrow, and tomorrow, and tomorrow; creeps in this
petty pace from day to day, until the last syllable of recorded time.
And all our yesterdays have lighted fools the way to dusty death.
</flowText>
</flowRegion>
</flowRoot>
<path d="M90,40L40,270L260,270L210,40z" fill="none" stroke="black" stroke-width="5"/>
</svg>
我的要求:
,從 「永不竣工」 SVG 1.2全面規範草案的。據我所知,只有Inkscape實現它。您需要通過測量文本並自行分割來實現JavaScript。 – 2014-08-30 13:29:20
有沒有其他的方式,而不是分裂自己?我按照確切的要求更新我的問題。讓我知道如何才能出來這個。 – 2014-08-30 13:40:10
編號SVG當前沒有任何自動文本佈局元素。否則,請嘗試使用Google搜索 - 也許有人制作了腳本。 – 2014-08-30 14:24:24