1
fatso posted
imageloadfont give error in GD library
trying to load new font for imagestring to draw horizontal text in GD Library.
$string = 'abcdefg+hijk';
$fontg=imageloadfont("fontnew.gdf");
$image = @imagecreate(200, 230);
$black = imagecolorallocate($image, 0, 0, 0); //background
$white = imagecolorallocate($image, 255, 255, 255);
imagestring($image,$fontg , 1, 1, $string, $white);
imagepng($image);
imagedestroy($image);
and it give me error
$string = 'abcdefg+hijk';
$fontg=imageloadfont("fontnew.gdf");
$image = @imagecreate(200, 230);
$black = imagecolorallocate($image, 0, 0, 0); //background
$white = imagecolorallocate($image, 255, 255, 255);
imagestring($image,$fontg , 1, 1, $string, $white);
imagepng($image);
imagedestroy($image);
45
so what should be the issue ?