[cairo] SVG backend patch

Kristian Høgsberg krh at bitplanet.net
Wed Jul 27 17:51:40 PDT 2005


Emmanuel Pacaud wrote:
> Hi,
> 
> Please find attached a path that could be the beginning of a SVG backend
> for cairo.
> 
> Not that I'm very proud of it, as it does almost nothing, but Carl told
> me to send it to the list, so, here it is...

That's pretty good, all the boilerplate code is in place and 
surface->fill_path() is working.  Next steps could be to get 
emit_solid_pattern() working.  Also, getting composite_trapezoids() 
working would make strokes work, so that's also worth looking into.  I'm 
thinking that the 'polygon' element would work well for trapezoids.

Text is probably going to be a bit more tricky, since the svg text 
operators seem more highlevel than the show_glyphs() cairo backend 
function.  And I'm not sure what's the right thing to do for fonts - we 
could certainly generated an svg font subset to embed in the svg file, 
but I'm not sure how many svg viewers support that, and we loose hinting 
when we do that.

Anyway, I think your work looks promising, keep it up.  By the way, I 
usually use a small script like this (make-patch.sh):

   #!/bin/sh
   NEW_FILES="test/svg-surface.c src/cairo-svg-surface.c src/cairo-svg.h"

   cvs diff -Nau
   for f in $NEW_FILES; do diff -au /dev/null $f; done

for creating a diff containing changes and new files.  It's easier to 
review and comment here on the list.

cheers,
Kristian



More information about the cairo mailing list