/ Published in: JavaScript
URL: http://cufon.shoqolate.com/generate/ http://github.com/sorccu/cufon/wiki/usage
Expand |
Embed | Plain Text
<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Playing with Cuf�³n</title> <!-- Stylesheets here, before all scripts. Helps avoid styling issues. --> <link rel="stylesheet" type="text/css" href="style.css" /> <!-- If you want to use complex selectors with Cuf�³n, load a selector engine (JavaScript framework) here. We support jQuery, Sizzle, MooTools, Dojo, Prototype and other popular frameworks. --> <script src="cufon-yui.js" type="text/javascript"></script> <script src="YourFont.font.js" type="text/javascript"></script> <script type="text/javascript"> Cufon.replace('h1'); // Works without a selector engine Cufon.replace('#sub1'); // Requires a selector engine for IE 6-7, see above </script> </head> <body> <h1>Your custom font here</h1> <h2 id="sub1">Your custom font here too</h2> <!-- To avoid delays, initialize Cuf�³n before other scripts at the bottom --> <script type="text/javascript"> Cufon.now(); </script> <!-- Google Analytics and other scripts here --> </body> </html> And get: http://cufon.shoqolate.com/js/cufon-yui.js And before the </body> tag, for IE: <script type="text/javascript"> Cufon.now(); </script> For my own reference: Cufon.replace('h2', { fontFamily: 'Myriad Pro Regular' }); Cufon.replace('h3', { fontFamily: 'Myriad Pro Semibold' }); Cufon.replace('h4', { fontFamily: 'Myriad Pro Semibold', color: '#1584bd', hover: true, hover: { color: '#515151' } }); Cufon.replace('.jcarousel-title', { fontFamily: 'Myriad Pro Semibold', color: '#1584bd', hover: true, hover: { color: '#515151' } });
You need to login to post a comment.
