From: Andreas Gal Date: Sat, 18 Jun 2011 04:34:06 +0000 (-0700) Subject: avoid toString conversion in lookup X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6dc697071e430631aeaba348245168fca1c56164;p=pdf.js.git avoid toString conversion in lookup --- diff --git a/fonts.js b/fonts.js index f348c34..7978cd6 100644 --- 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); }