aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fonts
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/apache/fop/fonts')
-rw-r--r--src/org/apache/fop/fonts/TTFSubSetFile.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/org/apache/fop/fonts/TTFSubSetFile.java b/src/org/apache/fop/fonts/TTFSubSetFile.java
index 7f349b4b8..d8f03af0b 100644
--- a/src/org/apache/fop/fonts/TTFSubSetFile.java
+++ b/src/org/apache/fop/fonts/TTFSubSetFile.java
@@ -462,6 +462,17 @@ public class TTFSubSetFile extends TTFFile {
flags = in.readTTFUShort(offset);
compositeIdx = new Integer(in.readTTFUShort(offset+2));
Integer newIdx = (Integer)glyphs.get(compositeIdx);
+ if (newIdx == null) {
+ // This errormessage would look much better
+ // if the fontname was printed to
+ MessageHandler.error("An embedded font " +
+ "contains bad glyph data. " +
+ "Characters might not display " +
+ "correctly.");
+ moreComposites = false;
+ continue;
+ }
+
in.writeTTFUShort(offset+2, newIdx.intValue());
offset+=4;