http://css-tricks.com/set-font-size-based-on-word-count/
There are mootools and jquery script.
Jquery script uses if, else if, else statement. Easy to understand.
Thanks Chris.
Here you can find useful tips about jquery, Javascript, CSS, HTML, Blogger and Web Development.