Dynamic Text Replacement

PHP+ CSSDynamic Text Replacement (with word-wrapping and inner tags)

PHP + CSS Dynamic Text Replacement is a JavaScript-free version of the Dynamic Text Replacement method originally created by Stewart Rosenberger.

The initial P+C DTR method by R. Marie Cox was lacking word-wrapping and the ability to use inner tags, so I took the code and rewrote it, giving it more flexibility and performance. Any new ideas or suggestions, please contact me.

CSS Rules that affect the font:

  • font-family
  • font-size (in points)
  • color
  • background-color
  • a:hover
  • text-decoration: underline
  • text-transform: uppercase/lowercase
  • text-align

Still to come:

  • text-align
  • font-weight
  • letter-spacing
  • line-height
  • text-shadow

The cool thing about this is that you don't need to worry about long headings... also features:

  • Valid xhtml and valid css
  • Style the element in a regular CSS file
  • Uses only open source tools and doesn't require any plugin (unlike sIFR that relies on proprietary Flash)
  • Extremely easy setup
  • It's free!

Download & Install Instructions:

After more than 3700 downloads, this project is now hosted in Google Code.

  1. Download the zip and extract the files
  2. Include the script in your file
  3. Open the headings.css file to set the font you want to use, colors, size, etc.
  4. Copy your font files (ttf or otf) to the DTR folder
  5. Load the files to your server and give write permission to the cache folder.

If you would like to support further development, please consider a Donation.

If you don't see the heading text images, your server probably does not support PHP image generation.


0 Comments