]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
prevent assert due to skipped out of order or duplicate glyph indices
authorGlenn Adams <gadams@apache.org>
Fri, 9 Mar 2012 16:50:06 +0000 (16:50 +0000)
committerGlenn Adams <gadams@apache.org>
Fri, 9 Mar 2012 16:50:06 +0000 (16:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1298912 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java

index 6037aa6e4452135ef402b1ed915c35498e3f6d7f..dfad577381b7a7faeea6b2dbcff96fe148e0d779 100644 (file)
@@ -176,6 +176,7 @@ public final class GlyphCoverageTable extends GlyphMappingTable implements Glyph
         }
         private void populate ( List entries ) {
             int i = 0;
+            int skipped = 0;
             int n = entries.size();
             int gidMax = -1;
             int[] map = new int [ n ];
@@ -188,6 +189,7 @@ public final class GlyphCoverageTable extends GlyphMappingTable implements Glyph
                             map [ i++ ] = gidMax = gid;
                         } else {
                             log.info ( "ignoring out of order or duplicate glyph index: " + gid );
+                            skipped++;
                         }
                     } else {
                         throw new AdvancedTypographicTableFormatException ( "illegal glyph index: " + gid );
@@ -196,7 +198,7 @@ public final class GlyphCoverageTable extends GlyphMappingTable implements Glyph
                     throw new AdvancedTypographicTableFormatException ( "illegal coverage entry, must be Integer: " + o );
                 }
             }
-            assert i == n;
+            assert ( i + skipped ) == n;
             assert this.map == null;
             this.map = map;
         }