NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 02-18-2008 04:39:14

pickey
New member

Fonts with Gdlib

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

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.

Offline

#2 02-23-2008 22:09:27

Waccoon
Administrator

Re: Fonts with Gdlib

You need to use the PostScript text function, rather than the string function.

You can read about it (and other GD-lib functions) at the PHP web site:  imagepstext()

Beware:  this function is very troublesome and might cause problems if your web site doesn't have enough memory allocated for PHP (the 8MB default may not be enough).

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB