andy206uk -
Joined: 02 Jan 2004 Posts: 2
|
Posted: Thu Jan 15, 2004 1:34 pm Post subject: GD / Freetype... |
|
|
Hey guys,
I've installed Abyss webserver on my PC (running windows 98se) at home along with PHP and GD support. I've tested it and everything works fine *except* for true type font support.
Whenever I use ImageTTFText() I get an error saying that the font file cannot be found or opened. The font is in the same directory as the script so I'm assuming that using a relative path is ok, however I've also tried absolute paths as well with no luck.
I've put the code I'm using at the bottom of the email, but I doubt its the problem, becuase I've run the same script on a zeus powered webserver and it works fine.
Has anyone else come across this problem or know of a solution? I thought it might be permissions, but I don't think its possible to set permissions on windows 98
Any help would be appreciated.
Thanks
Andy
Code: |
$sitename = "WOO FOOTER!";
$fontface = "FREESCPT.TTF";
$fontsize = "30";
$copyrightmessage = "COPYRIGHT 2004 $sitename";
$third=ImageCreateFromJPEG("../../images/$cookie_girlid/$galleryname/uploads/$file_name") or die("couldn't open image");
$textcolor = ImageColorAllocate ($third, 204, 204, 255);
$shadowcolor = ImageColorAllocate ($third, 153, 0, 102);
$copyrightcolor = ImageColorAllocate ($third, 255, 255, 255);
$imagesize = getimagesize("../../images/$cookie_girlid/$galleryname/uploads/$file_name");
$width = $imagesize[0];
$height = $imagesize[1];
$textxpos = "10";
$textypos = ($height - "30");
$shadowxpos = ($textxpos + 2);
$shadowypos = ($textypos + 2);
//***** MAKE SHADOW
ImageTTFText $third, "$fontsize", "0", "$shadowxpos", "$shadowypos", "$shadowcolor", "$fontface", "$sitename");
//***** MAKE TEXT
ImageTTFText($third, "$fontsize", "0", "$textxpos", "$textypos", "$textcolor", "$fontface", "$sitename");
//***** PUT COPYWRITE FOOTER ON
imagestring($third, 2, 10, ($height - 15), "$copyrightmessage", $copyrightcolor);
ImageJPEG($third,"../../images/$cookie_girlid/$galleryname/large/$file_name","95") or die("couldn't save image");
|
|
|