The SVG standard is extremely broad, and very few (or no) renderers support the entire standard. Rack’s SVG renderer does not support the following features.
Text and fonts: All text objects must be converted to paths. This can be achieved in Inkscape with Path > Object to Path. As a benefit, this avoids license issues with embedding proprietary fonts.
Complex gradients: Simple two-color linear gradients may work.
CSS: Although, most fill-* and stroke-* properties are supported in inline style attributes.
That was very helpful! I’ve been able to create a few gradients that work by avoiding complex gradients. Thanks for pointing me in the right direction.
Old thread, but bringing Rack’s nano SVG capabilities up to date for June 2023:
Only two stops per gradient. Just a start and an end.
Linear and simple Radial gradients are supported.
FWIW i see that nano has an incomplete PR on it adding support for more stops.
Radial gradients are more challenging to use because it’s easy to get very different results in Inkscape and Rack. At the SVG element level, it appears that nenovg ignores the fx and fy attributes. Stick to radial gradients that specify only a center position (cx, cy), a radius (r), and two stops.
This thread is even older now, but I had a similar problem - I was making a knob with a radial gradient in the SVG, and it didn’t show up as a gradient.
TL;DR: line 149 in Rack/src/window/Svg.cpp gives the gradient radius a hardcoded value of 160:
I’ve emailed VCV support, and hope that they’ll incorporate this fix or write a better one - mine’s good for round objects but doesn’t handle elliptical objects well, just uses the short radius.
OK, so the long story is that I experimented with bigger objects on a panel, and could see that the radial gradient was happening, but not in the right amount of space.
Inkscape:
Rack with the original code; see how the gradient doesn’t get to the dark blue, as if the radius is bigger than the object: