]> git.parisson.com Git - pdf.js.git/commitdiff
Remove the first empty character of charset
authorVivien Nicolas <21@vingtetun.org>
Thu, 30 Jun 2011 00:58:40 +0000 (02:58 +0200)
committerVivien Nicolas <21@vingtetun.org>
Thu, 30 Jun 2011 00:58:40 +0000 (02:58 +0200)
fonts.js
pdf.js

index 444980042550bfd1135ebbc67f8cd17b341e85f0..f023419bb4b7aff5217fc19dfbcba941b9091c93 100644 (file)
--- 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 33a21e38cfcf7a52969f2130703beb12776f4804..e1c48b4d99ee19c90e8555326f0d491724367eca 100644 (file)
--- 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"),