Hello All,
Am using below code :
header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);
Given above code I can not change Font Face what I can do is to change font size from 1 to 5 only.
How to go about it if I want to use different Font Face i.e. Verdana, Arial Rounded or it could be anything. I am using PNG images.
Fonts with GDLIB
Moderators: onion2k, General Moderators
Re: Fonts with GDLIB
imagestring() is pretty awful for switching fonts. Try imagettftext() instead, that will let you use TTF fonts (any Windows font basically). You do need to have Postscript compiled into GD but most hosts have it, as does the standard PHP installer if you're working locally.