[mapserver-users] Compiling TrueType -- A solutions :-)

klehr1 at tampabay.rr.com klehr1 at tampabay.rr.com
Fri Mar 8 21:17:11 EST 2002


This has been added to the wiki....

Compiling True Type Fonts with Mapserver 3.5 
I needed to compile the gd libraries with true type libraries to enable rotating text
on maps.

My box is Red Hat Linux 6.1 compiled with no X windows capabilities.  

Note on my RH 7.2 box, the gd library already has true type compiled in, so it works
automatically.  rpm-1.8.3-7

Process obtain freetype-1.3.1 and gd-1.8.4 compile both, then recompile mapserv 3.5 (sounds easy)


True Type --
download freetype-1.3.1.gz
tar -xvzf freetype-1.3.1.gz
cd freetype-1.3.1
./configure --without-x   
make
make blew out, as it was trying to compile some things in the test directory 
causing it to link in the X11 library, I edited the makefile and removed the 
lines where it was cd'ing into the test subdirectory and removed the 
compilation of test in the all: line.

make
su
make install
----------------------
GD
download gd-1.8.4.gz
tar gd-1.8.4.gz
cd gd-1.8.4
vi Makefile
    CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBTTF 
    LIBS=-lgd -lpng -lz -ljpeg -lm -lttf
    INCLUDEDIRS=-I. -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -I/www/stevestuff/freetype-1.3.1/lib 
    LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -L/www/stevestuff/freetype-1.3.1/lib 
    # I know I said I dont have X, guess I was to lazy to remove it here, 
    # note how you need to reference your freetype from above
make
----------------------
Last steps recompile Mapserver 3.5
./configure --with-gd=static,/www/stevestuff/gd-1.8.4
# note Stephan suggested 
# ./configure --with-gd=static,/www/stevestuff/gd-1.8.4 --with-ttf --enable-force- freetype1   
# BUT I had blown away all the freetype 2.x yesterday, so not a factor for me.
make

Make ran into some problems it picked up /usr/local/libgd.a and then it picked
up shared objects libgd.so  libgd.so.1  lbgd.so.1.2   from /usr/local/lib 
(I renamed libgd.a to libgd.a.old and moved the so's to the old directory)

So I did a make clean, then remade and all was fine

./mapserv -v
./mapserv: error in loading shared libraries: libttf.so.2: cannot open shared ob
ject file: No such file or directory  

Note its complaining that the included shared library is not findable libttf.so.2

As root, I had to edit /etc/ld.so.conf adding in the line the path to my 
libtff libraries, i.e. /usr/local/lib save file then run /sbin/ldconfig

su 
vi /etc/ld.so.conf  # add /usr/local/lib
/sbin/ldconfig

./mapserv -v 
MapServer version 3.5 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=TTF INPUT=TIFF
 INPUT=EPPL7 INPUT=JPEG INPUT=SHAPEFILE                                        

And now I have true type fonts working.  

Thanks to Steve Lime, Stephan Kafka, Daniel Morissette, and Richard Greenwood for 
their suggestions and help.  Rich -- your suggestion on freetype-2.X probably worked,
by I had the shared object problem and did not recognize it at the time
about /etc/ld.so.conf.

Cheers and now I can sleep.

Steve Lehr
WebDatabaseSolutions.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020308/63f3973f/attachment.html


More information about the mapserver-users mailing list