cancel
Showing results for 
Search instead for 
Did you mean: 

Font problem with imagettftext

geraldholdswort
Grafter
Posts: 28
Fixes: 1
Registered: ‎09-10-2008

Font problem with imagettftext

I'm trying to create a Captcha image, but am having trouble getting it working on the PlusNet servers (it works fine on my IIS5 server).
I get the error:
Warning: imagettftext() [function.imagettftext]: Could not find/open font in <path>/Captcha.php
The offending line is:
imagettftext($image,$font_size,0,$x,$y,$text_colour,"font.ttf",$code);
and "font.ttf" is a file in the same folder as Captcha.php.
I've even set the attributes of font.ttf to 755. Still no luck.
Is the GD looking at my folder or a generic folder?
2 REPLIES 2
Gabe
Grafter
Posts: 767
Registered: ‎29-10-2008

Re: Font problem with imagettftext

See the note on fontfile at http://php.net/manual/en/function.imagettftext.php
Or could use something like <a href="http://community.plus.net/forum/index.php/topic,84946.msg701631.html#msg701631">this</a>.
We have GD, but not the font library... yet.
Gabe
geraldholdswort
Grafter
Posts: 28
Fixes: 1
Registered: ‎09-10-2008

Re: Font problem with imagettftext

Cheers - that did the trick.
i.e. putting the full path of the font file, instead of just the font file name.
Gerald.