user1928089
user1928089

Reputation: 1

Unable to change Cufon fonts

I have a website that uses cufon font in a strange manner(Atleast I have'nt seen this before). I am trying to change these fonts as they are weird. The code written to display just a simple "Stock Products" is as:

<h2><cufon class="cufon cufon-canvas" alt="Stock " style="width: 68px; height: 26px; "><canvas width="93" height="29" style="width: 93px; height: 29px; top: -3px; left: -3px; "></canvas><cufontext>Stock </cufontext></cufon><cufon class="cufon cufon-canvas" alt="Products" style="width: 96px; height: 26px; "><canvas width="116" height="29" style="width: 116px; height: 29px; top: -3px; left: -3px; "></canvas><cufontext>Products</cufontext></cufon></h2>

They only include a cufon.js file in the header.

I tried to replace the font like this:

<script src="scripts/cufon-yui.js" type="text/javascript"></script>-->
<script src="scripts/Adobe_Fan_Heiti_Standard_OpenType_600.font.js" type="text/javascript"></script>
<script type="text/javascript">
       Cufon.replace('h2','h1','h3','h4');
     </script>

This is not working even. The code is too long and the file are too much to edit code manually, everywhere. Kindly suggest some solution.

THANKS in advance!!!

Upvotes: 0

Views: 880

Answers (1)

Maciej Gurban
Maciej Gurban

Reputation: 5739

Your cufon syntax doesn't seem to be correct. In the beginning, instead of

Cufon.replace('h2','h1','h3','h4');

try

Cufon.replace('h2');

According to Cufon API, to achieve what your code would indicate, you'd have to use:

Cufon.replace('h1')('h2')('h3')('h4');

Alternatively, if you're using jQuery, or similar JS framework on your site, it could be:

Cufon.replace('h1, h2, h3, h4');

For more information see: https://github.com/sorccu/cufon/wiki/API

Upvotes: 1

Related Questions