ThemeForest

Fix for Cufon not working in IE9-beta

27 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 1 and 9 items
  • United States
KalebAustin says

Seen quite a few ppl asking about this sooo figured I’d throw it out there.

If you aren’t aware, with IE9 cufon doesn’t render anything at all, not even the actual text. I know beta software is beta, but Microsoft…

Fix:
<!--[if gte IE 9]> <script type="text/javascript"> Cufon.set('engine', 'canvas'); </script> <![endif]-->
or add
<meta content="IE=8" http-equiv="X-UA-Compatible" />


or download the latest nightly and replace your old cufon-yui.js with it.

2 years ago
3624 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
  • Interviewed on the Envato Notes blog
  • Envato Staff
  • Reviewer
  • Community Moderator
  • Author had a Free File of the Month
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 50 and 99 items
  • Venezuela
  • Referred between 1 and 9 users
Ivor says

You’re the man! Thanks mate.

2 years ago
Ivor is a moderator
685 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Bought between 10 and 49 items
  • Uruguay
  • Referred between 1 and 9 users
_rg_ says

Oh! now i understand, for the microsof guys, “beta” means:

“Be carefull, this is what we do, and this are the new bugs, so, start learning how to fix them!!! But we promise to fix them for the next beta10”

2 years ago
1 post
  • Has been a member for 1-2 years
  • Bought between 10 and 49 items
catoha says

Great work. It now works great.

2 years ago
1743 posts
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Bought between 10 and 49 items
  • Germany
  • Referred between 1 and 9 users
BroOf says
Oh! now i understand, for the microsof guys, “beta” means: “Be carefull, this is what we do, and this are the new bugs, so, start learning how to fix them!!! But we promise to fix them for the next beta10”

No they will be fixed maybe in IE12 or so.

2 years ago
629 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Bought between 10 and 49 items
  • United States
  • Referred between 10 and 49 users
VagrantRadio says

Nice to see that IE9 is turning out to be every other version before it, lol!

2 years ago
307 posts
  • Has been a member for 1-2 years
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Europe
  • Referred between 10 and 49 users
WPScientist says

w00t, didn’t know about that. I’m not installing IE9 , I’m waiting for IE X :P

2 years ago
1182 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Bought between 10 and 49 items
campolar says

So they’ve brought new bugs now? Microsoft really knows how to do their job!

They’re bringing html5 and css3 support. So they thought it’s useless to keep js

2 years ago
704 posts
  • Has been a member for 3-4 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Author had a File in an Envato Bundle
  • Attended a Community Meetup
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 1 and 9 items
  • United States
  • Referred between 10 and 49 users
Parallelus says
So they’ve brought new bugs now? Microsoft really knows how to do their job!

It’s a beta. I wouldn’t bother making changes to your sites until they get to RC2 or later.

A Microsoft beta is different than other companies that try and find as many bugs as possible before the beta is released. Microsoft let’s the community do that for them. Their beta just means they finished working on the core and primary engines. Now need us to do their job for them, finding the little bugs that are easy to fix.

2 years ago
1 post
  • Has been a member for 1-2 years
johnhrv says

Hi folks,

Just a quick note to explain more on why older (pre 1.09i) versions of Cufon don’t work correctly with IE9 .

The library depended on legacy, non-standard IE behavior fixed in IE9 . The IE9 behavior is correct (as in, IE9 now behaves like all other browsers) and won’t change so we’ve worked with the Cufon authors on a fix for the library. And as we find sites affected by this, we contact them to let them know there’s an updated version of Cufon to use.

The gory details…

Cufon chooses an “engine” for rendering in registerEngine:
Cufon.registerEngine("vml", (function () {
    if (!document.namespaces) { //<------ browser detection
        return 
    }
   // build engine...
}
The check for document.namespaces is effectively an “if IE” check. IE supports document.namespaces, so the ‘vml’ engine is used instead of the ‘canvas’ engine. IE9 supports VML so that alone isn’t the problem. However, the ‘vml’ engine depends on legacy IE behavior in two places:
  1. Cufon uses elem.unknownAttr = ‘value’ to set a unknown attribute, e.g.
                S.stroked = "f";
                S.coordsize = m;
                S.coordorigin = H = (q - o) + "," + p;
                S.path = (Z.d ? "m" + Z.d + "xe" : "") + "m" + H + e;
                S.fillcolor = a;
    
    Unlike IE8 , IE9 treats these as script expando properties and not content attributes. If you replace these assignments with the standards-based setAttribute(A, B), it will work correctly.
  2. Cufon omits the unit ‘px’ in setting style properties, like ‘width’ and ‘height’. Like other browsers, IE9 requires units on length values without unit.
While this gets the VML engine working in IE9 , the best solution is using the latest-and-greatest: canvas. The canvas engine works great in IE9 .

John Hrvatin Program Manager, Internet Explorer

1 year ago
by
by
by
by
by