From d2b050a7f706c5c8a751e48a0bc953dcf8646d01 Mon Sep 17 00:00:00 2001 From: Bertrand Delacretaz Date: Tue, 10 Oct 2006 09:15:06 +0000 Subject: [PATCH] Throw exception if glyf table is not found (currently happens with some OTF font files) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@454669 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/truetype/TTFFile.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFile.java b/src/java/org/apache/fop/fonts/truetype/TTFFile.java index 6a20e2bb9..3ff335a4a 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFFile.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFFile.java @@ -946,6 +946,7 @@ public class TTFFile { */ private final void readGlyf(FontFileReader in) throws IOException { TTFDirTabEntry dirTab = (TTFDirTabEntry)dirTabs.get("glyf"); + if(dirTab==null) throw new IOException("glyf table not found, cannot continue"); for (int i = 0; i < (numberOfGlyphs - 1); i++) { if (mtxTab[i].getOffset() != mtxTab[i + 1].getOffset()) { in.seekSet(dirTab.getOffset() + mtxTab[i].getOffset()); -- 2.39.5