UNIX Fonts?

Bob Bruce covariance at SHAW.CA
Fri Apr 22 21:24:16 EDT 2005


I got this explanation from my hosting provider today about how he fixed the
font problem on his system:

"Hey Bob.

Well really, the final solution it isn't that complicated, it was
getting to that point that took a lot of messing around.

Basically, if you want true type support in PHP/Mapscript you have to
have freetype support compiled into PHP. And the only way to get
freetype support in PHP is to compile freetype into GD and then compile
GD into PHP.

Normally you add GD support to PHP with a simple option (--with-gd) and
PHP compiles in GD which is included with the PHP distribution. Thats
easy except the version of GD which comes with PHP doesn't include
freetype.

So you have to download and compile GD separately which really shouldn't
be that big of a deal except if you want GD to have freetype you have to
download and install that first as well!

And it also requires a number of other libraries to be installed first
(libjpg, libpng, libXpm etc.) The big problem there as that Xpm is old
and it won't compile with out a very special compiler (which I don't
have). So, in this case I would normally rely on a binary package that
comes with the OS (Slackware 9.1 in this case). But, Xpm is only
available by installing the entire XWindows system (XFree86). My server
doesn't have any need for Xwindows and since its such a large package I
didn't really want to install that but I did it anyhow. Unfortunately
there was something wrong with the Xpm libraries. Perhaps they might
have been the wrong version. I'm not sure.

Ultimately I found a binary distribution of just Xpm. I think that
allowed Xpm to compile into GD but then when I tried to start PHP it
would throw an error complaining about Xpm and die.

Finally I gave up on Xpm support and managed to compile GD without it.

Then, PHP wouldn't compile anymore but it turned out I had to remove the
"--with-xpm" option from PHP's configure and do a "make clean".

Finally PHP compiled and I was able to get it installed and Apache
started without it complaining.

I think there were several other false paths I went down as well but
I've forgotten them."


this gave me a greater appreciation for the work involved in setting up UNIX
servers and I'm glad that someone else is looking after that for me right
now. Anyway I copied the basic TTF files from my Windows system, including
one that I made up of the Trans-Canada highway symbol, and they are drawing
quite nicely now.

    Bob Bruce, Winnipeg, Manitoba



More information about the mapserver-users mailing list