-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
rendering problems in Safari 5.1.1 #178
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
Comments
OS X 10.7 (Lion) ships with the STIX fonts installed, and MathJax will use those in preference to its web-based fonts. Unfortunately, there appears to be an incompatibility with the STIX fonts and recent versions of WebKit that causes the fonts to be rendered over italicized (it looks like they have had an italic algorithm applied to them even though they are already italic). It is not actually the parenthesis that is misplaced, it is the preceding f that is over italicized. One solution is to use FontBook to disable the STIX fonts (if you aren't using them in other contexts). Or you could download and install the MathJax web fonts (since local copies of them will be used in preference to local STIX fonts). Alternatively, if you are the author of the web page using MathJax, you can change your configuration to remove the STIX fonts from the <script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": {
availableFonts: ["TeX"]
}
});
</script> Davide |
This is a duplicate of issue #152 |
Ok, thank you! |
OK, I've finally had the chance to come up with a work-around to the STIX font problem on OS X Lion. It turns out that WebKit seems to be replacing Fortunately, it is still possible to access the STIXGeneral font via <script type="text/x-mathjax-config">
MathJax.Hub.Register.LoadHook("[MathJax]/jax/output/HTML-CSS/fonts/STIX/fontdata.js", function () {
var HTMLCSS = MathJax.OutputJax["HTML-CSS"];
MathJax.Hub.Browser.Select({
Safari: function (browser) {
browser.STIXfontBug = browser.versionAtLeast("5.1") && browser.isMac;
},
Chrome: function (browser) {
var match = navigator.appVersion.match(/AppleWebKit\/(\d+)/);
if (match && parseInt(match[1]) > 534) {browser.STIXfontBug = true}
}
});
if (MathJax.Hub.Browser.STIXfontBug) {
HTMLCSS.FONTDATA.FONTS["STIXGeneral"].family = "STIXGeneral-Regular";
HTMLCSS.FONTDATA.FONTS["STIXGeneral-italic"].family = "STIXGeneral-Italic";
delete HTMLCSS.FONTDATA.FONTS["STIXGeneral-italic"].style;
HTMLCSS.FONTDATA.FONTS["STIXNonUnicode"].family = "STIXNonUnicode-Regular";
HTMLCSS.FONTDATA.FONTS["STIXNonUnicode-italic"].family = "STIXNonUnicode-Italic";
delete HTMLCSS.FONTDATA.FONTS["STIXNonUnicode-italic"].style;
}
});
</script> This will be included in MathJax v2.0. This should allow the STIX fonts to be used correctly with MathJax, without having your users disable STIX, or disabling STIX fonts for non-WebKit browsers. Hope that helps. Davide |
It turns out that the STIX NonUnicode fonts also need to be adjusted similarly to STIXGeneral (I have tested all the other fonts, and they seem to be OK. This seems only to affect the ones that have italic versions). I have edited my code snippet above to include the additional fonts. |
…e fonts also needed to be adjusted). Resolves issues mathjax#152 and mathjax#178.
On OS X Lion in Safari 5.1.1, there are several serious rendering issues. The sqrt line and parenthesis are mis-placed in the examples:
http://s4.postimage.org/utsmgtvo/Screen_Shot_2011_10_16_at_6_33_36_PM.png
The text was updated successfully, but these errors were encountered: