I have an OTF font file purchased from myfonts.com. I then used http://cufon.shoqolate.com/generate/ to generate a Jscript file for the font.

How do i embed this Jscript file to my HTML page?

Thank You All for All Support!

2 answers

2
points

You just link it in between the <head>-tags like so:

<script type="text/javascript" src="path_to_script/thefontscript.js"></script>

See this page's source code for an example :)

Answered almost 8 years ago by Jens Hedqvist
  • Who are you Man? Why was your Id 3** less than an Hour Ago and now your Id is 1003? rodney oleshin almost 8 years ago
  • In case i forget, I have included the code you suggested. Now, how do i implement the included <script> on a text i have in the body of my HTML? rodney oleshin almost 8 years ago
  • @rodney: His screen name is Jens Hedqvist, the number you referred to is his point, not ID. He got his points fast because he gave many useful answers and got up-voted, I'd gave him some myself, you should too. :) o.k.w almost 8 years ago
  • Haha, I'm the spider in your sealing, I'm the bug between your sheets, I'm the trojan hiding in the closet stealing your points! Mowhawhahahah! Ehrm. I'm just dedicated and a damn hippie (love to share) that's all :). Hence, my points. Jens Hedqvist almost 8 years ago
2
points

Cufon in its best usage will be with jquery

After downloading jquery, cufon and converting your font to a js file, now proceed this way

Embed all your Scripts in this order

Note: All script must be embedded in head tag

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="cufon-yui.js"></script>
<script type="text/javascript" src="yourfontfile.js"></script>

Give the text you want to use cufon on a class attribute e.g

<h1 class="myCufontext">This is Cufon live</h1>

Now the code that will make it happen

  <script type="text/javascript>
      Cufon.replace('.myCufonText', {fontFamily: 'yourfontfamilyname' });
  </script>

you have to type the code up right after the below code in the head tag

<script type="text/javascript" src="yourfontfile.js"></script>

make sure you select a font family name during conversion of font file to js then use the name in that script...

The whole coding in view

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="cufon-yui.js"></script>
<script type="text/javascript" src="yourfontfile.js"></script>
<script type="text/javascript>
      Cufon.replace('.myCufonText', {fontFamily: 'yourfontfamilyname' });
</script>
Answered almost 8 years ago by joberror