Closed dmi3kno closed 4 years ago
Apparently librsvg (which is an underlying C library behind rsvg and also base svg rendering library in GNOME e.g. also in GIMP and Inkscape) does not allow hashtagged identifiers inside url() call to be quoted.
librsvg
rsvg
url()
library(minisvg) doc <- svg_doc(width = 300, height = 30) pat <- stag$defs()$pattern(id = 'motif', width=60, height=30, patternUnits = 'userSpaceOnUse') pat$add('rect', x = 0, y=0, width = 30, height = 30, fill='black') doc$append(pat) doc$rect(x=0, y=0, width="100%", height="100%", fill=pat) doc$show() doc #> <?xml version="1.0" encoding="UTF-8"?> #> <svg width="300" height="30" viewBox="0 0 300 30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> #> <pattern id="motif" width="60" height="30" patternUnits="userSpaceOnUse"> #> <rect x="0" y="0" width="30" height="30" fill="black" /> #> </pattern> #> <rect fill="url('#motif')" x="0" y="0" width="100%" height="100%" /> #> </svg>
The last line before closing tag should instead read
#> <rect fill="url(#motif)" x="0" y="0" width="100%" height="100%" />
Then the document will be valid and can be rendered by librsvg, i.e. read by rsvg, magick and the like
magick
Thanks for the bug report (and all the other testing you're doing!)
I will fix this for the next release.
Fixed in https://github.com/coolbutuseless/minisvg/commit/ab5237f6c4d51408b649f3ebe95e6df5b52d5e81
Thank you very much!
Apparently
librsvg
(which is an underlying C library behindrsvg
and also base svg rendering library in GNOME e.g. also in GIMP and Inkscape) does not allow hashtagged identifiers insideurl()
call to be quoted.The last line before closing tag should instead read
Then the document will be valid and can be rendered by
librsvg
, i.e. read byrsvg
,magick
and the like