From 2790263b50fba7f76bbb0f994844af6cfed5908d Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 24 Jul 2007 15:12:14 +0000 Subject: [PATCH] include margin in device width/height --- lib/common/emit.c | 15 +++++++++++---- plugin/pango/gvrender_pango.c | 17 ++++++++++++++++- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index 1ebdcaa6c..143280949 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -692,8 +692,8 @@ static void init_job_pagination(GVJ_t * job, graph_t *g) } /* initial window size */ - job->width = pageSize.x * job->dpi.x / POINTS_PER_INCH; - job->height = pageSize.y * job->dpi.y / POINTS_PER_INCH; + job->width = (pageSize.x + 2*margin.x) * job->dpi.x / POINTS_PER_INCH; + job->height = (pageSize.y + 2*margin.y) * job->dpi.y / POINTS_PER_INCH; /* canvas area, centered if necessary */ job->canvasBox.LL.x = margin.x; @@ -2693,7 +2693,7 @@ static void auto_output_filename(GVJ_t *job) static char *buf; static int bufsz; char gidx[100]; /* large enough for '.' plus any integer */ - char *fn; + char *fn, *p; int len; if (job->graph_index) @@ -2714,7 +2714,14 @@ static void auto_output_filename(GVJ_t *job) strcpy(buf, fn); strcat(buf, gidx); strcat(buf, "."); - strcat(buf, job->output_langname); + if ((p = strchr(job->output_langname, ':'))) { + strcat(buf, p+1); + strcat(buf, "."); + strncat(buf, job->output_langname, (p - job->output_langname)); + } + else { + strcat(buf, job->output_langname); + } job->output_filename = buf; } diff --git a/plugin/pango/gvrender_pango.c b/plugin/pango/gvrender_pango.c index b079739f2..087131d4c 100644 --- a/plugin/pango/gvrender_pango.c +++ b/plugin/pango/gvrender_pango.c @@ -450,6 +450,21 @@ static gvrender_features_t cairogen_features_ps = { "cairo", /* gvloadimage target for usershapes */ }; +static gvrender_features_t cairogen_features_svg = { + GVRENDER_DOES_TRUECOLOR + | GVRENDER_Y_GOES_DOWN + | GVRENDER_DOES_TRANSFORM, /* flags */ + 0, /* default margin - points */ + 4., /* default pad - graph units */ + {0.,0.}, /* default page width, height - points */ + {72.,72.}, /* postscript 72 dpi */ + 0, /* knowncolors */ + 0, /* sizeof knowncolors */ + RGBA_DOUBLE, /* color_type */ + 0, /* device */ + "cairo", /* gvloadimage target for usershapes */ +}; + static gvrender_features_t cairogen_features_x = { GVRENDER_DOES_TRUECOLOR | GVRENDER_Y_GOES_DOWN @@ -495,7 +510,7 @@ gvplugin_installed_t gvrender_pango_types[] = { {FORMAT_PDF, "pdf", 1, &cairogen_engine, &cairogen_features_ps}, #endif #ifdef CAIRO_HAS_SVG_SURFACE - {FORMAT_SVG, "svg", -10, &cairogen_engine, &cairogen_features_ps}, + {FORMAT_SVG, "svg", -10, &cairogen_engine, &cairogen_features_svg}, #endif #ifdef CAIRO_HAS_XCB_SURFACE {FORMAT_XCB, "xcb", 0, &cairogen_engine, &cairogen_features_x}, -- 2.40.0