以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 SVG/GML/VRML/X3D/XAML 』  (http://bbs.xml.org.cn/list.asp?boardid=21)
----  如何保留textpath中的多个连续空格?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=21&rootid=&id=18741)


--  作者:wulemale
--  发布时间:5/23/2005 9:13:00 PM

--  如何保留textpath中的多个连续空格?
textpath中的多个连续空格会压缩为一个,如何保留。
或如何让文本均匀分布到路径上
--  作者:一直在漂
--  发布时间:5/24/2005 2:30:00 PM

--  回复
在text中添加了这样个属性xml:space='preserve',就可以了,测试代码如下:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="12cm" height="3.6cm" viewBox="0 0 1000 300" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="MyPath"
d="M 100 200
C 200 100 300 0 400 100
C 500 200 600 300 700 200
C 800 100 900 100 900 100" />
</defs>
<desc>Example toap01 - simple text on a path</desc>
<use xlink:href="#MyPath" fill="none" stroke="red" />
<text font-family="Verdana" font-size="42.5" fill="blue"  xml:space='preserve'>
<textPath xlink:href="#MyPath">
We go up, then    we    go        down, then up again
</textPath>
</text>
<!-- Show outline of canvas using 'rect' element -->
<rect x="1" y="1" width="998" height="298"
fill="none" stroke="blue" stroke-width="2" />
</svg>
--  作者:wulemale
--  发布时间:5/24/2005 5:47:00 PM

--  
thank you!
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
38.086ms