Small Caps in PHP

Who would have thought that it would be so difficult to create images with text in PHP, especially using small capitals?

I’m building a website where the titles are supposed to be in small capitals. To simplify things, I didn’t want to create it in Photoshop, but just have php render everything automatically. Which it now does, I have a script called titlemaker.php (which I’m going to clean up a bit) which renders a series of texts in both normal font and small caps, and creates png images from it.

It turns out there’s rather a lot of things going on behind the scenes to make everything come out right. The GD library’s TTF support isn’t made for typesetting exactly.

Well, at least now it works. If you’d like the php source, email me.

Post a Comment

Your email is never shared. Required fields are marked *

*
*