aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fonts
diff options
context:
space:
mode:
authorTore Engvig <tore@apache.org>2001-07-17 20:57:47 +0000
committerTore Engvig <tore@apache.org>2001-07-17 20:57:47 +0000
commit00973df92264024c54d2095d181369c82d61dede (patch)
treec27a1a23e40952faa20066224365ee9796098674 /src/org/apache/fop/fonts
parentd02a43aaefc7678be9f66e0758eb6a4f088fb0b9 (diff)
downloadxmlgraphics-fop-00973df92264024c54d2095d181369c82d61dede.tar.gz
xmlgraphics-fop-00973df92264024c54d2095d181369c82d61dede.zip
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
Diffstat (limited to 'src/org/apache/fop/fonts')
-rw-r--r--src/org/apache/fop/fonts/TTFFile.java13
1 files changed, 9 insertions, 4 deletions
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++;
+ }
+ }
}
}
}