More fun with SVG

Can't render embedded SVG object

They (whomever 'they' might be) say you learn something new every day. (I suppose if you have memory problems it might actually be the same new thing repeatedly.) Sure enough, I learned about the <image> SVG element from Sam Ruby's blog post about Recreational SVG. In some ways his method is probably faster than my own method of reproduction, which typically involves importing the original graphic into Adobe Illustrator, tracing it, saving it as SVG, and cleaning out all the Illustrator cruft. (Alternatively I might just draft the image by creating the SVG directly in emacs.)

Of course, almost all of my SVG images are actually PHP scripts, which allows me to scale them using URL arguments, such as http://Ken.Coar.Org/images/vector/flames.svg and http://Ken.Coar.Org/images/vector/flames.svg?scale=8. Sometimes I add code to allow rotation or differing X/Y scaling factors. Doing it in PHP also allows me to have reusable data structures; with those I can annotate my path curves for fine-tuning things. If I want to adjust the curve of this figure: http://Ken.Coar.Org/images/vector/path-sample.svg?scale=4, I can annotate it with the handle points so I can visualise the tangencies and how to tweak them: http://Ken.Coar.Org/images/vector/path-sample.svg?scale=4;debug=1

The next thing is going to be figuring out how to make the individual graphics reusable, so I don't need to reproduce the code from http://Ken.Coar.Org/images/vector/globe-plain.svg?scale=2 and http://Ken.Coar.Org/images/vector/flames.svg?scale=2 in order to get http://Ken.Coar.Org/images/vector/global-warming.svg?scale=2. And I think the <image> element might be just what I've been seeking for that.

Thanks, Sam!

Be the first to write a comment!