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.

One thought on “Small Caps in PHP

  1. If you got the source still laying around somewhere, I’d like to have it. I’ve been breaking my head on how to do small caps in GD.

    Thx in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>