tags:

views:

167

answers:

1

Offff dont understand why I get cufon.font is not a function error. I followed all the instructions at its website.

<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/Futura_Lt_BT_400.font.js"></script>

<script type="text/javascript">
$(document).ready(function() 
{

    Cufon.replace('.starter .content');
    }

            <div class="starter">
                <div class="image-1">
                    <div class="wrapper">
                        <div class="content">Family guy funny show.</div>
                    </div>
                </div>
                <div class="image-2">
                    <div class="wrapper">
                        <div class="content">Family guy funny show.</div>
                    </div>
                </div>                    
                <!-- <img src="images/logo_fg.png" alt="Logo" class="logo" /> -->
            </div>

Website is at http://www.pangeaadvisors.org/IDC/

Any suggestion appreciated!

+1  A: 

The error is not in your main page, it's in Futura_Lt_BT_400.font.js.

The line starts with:

Cufon.FuturaLightFont({"w":207,"face":{"font-family":"Futura Lt BT" ...

Normally, these JS files start with Cufon.registerFont. Where did this JS file come from? Did you use the Font Generator from the Cufon website?

Update: The inline JS is also malformed. It should be:

$(document).ready(function() 
{
    Cufon.replace('.starter .content');
});

Note the extra ); on the last line.

Aaronaught
Hi, yes I used cufon's font generator?
Efe Tuncel
The default script that comes out of the generator looks different from what's in your JS file. What options did you change?
Aaronaught
nothing. I selected The EULAs of these fonts allow Web Embedding (without Adobe Flash) and I acknowledge and accept these terms. I left other sections as they are.
Efe Tuncel
What's in the "Customization" box, near the bottom, just above the terms? Does it say `Cufon.registerFont`?
Aaronaught
yes. Cufon.registerFont.
Efe Tuncel
Then we seem to be at an impasse. Humour me - replace the text `Cufon.FuturaLightFont` in the file `js/Futura_Lt_BT_400.font.js` with the text `Cufon.registerFont`, then tell me what happens.
Aaronaught
same error. you can see it yourself at the website link I provided in the original message.
Efe Tuncel
Yes, I can see the same error, and I can see that the contents of that file have **not** changed. It still starts with `Cufon.FuturaLightFont`. Did you update that file on the server?
Aaronaught
Never mind, I see what happened, the *name* of the file was changed. It is what's *inside* that file that needs to be changed.
Aaronaught
my bad, I misunderstood your earlier message. Let me try again.
Efe Tuncel
oooo it worked! Thank you soo so so much!
Efe Tuncel