[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info-beta
Subject:    Re: png: selecting builtin font impossible?
From:       "Manfred Schwarb" <manfred99 () gmx ! ch>
Date:       2009-02-24 10:09:33
Message-ID: 20090224100933.67440 () gmx ! net
[Download RAW message or body]


-------- Original-Nachricht --------
> Datum: Mon, 23 Feb 2009 13:48:11 -0800
> Von: Ethan Merritt <merritt@u.washington.edu>
> An: "Manfred Schwarb" <manfred99@gmx.ch>
> CC: gnuplot-beta@lists.sourceforge.net
> Betreff: Re: png: selecting builtin font impossible?

> 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.


Yes, this fixes it.

Thanks,
Manfred

> 
> 
> -- 
> Ethan A Merritt

-- 
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL
für nur 17,95 ¿/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
gnuplot-beta mailing list
gnuplot-beta@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnuplot-beta

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic