nanosvg
nanosvg copied to clipboard
<use xlink:href> not working
I am trying to render a very simple file with <use>
elements, but it's not rendering correctly. Does nanosvg supports <use>
? Here are the contents of my file:
<svg viewBox="0 0 400 100">
<rect id="original-rect"
x="100" y="20"
width="50" height="50"
fill="#29e" />
<use xlink:href="#original-rect" x="150" y="10" />
</svg>
Implementing this requires
- Add xform into NSVGshape structure.
- Transform a shape during rasterising or
- Make a transformed copy of the shape including all elements: bounds, path, gradients etc. during parsing.
This feature would be very nice. Lots of SVG content has use
tags!
I have the same problem. We use nanosvg to parse svg file to support high dpi client. So many SVG content has <use> tags.