tore 01/06/06 13:13:24 Modified: src/org/apache/fop/fonts TTFSubSetFile.java Log: 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. Revision Changes Path 1.4 +12 -1 xml-fop/src/org/apache/fop/fonts/TTFSubSetFile.java Index: TTFSubSetFile.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/fonts/TTFSubSetFile.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- TTFSubSetFile.java 2001/04/08 14:55:39 1.3 +++ TTFSubSetFile.java 2001/06/06 20:13:21 1.4 @@ -1,4 +1,4 @@ -/* -- $Id: TTFSubSetFile.java,v 1.3 2001/04/08 14:55:39 kellyc Exp $ +/* -- $Id: TTFSubSetFile.java,v 1.4 2001/06/06 20:13:21 tore Exp $ * * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the @@ -462,6 +462,17 @@ 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; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]