dsaba Posted March 26, 2007 Share Posted March 26, 2007 hello everyone i'm getting this error: <b>Fatal error</b>: Call to undefined function: imagettftext() this the the code i'm running: <?PHP $background1 = "/images/background.png"; $avatar1 = "/images/avatar.png"; $background = imagecreatefrompng($background1); $avatar = imagecreatefrompng($avatar1); imagecopymerge($background, $avatar, 5, 28, 0, 0, 70, 67, 100); $white = imagecolorallocate($background, 255, 255, 255); $fontfile = "/fonts/varsity_regular.ttf"; $string = "Superdude1"; //imagettftext($image, $font_size, 0, $x, $y, $text_color, $this->font , $code) or die('Error in imagettftext function'); imagettftext($background, 12, 0, 3, 17, $white, $fontfile, $string); imagepng($background, "usercard.png"); imagedestroy($background); imagedestroy($avatar); ?> How can I fix it? Why am I getting the error? Quote Link to comment Share on other sites More sharing options...
trq Posted March 26, 2007 Share Posted March 26, 2007 It would appear you do not have the GD library or maybe freetype installed and configure correctly. Can you see it in a call to phpinfo()? Quote Link to comment Share on other sites More sharing options...
dsaba Posted March 26, 2007 Author Share Posted March 26, 2007 it appears that gd is enabled i have successfully created and displayed images before i dont know where to look for "freetype" in my phpinfo here it is: http://tinyurl.com/3b3ecp Quote Link to comment Share on other sites More sharing options...
dsaba Posted March 26, 2007 Author Share Posted March 26, 2007 NEW PROBLEM IGNORE THE OTHER POSTS READ THIS ONE! ok obviously freetype support isn't there in my phpinfo good news is I found a host that supports it however now I get this error: Warning: imagettftext(): Could not find/open font are there only certain fonts that you can use with this function? as you can see in my above code I used this font: $fontfile = "/fonts/varsity_regular.ttf"; and the font IS NOT in the same directory it is in /fonts, is that also a problem? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.