Font path

Font path

Posted by: DivaDoll
Posted on: 2009-05-10 12:44:00

I am using a piece of PhP code that creates a dynamic image of text for user registration as spam prevention.

what is the correct font path to use if I have shared hosting account?

<?php
Header ("Content-type: image/gif");
$im = imagecreate (440, 110);
$black = ImageColorAllocate ($im, 255, 255, 255);
$white = ImageColorAllocate ($im, 76, 203, 91);
//please adjust the font path!
ImageTTFText ($im, 42, 0, 0, 50, $white, "/usr/share/fonts/truetype/msttcorefonts/parryhotter.ttf","pigflu");
ImageGif ($im);
ImageDestroy ($im);
?>


Re: Font path

Posted by: vicm3
Posted on: 2009-05-10 15:04:00

The path is right, what I can't see installed is that font... you can use other? In fact I don't see other than ttf-bitstream-vera family installed on the machine I'm. I don't know if can be installed either of if you can install on your own home dir.

Regards.

Re: Font path

Posted by: sXi
Posted on: 2009-05-10 18:38:00

You can create a fonts directory and upload your own.




How To Install PHP.INI / ionCube on DreamHost

Re: Font path

Posted by: DivaDoll
Posted on: 2009-05-11 05:34:00

Thank you for the help. I thought the fonts had to be "installed" on local machine. I will use my own font directory then.

Tags: prevention