[cairo] SVG Spacewar

Jay Vaughan jayv at synth.net
Fri Apr 1 01:38:19 PST 2005

>There is a cairo snippet that loads a static SVG file, but I was
>thinking... the red ship and the blue ship are pretty much identical,
>but for different colors.  Do you know if the SVG spec (or something
>else?) allows for "parameterized" SVG, so that I can say something like
>"load the ship.svg file with parameters (primary_color = #FF66CC,
>active_layers = [ship, shields, exhaust], frame = 2)"?
>Thoughts, anyone?

i use SVG in a similar way; as a 'template skin' for various aspects 
of my GUI.  right now i hacked a version of libsvg that allows me to 
'selectively render' parts of my SVG elements by turning elements off 
and on, but i also need a way to process SVG elements in my app, 
dynamically, so that I can for example say "make this SVG element X 
the same color as this SVG element Y", or copy 'broad attributes' 
from one SVG object to another, easily.

for now, i'm hacking the SVG DTD and libsvg render-system myself, but 
I'd love for there to be a more general-purpose "SVG attribute" 
modification API that I could use in C...

the other plan is, anyway, to put the python interpreter into my 
code, and just use python to do the SVG/XML parsing and handling .. 
this would be useful for other aspects of my app, but I'd reallllly 
like it if there were a more libsvg-style approach to doing SVG 
content creation/modification on the DTD ..

DL'ing spacewar now, too .. do you know how well it compiles on OSX yet?



Jay Vaughan

More information about the cairo mailing list