Cabbage Logo
Back to Cabbage Site

Custom SVG format

Hey Rory,

I found this issue earlier, but I might be missing something here. There are 2 files uploaded here:

  1. rslider.svg - SVG file taken from Cabbage example and built upon.
  2. rslider_new.svg - SVG created from scratch with same artboard dimensions.

I find that rslider_new.svg does not work. This is of course, after linking the svg explicitly by svgfile(“slider”,“rslider_new.svg”). I don’t find any difference between the 2 files, but the latter just doesn’t work.

Any thoughts?

slider_svgs.zip (69.8 KB)

This is odd. What did you use to create the svg file? Might you have somehow set the opacity to 0 by mistake? I’m trying to figure out how one might do that in Inkscape but so far I’ve not been able to do it. There is definitely something up. I’ll keep digging.

[EDIT] I see you used Illustrator. Ok, I’m just doing a diff of the two files to see if I can spot the problem…

Modifying the image in Inkscape doesn’t work because Inkscape can’t seem to understand the different fills you are using. You can try simplifying your SVG and seeing if that helps. At some point, as you simplify it, it should suddenly work. I’ve stepped through the Cabbage source code with the debugger, and the SVG parser is reading the file Ok. it just can’t handle what it’s reading. Be careful of filters and things like that. They can cause problems.

Cabbage 2 will supports pngs for sliders. So you can create images and complex and photo realistic as you like. The only real advantage to svgs is that they can scale without loss of resolution. You could also use a filmstrip approach? I posted a simple example here

1 Like

I use Inkscape most of the time, but I decided to try out Illustrator. Illustrator is a mix of both raster and vector. So I am assuming one of the effects that I used, converted a part of the slider to a raster image. And I think exporting to svg from illustrator doesn’t make it entirely compatible with other vector graphics editors. That explains all the weird artifacts and stuff that you see when you try opening it in Inkspace.

But don’t waste your time on it. I redid the same, from scratch in Inkscape, and it’s working fine.

Cheers.