From: Tore Engvig Date: Tue, 17 Jul 2001 20:57:47 +0000 (+0000) Subject: Submitted by: SASAKI Suguru (s-sasaki@hkg.odn.ne.jp) X-Git-Tag: PRE_CODEFORMATTING~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=00973df92264024c54d2095d181369c82d61dede;p=xmlgraphics-fop.git Submitted by: SASAKI Suguru (s-sasaki@hkg.odn.ne.jp) 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 --- diff --git a/src/org/apache/fop/fonts/TTFFile.java b/src/org/apache/fop/fonts/TTFFile.java index 0cd0521b8..1e72a209e 100644 --- a/src/org/apache/fop/fonts/TTFFile.java +++ b/src/org/apache/fop/fonts/TTFFile.java @@ -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++; + } + } } } }