diff --git a/fonts.js b/fonts.js index 444980042..f023419bb 100644 --- a/fonts.js +++ b/fonts.js @@ -479,7 +479,7 @@ var Font = (function () { var charset = properties.charset; if (charset && charset.length) { - // XXX why is the first character equal to ''? + log(charset); for (var i = 1; i < charset.length; i++) { var position = getUnicodeRangeFor(GlyphsUnicode[charset[i]]); if (position < 32) { diff --git a/pdf.js b/pdf.js index 33a21e38c..e1c48b4d9 100644 --- a/pdf.js +++ b/pdf.js @@ -3440,6 +3440,7 @@ var CanvasGraphics = (function() { if (charset) { assertWellFormed(IsString(charset), "invalid charset"); charset = charset.split("/"); + charset.shift(); } } else if (IsName(encoding)) { var encoding = Encodings[encoding.name]; @@ -3534,6 +3535,8 @@ var CanvasGraphics = (function() { type: subType.name, encoding: encodingMap, charset: charset, + firstChar: fontDict.get("FirstChar"), + lastChar: fontDict.get("LastChar"), bbox: descriptor.get("FontBBox"), ascent: descriptor.get("Ascent"), descent: descriptor.get("Descent"),