Re: Why is imageTTFtext function useless?
| From: | Jason Wong | Date: | Thu, 25 Apr 2002 02:26:04 +0000 |
| Subject: | Re: Why is imageTTFtext function useless? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94497@lists.php.net to get a copy of this message | ||
On Thursday 25 April 2002 10:08, zhaoxd wrote:
> <?
> //define the type of inputting picture;
> Heder("content-type:image/png");
Is this a typo? Should be Header(...).
> //create picture
> $pic=imagecreate(240,30);
> //define color
> $black=imagecolorallocate($pic,0,0,0);
> $white=imagecolorallocate($pic,255,255,255);
> //define font copied from windows2000
> $font="fonts/simhei.ttf";
> //define characters to output
> $str =
> chr(0xE8).chr(0xB5).chr(0x9B).chr(0xE8).chr(0xBF).chr(0xAA).chr(0xE7).chr(0
>xBD).chr(0 x91)." www.ccidnet.com";
> //write ttf in picture
> imageTTFText($pic,20,0,10,20,$white,$font,$str);
> //create png picture
> imagepng($pic);
> //release the memory occupied by the picture
> imagedestroy($pic);
> ?>
I tried this and it works. However the font I used didn't have those
chr(0xE8), etc defined so I can only see "www.ccidnet.com".
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
You are only young once, but you can stay immature indefinitely.
*/