Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11 STIX-web bold-italic problem #950

Closed
shuminheng opened this issue Nov 5, 2014 · 7 comments

Comments

Projects
None yet
3 participants
@shuminheng
Copy link

commented Nov 5, 2014

Hey everyone,

I've run into an issue in IE where matrix brackets don't appear to size properly when the STIX font is being used. I've had a look through the issues here and I couldn't find anything existing, but apologies if that's not the case!

OS:
Windows 7

Browser versions:
IE 11
Chrome 38.0.2125.111 m
Firefox 33.0.2

Steps to replicate:
Simply render any matrix using Mathjax and the STIX fonts in IE.

For quick testing purposes, I made this jsbin which is a near replica of http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic-2.html, except it sets STIX in the config.

Open the jsbin and paste the following bit of matrix code into the text box:

\(\left[ {\begin{array}{c}1&0\\4&7\end{array}} \right]\)

In IE, the matrix brackets aren't sized:
matrix-ie

In other browsers like Chrome and Firefox, they are sized properly:

matrix-chrome

Any ideas as to what might be going wrong? Thanks in advance for any help!

@pkra

This comment has been minimized.

Copy link
Member

commented Nov 5, 2014

Thanks for this detailed report! Unfortunately, I'm unable to reproduce this. See this bin and this screencast.

Do you see the issue with this sample? I also didn't see problems with your bin. Also, do you have the STIX fonts installed locally?

@shuminheng

This comment has been minimized.

Copy link
Author

commented Nov 5, 2014

Hey, thanks for the reply!

You know what, I went back to both my and your bins and it worked! Which is good, but slightly concerning ;)

However, I tried another bit of Mathjax that was giving me problems, and the issue came up again.

Try using this bit of Mathjax in your bin on IE:

\(\boldsymbol{P} = \left[ {\begin{array}{c}1&0\\4&7\end{array}} \right]\)

Mathjax will try to load the BoldItalic face, but fails with:

Can't load web font STIX-Web/Main/BoldItalic

I'm guessing this is somehow preventing the matrix brackets from sizing properly as the \boldsymbol is the only thing that's different here (unless, of course, it works for you!). I did have the STIX fonts installed locally, but I have since removed them and ran the above test without them. In any case, your bin has preferredFont: null so it shouldn't really matter anyway.

Again, this works fine everywhere except IE.

Let me know if you can reproduce the above, and thanks again for your help so far!

@pkra

This comment has been minimized.

Copy link
Member

commented Nov 6, 2014

Thanks for following up!

I can reproduce the problem with bold-italic fonts. Looks similar to #735 (although FontFaceBug doesn't seem to help).

We'll have to look into it.

@pkra pkra changed the title Matrices in IE using STIX IE11 STIX-web bold-italic problem Nov 6, 2014

@pkra pkra self-assigned this Nov 6, 2014

@shuminheng

This comment has been minimized.

Copy link
Author

commented Nov 6, 2014

Ah, great, thanks for that! Hope it doesn't end up being too stressful to figure out.

@pkra pkra added this to the MathJax 2.5 milestone Nov 7, 2014

@dpvc

This comment has been minimized.

Copy link
Member

commented Dec 7, 2014

OK, it turns out that this is due to a length limitation of 31 for font-family names in IE9 through 11, and the STIX-Web font family name was STIXMathJax_Main-bold-italic-Web which happens to be 32 character! So although the font was loading, you couldn't access it, and so MathJax was not able to detect it.

The reason the long name was being used is that IE8 and below didn't handle font-style and font-weight properly for web fonts, and so MathJax used separate families for each combination. But IE9 and above don't seem to have that problem, so the solution in this case is easy: just use the long names for IE8 and below.

@dpvc dpvc removed the Investigate label Dec 7, 2014

dpvc pushed a commit to dpvc/MathJax that referenced this issue Dec 7, 2014

Davide P. Cervone
IE9+ has a name limits of 31 for font-family, so the long names cause…
… problems; fortunately, FontFaceBug is only needed for IE8 and below, so make that be version dependent. Resolves issue mathjax#950.
@dpvc

This comment has been minimized.

Copy link
Member

commented Dec 7, 2014

The issue950 branch of my fork of MathJax implements the fix.

@dpvc

This comment has been minimized.

Copy link
Member

commented Dec 7, 2014

=> Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.