Jump to content

[SOLVED] true type display problem


Asperon

Recommended Posts

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);
?>

Link to comment
https://forums.phpfreaks.com/topic/65313-solved-true-type-display-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.