From 9252a997fd36c5cdaf649115f9ad2911c85f5a43 Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 25 Nov 2018 18:31:26 +1030 Subject: [PATCH] Add cairo EPS output --- plugin/pango/gvrender_pango.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugin/pango/gvrender_pango.c b/plugin/pango/gvrender_pango.c index 8eca240eb..387514d99 100644 --- a/plugin/pango/gvrender_pango.c +++ b/plugin/pango/gvrender_pango.c @@ -33,6 +33,7 @@ typedef enum { FORMAT_PS, FORMAT_PDF, FORMAT_SVG, + FORMAT_EPS, } format_type; #define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0])) @@ -108,9 +109,12 @@ static void cairogen_begin_page(GVJ_t * job) if (cr == NULL) { switch (job->render.id) { case FORMAT_PS: + case FORMAT_EPS: #ifdef CAIRO_HAS_PS_SURFACE surface = cairo_ps_surface_create_for_stream (writer, job, job->width, job->height); + if (job->render.id == FORMAT_EPS) + cairo_ps_surface_set_eps (surface, TRUE); #endif break; case FORMAT_PDF: @@ -495,6 +499,14 @@ static gvdevice_features_t device_features_ps = { {72.,72.}, /* postscript 72 dpi */ }; +static gvdevice_features_t device_features_eps = { + GVRENDER_NO_WHITE_BG + | GVDEVICE_DOES_TRUECOLOR, /* flags */ + {36.,36.}, /* default margin - points */ + {0.,0.}, /* default page width, height - points */ + {72.,72.}, /* postscript 72 dpi */ +}; + static gvdevice_features_t device_features_pdf = { GVDEVICE_BINARY_FORMAT | GVRENDER_NO_WHITE_BG @@ -525,6 +537,7 @@ gvplugin_installed_t gvdevice_pango_types[] = { #endif #ifdef CAIRO_HAS_PS_SURFACE {FORMAT_PS, "ps:cairo", -10, NULL, &device_features_ps}, + {FORMAT_EPS, "eps:cairo", -10, NULL, &device_features_eps}, #endif #ifdef CAIRO_HAS_PDF_SURFACE {FORMAT_PDF, "pdf:cairo", 10, NULL, &device_features_pdf}, -- 2.40.0