pixels to ttf size

Need help with Photoshop, the GIMP, Illustrator, or others? Want to show off your work? Looking for advice on your newest Flash stuff?

Moderator: General Moderators

Post Reply
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

pixels to ttf size

Post 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
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

http://se.php.net/manual/en/function.imagettfbbox.php
Check out the imagettfbbox() function (phew, hard to spell ;) ), it will help you :)
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post 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
Post Reply