Category archive: ubuntu

GD TTF PCDTR in PHP 2

I’d been having a lot of trouble getting my Ubuntu machine to render TTFs with GD in PHP. So much trouble that I’d even tried crazy things like recompiling PHP. Luckily I found this post on excitris.com and I was able to solve all of my problems with one line of code. Since the code on their site is completely mangled, here it is:

putenv('GDFONTPATH=' . realpath('.'));

Now I can use dynamic text replacement without going insane.



My name is Joey Nelson. I'm a web developer living in Raleigh, NC and working with Node.js, MongoDB, Ruby, PHP, jQuery and some other stuff. More about me.