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
Warning: imageloadfont() [function.imageloadfont]: gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully in imagec.php
Warning: imageloadfont() [function.imageloadfont]: Error reading font, invalid font header in imagec.php
so what should be the issue ?