[cairo] creating graphics for use with cairo

Ralph Giles giles at ghostscript.com
Thu Jan 15 18:17:34 PST 2009


On Thu, Jan 15, 2009 at 4:25 PM, Dan McMahill <dan at mcmahill.net> wrote:

> Does anyone have suggestions for the right way to deal with these
> graphics?  I still need png for the web pages, probably xpm for my gtk
> dialogs and some vector format for printing.  I understand there is a
> way with SVG to get the printing but I can't seem to get my figures into
> SVG short of re-drawing them in some other tool (inkscape maybe?).
> Programming the figures in cairo would make them  pretty and I guess
> those could go directly in the gtk forms and cairo could produce png's
> but the thought of of recreating a dozen or so figures like this with
> cairo code sounds a bit painful.  In general I prefer using a drawing
> tool as the "source code editor" for the actual figure and then generate
> all the other representations of that figure that I may need.

Sounds like what you really want is a cairo driver for tgif. Depending
on the complexity of your figures that might be more or less work than
hacking a conversion.

There aren't good tools for converting to svg yet, as you seem to have
discovered but since you can create eps files, I can after a few other
suggestions:

- Make a separate set of pngs at 300 or 600 dpi and use those when
printing (if tgif can't do this, you can render the eps versions to
png with gs.

- Use the (experimental!) cairo output device in gs to render the eps
directly to gtkprint

- Use the gs->cairo device with the cairotrace library to capture the
cairo version of the eps drawing commands and embed them in your
program in a semi-automated way.

- convert the eps to pdf and render them through libpoppler+cairo

HTH,
 -r


More information about the cairo mailing list