]> granicus.if.org Git - graphviz/commitdiff
tweak font sizes
authorellson <devnull@localhost>
Fri, 1 Sep 2006 18:47:27 +0000 (18:47 +0000)
committerellson <devnull@localhost>
Fri, 1 Sep 2006 18:47:27 +0000 (18:47 +0000)
plugin/core/gvrender_core_svg.c

index b4fb04cd3810007e6240b7f152a7d5ab973d2e27..38f4129e6ebc5f688234c2c663879c243deb38ec 100644 (file)
@@ -142,8 +142,8 @@ static void svg_begin_graph(GVJ_t * job)
     }
     core_printf(job, " Pages: %d -->\n", job->pagesArraySize.x * job->pagesArraySize.y);
 
-    core_printf(job, "<svg width=\"%dpx\" height=\"%dpx\"\n",
-       job->width, job->height);
+    core_printf(job, "<svg width=\"%.2fin\" height=\"%.2fin\"\n",
+       job->width/job->dpi.x, job->height/job->dpi.y);
     /* namespace of svg */
     core_fputs(job, " xmlns=\"http://www.w3.org/2000/svg\"");
     /* namespace of xlink */
@@ -297,7 +297,8 @@ static void svg_textpara(GVJ_t * job, pointf p, textpara_t * para)
     else {
         core_printf(job, "font:%s;", para->fontname);
     }
-    core_printf(job, "font-size:%.2fpx;", para->fontsize);
+    /* FIXME - even inkscape requires a magic correction to fontsize.  Why?  */
+    core_printf(job, "font-size:%.2fpt;", para->fontsize * 0.9);
     switch (obj->pencolor.type) {
     case COLOR_STRING:
        if (strcasecmp(obj->pencolor.u.string, "black"))