Replacing header text dynamically with any font you want

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
Andor
Forum Members
Forum Members
Posts: 49
Joined: Sun Feb 19, 2006 1:42 pm

Replacing header text dynamically with any font you want

Post by Andor »

Just wanted to point your attention to a solution for replacing text dynamically with any font/typeface - in headings, for instance.

For several months I've been thinking of ways to have my headings look more interesting than just using standard fonts and maybe adding an interesting background pic. It's always possible to create pictures files for the text itself, but it's a lot of work for a site with expanding content.

At 'A List Apart' I found a solution. Two scripts - php and js - turn your headings into png-pictures based on the font file (.ttf) you pick. It looks fantastic and works perfect for my needs!

You can test the solution with this link where I just added the text to be replaced directly in the url.

Here you can see it in action on my test site.

Have fun!
Last edited by Andor on Wed Feb 07, 2007 5:58 pm, edited 1 time in total.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Replacing header text dynamically with any font you want

Post by tsw »

I think there are two modules for cmsms which do the same thing ;)

http://dev.cmsmadesimple.org/search/?ty ... rch=Search
Andor
Forum Members
Forum Members
Posts: 49
Joined: Sun Feb 19, 2006 1:42 pm

Re: Replacing header text dynamically with any font you want

Post by Andor »

I didn't know - kiitos!

I'll try it out - maybe it works even faster than the one I used ;)
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Replacing header text dynamically with any font you want

Post by tsw »

Ole hyvä ;)


IIRC imagetext creates the image only when text changes (but dont quote me on that)
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: Replacing header text dynamically with any font you want

Post by carasmo »

Thanks for posting this. I was thinking of using the SIFR (flash text replacement). I downloaded the modules and there's so many files, the one used for this original post uses only two files. I like that more. Less is more.

Thanks
Andor
Forum Members
Forum Members
Posts: 49
Joined: Sun Feb 19, 2006 1:42 pm

Re: Replacing header text dynamically with any font you want

Post by Andor »

Thanks, carasmo  -  I just love it, myself :)

I have also tried the CMSMS TruetypeText, which tsw mentioned, but have not been able to get it to work properly. It might be that I don't set it up right, but until now, I have had no luck. :'(
Post Reply

Return to “Tips and Tricks”