Hi Steven,
Supporting math fonts is complicated to do in MathJax and some work must
be done to overcome many issues. However, we plan to add more free Web
fonts in the upcoming v2.3 release, including STIX. For testing purpose
only, you can download that archive:
https://github.com/fred-wang/MathJax/archive/open-type-fonts.zip
Be sure that your test page points to the unpacked version
MathJax-open-type-fonts/unpacked/MathJax.js
Then you'll be able to use
webFont: "STIX-Web"
in your HTML-CSS config. Other options are "Asana-Math", "Gyre-Pagella",
"Gyre-Termes", "Latin-Modern" and "Neo-Euler".
Le 25/09/2013 03:28, steve...@googlemail.com a �crit :
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: { inlineMath: [['$', '$']] },jax: ["input/TeX","output/HTML-CSS"],extensions: ["tex2jax.js","FontWarnings.js"],TeX: {extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},"HTML-CSS": {preferredFont: "STIX",availableFonts: ["STIX"],webFont: null},FontWarnings: {fadeoutTime: 15*1000}});</script>
<style type="text/css">@font-face {font-family:"STIXSizeOneSym";src:url("fonts/STIX/STIXSizeOneSym-Regular.otf");}@font-face {font-family:"STIXSizeOneSym";src:url("fonts/STIX/STIXSizeOneSym-Bold.otf")font-weight:bold;}@font-face {font-family:"STIXGeneral";src:url("fonts/STIX/STIXGeneral-Regular.otf");font-weight:normal;font-style:normal;}@font-face {font-family:"STIXGeneral";src:url("fonts/STIX/STIXGeneral-Italic.otf");font-weight:normal;font-style:italic;}</style>
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;}
@font-face {font-family:"STIXGeneral-Regular";src:url("fonts/STIX/STIXGeneral-Regular.otf");font-weight:normal;font-style:normal;}@font-face {font-family:"STIXGeneral-Italic";src:url("fonts/STIX/STIXGeneral-Italic.otf");font-weight:normal;font-style:normal;}
def getSourceURL(path : String) : String = {
val url = getClass().getResource("/" + path)
if (url == null)
throw new RuntimeException("getSourceURL: no url found for '"+path+"'")
else
return url.toExternalForm()
}
def loadFont(path : String, fontFamily : String, fontStyle : FontStyle) {
val font = javafx.scene.text.Font.loadFont(getSourceURL(path), 1.0)
val ff = font.getFamily()
if (ff != fontFamily) {
throw new RuntimeException("Unexpected font family, found '"+ff+"' instead of '"+fontFamily+"'")
}
val fs = fontStyle match {
case FontStyle.REGULAR => "Regular"
case FontStyle.BOLD => "Bold"
case FontStyle.ITALIC => "Italic"
case FontStyle.BOLD_ITALIC => "Bold Italic"
}
if (fs != font.getStyle()) {
throw new RuntimeException("Unexpected font style, found '"+font.getStyle()+"' instead of '"+fs+"'.")
}
}
loadFont("fonts/STIX/STIXSizeOneSym-Regular.otf", "STIXSizeOneSym", FontStyle.REGULAR)loadFont("fonts/STIX/STIXSizeOneSym-Bold.otf", "STIXSizeOneSym", FontStyle.BOLD)loadFont("fonts/STIX/STIXGeneral-Regular.otf", "STIXGeneral", FontStyle.REGULAR)loadFont("fonts/STIX/STIXGeneral-Italic.otf", "STIXGeneral", FontStyle.ITALIC)
loadFont("fonts/STIX/STIXGeneral-Regular-bugfix.ttf", "STIXGeneral-Regular", FontStyle.REGULAR)loadFont("fonts/STIX/STIXGeneral-Italic-bugfix.ttf", "STIXGeneral-Italic", FontStyle.REGULAR)
--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.