[cairo] SVG & PS/EPS surfaces

Tomas By tomas at basun.net
Sun Aug 2 11:31:59 PDT 2015


Well, this code is simplified. I have various `drawings' (ie the 
recording surfaces) that I combine to create the files. Then I also have 
a GUI app that displays the images, for use in development. All this was 
done in Guile Scheme.

It seems to me now that what I will have to do is (1) create the 
drawings in C, to produce both EPS files, and also PNG files, for use in 
the GUI, and then (2) have the GUI load the PNG file into an image 
surface, to display. A somewhat less optimal solution.


On 2015-08-02 20:25, Emmanuel Pacaud wrote:
> Why are you using an intermediate surface ? The following code should
> do the same:
> fs = cairo_ps_surface_create("test.eps",100.0,100.0);
> cairo_ps_surface_set_eps(fs,1);
> cr = cairo_create(fs);
>   (drawing commands on cr)
> cairo_destroy(cr);
> cairo_surface_finish(fs);
> Anyway, if you have to use intermediate surface, use
> cairo_surface_create_similar.
> 	Cheers,
> 		Emmanuel.

More information about the cairo mailing list