mozMeasureText() is non-standard and deprecated
This commit is contained in:
parent
d0d608b17f
commit
d4a42a4e79
4
fonts.js
4
fonts.js
@ -203,7 +203,7 @@ Font.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.font = "bold italic 20px " + fontName + ", Symbol, Arial";
|
ctx.font = "bold italic 20px " + fontName + ", Symbol, Arial";
|
||||||
var textWidth = ctx.mozMeasureText(testString);
|
var textWidth = ctx.measureText(testString).width;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
ctx.fillText(testString, 20, 20);
|
ctx.fillText(testString, 20, 20);
|
||||||
@ -218,7 +218,7 @@ Font.prototype = {
|
|||||||
window.clearInterval(interval);
|
window.clearInterval(interval);
|
||||||
Fonts[fontName].loading = false;
|
Fonts[fontName].loading = false;
|
||||||
warn("Is " + fontName + " for charset: " + charset + " loaded?");
|
warn("Is " + fontName + " for charset: " + charset + " loaded?");
|
||||||
} else if (textWidth != ctx.mozMeasureText(testString)) {
|
} else if (textWidth != ctx.measureText(testString).width) {
|
||||||
window.clearInterval(interval);
|
window.clearInterval(interval);
|
||||||
Fonts[fontName].loading = false;
|
Fonts[fontName].loading = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user