|
From: Manfred S. <man...@gm...> - 2009-02-23 10:14:42
|
<snip>
> > > It seems clear to me from inspection of the "bad" ttf rotated text
> that
> > > the rotation angle is not truly 90. Without seeing the command that
> > > generated this text, I cannot say why that would happen.
> > >
> > > It is true that when you rotate text to an arbitrary angle, then the
> > > characters become somewhat distorted. Then again, with the builtin
> fonts
> > > you cannot rotate text to arbitrary angles at all.
> > >
> >
> >
> > I figured there are 2 separate issues:
> >
> > 1) bad rendering which optically results skewed color gradients:
> > This is purely my own fault, as the thing is a multiplot and
> > with each additional "plot" command all label commands were
> > executed, which resulted in multiple overlaying labels.
> > And the labels seem to be additive in the color space, with the
> > obvious result.
> > I.e. I simply forgot to add some "unset label" commands after the
> > "plot" command.
> > Hmmm, actually an implicit "unset label" after every plot command
> > would be more intuitive. And it is probably almost mandatory
> > to "unset label" after an plot command, at least I don't see
> > at the moment any usage of these already plotted labels after the
> > "plot" command.
> >
> >
> > 2) As you correctly noted, the strings are somewhat slanted. This only
> > happens with libgd, in cairo mode things are OK. And this issue
> > is something different from issue 1).
> > Interestingly this seems to happen only with recent gnuplot versions.
> > I found a gnuplot 4.3 version of December 2007 on my disk, and this
> > version does correct rendering, although it uses the very same
> > shared libraries (i.e. same libgd.so) as the recent cvs-versions
> > which show this strange slanting.
> > The slanting only occurs in vertical orientation, horizontal strings
> > are always OK.
> >
> > I will try to investigate this a bit further over the weekend, but at
> > the moment I'm a bit clueless.
> >
> > A script which shows this issue (probably it could be reduced even
> > more):
> >
> > set encoding iso_8859_1
> >
> > #set term pngcairo font 'arial,12' size 900,960
> > #set term png truecolor small size 900,960
> > set term png truecolor font 'arial,12' size 900,960
> > set out "demo.png"
> >
> > set multiplot
> > set label "DEMO" at screen 0.5,0.98 center font "large"
> > set lmargin screen 0.1
> > set rmargin screen (1.0-0.1)
> > set tmargin screen (1.0-0.0708333-0.234375-0.0791667*4.0)
> > set bmargin screen (1.0-0.0708333-0.234375-0.0791667*5.0)
> >
> > yoff=(1.0-0.0708333-0.234375-0.0791667*4.5)
> > set label "Atmosphärenquerschnitt [hPa]" at screen
> > (0.1-6.0*0.0133333),yoff \
> > center rotate textcolor lt -1
> > plot [0:180][-15:10] sin(x) notitle with lines lc rgb "#A0A0A0"
> >
> > unset multiplot
> > set output
> >
> >
>
>
> I did some binary search, an I got
> 20080915 good
> 20080916 bad
>
> the offending patch is:
>
> --- term.c 2008/09/07 04:13:02 1.179
> +++ term.c 2008/09/16 05:35:25 1.180
> @@ -1,5 +1,5 @@
> #ifndef lint
> -static char *RCSid() { return RCSid("$Id: term.c,v 1.179 2008/09/07
> 04:13:02 sfeam Exp $"); }
> +static char *RCSid() { return RCSid("$Id: term.c,v 1.180 2008/09/16
> 05:35:25 sfeam Exp $"); }
> #endif
>
> /* GNUPLOT - term.c */
> @@ -995,9 +995,9 @@
> (*t->put_text) (x - fix, y, text);
> }
> }
> - if (angle == TEXT_VERTICAL)
> + if (angle == 90 || angle == TEXT_VERTICAL)
> x += t->v_char;
> - else if (-angle == TEXT_VERTICAL)
> + else if (angle == -90 || angle == -TEXT_VERTICAL)
> x -= t->v_char;
> else
> y -= t->v_char;
>
>
>
Baa, I missed a hunk of this commit, here it is:
--- term_api.h 2008/07/09 16:39:50 1.74
+++ term_api.h 2008/09/16 05:35:25 1.75
@@ -1,5 +1,5 @@
/*
- * $Id: term_api.h,v 1.74 2008/07/09 16:39:50 mikulik Exp $
+ * $Id: term_api.h,v 1.75 2008/09/16 05:35:25 sfeam Exp $
*/
/* GNUPLOT - term_api.h */
@@ -59,9 +59,10 @@
#define LT_DEFAULT (-7)
/* Constant value passed to (term->text_angle)(ang) to generate vertical
- * text. Current implementation has ang equal to rotation in degrees.
+ * text corresponding to old keyword "rotate", which produced the equivalent
+ * of "rotate by 90 right-justified".
*/
-#define TEXT_VERTICAL (90)
+#define TEXT_VERTICAL (-270)
/* Type definitions */
Before 20080916, I get angle=90, TEXT_VERTICAL=90 for
the vertical label in my example and therefore we get into the
first case: x += t->v_char;
After this date, I get angle=0, TEXT_VERTICAL=-270, and
we fall into case 3: y -= t->v_char;
I will stop tracing this issue now, I hope someone can
pursue this some further.
Cheers,
Manfred
<snip>
--
Jetzt 1 Monat kostenlos! GMX FreeDSL - Telefonanschluss + DSL
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
|