The following minimal program gives a segmentation fault #include <cairo.h> #include <cairo-ps.h> #define X_INCHES 2 #define Y_INCHES 2 #define X_PPI 300.0 #define Y_PPI 300.0 #define WIDTH X_INCHES * 72.0 #define HEIGHT Y_INCHES * 72.0 #define FILENAME "/tmp/test.ps" int main (void) { cairo_t *cr; cairo_surface_t *surface; FILE *file; file = fopen (FILENAME, "w"); if (file == NULL) { fprintf (stderr, "Failed to open file %s for writing.\n", FILENAME); return 1; } cr = cairo_create (); cairo_set_target_ps (cr, file, X_INCHES, Y_INCHES, X_PPI, Y_PPI); cairo_show_page (cr); /* gives segmentation fault */ return 0; }
I ported this code to the latest API, which is changing the cairo_create and cairo_set_target_ps calls to: surface = cairo_ps_surface_create (file, X_INCHES, Y_INCHES, X_PPI, Y_PPI); cr = cairo_create (surface); and I was not able to replicate the segfault. Perhaps the bug has been fixed between the time it was reported and now?
It works for me too with the new API, it must have been fixed somehow, perhaps the problem was with cairo_set_target_ps() which no longer exists.
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.