Having trouble putting a .svg graphic in a module

I’d like to try out SVG graphics and see if they perform better in the X-Wing vassal module.

I used to do a test a while back (I think it was in vassal v3.12 iirc) and it did work with the famous tiger.svg from the internet, although that image is a little complex.

I’ve looked up the documentation on general SVG instructions to produce a graphic, which loads well under firefox and other programs which can render SVG graphics.

When I try to load it in my x-wing module, it creates an error. I’ll post my xml lines for the SVG here
Can anyone point me to any vassal module that successfuly uses svg graphics? I’d like to study how it’s implemented.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg id="svg2" xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="544.76" width="94" height="847.5" fill="red" style="fill:red;fill-opacity:0.5" />
<rect x="544.76" y="282.5" width="94" height="565" fill="red" style="fill:red;fill-opacity:0.5" />
<rect x="544.76" y="565" width="94" height="282.5" fill="red" style="fill:red;fill-opacity:0.5" />

<path d="M0,198.277 A847.5,847.5 0 0,1 544.79,0 v847.5,0 Z" style="fill:red;fill-opacity:0.5"/>
<path d="M181.59,414.68 A565,565 0 0,1 544.79,282.5 V847.5 Z" style="fill:red;fill-opacity:0.5"/>
<path d="M363.17,631.09 A282.5,282.5 0 0,1 544.79,565 V847.5 Z" style="fill:red;fill-opacity:0.5"/>

<path d="M638.76,847.5 V0 A847.5,847.5 0 0,1 1183.58,198.277 Z" style="fill:red;fill-opacity:0.5"/>
<path d="M638.76,847.5 V282.5 A565,565 0 0,1 1001.99,414.68 Z" style="fill:red;fill-opacity:0.5"/>
<path d="M638.76,847.5 V565 A282.5,282.5 0 0,1 820.35,631.09 Z" style="fill:red;fill-opacity:0.5"/>
</svg>

I duplicated that error. The corresponding snippet from the VASSAL error log is here: pastebin.com/znivLXAe

However, I was able to load your code (having saved it as an SVG) in Inkscape, resized the document to a width and height that would accommodate it all, group everything together and center it on the page, then save as a new SVG…and that imported just fine.

I’m not sure which of these things I did provided the crucial addition, though.

Thanks, it worked. I saved as a plain .svg though, not as an inkscape .svg. It cuts the crap that way.

Yup, I saved all the SVG in my modules the same way.

Thus spake JoelCFC25 via messages:

I duplicated that error. The corresponding snippet from the VASSAL error
log is here: pastebin.com/znivLXAe[1]

The problem is that the svg element is lacking both width and height
attributes. It’s valid SVG without them, but VASSAL needs them to
size the image correctly.


J.