detect if font download in IE is enabled

Scorpius picture Scorpius · Nov 1, 2011 · Viewed 11.1k times · Source

Is there a way to detect whether the font download property in internet explorer is disabled or enabled?

Currently if I were to implement an @font-face solution (font-squirrel or typekit or other) for font-rendering, all browsers will play nice except if internet explorer has its "Font Download" option disabled.

This setting can be found in IE > Internet Options > Security > Custom Level > Downloads > Font download > Enable/Disable.

If I can detect this option, I could fall back to javascript methods.

These solutions do not work as this option does not actually disable the feature, it prevents a download from occurring:

  • http://paulirish.com/2009/font-face-feature-detection/
  • http://www.lalit.org/lab/javascript-css-font-detect/

EDIT: I should mention that we cannot not use a server-side solution, it must be purely client-side scripting.

Answer

zopieux picture zopieux · Nov 2, 2011

As this feature prevents a download from occurring, a (rather dirty) solution would be to ask IE to download a so-called font that is actually a simple script on your server that puts eg. a cookie saying “ok he gots the font” and returns a blank page. When the user loads the next page, you will deploy the Javascript machinery if the cookie isn't there.

enter image description here