Page 1 of 1

Incorrect conversion from MVG to SVG

Posted: 2009-03-04T16:03:20-07:00
by rmagick
This is 6.4.9-8 on Ubuntu 8.10, built with librsvg.

I started with the MVG program shown below, which produces the image below it, to SVG using this command:

convert -size 300x300 pattern.mvg pattern.svg

Code: Select all

push defs
push pattern xxxxx 0 0 16 16
push graphic-context
stroke "none"
fill "DarkBlue"
rectangle 0,0 16,16
fill "yellow"
stroke "red"
polygon 0,0,8,16,16,0,0,0
pop graphic-context
pop pattern
pop defs
fill "xxxxx"
stroke "blue"
stroke-width 5
path 'M50,50 Q-30,100 50,150 100,230 150,150 230,100 150,50 100,-30 50,50'

Image

However, the resulting SVG file is incorrect, producing the image below:

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
  "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="300" height="300">
<defs>
<pattern id="xxxxx" x="0" y="0" width="16" height="16">
<g style="stroke:none;fill:DarkBlue;">
  <rect x="0" y="0" width="16" height="16"/>
fill:yellow;stroke:red;  <polygon points="0,0 8,16 16,0 0,0 0,0 "/>
</g>
</pattern>
</defs>
fill:xxxxx;stroke:blue;stroke-width:5;  <path d="M50,50 Q-30,100 50,150 100,230 150,150 230,100 150,50 100,-30 50,50"/>
</svg>
Image

Please let me know if you need any other information.

Re: Incorrect conversion from MVG to SVG

Posted: 2009-03-05T17:18:46-07:00
by anthony
Even the rsvg library does not produce a good result from that SVG, so something is definitely wrong with the SVG generated.

Unfortunately I can help you with SVG :-(