jeremias    2003/01/09 05:47:26

  Modified:    .        Tag: fop-0_20_2-maintain CHANGES
               src/org/apache/fop/fonts Tag: fop-0_20_2-maintain
                        TTFFile.java TTFMtxEntry.java
  Log:
  Fixed bug #15877: ArrayIndexOutOfBoundException with certain TrueType fonts.
  Reserved name indexes were not ignored.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.38 +2 -0      xml-fop/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/xml-fop/CHANGES,v
  retrieving revision 1.10.2.37
  retrieving revision 1.10.2.38
  diff -u -r1.10.2.37 -r1.10.2.38
  --- CHANGES   11 Dec 2002 14:43:15 -0000      1.10.2.37
  +++ CHANGES   9 Jan 2003 13:47:25 -0000       1.10.2.38
  @@ -1,5 +1,7 @@
   ==============================================================================
   Done since 0.20.4 release
  +- Fixed bug #15877: ArrayIndexOutOfBoundException with certain TrueType fonts.
  +  Reserved name indexes were not ignored. (Jeremias Maerki)
   - Fixed resolution of relative URLs in FopImageFactory with IBM JDK
     Submitted by: Manuel Mall <[EMAIL PROTECTED]> (see bug #14948)
   - Fixed infinite loop when page-height="auto" (Oleg Tkachenko)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.6   +11 -9     xml-fop/src/org/apache/fop/fonts/Attic/TTFFile.java
  
  Index: TTFFile.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fonts/Attic/TTFFile.java,v
  retrieving revision 1.6.2.5
  retrieving revision 1.6.2.6
  diff -u -r1.6.2.5 -r1.6.2.6
  --- TTFFile.java      29 Nov 2002 09:26:59 -0000      1.6.2.5
  +++ TTFFile.java      9 Jan 2003 13:47:25 -0000       1.6.2.6
  @@ -1,6 +1,6 @@
   /*
    * $Id$
  - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
  + * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
    */
  @@ -138,7 +138,7 @@
               // " Encoding: "+cmap_eid);
   
               if (cmap_pid == 3 && cmap_eid == 1) {
  -                cmap_unioffset = cmap_offset; 
  +                cmap_unioffset = cmap_offset;
               }
           }
   
  @@ -731,12 +731,14 @@
                       mtx_tab[i].name =
                           Glyphs.mac_glyph_names[mtx_tab[i].index];
                   } else {
  -                    k = mtx_tab[i].index - NMACGLYPHS;
  -                    /*
  -                     * System.out.println(k+" i="+i+" mtx="+mtx_tab.length+
  -                     * " ps="+ps_glyphs_buf.length);
  -                     */
  -                    mtx_tab[i].name = ps_glyphs_buf[k];
  +                    if (!mtx_tab[i].isIndexReserved()) {
  +                        k = mtx_tab[i].index - NMACGLYPHS;
  +                        /*
  +                         * System.out.println(k+" i="+i+" mtx="+mtx_tab.length+
  +                         * " ps="+ps_glyphs_buf.length);
  +                         */
  +                        mtx_tab[i].name = ps_glyphs_buf[k];
  +                    }
                   }
               }
   
  
  
  
  1.4.2.3   +34 -4     xml-fop/src/org/apache/fop/fonts/Attic/TTFMtxEntry.java
  
  Index: TTFMtxEntry.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fonts/Attic/TTFMtxEntry.java,v
  retrieving revision 1.4.2.2
  retrieving revision 1.4.2.3
  diff -u -r1.4.2.2 -r1.4.2.3
  --- TTFMtxEntry.java  19 Nov 2002 01:04:06 -0000      1.4.2.2
  +++ TTFMtxEntry.java  9 Jan 2003 13:47:26 -0000       1.4.2.3
  @@ -1,6 +1,6 @@
   /*
    * $Id$
  - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  + * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
    */
  @@ -28,12 +28,42 @@
       }
   
       public String toString(TTFFile t) {
  -        return new String("Glyph " + name + " index: " + index + " bbox [ "
  +        return new String("Glyph " + name + " index: " + getIndexAsString() + " 
bbox ["
                             + t.get_ttf_funit(bbox[0]) + " "
                             + t.get_ttf_funit(bbox[1]) + " "
                             + t.get_ttf_funit(bbox[2]) + " "
  -                          + t.get_ttf_funit(bbox[3]) + "]" + "wx: "
  +                          + t.get_ttf_funit(bbox[3]) + "] wx: "
                             + t.get_ttf_funit(wx));
       }
  +
  +    /**
  +     * Returns the index.
  +     * @return int
  +     */
  +    public int getIndex() {
  +        return index;
  +    }
  +
  +    /**
  +     * Determines whether this index represents a reserved character.
  +     * @return True if it is reserved
  +     */
  +    public boolean isIndexReserved() {
  +        return (getIndex() >= 32768) && (getIndex() <= 65535);
  +    }
  +
  +    /**
  +     * Returns a String representation of the index taking into account if
  +     * the index is in the reserved range.
  +     * @return index as String
  +     */
  +    public String getIndexAsString() {
  +        if (isIndexReserved()) {
  +            return Integer.toString(getIndex()) + " (reserved)";
  +        } else {
  +            return Integer.toString(getIndex());
  +        }
  +    }
  +
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to