+ } else {
+ if (!$flag_gd_typo) {
+ return $texte;
+ } else {
+ $font = find_in_path('polices/' . $police);
+ if (!$font) {
+ spip_log(_T('fichier_introuvable', array('fichier' => $police)));
+ $font = find_in_path('polices/' . "dustismo.ttf");
+ }
+
+ $imgbidon = imageCreateTrueColor($largeur, 45);
+ $retour = printWordWrapped($imgbidon, $taille + 5, 0, $largeur, $font, $couleur, $text, $taille, 'left',
+ $hauteur_ligne);
+ $hauteur = $retour["height"];
+ $largeur_reelle = $retour["width"];
+ $espace = $retour["espace"];
+ imagedestroy($imgbidon);
+
+ $im = imageCreateTrueColor($largeur_reelle - $espace + (2 * $padding), $hauteur + 5 + (2 * $padding));
+ imagealphablending($im, false);
+ imagesavealpha($im, true);
+
+ // Creation de quelques couleurs
+
+ $grey2 = imagecolorallocatealpha($im, hexdec("0x{" . substr($couleur, 0, 2) . "}"),
+ hexdec("0x{" . substr($couleur, 2, 2) . "}"), hexdec("0x{" . substr($couleur, 4, 2) . "}"), 127);
+ ImageFilledRectangle($im, 0, 0, $largeur_reelle + (2 * $padding), $hauteur + 5 + (2 * $padding), $grey2);
+
+ // Le texte a dessiner
+ printWordWrapped($im, $taille + 5 + $padding, $padding, $largeur, $font, $couleur, $text, $taille, $align,
+ $hauteur_ligne);
+
+
+ // Utiliser imagepng() donnera un texte plus claire,
+ // compare a l'utilisation de la fonction imagejpeg()
+ _image_gd_output($im, array('fichier_dest' => $fichier, 'format_dest' => 'png'));
+ imagedestroy($im);
+
+ $image = $fichier;
+ }