Strange rendering issue on Mac OS X Lion

406 views
Skip to first unread message

lukhnos

unread,
Dec 17, 2011, 1:49:28 PM12/17/11
to MathJax Users
Hi,

I found the TeX sample page isn't rendered beautifully on my Mac OS X
Lion installation. I tried Safari, Chrome and Firefox, and none of
them rendered the page as well as I remembered it should be. Both
WebKit-based browsers (Safari and Chrome) have worse rendering than
Firefox.

I compared with a (clean and old) Safari 5.0.5 running on Mac OS X
Leopard, and IE 8 on Windows 7, and the latter two did the job well.

I have MacTeX package installed on my Lion computer, and that's the
only reason I can think of that's affecting the font selection.

Below are the links to the four screenshots. Has anyone run into
similar issues, and does anyone know why is this happening?

Thanks!

Safari 5.1.2 on Lion (Chrome's looks the same):
http://dl.dropbox.com/u/142739/MathJax/Safari-5.1.2-Lion.png
Firefox 8.0.1 on Lion: http://dl.dropbox.com/u/142739/MathJax/Firefox-8.0.1-Lion.png

Compared with:

IE 8 on Windows 7: http://dl.dropbox.com/u/142739/MathJax/IE-8-Win7.png
Safari 5.0.5 on Leopard: http://dl.dropbox.com/u/142739/MathJax/Safari-5.0.5-Leopard.png

leathrum

unread,
Dec 17, 2011, 9:16:14 PM12/17/11
to MathJax Users
There have been several reports of problems with Lion, apparently due
to something wrong with its STIX font configuration. If you search
this group for "lion stix" you will find several threads from around
the time Lion was released. I know Davide was talking in those
threads about a fix involving bypassing STIX fonts in Safari and using
the web fonts instead, but I don't know the current status of the fix.

Davide P. Cervone

unread,
Dec 18, 2011, 7:25:04 AM12/18/11
to mathja...@googlegroups.com
Mac OS X Lion (10.7) comes with the STIX fonts installed, and MathJax
will use those in preference to its web-based fonts when they are
available. So the first difference between your Mac renderings and
the Windows ones is that. What you are seeing in the Firefox output
versus the Windows output is the difference between the STIX fonts and
the MathJax web fonts. You may not care for the look of the STIX
fonts (personally, I prefer the MathJax fonts, but that is because
they are based on the TeX CM fonts, and I am more used to that look),
but the Firefox rendering is correct for those fonts, and not in error.

As Tom Laethrum mentioned, there is a known issue with the STIX fonts
and WebKit that causes them to be rendered incorrectly. That is the
effect you are seeing in the Chrome and Safari output. In addition to
his suggestion of searching the forums, see also issues #152 and #178
on the MathJax GitHub issue tracker at:

https://github.com/mathjax/MathJax/issues

for more information and suggestions. In particular, of you disable
the STIX fonts in FontBook, you should get the rendering that you
prefer.

Davide

Brion Vibber

unread,
Dec 18, 2011, 8:16:12 AM12/18/11
to mathja...@googlegroups.com
On Sun, Dec 18, 2011 at 4:25 AM, Davide P. Cervone <dp...@union.edu> wrote:
Mac OS X Lion (10.7) comes with the STIX fonts installed, and MathJax will use those in preference to its web-based fonts when they are available.  So the first difference between your Mac renderings and the Windows ones is that.  What you are seeing in the Firefox output versus the Windows output is the difference between the STIX fonts and the MathJax web fonts.  You may not care for the look of the STIX fonts (personally, I prefer the MathJax fonts, but that is because they are based on the TeX CM fonts, and I am more used to that look), but the Firefox rendering is correct for those fonts, and not in error.

As Tom Laethrum mentioned, there is a known issue with the STIX fonts and WebKit that causes them to be rendered incorrectly.  That is the effect you are seeing in the Chrome and Safari output.  In addition to his suggestion of searching the forums, see also issues #152 and #178 on the MathJax GitHub issue tracker at:

       https://github.com/mathjax/MathJax/issues

for more information and suggestions.  In particular, of you disable the STIX fonts in FontBook, you should get the rendering that you prefer.

Is there a good recommendation for content authors on this issue? I'm looking into using MathJax for default rendering of math on Wikipedia sites, and we'd want to be sure that rendering is correct for Safari and Chrome users on Mac OS X without any manual intervention... requiring end-users to disable fonts on their own systems is not really practical.

This comment seems to indicate that changing the configuration to force the TeX fonts can resolve the issue:
https://github.com/mathjax/MathJax/issues/152#issuecomment-2962560

Other than resolving the rendering bug, is there any substantive difference between the font sets that would make setting this the global default a problem?

-- brion vibber (brion @ pobox.com / bvibber @ wikimedia.org)

Davide P. Cervone

unread,
Dec 21, 2011, 8:43:19 AM12/21/11
to mathja...@googlegroups.com
Sorry for the delay in getting back to you.  I've been out of town and not in electronic contact for the past few days.

The thread you cite does suggest removing the STIX fonts from the availableFonts array, which will prevent MathJax for using the STIX fonts instead of web-based fonts.  That could be done on an OS-specific basis, so it only affects Mac OS X, if you want, and version 2.0 of MathJax will incorporate that type of solution to the STIX font problem.  Something like

MathJax.Hub.Config({
  "HTML-CSS": {
    availableFonts: ((MathJax.Hub.Browser.isSafari || MathJax.Hub.Browser.isChrome) &&
                                        MathJax.Hub.Browser.isMac ? ["TeX"] : ["TeX","STIX"])
  }
});

would do it for now (though v2.0 will use other values to try to target the affected versions of WebKit).

You ask if there are other consequences of this.  The MathJax web fonts are not as complete as the STIX fonts (they don't include as many glyphs) in order to be small enough to send over the web when needed.  If you are using MathJax to process TeX code, that should not be an issue, since the fonts include all the characters that MathJax's TeX input parser will produce.  But if you are planning to use MathML, or your users enter Unicode characters directly from the keyboard or through HTML entity references, then it is possible that they can access characters that aren't in the fonts.  How this is handled depends on the browser and the OS.  For most, the characters will be taken from other local fonts automatically, of they are available in a local font.  In particular, Mac OS is pretty good at this, so if you use the OS-specific check like I suggest above, that should not be a problem.  It is likely, however, that these extra characters will be found in the STIX fonts and so they might be italicized when they shouldn't be, but since such characters should be extremely rare, I suspect that this is not a serious problem.  You can configure the fonts to use for the missing characters, and can try to use other fonts in preference to STIX if you want.

Hope that helps.  I would be very happy to help you get things working for Wikipedia.  I have seen some of the discussion about this, and there are some things that can be done to address some of the concerns that have been brought up.  

Davide
Reply all
Reply to author
Forward
0 new messages