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: 1. The Referrer header was correct and the WebView was able to download the Typekit script (http://use.typekit.net/01234567.js) 2. 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:

#WebView:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko)

#Safari:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14

Safari tells a little bit more about itself, so I tried adding “Safari” to the WebView’s user-agent:

[webViewInstance setApplicationNameForUserAgent: @"Safari"];

So now it looks like this:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Safari

And the fonts are finally back: