From 6a6753fd5e1068684488f95d9a16e98cc3c9ee80 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Tue, 14 Jun 2011 11:59:10 +0200 Subject: [PATCH] Add support for brackets around the header emails --- PDFFont.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PDFFont.js b/PDFFont.js index 509d714fe..9c6c620bb 100644 --- a/PDFFont.js +++ b/PDFFont.js @@ -38,10 +38,14 @@ var Fonts = { this._active = this[aFontName]; }, - getUnicodeFor: function fonts_getUnicodeFor(aCode) { - var glyph = this._active.encoding[aCode]; - var unicode = "0x" + GlyphsUnicode[glyph]; - return unicode || aCode; + unicodeFromCode: function fonts_unicodeFromCode(aCode) { + var active = this._active; + if (!active) + return aCode; + + var difference = active.encoding[aCode]; + var unicode = GlyphsUnicode[difference]; + return unicode ? "0x" + unicode : aCode; } };