在Inkscape中导入以下SVG文件仅显示文本,但忽略<use>语句(或其引用的组)。是一个bug还是一个特性?有什么需要改变的吗?顺便说一句,<g>组比示例文件中的组更复杂。文件在Chrome中显示正确。(Windows 10,Inkscape最新版本)
谢谢!马里奥
<svg width="400" height="200" x="0" y="0"
xmlns="http://www.w3.org/2000/svg">
<defs>
<g id="plus">
<circle cx="40" cy="30" r="20" stroke="#FF0000" fill="none"></circle>
</g>
</defs>
<svg x="100" y="50">
<rect x="1" y="1" width="78" height="86" rx="10" ry="10" stroke="#0000FF" fill="none"></rect>
<use href="#plus"></use>
<text x="20" y="74" width="68" height="26">ABCD</text>
</svg>
</svg>发布于 2019-05-09 23:08:44
<use href="#plus">应为<use xlink:href="#plus">。此外,您还需要向根SVG标记添加xmlns:xlink属性。
<svg width="400" height="200" x="0" y="0"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<g id="plus">
<circle cx="40" cy="30" r="20" stroke="#FF0000" fill="none"></circle>
</g>
</defs>
<svg x="100" y="50">
<rect x="1" y="1" width="78" height="86" rx="10" ry="10" stroke="#0000FF" fill="none"></rect>
<use xlink:href="#plus"></use>
<text x="20" y="74" width="68" height="26">ABCD</text>
</svg>
</svg>如果进行了这些修复,文件将加载到Inkscape中。
https://stackoverflow.com/questions/56061765
复制相似问题