ddsjm | Bonjour,
J'ai un petit soucis avec un script qui permet d'insérer un cryptographe. Voila l'erreur qui apparait à la place de l'image :
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /mnt/140/sda/0/2/www.blogue/_blogadata/picto/cryptographp.inc.php on line 83 |
Je suis plus que très loin d'être un pro en PHP et voila le code qui pose le problème : (la ligne 83 correspond à la ligne 28)
Code :
- // Création du cryptogramme temporaire
- $imgtmp = imagecreatetruecolor($cryptwidth,$cryptheight);
- $blank = imagecolorallocate($imgtmp,255,255,255);
- $black = imagecolorallocate($imgtmp,0,0,0);
- imagefill($imgtmp,0,0,$blank);
- $word ='';
- $x = 10;
- $pair = rand(0,1);
- $charnb = rand($charnbmin,$charnbmax);
- for ($i=1;$i<= $charnb;$i++) {
- $tword[$i]['font'] = $tfont[array_rand($tfont,1)];
- $tword[$i]['angle'] = (rand(1,2)==1)?rand(0,$charanglemax):rand(360-$charanglemax,360);
-
- if ($crypteasy) $tword[$i]['element'] =(!$pair)?$charelc{rand(0,strlen($charelc)-1)}:$charelv{rand(0,strlen($charelv)-1)};
- else $tword[$i]['element'] = $charel{rand(0,strlen($charel)-1)};
- $pair=!$pair;
- $tword[$i]['size'] = rand($charsizemin,$charsizemax);
- $tword[$i]['y'] = ($charup?($cryptheight/2)+rand(0,($cryptheight/5)):($cryptheight/1.5));
- $word .=$tword[$i]['element'];
-
- $GDFONTPATH_Save = getenv('GDFONTPATH');
- putenv('GDFONTPATH='.realpath('./fonts'));
- $lafont=$tword[$i]['font'];
- if (strpos(strtoupper($lafont), ".TTF" ) == strlen($lafont)-4) $lafont = substr ($lafont,0,strlen($lafont)-4);
- imagettftext($imgtmp,$tword[$i]['size'],$tword[$i]['angle'],$x,$tword[$i]['y'],$black,$lafont,$tword[$i]['element']);
- $x +=$charspace;
- }
|
Normalement si j'ai bien compris, ce code génère une série de lettres aux hasard et les écrit dans une petite image.
Je pense que c'est les fichiers de polices qu'il ne trouve pas. Il sont stockés dans un dossier Fonts. Il y en a 7 différents qui portent des noms du style (Alanden_.ttf , RASCAL__.TTF, ELECHA__.TTF,...)
Merci d'avance pour votre aide, ---------------
Mon vieux feedback :)
|