]> git.parisson.com Git - pdf.js.git/commitdiff
nits, picked
authorAdil Allawi <adil@diwan.com>
Wed, 13 Jul 2011 16:46:48 +0000 (17:46 +0100)
committerAdil Allawi <adil@diwan.com>
Wed, 13 Jul 2011 16:46:48 +0000 (17:46 +0100)
fonts.js
pdf.js

index a048e78d89836e89ee8e332dc580ac5db1c2e17b..607e2aab93241a8187fa6420152f30cf98dd25d4 100755 (executable)
--- a/fonts.js
+++ b/fonts.js
@@ -411,7 +411,7 @@ var Font = (function() {
         break;
     }
     this.data = data;
-    this.type = properties.type; // Use the type to test if the string is single or multi-byte
+    this.type = properties.type;
     this.id = Fonts.registerFont(name, data, properties);
     this.loadedName = 'pdfFont' + this.id;
     this.compositeFont = properties.compositeFont;
@@ -924,13 +924,12 @@ var Font = (function() {
 
         // Replace the old CMAP table with a shiny new one
         if (properties.type == 'CIDFontType2') {
-          // Type2 composite fonts map charcters directly to glyphs so the cmap
+          // Type2 composite fonts map characters directly to glyphs so the cmap
           // table must be replaced.
           
           var glyphs = [];
           var charset = properties.charset;
-          if (charset.length == 0)
-          {
+          if (!charset.length) {
             // PDF did not contain a GIDMap for the font so create an identity cmap
             
             // First get the number of glyphs from the maxp table
@@ -939,16 +938,17 @@ var Font = (function() {
             var numGlyphs = int16(font.getBytes(2));
             
             // Now create an identity mapping
-            for (var i=1; i < numGlyphs; i++) {
+            for (var i = 1; i < numGlyphs; i++) {
               glyphs.push({
                 unicode: i
               });
             }
           } else {
-            for (var i=1; i < charset.length; i++) {
-              if (charset.indexOf(i) != -1) {
+            for (var i = 1; i < charset.length; i++) {
+              var index = charset.indexOf(i);
+              if (index != -1) {
                 glyphs.push({
-                  unicode: charset.indexOf(i)
+                  unicode: index
                 });
               } else {
                 break;
diff --git a/pdf.js b/pdf.js
index 1680c1c59648eddd48e5fc6b19a96d6c683ed180..a3179406ceda56cee60952e3dc7341ae5945fe73 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -3634,8 +3634,7 @@ var PartialEvaluator = (function() {
       //  - get the descendant font
       //  - set the type according to the descendant font
       //  - get the FontDescriptor from the descendant font
-      if (subType.name == 'Type0')
-      {
+      if (subType.name == 'Type0') {
         var df = fontDict.get('DescendantFonts');
         if (!df)
           return null;