-
Notifications
You must be signed in to change notification settings - Fork 69
Does it work with SVG sprites by using xlink:href="#spritename"? #17
Comments
Off the top of my head I'll say no - but then I have never tried. There is no attempt to handle this explicitly in the plugin code, so if it works it will only be by chance. It might be a feature that can be added to SVGMagic at some point in the future. I don't know about Dirk Groenen, but I don't have any personal experience working with these kinds of SVGs. If you would like to help get the feature added, could you perhaps write a small test HTML file (with an SVG sprite included) and describe what you would expect SVGMagic to do with it? Even more useful would be to provide two versions of that HTML test page. One with the SVG and the other with the PNG-rendered output of what you'd expect SVGMagic to have created. By way of a guess, are you asking for SVG sprites to be transformed into a "PNG sprite" combined image. So, for example a 50×50 px SVG with five frames defined, would be converted into a PNG image that is 50×250 px PNG image? Thanks |
I'll see if I can come up with a test page this weekend. The PNG doesn't have to be a sprite, just the single png like with regular SVG's. One sprites.svg which contains three named one, two and three would output i.e. one.png, two.png and three.png via the converter. Converting to a sprite would be harder because of different sizes which would have to be applied to the whole sprite map and calculating correct background positions etc. |
I have to copy Craig on this one. I'm not available for the coming two weeks, but when I'm back I will take a look a the test page, maybe that I can come up with a solution. |
I know I'm late to the party (3+ years later, lol) but this feature is a must these days. I use SVG sprites for icons all the time, just like I used to do with PNG sprites. Using the
The sprite SVG file looks like this:
The idea would be to replace the Aaanyhow, is this something you may be interested in implementing at all? Not sure if that's going to happen since this post hasn't been updated since Aug 8, 2014 😕. Thanks, |
I'm going to chip in that I'm highly unlikely to work on this myself. SVG magic is becoming decreasingly important to me, now that all of the browsers I target support SVG natively to some extent or another. Indeed, I'm soon to drop IE9 support in my own work. |
Got it 👍, thanks for clarifying. FWIW, according to caniuse: "IE9-Edge12, Safari 5.1-6, and UCWeb 11 do not support referencing external files via <use xlink:href>". An alternative script to support this feature is SVG for Everybody. |
PS: For clarity, I'm not the original author of SVG Magic, but I contributed a little. I was mainly responding because of a thread-participant notification. |
I'm with Craig on this one @ricardozea. I have no plans in shutting down SVGmagic since there's still enough sites "depending" on it. That said with decreasing IE9 usage I don't see myself invest time in adding new features to it. |
Sounds good guys, thanks for your comments. |
SVG's sprites are multiple SVG's combined into one file by using a block or definitions. Does SVGMagic support linking to those symbols using xlink:href="#spritename"?
The text was updated successfully, but these errors were encountered: