]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
TrueType embedding: FPGM table is optional, so ignore it if it's not there.
authorJeremias Maerki <jeremias@apache.org>
Thu, 13 Feb 2003 17:19:13 +0000 (17:19 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 13 Feb 2003 17:19:13 +0000 (17:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@195943 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fonts/TTFSubSetFile.java

index 075964a4d28a78bd72794344b9ab7b347d892841..569d6c78df52f90462538bb4ebc5636f1766ec58 100644 (file)
@@ -88,10 +88,12 @@ public class TTFSubSetFile extends TTFFile {
         currentPos += 12;
         realSize += 16;
 
-        writeString("fpgm");
-        fpgmDirOffset = currentPos;
-        currentPos += 12;
-        realSize += 16;
+        if (hasFpgm()) {
+            writeString("fpgm");
+            fpgmDirOffset = currentPos;
+            currentPos += 12;
+            realSize += 16;
+        }
 
         writeString("glyf");
         glyfDirOffset = currentPos;
@@ -153,6 +155,9 @@ public class TTFSubSetFile extends TTFFile {
     }
 
 
+    private boolean hasFpgm() {
+        return (dirTabs.get("fpgm") != null);
+    }
 
     /**
      * Copy the fpgm table as is from original font to subset font
@@ -171,7 +176,8 @@ public class TTFSubSetFile extends TTFFile {
             currentPos += (int)entry.length;
             realSize += (int)entry.length;
         } else {
-            throw new IOException("Can't find fpgm table");
+            //fpgm table is optional
+            //throw new IOException("Can't find fpgm table");
         }
     }