Question

I've been working on a proof of concept for using Google/Typekit's WebFont Loader to deal with remote @font-face request failures but I've run into a roadblock.

Demo: http://dl.dropbox.com/u/114859/code-experiments/web-fonts-loader-test/index.html

Now, it doesn't load the font (as it shouldn't, it doesn't exist) but it takes five seconds to fail. That's a problem as I've told it to take only one second to fail. As far as I can tell in the documentation I've done this correctly (it loads the font if I give it a proper string).

I'm not getting any errors aside from a 404 when the font URL is bad. How can I fix this?

Was it helpful?

Solution

I'm one of the developers of the webfontloader. I had a quick look and it seems you found a bug. When I implemented the configurable timeout I added it to the core which most modules use. However, you are using the Google module, which uses its own implementation of this particular piece of code and thus doesn't support the configurable timeout. I just fixed this and created a pull request:

https://github.com/typekit/webfontloader/pull/109

This should fix your problem. It will probably take a couple of days for this to be released and to be on the Google CDN. Leave me a message on the pull request if you'd like me to build a temporary build of the webfontloader to use in the meantime.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top