Fixed accidental switching of true and false when testing for local font. Issue #681.
This commit is contained in:
parent
6c50f1dae8
commit
ba238a6393
|
@ -84,14 +84,14 @@
|
||||||
this.div.style.fontStyle = (font.style||"normal");
|
this.div.style.fontStyle = (font.style||"normal");
|
||||||
}
|
}
|
||||||
var W = this.getComparisonWidths(font.testString,font.noStyleChar);
|
var W = this.getComparisonWidths(font.testString,font.noStyleChar);
|
||||||
var found = false;
|
var found = null;
|
||||||
if (W) {
|
if (W) {
|
||||||
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[0];
|
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[0];
|
||||||
if (this.div.offsetWidth == W[0]) {
|
if (this.div.offsetWidth == W[0]) {
|
||||||
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[W[2]];
|
this.div.style.fontFamily = "'"+font.family+"',"+this.comparisonFont[W[2]];
|
||||||
if (this.div.offsetWidth == W[1]) {found = true}
|
if (this.div.offsetWidth == W[1]) {found = false}
|
||||||
}
|
}
|
||||||
if (!found && (this.div.offsetWidth != W[3] || this.div.offsetHeight != W[4])) {
|
if (found === null && (this.div.offsetWidth != W[3] || this.div.offsetHeight != W[4])) {
|
||||||
if (!font.noStyleChar && HTMLCSS.FONTDATA && HTMLCSS.FONTDATA.hasStyleChar) {
|
if (!font.noStyleChar && HTMLCSS.FONTDATA && HTMLCSS.FONTDATA.hasStyleChar) {
|
||||||
for (var i = 0, m = this.testSize.length; i < m; i++)
|
for (var i = 0, m = this.testSize.length; i < m; i++)
|
||||||
{if (this.testStyleChar(font,this.testSize[i])) {found = true; m = 0}}
|
{if (this.testStyleChar(font,this.testSize[i])) {found = true; m = 0}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user