是否可以定义textPath的内联路径,而不是创建def并将其作为xlink:href作为属性引用?
<defs>
<path id="MyPath"
d="M 100 200
C 200 100 300 0 400 100" />
</defs>
<use xlink:href="#MyPath"/>
<text>
<textPath xlink:href="#MyPath">
My text along a path
</textPath>
</text>所以有没有可能有像这样的东西
<text>
<textPath path="M 100 200 C 200 100 300 0 400 100">
My text along a path
</textPath>
</text>这不起作用,但是像这样的东西呢?
发布于 2015-06-05 06:03:41
这是新的SVG2规范中的路径,您可以使用feature属性。
新的SVG2特性的浏览器实现正在进行中。下面的示例可以在Firefox中运行,但不确定在其他地方。
html, body {
height: 100%;
width: 100%;
}<svg height="100%" width="100%">
<text>
<textPath path="M 100 200 C 200 100 300 0 400 100">
My text along a path
</textPath>
</text>
</svg>
https://stackoverflow.com/questions/30654713
复制相似问题