> > <?
> > //define the type of inputting picture;
> > Heder("content-type:image/png");
>
> Is this a typo? Should be Header(...).
>
Sorry, I did a wrong copy.But when I cut this line,it output a warning words:
"libgd was not built with FreeType font support in /usr/local/apache/htdocs/test.php
on line 14",
I guess my compiling is not right,when I installed the php,my parameter of
configuration is
"./configure --with-mysql=/usr/local/mysql --with-apache=../apache-1.3.24
--enable-track-vars --with-gd=../gd-1.8.4 --with-imap=../imap-4.7c --enable-ftp
--with-ldap=/usr/local/ldap --with-zlib-dir=../zlib --with-png-dir=../libpng
--with-freetype-dir=../freetype2.1.0 --with-ttf=/usr/local/lib"
Did I use freetype2.1.0 right?
Maybe I shall try freetype-1.3.
right?
> > //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. I can only see "www.ccidnet.com".
Thank you,
zhaoxd