So I ran into this problem with the Cocoa WebView and Typekit. Fonts look awesome when I open the web-page in Safari or Chrome or anything else, but they don’t work in the WebView component.
I tried to use the web inspector and debug this whole thing, so I knew that:
- The Referrer header was correct and the WebView was able to download the Typekit script (http://use.typekit.net/01234567.js)
- But for some reason the script didn’t download anything else
I asked the Typekit support if this was legal to use it this way, and surely, the answer was yes. Also, the guy told me to check the user-agent, and he was right.
Notice the difference between these two:
Safari tells a little bit more about itself, so I tried adding “Safari” to the WebView’s user-agent:
So now it looks like this:
And the fonts are finally back: