Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject:
PostPosted: Tue Aug 02, 2011 6:40 pm 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
Take a look at this:
http://php.net/manual/en/function.imagettftext.php

And make sure that the font exists on the system and that it's in the system path, looks like GDFONTPATH is the environment variable that GD uses to look at for fonts.


Top
   
 Post subject:
PostPosted: Tue Aug 02, 2011 6:52 pm 
Offline
Junior Member

Joined: Sun Jul 31, 2011 5:03 pm
Posts: 49
Website: http://www.clubpenguincheatsy.com/
AOL: thefiame12
Location: GA
Lol, yeah in the eyes of a novice I have no idea what this means.

I have the font in the same directory. That wouldn't be enough?


Top
   
 Post subject:
PostPosted: Tue Aug 02, 2011 7:18 pm 
Offline
Senior Member

Joined: Thu May 21, 2009 3:19 am
Posts: 336
I don't know how to make it clearer than this. Looks like you may need to do the trick they explain there to make PHP see the font file.

Code:
fontfile

The path to the TrueType font you wish to use.

Depending on which version of the GD library PHP is using, when fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.

When using versions of the GD library lower than 2.0.18, a space character, rather than a semicolon, was used as the 'path separator' for different font files. Unintentional use of this feature will result in the warning message: Warning: Could not find/open font. For these affected versions, the only solution is moving the font to a path which does not contain spaces.

In many cases where a font resides in the same directory as the script using it the following trick will alleviate any include problems.

<?php
// Set the enviroment variable for GD
putenv('GDFONTPATH=' . realpath('.'));

// Name the font to be used (note the lack of the .ttf extension)
$font = 'SomeFont';
?>


Top
   
 Post subject:
PostPosted: Tue Aug 02, 2011 7:21 pm 
Offline
Junior Member

Joined: Sun Jul 31, 2011 5:03 pm
Posts: 49
Website: http://www.clubpenguincheatsy.com/
AOL: thefiame12
Location: GA
The fix was so simple!

Ugh, just had to add ./ to the beginning of the font name.

I didn't know...

Glad that's over.

Thanks for all your help.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group