If you want to make it the most extendable, you'll make a little PHP script to do it, like I did with this:
Then, you can pass your params to it which you wish to have written.
mod_rewrite would be a good candidate:
Code:
RewriteCond ^images/macros/custom/(.*)\.jpg$
ReWriteRule /path/to/gd/script?text=$1 [L]
If you want to do it really slick, you'll do an md5() of the text, and have it have it imagejpg() that out to a file, and if that file exists, fpassthru() or readfile() that file instead of the overhead of recreating it.
.. and it'll work to create new ones, too.
This is what we call creative over-engineering.