[cairo] Re: svg shootout

Carl Worth cworth at cworth.org
Fri Sep 2 15:42:06 PDT 2005


On Fri, 02 Sep 2005 17:20:22 -0300, Mauricio Piacentini wrote:
> http://www.linuxrising.org/svg_test/
> 
> and it has this bit of information:
> 
> "libsvg-cairo is being deprecated in favour of Cairo-enabled librsvg, 
> but included for completeness and comparison. "
> 
> Is this the opinion of the author of the test, or an official position 
> of the maintainers of libsvg and libsvg-cairo?

Here's my take on libsvg and libsvg-cairo:

I originally created these libraries by modifying librsvg. I wanted to
hand the code back to librsvg, but they weren't ready for it at the
time, (no fault implied). So, I maintained these libraries separately,
but I've only ever done so as a way to feed SVG tests into cairo. I've
never made any attempt to improve the SVG-completeness of these
libraries beyond what was useful for testing cairo, (nor has anyone
else to this point).

Fast forward to now and the librsvg maintainers, (who do care about
trying to achieve a complete SVG library, and have added some
significant features since libsvg-cairo branched off), have now added
cairo support to librsvg. Many thanks are due to Caleb Moore and Dom
Lachowicz for this work. The source can be compiled --with-cairo and
it builds separate librsvg-2-cairo.so and librsvg-2-base.so libraries,
(as well as librsvg-2.so and librsvg-2-libart.so libraries as
desired).

> I understand that librsvg has a simple and functional API, but I thought 
> that with libsvg-cairo much more is possible. Am I mistaken? I 
> considered for example the need to render svg at an angle (rotation), 
> which is not possible directly with librsvg. Am I wrong to assume that 
> doing this via libsvg-cairo (using cairo_rotate before you call 
> svg_cairo_render) will produce better results than simply rendering to a 
> pixmap via librsvg and then rotating it with affine transformation? I am 
> not quite sure how it works internally, still studying it, so any 
> pointers are appreciated.

The interface for the new rsvg-cairo stuff is quite nice, with just a
single function currently in rsvg-cairo.h:

	void
	rsvg_cairo_render (cairo_t *cr, RsvgHandle *handle);

which you will notice is quite similar to the svg_cairo_render
interface. The similarity isn't accidental, Dom Lachowicz basically
designed the original libsvg-cairo interface, and I've helped a bit
with some of the recent rsvg-cairo stuff.

The short answer is that this will let you do the same kinds of
cairo-based transformations currently possible with svg-cairo.

The rsvg-cairo stuff isn't complete yet, and it will still need some
more work before being a completely adequate replacement for
libsvg-cairo in my book, (for example, it's using paths for text
rather than calling down into the backend to let cairo text interfaces
be used).

I encourage anyone who currently cares about libsvg-cairo to go give
librsvg --with-cairo a try from CVS:

	http://librsvg.sourceforge.net/

and work with the librsvg folks to help ensure no important
functionality is lost.

Personally, I look forward to having fewer SVG libraries, but no loss
in capability.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050902/29df5d70/attachment.pgp


More information about the cairo mailing list