Skip to content

Commit 54007ab

Browse files
committed
Merge branch 'issue813' into v2.4-beta. Issue #813.
2 parents 0ebff03 + e1f4656 commit 54007ab

File tree

1 file changed

+58
-47
lines changed
  • unpacked/jax/output/NativeMML

1 file changed

+58
-47
lines changed

unpacked/jax/output/NativeMML/jax.js

Lines changed: 58 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
}
123123
}
124124
},
125+
handlesVariants: false, // true if native support for mathvariants
125126
settings: HUB.config.menuSettings,
126127
ex: 1, scale: 1, // filled in later
127128
adjustWidths: [], // array of elements to have their widths adjusted
@@ -856,53 +857,62 @@
856857
var fontDir = AJAX.fileURL(MathJax.OutputJax.fontDir+"/HTML-CSS/TeX/otf");
857858

858859
/*
859-
* Add fix for mathvariant issues in FF
860+
* Add fix for mathvariant issues
860861
*/
861862
nMML.Augment({
862-
config: {
863-
styles: {
864-
'[mathvariant="double-struck"]': {"font-family":"MathJax_AMS, MathJax_AMS-WEB"},
865-
'[mathvariant="script"]': {"font-family":"MathJax_Script, MathJax_Script-WEB"},
866-
'[mathvariant="fraktur"]': {"font-family":"MathJax_Fraktur, MathJax_Fraktur-WEB"},
867-
'[mathvariant="bold-script"]': {"font-family":"MathJax_Script, MathJax_Caligraphic-WEB", "font-weight":"bold"},
868-
'[mathvariant="bold-fraktur"]': {"font-family":"MathJax_Fraktur, MathJax_Fraktur-WEB", "font-weight":"bold"},
869-
'[mathvariant="monospace"]': {"font-family":"monospace"},
870-
'[mathvariant="sans-serif"]': {"font-family":"sans-serif"},
871-
'[mathvariant="bold-sans-serif"]': {"font-family":"sans-serif", "font-weight":"bold"},
872-
'[mathvariant="sans-serif-italic"]': {"font-family":"sans-serif", "font-style":"italic"},
873-
'[mathvariant="sans-serif-bold-italic"]': {"font-family":"sans-serif", "font-style":"italic", "font-weight":"bold"},
874-
'[class="MJX-tex-oldstyle"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB"},
875-
'[class="MJX-tex-oldstyle-bold"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB", "font-weight":"bold"},
876-
'[class="MJX-tex-caligraphic"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB"},
877-
'[class="MJX-tex-caligraphic-bold"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB", "font-weight":"bold"},
863+
config: {
864+
styles: {
865+
'[class="MJX-tex-oldstyle"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB"},
866+
'[class="MJX-tex-oldstyle-bold"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB", "font-weight":"bold"},
867+
'[class="MJX-tex-caligraphic"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB"},
868+
'[class="MJX-tex-caligraphic-bold"]': {"font-family":"MathJax_Caligraphic, MathJax_Caligraphic-WEB", "font-weight":"bold"},
878869

879-
'@font-face /*1*/': {
880-
"font-family": "MathJax_AMS-WEB",
881-
"src": "url('"+fontDir+"/MathJax_AMS-Regular.otf')"
882-
},
883-
'@font-face /*2*/': {
884-
"font-family": "MathJax_Script-WEB",
885-
"src": "url('"+fontDir+"/MathJax_Script-Regular.otf')"
886-
},
887-
'@font-face /*3*/': {
888-
"font-family": "MathJax_Fraktur-WEB",
889-
"src": "url('"+fontDir+"/MathJax_Fraktur-Regular.otf')"
890-
},
891-
'@font-face /*4*/': {
892-
"font-family": "MathJax_Caligraphic-WEB",
893-
"src": "url('"+fontDir+"/MathJax_Caligraphic-Regular.otf')"
894-
},
895-
'@font-face /*5*/': {
896-
"font-family": "MathJax_Fraktur-WEB", "font-weight":"bold",
897-
"src": "url('"+fontDir+"/MathJax_Fraktur-Bold.otf')"
898-
},
899-
'@font-face /*6*/': {
900-
"font-family": "MathJax_Caligraphic-WEB", "font-weight":"bold",
901-
"src": "url('"+fontDir+"/MathJax_Caligraphic-Bold.otf')"
902-
}
903-
}
904-
}
870+
'@font-face /*1*/': {
871+
"font-family": "MathJax_Caligraphic-WEB",
872+
"src": "url('"+fontDir+"/MathJax_Caligraphic-Regular.otf')"
873+
},
874+
'@font-face /*2*/': {
875+
"font-family": "MathJax_Caligraphic-WEB", "font-weight":"bold",
876+
"src": "url('"+fontDir+"/MathJax_Caligraphic-Bold.otf')"
877+
}
878+
}
879+
}
905880
});
881+
if (!this.handlesVariants) {
882+
nMML.Augment({
883+
config: {
884+
styles: {
885+
'[mathvariant="double-struck"]': {"font-family":"MathJax_AMS, MathJax_AMS-WEB"},
886+
'[mathvariant="script"]': {"font-family":"MathJax_Script, MathJax_Script-WEB"},
887+
'[mathvariant="fraktur"]': {"font-family":"MathJax_Fraktur, MathJax_Fraktur-WEB"},
888+
'[mathvariant="bold-script"]': {"font-family":"MathJax_Script, MathJax_Caligraphic-WEB", "font-weight":"bold"},
889+
'[mathvariant="bold-fraktur"]': {"font-family":"MathJax_Fraktur, MathJax_Fraktur-WEB", "font-weight":"bold"},
890+
'[mathvariant="monospace"]': {"font-family":"monospace"},
891+
'[mathvariant="sans-serif"]': {"font-family":"sans-serif"},
892+
'[mathvariant="bold-sans-serif"]': {"font-family":"sans-serif", "font-weight":"bold"},
893+
'[mathvariant="sans-serif-italic"]': {"font-family":"sans-serif", "font-style":"italic"},
894+
'[mathvariant="sans-serif-bold-italic"]': {"font-family":"sans-serif", "font-style":"italic", "font-weight":"bold"},
895+
896+
'@font-face /*3*/': {
897+
"font-family": "MathJax_AMS-WEB",
898+
"src": "url('"+fontDir+"/MathJax_AMS-Regular.otf')"
899+
},
900+
'@font-face /*4*/': {
901+
"font-family": "MathJax_Script-WEB",
902+
"src": "url('"+fontDir+"/MathJax_Script-Regular.otf')"
903+
},
904+
'@font-face /*5*/': {
905+
"font-family": "MathJax_Fraktur-WEB",
906+
"src": "url('"+fontDir+"/MathJax_Fraktur-Regular.otf')"
907+
},
908+
'@font-face /*6*/': {
909+
"font-family": "MathJax_Fraktur-WEB", "font-weight":"bold",
910+
"src": "url('"+fontDir+"/MathJax_Fraktur-Bold.otf')"
911+
}
912+
}
913+
}
914+
});
915+
}
906916
}
907917

