when you say it doesn't work, do you mean that you get an error message or
it just doesn't write the text to the image?

-----Original Message-----
From: Adrian Murphy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 1:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] image generation issues


Hi,
I'm using the code in the manual to draw text  on a png.
but Its not working - ImageString() works but not ImageTTFText()
I uploaded arial.ttf from windows to fonts/ folder
Any Ideas:
as a side note: PNG's - any real disadvantage to using them
 instead of gifs - not withstanding the compuserve issue and
old browsers.

the code
button.php
<?php
Header ("Content-type: image/png");
$im = imagecreate (400, 30);
$black = ImageColorAllocate ($im, 0, 0, 0);
$white = ImageColorAllocate ($im, 255, 255, 255);
ImageTTFText ($im, 20, 0, 10, 20, $white, "fonts/arial.ttf","Testing...
Omega: &#937;");
ImagePng ($im);
ImageDestroy ($im);
?>
and i call it with
<img src="button.php" border="0" alt="">

Reply via email to