[cairo] creating graphics for use with cairo

Dan McMahill dan at mcmahill.net
Fri Jan 16 08:37:54 PST 2009


Peter Clifton wrote:
> On Thu, 2009-01-15 at 19:25 -0500, Dan McMahill wrote:
>> Hello,
> 
>> I have played around a little with trying to use pstoedit to convert my 
>> .eps files to .svg but haven't managed to get it to work right.
>>
>> At this point I'm a little unsure of the direction I should take.  Any 
>> thoughts?
> 
> Hi Dan!
> 
> (Dan is another gEDA developer, on the PCB design side of things
> usually).
> 
> I wonder if it would be worth teaching pstoedit a new backend which can
> "render" to cairo calls in C. (As in.. produce generated source-code
> fragments calling the cairo routines).
> 
> This would let you avoid the svg conversion and librsvg dependency.

In general do people have good luck with pstoedit?  I've been playing 
around with it and the plot-svg as well as the sk (skencil) output. 
Neither seems to do much for producing a good result.  The .sk output 
(viewed directly with skencil) seems to have problems with filled 
polygons.  But maybe that is a skencil limitation.  The plot-svg output 
is also not dealing well with filled polygons.

A tool to directly product cairo code might be pretty neat.

One thing I have realized when I started to think more seriously about 
maybe writing some code to teach tgif to directly export either svg or 
cairo is this.  Most of what I do in tgif I think would very nicely 
translate.  Things like "draw a line from here to there" "fill a 
rectangle".  But there is one bit of functionality in tgif that I've 
used a good bit which is you can embed postscript figures.  In my case I 
use it to embed LaTeX equations in figures.  Then tgif is able to launch 
a script that runs latex and dvips and pulls in the eps along with a 
bitmap preview.  But that means during printing, tgif doesn't actually 
render that part of the figure.  It just spits out the eps along with 
the appropriate postscript code to surround the eps.  Except for that 
bit, I could imagine teaching tgif to produce cairo code (I think).

-Dan



More information about the cairo mailing list