Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > GD and Freetype

GD and Freetype
Thread Tools
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Jun 12, 2001, 10:38 AM
 
Has anyone managed to get these two talking on OSX?

I have been banging my head against a brick wall all day.

The freetype include directories appear to get all muddled and gd seems to want tosee them sitting in its build directory rather than in usr/local/include. The files are all #include "x" rather than #include <x> .

I've tried building jam (which built - finally - but then wouldn't build freetype2). I tried renaming all the freetype includes in the GD files. I tried some symbolic links mapping freetype's include files to where GD seemed to want to find them.

I even symbolically linked malloc.h.

all to no avail.

Anyone got any further?

-s.
     
sambeau  (op)
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Jun 12, 2001, 12:48 PM
 
Looks like I'm talking to myself here

Anyway.. I managed to get it working.

I used FreeType 2.0 rather than 2.0.3. Unpacked it and ran make twice. Then I did a sudo make install (this part was not mentioned in the instructions for some reason).

(I had already installed gd without freetype support -- see stepwise.com for full instructions).


Next I edited GD's Makefile. After various attempts I found that this worked.
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>#Depending on your system, you will need to modify <font color = green>this</font> makefile.

#If you <font color = green>do</font> not have gcc, change the setting <font color = green>for</font> COMPILER, but you must
#use an ANSI standard C compiler (NOT the old SunOS <font color = blue>4.1</font>.<font color = blue>3</font> cc
#compiler; get gcc <font color = green>if</font> you are still using it).
COMPILER=cc

#If the ar command fails on your system, consult the ar manpage
#<font color = green>for</font> your system.
AR=ar

#If you don't have FreeType, libjpeg and/or Xpm installed, including the
#header files, uncomment <font color = green>this</font> (<font color = green>default</font>). You really must install
#libpng and zlib to get anywhere <font color = green>if</font> you wish to create PNG images.
#CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG

#If you <font color = green>do</font> have FreeType, libjpeg and/or Xpm fully installed, uncomment a
#variation of <font color = green>this</font> and comment out the line above. See also LIBS below.
CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG \
-DHAVE_LIBFREETYPE

#To use the old FreeType <font color = blue>1.</font>x library, add <font color = green>this</font> additional #define
#to the line above
#-DHAVE_LIBTTF

#If you don't have FreeType Xpm fully installed, uncomment <font color = green>this</font>
#(<font color = green>default</font>).

#PLEASE NOTE: YOU MAY HAVE TO JUGGLE THE ORDER OF THE LIBRARIES.
#Some systems are very picky about link order. They don't all agree
#on the right order, either.

#LIBS=-lgd -lpng -lz -lm

#If you <font color = green>do</font> have FreeType, JPEG and/or Xpm fully installed, uncomment a
#variation of <font color = green>this</font> and comment out the line above. Note that
#Xpm requires X11. See also CFLAGS above.

LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm

#Note: <font color = green>for</font> Freetype <font color = blue>1.</font>x, use DHAVE_LIBTTF and -lttf instead.

#Typical install locations <font color = green>for</font> freetype, zlib, xpm, libjpeg and libpng header
#files. If yours are somewhere <font color = green>else</font>, change <font color = green>this</font>. -I. is important to
#ensure that the version of gd you are installing is used, and not an
#older release in your directory tree somewhere.

INCLUDEDIRS=-I. -I/usr/local/include/freetype2 -I/usr/local/include

#Typical install locations <font color = green>for</font> freetype, zlib, xpm and libpng libraries.
#If yours are somewhere <font color = green>else</font>, other than a standard location
#such as /lib or /usr/lib, then change <font color = green>this</font>. Be sure to keep
#-L. as <font color = green>this</font> allows the gd library itself to be found.
#Put -L. first so that old versions of the gd library elsewhere
#on your system can't cause conflicts <font color = green>while</font> building a new one.
#This line shouldn't hurt <font color = green>if</font> you don't actually have some of the
#optional libraries and directories.
LIBDIRS=-L. -L/usr/local/lib

