|
From: Ethan M. <merritt@u.washington.edu> - 2009-02-23 23:12:33
|
On Monday 23 February 2009 08:38:40 Manfred Schwarb wrote:
>
> > On Monday 23 February 2009, Manfred Schwarb wrote:
> > >
> > >
> > >
> > > 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;
> >
> > What terminal are you using, that seems to think an angle of
> > -270 is different from an angle of 90? The ones I have tested
> > here do not seem to have any problem with it.
> >
> > > I will stop tracing this issue now, I hope someone can
> > > pursue this some further.
> >
> > We'll need a simple script that demonstrates the bug,
> > and a note on which terminal type is affected.
> >
>
> Is the script I have added to an earlier email enough, or do you
> want me to reduce it some more?
>
> Terminal: as I stated, pngcairo is OK, I see this effect only
> with libgd ("set term png"). I did not test any other terminals.
OK, considering only the png terminal (gd.trm) it seems there may
be a bug in some versions of libgd that causes the text alignment
to behave badly if the angular setting is outside the range
-180 < angle < 180.
The following patch may improve things:
--- gnuplot/term/gd.trm 2008-12-01 11:33:06.000000000 -0800
+++ gnuplot-cvs/term/gd.trm 2009-02-23 13:38:40.000000000 -0800
@@ -1672,6 +1677,8 @@ PNG_put_text(unsigned int x, unsigned in
TERM_PUBLIC int
PNG_text_angle(int ang)
{
+ while (ang < -180) ang += 360;
+ while (ang > 180) ang -= 360;
png_state.angle = ang;
return TRUE;
}
Please let me know if that fixes your problem or not.
--
Ethan A Merritt
|