From: north Date: Fri, 8 Dec 2006 17:59:44 +0000 (+0000) Subject: Correct some scaling issues in SVG X-Git-Tag: LAST_LIBGRAPH~32^2~5761 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61dc6ec36f11d2eb5a59b5e3b3a5d9a2b99d3714;p=graphviz Correct some scaling issues in SVG --- diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c index 206eb238d..c57dfddf9 100644 --- a/plugin/core/gvrender_core_svg.c +++ b/plugin/core/gvrender_core_svg.c @@ -144,6 +144,9 @@ static void svg_begin_graph(GVJ_t * job) core_printf(job, "width/job->dpi.x, job->height/job->dpi.y); + core_printf(job, " viewBox=\"%.2f %.2f %.2f\"", + job->canvasBox.LL.x, job->canvasBox.LL.y, + job->canvasBox.UR.x, job->canvasBox.UR.y); /* namespace of svg */ core_fputs(job, " xmlns=\"http://www.w3.org/2000/svg\""); /* namespace of xlink */ @@ -298,7 +301,7 @@ static void svg_textpara(GVJ_t * job, pointf p, textpara_t * para) core_printf(job, "font:%s;", para->fontname); } /* FIXME - even inkscape requires a magic correction to fontsize. Why? */ - core_printf(job, "font-size:%.2fpt;", para->fontsize * 0.81); + core_printf(job, "font-size:%.2f;", para->fontsize); switch (obj->pencolor.type) { case COLOR_STRING: if (strcasecmp(obj->pencolor.u.string, "black")) @@ -450,7 +453,7 @@ gvrender_features_t svg_features = { DEFAULT_EMBED_MARGIN, /* default margin - points */ 4., /* default pad - graph units */ {0.,0.}, /* default page width, height - points */ - {96.,96.}, /* default dpi */ + {72.,72.}, /* default dpi */ svg_knowncolors, /* knowncolors */ sizeof(svg_knowncolors) / sizeof(char *), /* sizeof knowncolors */ RGBA_BYTE, /* color_type */