Page 1 of 1

pixels to ttf size

Posted: Wed Oct 13, 2004 9:10 am
by phpScott
Has any one come across a way to determine size in pixels to true type font letter size.

I am building a flyer maker and it all works fine execpt for the writing of the description. I need to know how when to wrap a line so that it doesn't get cut off.

I'm using the GD2 library and imagettftext to write the words to an image but I keep cutting words in the description or missing the bottom portion of my product number.

is that clear or does it sound as confused as i am?

thanks

Posted: Wed Oct 13, 2004 1:24 pm
by vigge89
http://se.php.net/manual/en/function.imagettfbbox.php
Check out the imagettfbbox() function (phew, hard to spell ;) ), it will help you :)

Posted: Thu Oct 14, 2004 6:07 am
by phpScott
Thanks that was just what I was looking for.
It will be trouble to implement it how I want to but at least I will know the size of the text that needs to be entered.

Thanks again, I don't know how I missed it when searching through the manual maybe getting glassy eyed and not really reading everything.

phpScott