j'essaie désespérément d'utiliser une font perso au format gdf mais rien ne s'affiche
Voici mon code :
CODE
$captcha = imagecreatefrompng("captcha/captcha.png");
$font_color = imagecolorallocate($captcha, 0, 0, 0);
imageline($captcha,5,0,39,37,$font_color);
imageline($captcha,100,15,80,60,$font_color);
$x_value = rand(0,35);
$y_value = rand(0,15);
if(!($font = imageloadfont('captcha/anonymous.gdf')))
die('*F* Impossible de charger la police');
imagestring($captcha, $font, $x_value, $y_value, $this->getClef(), $font_color);
header("Content-type: image/jpeg");
imagejpeg($captcha);
imagedestroy($captcha);
$font_color = imagecolorallocate($captcha, 0, 0, 0);
imageline($captcha,5,0,39,37,$font_color);
imageline($captcha,100,15,80,60,$font_color);
$x_value = rand(0,35);
$y_value = rand(0,15);
if(!($font = imageloadfont('captcha/anonymous.gdf')))
die('*F* Impossible de charger la police');
imagestring($captcha, $font, $x_value, $y_value, $this->getClef(), $font_color);
header("Content-type: image/jpeg");
imagejpeg($captcha);
imagedestroy($captcha);
Si je remplace $font par un chiffre < 11 dans imagestring, ca fonctionne, donc le probleme vient des fonts.
J'ai essaye avec plusieurs fontes trouvees sur le net mais sans que ca fonctionne mieux. J'ai essaye aussi sur plusieurs systemes (HP-UX et NetBSD) mais toujours sans resultat. Bref ... je seche.
Dans tout les cas, je suis sous Apache 2.2 avec PHP 5.2.4 compile avec les options suivantes :
CODE
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib' '--enable-exif' '--with-gd' '--with-jpeg-dir=/usr/pkg' '--with-png-dir=/usr/pkg' '--with-pgsql' '--without-pear' '--with-xsl' '--with-libxml' '--with-pdo-pgsql' '--enable-sysvsem' '--enable-sysvshm'
Si qq'un a une idee, qu'il n'hesite pas.
Merci et A+
PS : non, je ne veux pas utiliser du TTF.