Asperon Posted August 16, 2007 Share Posted August 16, 2007 here is my code, the image shows but the text won't dispaly, the font path is right <?php putenv('GDFONTPATH=C:\WINDOWS\Fonts'); $fontsize = 33; $text = 'Hello World'; $font = 'arial'; $height = 200; $width = 400; $im = ImagecreateTrueColor($width, $height); $white = ImageColorAllocate($im,255,255,255); $blue = ImageColorAllocate($im,0,0,64); ImageFill($im,0,0,$blue); ImageLine($im,20,150,200,150,$white); ImageTTFText($im,$fontsize,0,50,135,$white,$font,$text); Header('Content-type: image/Png'); ImagePng($im); ImageDestroy($im); ?> Quote Link to comment https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/ Share on other sites More sharing options...
lemmin Posted August 16, 2007 Share Posted August 16, 2007 Try capitalizing "arial", or maybe try a new font "Times New Roman". See if that has the same problem. Quote Link to comment https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/#findComment-326187 Share on other sites More sharing options...
Barand Posted August 16, 2007 Share Posted August 16, 2007 try escaping the backslashes putenv('GDFONTPATH=C:\\WINDOWS\\Fonts'); Quote Link to comment https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/#findComment-326191 Share on other sites More sharing options...
Asperon Posted August 16, 2007 Author Share Posted August 16, 2007 I tried it with Arial, Times New Roman, Garamond and I added .ttf to all of them...still nothing Quote Link to comment https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/#findComment-326192 Share on other sites More sharing options...
Asperon Posted August 16, 2007 Author Share Posted August 16, 2007 would it be because the code above is in an image.php file and I have it call on my index.php file as an <img src="image.php></img> escaping the backslashes didn't work either Quote Link to comment https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/#findComment-326193 Share on other sites More sharing options...
Barand Posted August 16, 2007 Share Posted August 16, 2007 instead of putenv('GDFONTPATH=C:\WINDOWS\Fonts'); $font = 'arial'; try $font = 'c:/windows/fonts/arial.ttf'; Quote Link to comment https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/#findComment-326196 Share on other sites More sharing options...
Asperon Posted August 16, 2007 Author Share Posted August 16, 2007 that worked thank you Quote Link to comment https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/#findComment-326198 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.