Remove commas that confuse IE8, work around IE8 problem with insertBefore when second argument is negative, fix mspaces with negative width, and add a hack to avoid negative spaces after \int to adjust for different spacing between CM and Times fonts.
This commit is contained in:
parent
781689e7e4
commit
0864dfcd79
|
@ -383,7 +383,7 @@
|
||||||
"bold-fraktur": "MJXc-frak MJXc-bold",
|
"bold-fraktur": "MJXc-frak MJXc-bold",
|
||||||
"monospace": "MJXc-mono",
|
"monospace": "MJXc-mono",
|
||||||
"sans-serif": "MJXc-sf",
|
"sans-serif": "MJXc-sf",
|
||||||
"-tex-caligraphic": "MJXc-cal",
|
"-tex-caligraphic": "MJXc-cal"
|
||||||
},
|
},
|
||||||
MATHSPACE: {
|
MATHSPACE: {
|
||||||
veryverythinmathspace: 1/18,
|
veryverythinmathspace: 1/18,
|
||||||
|
@ -498,7 +498,7 @@
|
||||||
return (m.toFixed(3).replace(/\.?0+$/,""))+"em";
|
return (m.toFixed(3).replace(/\.?0+$/,""))+"em";
|
||||||
},
|
},
|
||||||
|
|
||||||
arrayEntry: function (a,i) {return a[Math.max(0,Math.min(i,a.length-1))]},
|
arrayEntry: function (a,i) {return a[Math.max(0,Math.min(i,a.length-1))]}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -537,6 +537,11 @@
|
||||||
CHTMLcreateSpan: function (span) {
|
CHTMLcreateSpan: function (span) {
|
||||||
this.bbox = {w:0, h:0, d:0, l:0, r:0, t:0, b:0};
|
this.bbox = {w:0, h:0, d:0, l:0, r:0, t:0, b:0};
|
||||||
if (this.inferred) return span;
|
if (this.inferred) return span;
|
||||||
|
// ### FIXME: This is a hack to handle the different spacing of the
|
||||||
|
// ### integral sign in Times compared to CM fonts
|
||||||
|
if (this.type === "mo" && this.data.join("") === "\u222B") {CHTML.lastIsInt = true}
|
||||||
|
else if (this.type !== "mspace" || this.width !== "negativethinmathspace") {CHTML.lastIsInt = false}
|
||||||
|
// ###
|
||||||
if (!this.CHTMLspanID) {this.CHTMLspanID = CHTML.GetID()};
|
if (!this.CHTMLspanID) {this.CHTMLspanID = CHTML.GetID()};
|
||||||
var id = (this.id || "MJXc-Span-"+this.CHTMLspanID);
|
var id = (this.id || "MJXc-Span-"+this.CHTMLspanID);
|
||||||
return HTML.addElement(span,"span",{className:"MJXc-"+this.type, id:id});
|
return HTML.addElement(span,"span",{className:"MJXc-"+this.type, id:id});
|
||||||
|
@ -730,6 +735,11 @@
|
||||||
d = CHTML.length2em(values.depth);
|
d = CHTML.length2em(values.depth);
|
||||||
var bbox = this.bbox;
|
var bbox = this.bbox;
|
||||||
bbox.w = w; bbox.h = h; bbox.d = d;
|
bbox.w = w; bbox.h = h; bbox.d = d;
|
||||||
|
if (w < 0) {
|
||||||
|
// ### FIXME: lastIsInt hack
|
||||||
|
if (!CHTML.lastIsInt) span.style.marginLeft = CHTML.Em(w);
|
||||||
|
w = 0;
|
||||||
|
}
|
||||||
span.style.width = CHTML.Em(w);
|
span.style.width = CHTML.Em(w);
|
||||||
span.style.height = CHTML.Em(h+d);
|
span.style.height = CHTML.Em(h+d);
|
||||||
if (d) span.style.verticalAlign = CHTML.Em(-d);
|
if (d) span.style.verticalAlign = CHTML.Em(-d);
|
||||||
|
@ -804,7 +814,8 @@
|
||||||
acc = acc - obox.d + .1; if (bbox.t != null) {acc += bbox.t - bbox.h}
|
acc = acc - obox.d + .1; if (bbox.t != null) {acc += bbox.t - bbox.h}
|
||||||
over.firstChild.firstChild.style.marginBottom = CHTML.Em(acc);
|
over.firstChild.firstChild.style.marginBottom = CHTML.Em(acc);
|
||||||
}
|
}
|
||||||
span.insertBefore(over,span.firstChild);
|
if (span.firstChild) {span.insertBefore(over,span.firstChild)}
|
||||||
|
else {span.appendChild(over)}
|
||||||
}
|
}
|
||||||
if (this.data[this.under]) {
|
if (this.data[this.under]) {
|
||||||
span.lastChild.firstChild.style.marginLeft = ubox.l =
|
span.lastChild.firstChild.style.marginLeft = ubox.l =
|
||||||
|
@ -821,7 +832,10 @@
|
||||||
MML.msubsup.Augment({
|
MML.msubsup.Augment({
|
||||||
toCommonHTML: function (span) {
|
toCommonHTML: function (span) {
|
||||||
span = this.CHTMLdefaultSpan(span,{noBBox:true});
|
span = this.CHTMLdefaultSpan(span,{noBBox:true});
|
||||||
if (!this.data[this.base]) {span.insertBefore(HTML.Element("span"),span.firstChild)}
|
if (!this.data[this.base]) {
|
||||||
|
if (span.firstChild) {span.insertBefore(HTML.Element("span"),span.firstChild)}
|
||||||
|
else {span.appendChild(HTML.Element("span"))}
|
||||||
|
}
|
||||||
var base = this.data[this.base], sub = this.data[this.sub], sup = this.data[this.sup];
|
var base = this.data[this.base], sub = this.data[this.sub], sup = this.data[this.sup];
|
||||||
if (!base) base = {bbox: {h:.8, d:.2}};
|
if (!base) base = {bbox: {h:.8, d:.2}};
|
||||||
span.firstChild.style.marginRight = ".05em";
|
span.firstChild.style.marginRight = ".05em";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user