MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

IE9/10/11 webFont: 9 second load for most fonts

Open Loginisalreadytaken opened this issue 11 years ago • 6 comments

Error (might not be related to this issue): CSS3117: @font-face failed cross-origin request. Resource access is restricted. (about:blank)

TeX: No error, quick load STIX-Web: Error, quick load Asana-Math: Error, slow load Neo-Euler: Error, slow load Gyre-Pagella: Error, slow load Gyre-Termes: Error, slow load Latin-Modern: Error, slow load

alert(MathJax.Message.Log()) says "Can't load web font..." but eventually they are loaded anyway.

See the page at http://foshin.com .Currently Latin-Modern is selected, but it behaves and looks about the same with all fonts that "load slowly".

Loginisalreadytaken avatar Feb 04 '15 13:02 Loginisalreadytaken

Thanks for reporting. I can reproduce the issue.

The CORS headers are fine btw. Perhaps this is another case of #950 .

pkra avatar Feb 04 '15 15:02 pkra

OK, it looks like the problem is in your configuration, where you have

        "availableFonts": ["Asana-Math"],
        "preferredFont": "Asana-Math",

The availableFonts and preferredFont tell MathJax what local fonts to look for. The Asana-Math font is a web font (a specially modified version of Asana for use with MathJax), and won't be available on anyone's local system, so there is no use in trying to check for it. Apparently, IE is having trouble with the attempt, and it tries waiting for it to arrive, and times out after 10 seconds when it doesn't find it. Then it loads the Latin-Modern web font.

Changing these lines to

        "availableFonts": [],
        "preferredFont": null,

prevents MathJax from attempting to look for local fonts at all, and so you get the Latin-Modern font directly. The solves the problem for me. It also solves the problem with the square roots from issue #1044, which I don't understand at all. Apparently, the attempt to load the Asana font is messing up either MathJax or IE. I will have to look into it further, but if you change the lines above, you won't need to apply the fix for the square roots.

dpvc avatar Feb 13 '15 18:02 dpvc

http://setosa.io/ev/eigenvectors-and-eigenvalues/

I am getting CORS error on this page.

OS: Win 10 Browser: Firefox 48

louy2 avatar Sep 07 '16 02:09 louy2

@louy2 I'm afraid I'm unable to reproduce any issues on FF48 / Win10 using your page (using saucelabs to test). You might want to provide more information (but please file a new issue since this one is IE specific).

pkra avatar Sep 12 '16 09:09 pkra

@pkra Thanks for response. Before opening I rechecked and found that CORS is caused by HTTPS Everywhere blocking HTTP requests. It doesn't affect usage.

louy2 avatar Sep 12 '16 17:09 louy2

@louy2 glad you could figure it out. That's unfortunately outside MathJax's control.

pkra avatar Sep 13 '16 07:09 pkra