mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 01:28:06 +02:00
Use measureText instead of mozMeasureText (deprecated)
This commit is contained in:
parent
a53736b732
commit
8d9ffb1872
1 changed files with 2 additions and 2 deletions
4
fonts.js
4
fonts.js
|
@ -203,7 +203,7 @@ Font.prototype = {
|
|||
}
|
||||
}
|
||||
ctx.font = "bold italic 20px " + fontName + ", Symbol, Arial";
|
||||
var textWidth = ctx.mozMeasureText(testString);
|
||||
var textWidth = ctx.measureText(testString);
|
||||
|
||||
if (debug)
|
||||
ctx.fillText(testString, 20, 20);
|
||||
|
@ -218,7 +218,7 @@ Font.prototype = {
|
|||
window.clearInterval(interval);
|
||||
Fonts[fontName].loading = false;
|
||||
warn("Is " + fontName + " for charset: " + charset + " loaded?");
|
||||
} else if (textWidth != ctx.mozMeasureText(testString)) {
|
||||
} else if (textWidth != ctx.measureText(testString)) {
|
||||
window.clearInterval(interval);
|
||||
Fonts[fontName].loading = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue