Question

I am using 3 different fonts on my site with Cufon.

With my first 2, everything works nicely as it should. However, as soon as I add my third font file, even without calling Cufon.replace on this one, all my other specified elements change to my last added font.

When I change the order of the fonts in the head and move my newest one to first, everything goes back to normal except that font 3 doesn't show.

Not sure what is wrong??

Here is my code

<script type="text/javascript" src="cufon.js"></script>
<script type="text/javascript" src="font1.js"></script>
<script type="text/javascript" src="font2.js"></script>
<script type="text/javascript" src="font3.js"></script>

This is my script

    Cufon.replace('elements', {'font-family': 'font1'} ); 
Cufon.replace('elements', {'font-family': 'font2'} );
Cufon.replace('elements', {'font-family':'font3'} );
Was it helpful?

Solution

Try this:

Cufon.replace('h1', {fontFamily:'font1'});
Cufon.replace('h2', {fontFamily:'font2'});

OTHER TIPS

Magic! Writing it fontFamily solves the problem!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top