]> git.parisson.com Git - pdf.js.git/commitdiff
Support lsb div format
authorVivien Nicolas <21@vingtetun.org>
Wed, 24 Aug 2011 15:18:56 +0000 (17:18 +0200)
committerVivien Nicolas <21@vingtetun.org>
Wed, 24 Aug 2011 15:18:56 +0000 (17:18 +0200)
fonts.js

index 9049255e754895215ab308653345fc3eb810745f..9dc739796cffdb23bb8be64e661b248820aa0ac1 100755 (executable)
--- a/fonts.js
+++ b/fonts.js
@@ -1485,14 +1485,18 @@ var Type1Parser = function() {
           // TODO Clean this code
           if (value == 13) {
             if (charstring.length == 2) {
+              lsb = charstring[0];
               width = charstring[1];
             } else if (charstring.length == 4 && charstring[3] == 'div') {
+              lsb = charstring[0];
               width = charstring[1] / charstring[2];
+            } else if (charstring.length == 4 && charstring[2] == 'div') {
+              lsb = charstring[0] / charstring[1];
+              width = charstring[3];
             } else {
               error('Unsupported hsbw format: ' + charstring);
             }
 
-            lsb = charstring[0];
             charstring.push(lsb, 'hmoveto');
             charstring.splice(0, 1);
             continue;