From 494227dfcc262605e2cda1345a56ad5cdc7c9792 Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Fri, 17 Jun 2011 21:34:06 -0700 Subject: [PATCH] avoid toString conversion in lookup --- fonts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fonts.js b/fonts.js index f348c346f..7978cd60d 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); }