【发布时间】:2015-09-22 17:46:44
【问题描述】:
我有一个简单的 SVG 文件,显示一个双头水平箭头,中间有一个标记,标记下有“1/2”文本。
它在 Chrome 和 Firefox 中显示良好,但当被 Inkscape 等 SVG 应用程序打开时,它会出现乱码。
这是它在 Inkscape 中的样子:
代码在这里:
<?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="1200" height="120" xmlns="http://www.w3.org/2000/svg" version="1.1">
<g stroke="blue" >
<!-- Horizontals -->
<line x1="0" y1="50" x2="1200" y2="50" style="stroke: #6666ff; stroke-width: 6px; fill: none; " />
<!-- Arrows -->
<line y1="50" x1="0" y2="35" x2="40" stroke-width="3" />
<line y1="50" x1="0" y2="65" x2="40" stroke-width="3" />
<line y1="50" x1="1200" y2="35" x2="1160" stroke-width="3" />
<line y1="50" x1="1200" y2="65" x2="1160" stroke-width="3" />
<!-- Verticals -->
<line y1="35" x1="50%" y2="65" x2="50%" stroke-width="3" />
<!-- Numbers -->
<text text-anchor="middle" x="50%" y="80%" dy=".35em" font-family="sans-serif" font-size="20px" stroke="red" >1/2</text>
</g>
</svg>
请帮忙。
【问题讨论】:
-
随机猜测,但 Inkscape 可能不支持百分比/相对位置,因此将其定位在 0,0。 bugs.launchpad.net/inkscape/+bug/384301 =3
-
@Ray。把这个作为答案,我会接受的。刚刚尝试过硬位置而不是相对位置,现在效果很好。非常感谢。