#Location where libgd.a should be installed by <font color = red>"make install"</font>.
INSTALL_LIB=/usr/local/lib

#Location where .h files should be installed by <font color = red>"make install"</font>.
INSTALL_INCLUDE=/usr/local/include

#Location where useful non-test programs should be installed by <font color = red>"make install"</font>.
INSTALL_BIN=/usr/local/bin</font>[/code]

This allowed me to compile the gdtestft. I first had to find a font that it was happy with. I tried the standard OSX ones but it wasn't happy. I then tried a free windows font from chank.com and voila!

Hope that helps somebody as it took me all afternoon to work it out.

Also, If anyone has any suggestions for things I could have done better...
     
Fresh-Faced Recruit
Join Date: Mar 2001
Location: Netherlands
Status: Offline
Reply With Quote
Jun 13, 2001, 02:13 AM
 
I've been strugling with gd and freetype also, and I can't get it working! All sorts of errors occur. Perhaps you can post a step by step installation proces for gd with freetype, mysql, php and apache?
     
sambeau  (op)
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Jun 13, 2001, 03:59 AM
 
I'll see what I can do.

However, GD, PHP & Apache are all covered completely by Scott Anguish at Stepwise.com and MySQL is covered by Wincent Colaiuta Webmonkey.

I'm going to experiment some more with freetype, then install it on another machine. I'll try and keep a detailed note of what I do to get it working.


GD: http://www.stepwise.com/Articles/Wor...-06-12.01.html

PHP & Apache: http://www.stepwise.com/Articles/Wor...-03-24.01.html

PHP, Apache & MySQL: http://hotwired.lycos.com/webmonkey/01/16/index3a.html
     
sambeau  (op)
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Jun 14, 2001, 05:30 AM
 
I suddenly remembered that I am a Mac user and not a Unix hacker. As such I have decided to revert to the good old ways.

I have stuck built libraries for gd, freetype, png & jpegs on my iDisk shard folder (gd) along with the includes.

I think that should work.

Oh. Top tip: "Go to folder" (apple ~) allows /usr/local . Maybe I'm a little slow but I didn't realise that until today

Tell me if they work. If they don't I'll make instructions :yawn:.

s.

sambeau@mac.com
     
Grizzled Veteran
Join Date: Sep 1999
Location: Boston, MA USA
Status: Offline
Reply With Quote
Jun 14, 2001, 10:14 AM
 
I also struggled mightly with and finaaly got working GD with Freetype. However, I'm still fighting madly with getting PHP to compile with PDFLib support. And Ming (create Flash SWF files programmatically) is a distant dream.
     
sambeau  (op)
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Jun 19, 2001, 04:11 AM
 
Just a quick note to say that you can install these libraries in a drag-and-drop fashion. I managed it at the weekend.

Just make sure you have root permission before you start and that you run manlib for each file after you finish (manlib * seemed to work for me).

s.
     
sambeau  (op)
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status: Offline
Reply With Quote
Jun 19, 2001, 11:06 AM
 
I've made a disk image with the libs and includes and put it here:
http://homepage.mac.com/sambeau/FileSharing.html

let me know if there are problems as I'm also new to all this.

s.
     
Fresh-Faced Recruit
Join Date: Mar 2001
Location: Netherlands
Status: Offline
Reply With Quote
Jun 20, 2001, 08:16 AM
 
I can't get it done! Installing the gd & freetype files and compiling php with it went fine. But now I'm having problems configuring apache. I tried different things, and I get different errors al the time.
So could someone PLEASE post step by step installation instructions for php with gd and freetype and mysql and apache?
     
Fresh-Faced Recruit
Join Date: Mar 2001
Location: Netherlands
Status: Offline
Reply With Quote
Jul 9, 2001, 03:17 AM
 
Yes, finally an easy way to get it working. Check out this website. It worked for me!
http://www.entropy.ch/software/macosx/
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:50 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2