开发者

Cufon Loading But Not Displaying

Test case:

<!DOCTYPE html&开发者_如何转开发gt;
<html>
<head>
<meta charset="UTF-8" />
<script type="text/javascript" src="/cufon.js"></script>
<script type="text/javascript" src="/font.font.js"></script>
</head>
<body>
<h1>Text</h1>
<script type="text/javascript">
    Cufon.replace('h1');
</script>
</body>
</html>

where "cufon.js" is the latest version (same result with minimized version from the main site and non-minimized version from GitHub), and "font.font.js" is a generated font from cufon's website subset to Latin.

There are no HTTP, HTML, CSS, or JS errors reported by the browser, and yet no VML is generated in IE 8, FF 3.6, or Safari 5. Generated output does have <html class="cufon-active cufon-ready"> and Cufon inline styles, but that's it.

I've also tried, to no avail:

  • Switching where the scripts appear (before </head> and before </body>)
  • Calling jQuery before Cufon
  • Manually declaring the font-family specified in font.font.js using inline CSS
  • Changing the DOCTYPE from HTML5 to XHTML 1.1 or HTML 4.01 Strict


I hadn't listed localhost as an authorized domain. Silly me.


I've always included the fontFamily name:

Cufon.replace('#search-button', { fontFamily: 'Futura', hover: true });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