908918
MML.math.Augment({
@@ -1309,16 +1319,17 @@
13091319
nMML.mmultiscriptsBug = true;
13101320
},
13111321
Firefox: function (browser) {
1322+
var is29 = browser.versionAtLeast("29.0");
13121323
nMML.ffTableWidthBug = !browser.versionAtLeast("13.0"); // <mtable width="xx"> not implemented
1313-
nMML.forceReflow = true; // <mtable> with alignments set don't display properly without a reflow
1314-
nMML.widthBug = true; // <math> elements don't always get the correct width
1324+
nMML.forceReflow = !is29; // <mtable> with alignments set don't display properly without a reflow
1325+
nMML.widthBug = !is29; // <math> elements don't always get the correct width
1326+
nMML.mtdWidthBug = !is29; // <mtd> widths not properly determined
1327+
nMML.handlesVariants = is29; // FF >=29 handles all math variants
13151328

13161329
// In Firefox < 20, the intrinsic width of <mspace> is not computed
13171330
// correctly and thus the element is displayed incorrectly in <mtable>.
13181331
nMML.spaceWidthBug = !browser.versionAtLeast("20.0");
13191332

1320-
nMML.mtdWidthBug = true; // <mtd> widths not properly determined
1321-
13221333
nMML.tableSpacingBug = true; // mtable@rowspacing/mtable@columnspacing not
13231334
// supported.
13241335
nMML.tableLabelBug = true; // mlabeledtr is not implemented.

0 commit comments

Comments
 (0)