Re: Editing SVG content with Cairo
影月 零 <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CA+JGUxQMaHsmgczd2zb8i16GJ0F8uL81bw6tr-Jf+sZpcdtO_Q@mail.gmail.com> |
Simon, I've already got rendering handled so that's not an issue. As an experiment I actually did run through the XML and successfully manipulated the colors of each object... but that's hardly a robust programatically "good" approach if I want to do anything less trivial than change some colors. I'd also like to do this just using some base SVG handling libraries as installing Inkscape will not be an option with some of my deploy targets. It seems you are saying Cairo can open an SVG as a surface, then draw on top of it, but has absolutely no functionality to re-instantiate the objects in the SVG DOM and make them available. If this is true then how does it handle rendering of the vector objects of the SVG at all? I'm quite confused here! Thanks, -Rei 2014/1/4 Simon Sapin <[email protected]> > On 03/01/2014 19:02, 影月 零 wrote: > >> Is it possible to edit the content of an SVG image and then save the >> result back? I don't mean just drawing on top of the image, I mean >> manipulating objects/vectors within the image. I've been searching but >> haven't found a good sample or explanation of how this would be done, if >> it is possible. >> > > Hi, > > cairo itself does not read or otherwise render SVG files. (There are SVG > renderers based on cairo, though.) > > You could use an XML parser and manipulate XML elements. > > Or look into making an Inkscape extension: > http://wiki.inkscape.org/wiki/index.php/ScriptingHOWTO > > -- > Simon Sapin > > -- > cairo mailing list > [email protected] > http://lists.cairographics.org/mailman/listinfo/cairo > -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo