Markers don't survive pass through <use xlink:href="file.svg">
Given an svg file "markertest.svg" which includes a path with a marker Arrow1Lend
defined in the file, and another svg file parent.svg
which contains an item layer1
of markertest.svg
via a <use>
tag, Arrow1Lend
does not appear when displaying parent.svg
markertest.svg
:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink= "http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
width="1000" height="1000" viewBox="-10 -10 20 20"
id="svg2" version="1.1"
>
<defs>
<marker orient="auto" refY="0.0" refX="0.0" id="Arrow1Lend" style="overflow:visible;">
<path
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="stroke:black;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.8) rotate(180) translate(12.5,0)"
/>
</marker>
</defs>
<g id="layer1">
<path
style="fill:none;stroke:black;stroke-width:0.05;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
d="m 0,-5 0,5"
/>
</g>
</svg>
parent.svg
:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink= "http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
width="1000"
height="1000"
viewBox="0 0 20 20"
id="svg2"
version="1.1"
>
<use xlink:href="markertest.svg#layer1" transform="translate(10 10)"/>
</svg>
Tested with rsvg-view-3. librsvg: librsvg-2.so.2.40.13 from Ubuntu 16.04.3 Also tested with : 2.42.2 (the latest I'm able to easily compile) and confirmed the same
Affects a large number of applications dependant on rsvg including EOG(EyeOfGnome) and Gthumb