2

I'm trying to write some SVG for illustration and while it renders well in:

But nothing gets displayed in:

  • Inkscape (Inkscape 0.92.5 (2060ec1f9f, 2020-04-08)).
  • wmflabs (though it did not report any issues)

Minimal working example to reproduce is below and was validated against:

<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
        <!-- last joint -->
           <defs>
           <g id="disk">
            <!-- define here the joint -->
            <circle cx="0" cy="0" r="100"/>
            </g>
         </defs>
      <use href="#disk" />
</svg>

Google / Firefox rendering: enter image description here:

While Inkscape shows only a blank sheet.

I'm assuming some specifics to Inkscape (I've seen special handling for layers, but would rather avoid reverse engineering if possible).

1 Answer 1

2

Try this:

<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 200">
        <!-- last joint -->
           <defs>
           <g id="disk">
            <!-- define here the joint -->
            <circle cx="0" cy="0" r="100"/>
            </g>
         </defs>
      <use xlink:href="#disk" />
</svg>

Basically all I did here was to use xlink:href= instead of href= and declare the namespace prefix xmlns:xlink="http://www.w3.org/1999/xlink". I tested this and it works in Inkscape, Firefox and Google Chrome.

I don't know why href doesn't seem to work in Inkscape. To get an answer to that, perhaps better to ask the Inkscape developers.

1
  • awesome, thanks ! just checked and it works. and as to why it is needed i'll dig in the inkscape documentation now that there is a vector for where to start from. Commented Apr 28, 2020 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.