Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SVG在Chrome中格式正确,但在Inkscape中格式不正确_Svg_Inkscape - Fatal编程技术网

SVG在Chrome中格式正确,但在Inkscape中格式不正确

SVG在Chrome中格式正确,但在Inkscape中格式不正确,svg,inkscape,Svg,Inkscape,我有一个简单的SVG文件,显示一个双向水平箭头,带有一个中间标记,标记下有“1/2”文本 它在Chrome和Firefox中显示得很好,但当被Inkscape等SVG应用程序打开时,就会出现乱码 以下是FF中的外观: 以下是Inkscape中的外观: 代码如下: <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org

我有一个简单的SVG文件,显示一个双向水平箭头,带有一个中间标记,标记下有“1/2”文本

它在Chrome和Firefox中显示得很好,但当被Inkscape等SVG应用程序打开时,就会出现乱码

以下是FF中的外观:

以下是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>

1/2

请帮助。

Inkscape似乎不支持百分比/相对位置,因此它将其定位在坐标0,0处


看看其他用户有相同问题的地方,以及可能的解决方案和指导原则。

随机猜测,但Inkscape可能不支持百分比/相对位置,因此它将其定位为0,0=3@Ray. 把这个作为答案,我会接受的。只是尝试了硬的立场,而不是相对的,它现在运作良好。非常感谢。