Freetype Install

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sane993
Forum Newbie
Posts: 22
Joined: Thu Jan 16, 2003 9:44 pm

Freetype Install

Post by sane993 »

Hello. Just installed php 4.3.0 yesterday. And changed the php.ini file to allow gd image support. The images are fine. Except when I go to use fonts nothing happens. I believe I need the freetype library. Which one should I download and how do I install it? Any tutorials you can point in the direction of?

Thanks
-Sane993
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If you are on Windows then the gd.dll has the freetype libraries included. Have you made sure that you specify the correct path to the font that you wish to use?

Mac
sane993
Forum Newbie
Posts: 22
Joined: Thu Jan 16, 2003 9:44 pm

Post by sane993 »

Code: Select all

ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "C:/WINDOWS/Fonts/times.ttf", $text);
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have you tried putting a copy of the font into your web directory and seeing if that works?

Mac
sane993
Forum Newbie
Posts: 22
Joined: Thu Jan 16, 2003 9:44 pm

Post by sane993 »

Code: Select all

ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white, "times.ttf", $text);
copied and pasted the times.ttf file into the same directory as the code and no difference in the output.
sane993
Forum Newbie
Posts: 22
Joined: Thu Jan 16, 2003 9:44 pm

Post by sane993 »

Just fiddled with the code and it worked. Thanks for you help. :)
Post Reply