]> git.parisson.com Git - pdf.js.git/commitdiff
avoid toString conversion in lookup
authorAndreas Gal <andreas.gal@gmail.com>
Sat, 18 Jun 2011 04:34:06 +0000 (21:34 -0700)
committerAndreas Gal <andreas.gal@gmail.com>
Sat, 18 Jun 2011 04:34:06 +0000 (21:34 -0700)
fonts.js

index f348c346fc9f411c9cc6f8566c96f5f931293e5c..7978cd60d333ebf918f52f83294b42e41412fab1 100644 (file)
--- a/fonts.js
+++ b/fonts.js
@@ -58,8 +58,8 @@ var Fonts = {
     for (var i = 0; i < chars.length; ++i) {
       var ch = chars.charCodeAt(i);
       var uc = encoding[ch];
-      if (typeof uc != "number") // we didn't convert the glyph yet
-        uc = encoding[ch] = GlyphsUnicode[uc];
+      if (uc instanceof Name) // we didn't convert the glyph yet
+        uc = encoding[ch] = GlyphsUnicode[uc.name];
       ret += String.fromCharCode(uc);
     }