Please consider submitting a link to your site, so I can showcase it here!
All donations will go to my wife, kids, two dogs and a bunnyrabbit, who sacrifice their time with me so I can write crazy code for you.
Don't worry, it's easy!
Of course, if you haven't already, you need to generate your JavaScript and font image files, and download the script.
Let's look at a sample webpage:
<html>
<head>
<title>Neato!</title>
<script type="text/javascript" src="fontjazz.js"></script>
<script type="text/javascript" src="font.js"></script>
</head>
<body>
<h1>Wow! Fancy headlines!</h1>
<p>Gotta love it!</p>
<script type="text/javascript">
FontJazz.apply("h1", "font");
</script>
</body>
</html>
The two <script> tags in the <head> of the document link to the fontjazz script (fontjazz.js), and the generated metrics for your font (font.js).
Inside the body of your document, you use regular <h1> tags for your headlines, as usual.
The <script> tag just before the </body> tag contains the JavaScript statement that activates FontJazz and inspires it to replace your dull-as-dishwater <h1> tags and make them sparkle with beauty and grace:
FontJazz.apply("h1", "font");
"h1", obviously, is the tag we're replacing, and "font" refers to the name of your registered FontJazz typeface.
Hey, when did that happen? I hear you ask. Well...
Let's take a peek inside your generated "font.js" file, the second file we embedded in the <head> tag:
FontJazz.register('font', {
image: 'font.gif',
width: 1142,
height: 74,
'A': [0, 19, 1, 21],
'B': [20, 18, 1, 19],
'C': [39, 16, 1, 18],
...
});
The generated JavaScript registers the font, cleverly named "font", for use with FontJazz. We can then apply that font to, for example, the <h1> tags.
If it doesn't work, you probably need to check your paths:
Nothing simpler!
To add another headline type, generate another font, and do a couple of edits:
Hint: Condensing the JavaScript files into a single file, is an easy optimization - put the contents of "fontjazz.js" first, then your FontJazz.register() statements.
If you love it, clap your hands!
(and tell your friends)
Please try the FAQ page - or if that doesn't answer your question, use the contact form.