diff options
author | Tore Engvig <tore@apache.org> | 2001-06-06 20:13:21 +0000 |
---|---|---|
committer | Tore Engvig <tore@apache.org> | 2001-06-06 20:13:21 +0000 |
commit | b68fb9a202870ee128ee1d9948af055f543ca4fe (patch) | |
tree | fb39c975b994cd5411654d956626a7b59a2a1b89 /src/org/apache/fop/fonts | |
parent | 503416560bf299e1ca4d210bb2b34fcf1d6122b5 (diff) | |
download | xmlgraphics-fop-b68fb9a202870ee128ee1d9948af055f543ca4fe.tar.gz xmlgraphics-fop-b68fb9a202870ee128ee1d9948af055f543ca4fe.zip |
Some fonts contains malformed composite glyphs which used to make fop crash. This adds
an errormessage and tries to embed the font without the composite glyph.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194276 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fonts')
-rw-r--r-- | src/org/apache/fop/fonts/TTFSubSetFile.java | 11 |
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; |