Universal TFF + PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Universal TFF + PHP?

Post by Citizen »

Is there any way to use these functions:

http://us3.php.net/imagettfbbox
http://us2.php.net/imagettftext

Without having ttf enabled on the server?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Universal TFF + PHP?

Post by onion2k »

No.
Citizen
Forum Contributor
Posts: 300
Joined: Wed Jul 20, 2005 10:23 am

Re: Universal TFF + PHP?

Post by Citizen »

Is there an alternative that can be used with just GD, even with less quality?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Universal TFF + PHP?

Post by onion2k »

There's GD's built in text (imagestring()..) but that's a little limited. There's imagepstext() if your version of PHP has been compiled with t1lib. There's imagefttext() too, though that requires freetype which I assume you don't have else imagettftext() would also work.

If none of those work then there's always bitmap fonts.. essentially you draw each letter you need into an image (or series of images like a.png, b.png, c.png etc), load them and using imagecopy() to "write" the text letter by letter. It might sound awful but it's actually a really good technique for very complicated, artistic lettering.
Post Reply