]> git.parisson.com Git - pdf.js.git/commitdiff
mozMeasureText() is non-standard and deprecated
authorChris Jones <jones.chris.g@gmail.com>
Sun, 19 Jun 2011 05:04:36 +0000 (22:04 -0700)
committerChris Jones <jones.chris.g@gmail.com>
Sun, 19 Jun 2011 05:04:36 +0000 (22:04 -0700)
fonts.js

index 7978cd60d333ebf918f52f83294b42e41412fab1..6c643ae4071f860bc6d7be158c22bb9e29cda42f 100644 (file)
--- a/fonts.js
+++ b/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).width;
 
     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).width) {
         window.clearInterval(interval);
         Fonts[fontName].loading = false;
       }