]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Submitted by: SASAKI Suguru (s-sasaki@hkg.odn.ne.jp)
authorTore Engvig <tore@apache.org>
Tue, 17 Jul 2001 20:57:47 +0000 (20:57 +0000)
committerTore Engvig <tore@apache.org>
Tue, 17 Jul 2001 20:57:47 +0000 (20:57 +0000)
Some glyphs are missed when more then one glyph maps to the same data,
this patch fixes it.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194359 13f79535-47bb-0310-9956-ffa450edef68

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

index 0cd0521b8f118a54d05657dbece7a715071fdf08..1e72a209e13ff985f62ef21b34eac5a2fa5fee2a 100644 (file)
@@ -200,14 +200,15 @@ public class TTFFile {
                         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() +
-                                            cmap_deltas[i]) & 0xffff;
+                            glyphIdx = (in.readTTFUShort() +
+                                        cmap_deltas[i]) & 0xffff;
 
                             unicodeMapping.addElement(
                               new UnicodeMapping(glyphIdx, j));
@@ -254,7 +255,7 @@ public class TTFFile {
                         }
                         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 @@ public class TTFFile {
                                 mtx_tab[(j+cmap_deltas[i]) & 0xffff].name);
                               */
                         }
-                        mtxPtr++;
+                        if (glyphIdx < mtx_tab.length) {
+                            if (mtx_tab[glyphIdx].unicodeIndex.size() < 2) {
+                                mtxPtr++;
+                            }
+                        }
                     }
                 }
             }