下载字体后,我试图用我的家用机器复制中间图像(Ubuntu字体系列的0.71.2版本). Arch Linux,x86_64,PHP 5.3.6,GD 2.0.34(捆绑),Suhosin补丁,FreeType 2.4.4.我最好在e和x上进行字距调整.
图像生成:
$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);
?>
输出: