[cairo] Cairo and SVG

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Dec 21 12:37:09 PST 2007


On 2007-12-21 14:20-0500 Behdad Esfahbod wrote:

> On Fri, 2007-12-21 at 14:05 -0500, Jake B wrote:
>> Hi, I'm wondering if anyone could tell me, are there any projects that
>> are currently trying to implement SVG using Cairo?
>> Please let me know. Thanks.
>
> Search for librsvg, if rendering is what you mean by implementing SVG.

My knowledge of Cairo is limited (only what I can pick up from the
cairo-related devices that have been implemented by somebody else for PLplot
and from lurking on list here for a while) so please bear with me. The
PLplot cairo devices code does implement a svgcairo device that calls
cairo_svg_surface_create_for_stream. Looking over the relevant Debian
package dependencies for libcairo2-dev, I cannot find any mention of
librsvg, but it may be in one of the longer dependency chains that I didn't
explore.

Note, it appears that SVG backend (I hope I am using the correct terminology
here) is not nearly as well supported as the PS, PDF, PNG, and X backends.
Our cairo devices are implemented almost entirely with common code with only
minimal variations for each backend (e.g., calls to such functions as
cairo_svg_surface_create_for_stream in the svgcairo case).  However, our
svgcairo device does not work nearly as well as our pscairo, pdfcairo,
pngcairo, and xcairo devices. For svgcairo, all the plot lines and shapes
are there in the resulting SVG file, but the text annotations are missing!

Therefore, is PLplot wasting its time using
cairo_svg_surface_create_for_stream to implement an SVG device as a simple
add-on device to our other cairo-related devices, do we have to do more than
a simple call to cairo_svg_surface_create_for_stream to get text to work, or
can we eventually expect text rendering to work automatically for this
device like it does for the rest?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the cairo mailing list