]> git.parisson.com Git - pdf.js.git/commitdiff
Need to use font.translated.name as unique identifier
authorJulian Viereck <julian.viereck@gmail.com>
Mon, 5 Sep 2011 18:19:44 +0000 (11:19 -0700)
committerJulian Viereck <julian.viereck@gmail.com>
Thu, 15 Sep 2011 15:12:28 +0000 (08:12 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index e53ff1cb3ecee33960550b3559d3e300bb3ad1ba..13ec62e15cc40e37013e6f50759601aee6268d4d 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -4212,23 +4212,24 @@ var PartialEvaluator = (function() {
           } else if (cmd == 'Tf') { // eagerly collect all fonts
             var fontName = args[0].name;
             
-            // Check if this font is known already and process it otherwise.
-            if (!FontsMap[fontName]) {
-              var fontRes = resources.get('Font');
-              if (fontRes) {
-                fontRes = xref.fetchIfRef(fontRes);
-                var font = xref.fetchIfRef(fontRes.get(fontName));
-                assertWellFormed(IsDict(font));
-                if (!font.translated) {
-                  font.translated = this.translateFont(font, xref, resources);
-                  if (fonts && font.translated) {
-                    // keep track of each font we translated so the caller can
-                    // load them asynchronously before calling display on a page
-                    fonts.push(font.translated);
-                    FontsMap[fontName] = font;
-                  }
+            var fontRes = resources.get('Font');
+            if (fontRes) {
+              fontRes = xref.fetchIfRef(fontRes);
+              var font = xref.fetchIfRef(fontRes.get(fontName));
+              assertWellFormed(IsDict(font));
+              if (!font.translated) {
+                font.translated = this.translateFont(font, xref, resources);
+                if (fonts && font.translated) {
+                  // keep track of each font we translated so the caller can
+                  // load them asynchronously before calling display on a page
+                  fonts.push(font.translated);
+                  FontsMap[font.translated.name] = font;
                 }
               }
+              args[0].name = font.translated.name;
+            } else {
+              // TODO: TOASK: Is it possible to get here? If so, what does
+              // args[0].name should be like???
             }
           }