<?php
imagettftext($im,15,0,470,$m,$black,$font,"this is testing of all");
?>
when i run this function i got the image with uneven spaces. like this: this is testin g o fall
does anybody know whats the problem is???
<?php
imagettftext($im,15,0,470,$m,$black,$font,"this is testing of all");
?>
when i run this function i got the image with uneven spaces. like this: this is testin g o fall
does anybody know whats the problem is???
m getting this... my code is not showin here my code is imagettftext($im,15,0,470,$m,$black,$font,"this is testing of all");
This is a so-called kerning problem. TrueType fonts contain information about the spacing between certain pairs of characters to achieve a natural flow of letters.
From my experience, GD's TrueType function imagettftext()
often doesn't use the kerning information contained in TrueType fonts, or does not use them well enough.
Try imagefttext()
first. (notice the ft
instead of the ttf
) It makes use of the FreeType library.
If that doesn't improve the result, you may have to resort to ImageMagick if your server supports it. But try the Freetype functions first.