Hi, fop-team.

Current org.apache.fop.fonts.TTFFile dosen't load all glyph data
when two or more character is mapped to one glyph.
(In fact, Bitstream Cybetbit font has mapped many characters to
missingGlyph (glyphIndex = 0)).
Some character dosen't appear in outputs because of this.

This pacth will fix this problem.

=======
SASAKI Suguru
  mailto : [EMAIL PROTECTED]



--- src/org/apache/fop/fonts/TTFFile.java.orig  Tue Apr 17 01:07:30 2001
+++ src/org/apache/fop/fonts/TTFFile.java       Thu Jul 12 01:37:20 2001
@@ -200,13 +200,14 @@
                         lastChar = (short) j;
 
                     if (mtxPtr < mtx_tab.length) {
+                        int glyphIdx;
                         if (cmap_rangeOffsets[i] != 0) {
                             int glyphOffset = glyphIdArrayOffset +
                                               ((cmap_rangeOffsets[i] / 2) +
                                                (j - cmap_startCounts[i]) + (i) -
                                                cmap_segCountX2 / 2) * 2;
                             in.seek_set(glyphOffset);
-                            int glyphIdx = (in.readTTFUShort() +
+                            glyphIdx = (in.readTTFUShort() +
                                             cmap_deltas[i]) & 0xffff;
 
                             unicodeMapping.addElement(
@@ -254,7 +255,7 @@
                         }
                         else {
 
-                            int glyphIdx = (j + cmap_deltas[i]) & 0xffff;
+                            glyphIdx = (j + cmap_deltas[i]) & 0xffff;
 
                             if (glyphIdx < mtx_tab.length)
                                 mtx_tab[glyphIdx] .unicodeIndex.addElement(
@@ -308,7 +309,11 @@
                                 mtx_tab[(j+cmap_deltas[i]) & 0xffff].name);
                               */
                         }
-                        mtxPtr++;
+                        if (glyphIdx < mtx_tab.length){
+                            if(mtx_tab[glyphIdx] .unicodeIndex.size() < 2){
+                                mtxPtr++;
+                            }
+                        }
                     }
                 }
             }


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

Reply via email to