Re: error with Captcha

From: Date: Sat, 17 Mar 2007 18:09:04 +0000
Subject: Re: error with Captcha
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26868@lists.php.net to get a copy of this message
Tiron Adrian wrote:
$options = array(
    'font_size' => 24,
    'font_path' => './',
    'font_file' => 'COUR.TTF'
); It's just like in the example at http://pear.php.net/manual/en/package.text.text-captcha.php ----- Original Message ---- From: brian <brian@zijn-digital.com> To: pear-general@lists.php.net Sent: Saturday, March 17, 2007 6:51:27 PM Subject: Re: [PEAR] error with Captcha Tiron Adrian wrote:
Hello, I'm trying the first example from the Captcha pakage(wich tries to create a png) and i get the following error: Error initializing Image_Text (font missing?!). This is form from my phpinfo(): ./configure...........' '--with-freetype-dir=/usr'...........and this:
GD Support     enabled GD Version     bundled (2.0.28 compatible) FreeType Support     enabled FreeType Linkage     with freetype FreeType Version     2.2.1
and the command locate ttf | grep -i COUR.TTF gives me: /usr/share/fonts/msttcorefonts/cour.ttf so perhaps i should recompile php with a different path to freetype?But i'm not sure exactly which path.......any ideas?Thanks. Is there a freetype extention available with yum?(I'm using FC6) .
Maybe a permissions problem? You didn't say spceifically how you passed the location of the font in the options array. If you think the path is correct, try copying the font to some place under document root and pointing to there.
Please don't top-post. The example assumes that the font is sitting in the same directory as the script that is invoking PEAR_Captcha. Either copy COUR.TTF to the same directory as your script or make '/usr/share/fonts/msttcorefonts/' the font_path (not recommended, for portability reasons). b

« previous php.pear.general (#26868) next »