]> git.parisson.com Git - pdf.js.git/commitdiff
Check for more missing tables in TrueType (sigh)
authorVivien Nicolas <21@vingtetun.org>
Mon, 20 Jun 2011 01:01:09 +0000 (03:01 +0200)
committerVivien Nicolas <21@vingtetun.org>
Mon, 20 Jun 2011 01:01:09 +0000 (03:01 +0200)
fonts.js

index 281eb94a8d7a5e9f1b7c16351fd4003706d55a4b..72fabd2e33ed727a90d801998310a20bdb48ef92 100644 (file)
--- a/fonts.js
+++ b/fonts.js
@@ -694,7 +694,7 @@ var TrueType = function(aName, aFile, aProperties) {
   // If any tables are still in the array this means some required tables are
   // missing, which means that we need to rebuild the font in order to pass
   // the sanitizer.
-  if (requiredTables.length && requiredTables[0] == "OS/2") {
+  if (requiredTables.length == 1 && requiredTables[0] == "OS/2") {
     var OS2 = [
       0x00, 0x03, // version
       0x02, 0x24, // xAvgCharWidth
@@ -812,11 +812,10 @@ var TrueType = function(aName, aFile, aProperties) {
 
     this.data = fontData;
     return;
-  } else if (requiredTables.lenght) {
-    error("Table " + requiredTables[0] + " is missing from the TrueType font");
-  } else {
-    this.data = aFile;
+  } else if (requiredTables.length) {
+    warn("Missing " + requiredTables + " in the TrueType font");
   }
+  this.data = aFile;
 };
 
 TrueType.prototype = {