[cairo] Editing SVG content with Cairo
kagetsuki at gmail.com
Sun Jan 5 04:11:04 PST 2014
OK, that sort of clears things up for me. It still confuses me how an SVG
can be loaded with this:
and rendered by Cairo without actually breaking down the DOM at some point
and, if that is happening, why it isn't converted into native objects or
data structures which would be accessible.
What I need isn't necessarily a scene graph in whole as I need no actual
rendering capability. I really just need to be able to manipulate the SVG
data and I would like to do that in an object-oriented and language-native
way, rather than hacking through XML with an XML library like Nokogiri.
That no library like this seems to exist surprises me. I was really
expecting to find something like COLLADA DOM (but hopefully easier to use)
For now I'll just hack the XML as I really only need to change colors. It
feels like a poor way to do it but I guess I have no choice. Thanks for the
2014/1/5 David Young <dyoung at pobox.com>
> On Sat, Jan 04, 2014 at 12:46:58PM +0900, 影月 零 wrote:
> > I mean open the SVG, then iterate through all the vector objects in it
> > alter them somehow; like change the color attribute or make all their
> > into dashed lines.
> > To be more sepcific, I would like to be able to open an SVG, iterate
> > through each vector object in it applying some change along the way, then
> > write out a new SVG.
> > At the moment I'm using RSVG and Cairo, but I'm assuming it's Cairo
> > does all the actual image manipulation. I guess my question could also be
> > re-phrased as:
> > Does Cairo or any other library re-instantiate objects from items in the
> > DOM of an SVG file when it opens them? If so where are they and how can I
> > iterate over them?
> It sounds like you're looking for the "scene graph,"
> <http://en.wikipedia.org/wiki/Scene_graph>, corresponding to the SVG.
> AFAIK, Cairo isn't based on a scene graph.
> David Young
> dyoung at pobox.com Urbana, IL (217) 721-9981
> cairo mailing list
> cairo at cairographics.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo