Était-ce utile?

La solution

J'ai tenté de reproduire l'image du milieu avec ma machine personnelle après avoir téléchargé la police (version 0.71.2 de la famille de polices Ubuntu).Arch Linux, x86_64, PHP 5.3.6, GD 2.0.34 (fourni), correctif Suhosin, FreeType 2.4.4.J'avais un meilleur crénage sur e et x.

Génération d'images:

<?php
$img = imagecreatetruecolor(158, 72);
imagesavealpha($img, true);

$bg = imagecolorallocatealpha($img, 0, 0, 0, 127);
$black = imagecolorallocate($img, 0, 0, 0);
imagefill($img, 0, 0, $bg);

$text = "testar text"; // - was attempt at no aa, like example
imagettftext($img, 24, 0, 0, 36, -($black), 'Ubuntu-M', $text);
$text = "med text";
imagefttext($img, 24, 0, 12, 72, $black, 'Ubuntu-M', $text);

imagepng($img, 'test.png');
imagedestroy($img);
?>

Sortie:

sortie de la tentative de duplication de la deuxième image en question

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top