[cairo] Editing SVG content with Cairo

Simon Sapin simon.sapin at exyr.org
Sun Jan 5 05:20:01 PST 2014

On 05/01/2014 12:11, 影月 零 wrote:
> OK, that sort of clears things up for me. It still confuses me how an
> SVG can be loaded with this:
> http://cairographics.org/documentation/cairomm/reference/classCairo_1_1SvgSurface.html

It can not. Cairo’s SVG surface only *writes* SVG files. It does not 
know how to read them or render them.

> 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.

SVG is fundamentally XML. SVG’s DOM is XML’s DOM.

On top of that there are a few things like parsing a path, but not much 
really. Every renderer I know of implements those ad-hoc.

> 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 SVG.

I’ll be looking forward to you making it :)

Simon Sapin

More information about the cairo mailing list