SVG -> Cairo, Ubuntu way – ?
September 15, 2007 12:49 pm GeneralIn gswitchit-plugins, I am rendering svg files into Cairo. Using libsvg-cairo. Some people were asking me, if I could make .deb of the plugins (for Ubuntu). No, I cannot – because libsvg-cairo is not packaged in Ubuntu. I wonder, what do Ubuntaries do when they have to render SVG to Cairo?
September 15th, 2007 at 1:16 pm
Hello
i’m no expert in it at all but i’m pretty sure that libsvg-cairo is obsoleted by librsvg which is available in ubuntu.
Doesn’t cairo have a built-in backend for svg now?
September 15th, 2007 at 1:24 pm
I suppose they use rsvg_handle_render_cairo. I have used it successfully with the librsvg Python bindings.
/**
* rsvg_handle_render_cairo
* @handle: A RsvgHandle
* @cr: A Cairo renderer
*
* Draws a SVG to a Cairo surface
*
* Since: 2.14
*/
void
rsvg_handle_render_cairo (RsvgHandle * handle, cairo_t * cr)
http://svn.gnome.org/viewcvs/librsvg/trunk/rsvg-cairo-render.c?view=markup
September 15th, 2007 at 1:27 pm
librsvg renders via cairo. #include for details.
September 15th, 2007 at 1:28 pm
the newer versions of perhaps?
September 15th, 2007 at 1:31 pm
er, that should be rsvg rather.
September 15th, 2007 at 1:42 pm
Lads, thanks to all of you – I’ll try librsvg.
September 15th, 2007 at 8:04 pm
Fabian – yes, cairo has a SVG backend. But this only generates SVG content. It does not render SVG content.
September 15th, 2007 at 9:41 pm
Ubunteros, actually.
September 17th, 2007 at 6:58 am
FYI some basic python bindings for librsvg come with pygtk (import rsvg). If you need access to more librsvg features (like draw from id) it looks like you’ll need to roll your own with ctypes.
I was using pixbuff loader as a quick hack but have switched over to the cairo rendering now in Jambu.