Cod-nes Posted June 13, 2009 Share Posted June 13, 2009 How can I do that?$mid=the part I'm asking how to do that.imagettftext($tmp_img,10,0,$mid,18,$white,"verdana.ttf","$imagesize KB $width x $height"); Link to comment Share on other sites More sharing options...
Synook Posted June 13, 2009 Share Posted June 13, 2009 You have to figure it out mathematically - I don't think there is a "quick" way.Get the image width, divide it by two, and subtract the width of the text divided by two. You can get the width of the text by doing a "dummy" run and reading the returned array. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 13, 2009 Share Posted June 13, 2009 If you're using truetype fonts you can use this:http://www.php.net/manual/en/function.imagettfbbox.phpor postscript fonts:http://www.php.net/manual/en/function.imagepsbbox.php Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.