PHP + CSS Text Replacement

I’ve recently found the script http://www.artypapers.com/csshelppile/pcdtr/ that allows you to use your own font to write headers (like my articles headers) and is then converted into an image using GD and PHP power. It’s pretty good if you want to use special fonts that no one has on his computer.

I’d only suggest you a small fix (if it’s not working fine the first time):

//Define the GD environment variable putenv('GDFONTPATH=' . realpath('.'));

In image.php, you should put this right after

Additional documentation on PHP’s image handling capabilities can
be found at http://www.php.net/image/
*/

Really useful for someone who’s trying to get the script to run but it simply won’t (it gives a “Error: The server could not create this heading image.” message if you don’t have this putenv line)

The only thing I’m looking up to is to make the possibility to use + without using the %2B because it mess up my titles :(

9 Responses to “PHP + CSS Text Replacement”


  1. Gravatar Icon 1 loluigi

    can’t see shit captain, use a better font?

  2. Gravatar Icon 2 Tomzx

    Point me some, go at dafont.

  3. Gravatar Icon 3 Eden

    i think is easiest do the image with photoshop :S

  4. Gravatar Icon 4 Sanjiv

    Kindly shed some light on how to use this with variables. It displays the image multiple times if a while loop is being used to fetch data from MySQL. I am tired of trying to fix this.

  5. Gravatar Icon 5 pht3k

    hi,

    may i know which file do i have to edit? php.ini?

    thanks,
    pht3k

  6. Gravatar Icon 6 Gary

    You’ve just saved my life… deadline in 4 hours, new server commissioned GD working, script not

    thank you…

    thank you…
    :-)

  7. Gravatar Icon 7 MurzNN

    I create patch for PHP + CSS Text Replacement script, that allows to use Cyrillic CP1251 TTF fonts with this script, you can see it in my blog: http://murznn.blogspot.com/2008/02/cyrillic-letters-for-pc-dtr-php-css.html

  8. Gravatar Icon 8 margot

    How do I add the php code from http://www.artypapers.com/csshelppile/pcdtr/ to an existing php page (WordPress)? I’m getting errors when I add the font php into my wordpress php pages.

    Thanks!

  1. 1 gd ttf pcdtr in php at joey’s blog LOL

Leave a Reply