Skip to content
Permalink
Browse files

Merge branch 'issue681' into develop. Issue mathjax#681.

  • Loading branch information...
dpvc committed Feb 7, 2014
2 parents 8089fe3 + 6c50f1d commit 76a4ee314c31d1dbaa2f33b0c83eb5b08e7e35b7
Showing with 9 additions and 6 deletions.
  1. +9 −6 unpacked/jax/output/HTML-CSS/jax.js
@@ -84,19 +84,22 @@
this.div.style.fontStyle = (font.style||"normal");
}
var W = this.getComparisonWidths(font.testString,font.noStyleChar);
var found = false;
if (W) {
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[0];
if (this.div.offsetWidth == W[0]) {
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[W[2]];
if (this.div.offsetWidth == W[1]) {return false}
if (this.div.offsetWidth == W[1]) {found = true}
}
if (this.div.offsetWidth != W[3] || this.div.offsetHeight != W[4]) {
if (font.noStyleChar || !HTMLCSS.FONTDATA || !HTMLCSS.FONTDATA.hasStyleChar) {return true}
for (var i = 0, m = this.testSize.length; i < m; i++)
{if (this.testStyleChar(font,this.testSize[i])) {return true}}
if (!found && (this.div.offsetWidth != W[3] || this.div.offsetHeight != W[4])) {
if (!font.noStyleChar && HTMLCSS.FONTDATA && HTMLCSS.FONTDATA.hasStyleChar) {
for (var i = 0, m = this.testSize.length; i < m; i++)
{if (this.testStyleChar(font,this.testSize[i])) {found = true; m = 0}}
} else {found = true}
}
}
return false;
if (HTMLCSS.safariTextNodeBug) {this.div.innerHTML = ""} else {this.text.nodeValue = ""}
return found;
},

styleChar: "\uEFFD", // width encodes style

0 comments on commit 76a4ee3

Please sign in to comment.
You can’t perform that action at this time.