]> git.parisson.com Git - pdf.js.git/commitdiff
remove fontCount/fontName/kDisableFonts debug hacks and fix bug in font loading
authorAndreas Gal <andreas.gal@gmail.com>
Thu, 7 Jul 2011 05:14:48 +0000 (22:14 -0700)
committerAndreas Gal <andreas.gal@gmail.com>
Thu, 7 Jul 2011 05:14:48 +0000 (22:14 -0700)
fonts.js

index f6620a0a064362e3ffe01322259e92e36999a00e..2f6a550f88b9a6042d261d33ee7e8757ff069ce5 100755 (executable)
--- a/fonts.js
+++ b/fonts.js
@@ -15,20 +15,6 @@ var kMaxFontFileSize = 40000;
  */
 var kMaxWaitForFontFace = 1000;
 
-/**
- * Useful for debugging when you want to certains operations depending on how
- * many fonts are loaded.
- */
-var fontCount = 0;
-var fontName = '';
-
-/**
- * If for some reason one want to debug without fonts activated, it just need
- * to turn this pref to true/false.
- */
-var kDisableFonts = false;
-
-
 /**
  * Hold a map of decoded fonts and of the standard fourteen Type1 fonts and
  * their acronyms.
@@ -253,7 +239,7 @@ var FontLoader = {
       src += '  }';
       src += '</script></head><body>';
       for (var i = 0; i < names.length; ++i) {
-        src += '<p style="font-family:\'' + fontName + '\'">Hi</p>';
+        src += '<p style="font-family:\'' + names[i] + '\'">Hi</p>';
       }
       src += '</body></html>';
       var frame = document.createElement('iframe');
@@ -420,12 +406,10 @@ var Font = (function() {
       this.font = Fonts.lookup(name).data;
       return;
     }
-    fontCount++;
-    fontName = name;
 
     // If the font is to be ignored, register it like an already loaded font
     // to avoid the cost of waiting for it be be loaded by the platform.
-    if (properties.ignore || kDisableFonts) {
+    if (properties.ignore) {
       Fonts.blacklistFont(name);
       return;
     }