diff options
Diffstat (limited to 'src/org/apache/fop')
-rw-r--r-- | src/org/apache/fop/fonts/truetype/TTFSubSetFile.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/org/apache/fop/fonts/truetype/TTFSubSetFile.java b/src/org/apache/fop/fonts/truetype/TTFSubSetFile.java index 8014cf48e..0ee5bd926 100644 --- a/src/org/apache/fop/fonts/truetype/TTFSubSetFile.java +++ b/src/org/apache/fop/fonts/truetype/TTFSubSetFile.java @@ -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"); } } |