hello there, having problems with aliasing text after an upgrade on my server!
http://jynk.net/testfont/test1.php
(http://jynk.net/phpinfo.php)
compared to the old server
http://www.manandeve.co.uk/testfont/test1.php
(http://www.manandeve.co.uk/phpinfo.php)
does anyone mnowanything about this? Really messed up a job i was about to use it on and all my clients are now on the new server setup(media temple).
Any help appreciated. D.
OH yeh - it uses true type fonts and this script;
function createTextImage($textString, $font, $fontSize, $textColour, $bgColour, $dir, $filename, $w, $h, $imageType, $quality, $vCentered){
$newImage = @imagecreatetruecolor($w, $h) or die("Cannot Initialize new GD image stream, please check you have GD2 Image library module installed");
$bgColourArr = explode(",",$bgColour);
$bgColourRGB = imagecolorallocate ($newImage, $bgColourArr[0],$bgColourArr[1],$bgColourArr[2]);
imagefill($newImage, 0, 0, $bgColourRGB);
$textColorArr = explode(",",$textColour);
$textColor = imagecolorallocate($newImage, $textColorArr[0],$textColorArr[1],$textColorArr[2]);
$box = @imagettfbbox($fontSize,0,$font,$textString);
$textHeight = abs($box[5] - $box[1]);
$textWidth = abs($box[4] - $box[0]);
if($textWidth>$w){
$returnMsg = 'widthExceeded';
}
$vPos = 20;
if($vCentered){
$vPos = round(($h/2)+($textHeight/4));
} else {
// The offset from the top edge in pixels if $vCentered is set to false;
$vPos = 20;
}
$xPos = 20;
// The offset from the right hand edge in pixels
imagettftext ($newImage,$fontSize,0, $xPos,$vPos, $textColor, $font, $textString);
touch($filename);
// check to see if the file exists if so delete the existing file
if(is_file($filename)){
// remove the existing file
unlink($filename);
}
if($dir || $dir !=''){
$dir = $dir.'/';
}
switch($imageType){
case "png":
imagepng($newImage,$dir.$filename.'.'.$imageType);
break;
//
case "jpg":
imagejpeg($newImage,$dir.$filename.'.'.$imageType,$quality);
break;
//
}
imagedestroy($newImage);
return $returnMsg;
}