[mapserver-users] ANGLE AUTO labels with TRUETYPE and LINE features. The text isdisplayed wrong.

Dan Keith bud at cirl.uoregon.edu
Thu Mar 28 19:11:16 EST 2002

Hi Michel,

I have some more clues regarding this behavior...

My MacOSX (which exhibits the bug) is using GD1.8.4 linked with Mapserver.

My Linux box (running the most recent Debian software [unstable]) is 
running GD2.0.1.

I am almost certain that the bug is in the GD source file gdft.c in 
the function gdImageStringFT(), which is responsible for invoking the 
freetype library to draw a character at a time. The initial angle 
calculated by mapserver is correct; mapserver appears to NOT be at 

gdImageStringFT() probably incorrectly computes the proper x/y 
coordinates for the individual characters, resulting in the 
appearance of a bad angle.

My conjecture is that you are also running GD1.8.4.

You may ask, "How come other people running 1.8.4 aren't experiencing 
this bug?" The probable answer is that their GD is compiled with the 
-DHAVE_LIBTTF flag on, which will enable mapserver to use an 
alternate function, gdImageStringTTF(), which does not have the bug. 
This is why people to build mapserver or GD for freetype 1.x do not 
experience this bug (Steve Lime mentioned this last fact in a 
previous message).

Sooooo.... I am going to try to build GD2.0.1 and see if I can get 
mapserver to link with it and see if it works. It may also be 
possible to fix the bug directly in 1.8.4, which may be desirable if 
GD2.0.1 is full of other bugs.

Note that I was able to duplicate this bug without mapserver by 
hacking the GD test file, gdtestft.c to draw angled text. The bug 
reproduces quite nicely in isolation.

dan keith

Dan "Bud" Keith - bud at otsys.com

More information about the mapserver-users mailing list