]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Some fonts contains malformed composite glyphs which used to make fop crash. This...
authorTore Engvig <tore@apache.org>
Wed, 6 Jun 2001 20:13:21 +0000 (20:13 +0000)
committerTore Engvig <tore@apache.org>
Wed, 6 Jun 2001 20:13:21 +0000 (20:13 +0000)
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

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

index 7f349b4b8dd9de02a34ec1ff221ad024992c0232..d8f03af0b760a80082c191dad81d074e3f6ea38d 100644 (file)
@@ -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;