Guys I have created an image in php that's size is 160 x 225. It means my image's width is 160 pixels. Now I wish to put text on it just like "PAYING", font size 10 and face is ARIAL. I wish to put this text in center of image. I am confused how to convert font size 10 into pixel or 160 pixels into font size? Any formula? GlobalCashSite
Hi buddy I created one image with php's image.....() function that's size is in pixels i.e. 160 x 225. Now I want to add text on it like "PAYING". The text's normal font size is 10. I wish to place this text in center of newly created image. I want to have a formula that automatically calculates text length and then decide at which point to add text so it looks in center. Text length will be different like "PAYING" or "NOT PAYING" or "WAITING" so I need formula that automatically decide where to place text. Font size and image size is in different unit. I am sure now you understand it. GCS
Hey, I'm not quite sure what you want to do, but I think it's possible using this function: http://www.php.net/manual/en/function.imagettfbbox.php It basically gives you the coordinates of the corners that a given text has, when you write it on a certain image in a certain size and certain font. The height of the text is the difference between the coordinates. Why do you try to create this image with PHP? The "Paying"-image is usually shown to all users as the same image, so you should rather create one with Photoshop or GIMP, and not with PHP.