IMAGEPNG() Fonts...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

IMAGEPNG() Fonts...

Post by Dale »

Is there way to change the font on a imagecreate tag?

Code: Select all

<?
header ("Content-type: image/png");
$im = imagecreate(450,73);

$black = imagecolorallocate ($im,0x00, 0x00, 0x00);
$white = imagecolorallocate ($im,0xFF, 0xFF, 0xFF);

imagefilledrectangle($im, 0, 0, 450, 73, $black);
imagestring ($im, 3, 3, 3, "Pe Po", $white);

imagepng ($im);
imagedestroy ($im);
?>
How can i change the text to... erm.. Tahoma... or Verdana... or Arial...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Expanding on the imagettftext() function: http://www.ooer.com/index.php?section=php&id=18
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post by Dale »

Thank You Both.
Post Reply