<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial>
<DIV><FONT size=2>This has been added to the wiki....</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Compiling True Type Fonts with Mapserver 3.5 </FONT></DIV><PRE>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
<FONT size=2>And now I have true type fonts working. </FONT></PRE><PRE><FONT size=2></FONT> </PRE><PRE><FONT size=2>Thanks to Steve Lime, Stephan Kafka, Daniel Morissette, and Richard Greenwood for </FONT></PRE><PRE><FONT size=2>their suggestions and help. Rich -- your suggestion on freetype-2.X probably worked,</FONT></PRE><PRE><FONT size=2>by I had the shared object problem and did not recognize it at the time</FONT></PRE><PRE><FONT size=2>about /etc/ld.so.conf.</FONT></PRE>
<DIV> </DIV>
<DIV><FONT size=2>Cheers and now I can sleep.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Steve Lehr</FONT></DIV><FONT size=2>
<DIV>WebDatabaseSolutions.com</FONT></FONT></DIV></DIV>
<DIV> </DIV></BODY></HTML>