From 39e152cc0f9fcb256547fd6d710da710693a21b4 Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 24 Oct 2007 18:20:16 +0000 Subject: [PATCH] raise labels by 0.1*fontsize in -Tps and -Tsvg --- plugin/core/gvrender_core_ps.c | 2 ++ plugin/core/gvrender_core_svg.c | 2 ++ plugin/pango/gvtextlayout_pango.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/core/gvrender_core_ps.c b/plugin/core/gvrender_core_ps.c index fe01cb1ac..e68a02f34 100644 --- a/plugin/core/gvrender_core_ps.c +++ b/plugin/core/gvrender_core_ps.c @@ -271,6 +271,8 @@ static void psgen_textpara(GVJ_t * job, pointf p, textpara_t * para) ps_set_color(job, &(job->obj->pencolor)); gvdevice_printf(job, "%.2f /%s set_font\n", para->fontsize, para->fontname); str = ps_string(para->str,isLatin1); + /* don't use para->yoffset because we don't need the baseline offset */ + p.y += .1 * para->fontsize; if (para->xshow) { switch (para->just) { case 'l': diff --git a/plugin/core/gvrender_core_svg.c b/plugin/core/gvrender_core_svg.c index e176751ee..449971467 100644 --- a/plugin/core/gvrender_core_svg.c +++ b/plugin/core/gvrender_core_svg.c @@ -291,6 +291,8 @@ static void svg_textpara(GVJ_t * job, pointf p, textpara_t * para) gvdevice_fputs(job, " text-anchor=\"middle\""); break; } + /* don't use para->yoffset because we don't need the baseline offset */ + p.y += .1 * para->fontsize; gvdevice_printf(job, " x=\"%g\" y=\"%g\"", p.x, -p.y); gvdevice_fputs(job, " style=\""); pA = para->postscript_alias; diff --git a/plugin/pango/gvtextlayout_pango.c b/plugin/pango/gvtextlayout_pango.c index d67c5051b..a0af42d43 100644 --- a/plugin/pango/gvtextlayout_pango.c +++ b/plugin/pango/gvtextlayout_pango.c @@ -164,7 +164,7 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) iter = pango_layout_get_iter (layout); para->yoffset = pango_layout_iter_get_baseline (iter) * textlayout_scale +.1 * para->fontsize; /* In labels.c y is already midline - * 0.15 is the distance below midline for y centering */ + * 0.1 is the distance below midline for y centering */ /* determine position of each character in the layout */ para->xshow = NULL; -- 2.40.0