]> 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:10:59 +0000 (17:10 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 13 Feb 2003 17:10:59 +0000 (17:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195942 13f79535-47bb-0310-9956-ffa450edef68

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

index 8014cf48ee84250663c3bb9df1340538168ab456..0ee5bd92647f575ea0fe2515d5855cd026b635b3 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,10 @@ 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 +177,8 @@ public class TTFSubSetFile extends TTFFile {
             currentPos += (int)entry.getLength();
             realSize += (int)entry.getLength();
         } else {
-            throw new IOException("Can't find fpgm table");
+               //fpgm table is optional
+            //throw new IOException("Can't find fpgm table");
         }
     }