View Single Post
  #1 (permalink)  
Old April 15th, 2009, 09:01 PM
sgtwwilson sgtwwilson is offline
Registered User
Join Date: Apr 2009
Posts: 8
Thanks: 0
Thanked 1 Time in 1 Post
Default Ch 7 imagettftext function failing to find fonts

I am new to all of this and I have been struggling to get the imagettftext() function to work as it is written in the chapter 7 code.

The putenv('GDFONTPATH=' . 'C:/Windows/Fonts') does not seem to facilitate the use of fonts in the Windows font folder...

This bit of code below is taken from the book:

PHP Code:
//change this path to match your fonts directory and the desired font
putenv('GDFONTPATH=' 'C:/Windows/Fonts');
$font 'arial';


// add the caption if requested
if (isset($_GET['capt'])) {

The only way I have gotten it to work is to set $font = 'arial.ttf' and place the arial.ttf file into my ...apache2.2/htdoc folder.

I would love to know why the putenv call is not working; any help would be appreciated.

Reply With Quote