fix problems with dvipdfmx eating characters
patch by AKira Kakuto and Hironori Kitagawa
see devel@texjp.org ML, thread starting at post nr 326
---
 texk/dvipdfm-x/cidtype2.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- texlive-bin.orig/texk/dvipdfm-x/cidtype2.c
+++ texlive-bin/texk/dvipdfm-x/cidtype2.c
@@ -653,10 +653,14 @@
 	c = h_used_chars[i];
 	break;
       }
+    }
+    for (i = 8191; i >= 0; i--) {
       if (v_used_chars && v_used_chars[i] != 0) {
-	last_cid = i * 8 + 7;
-	c = v_used_chars[i];
-	break;
+	if (i*8+7 >= last_cid) {
+	   c = (i*8+7 > last_cid) ? (v_used_chars[i]) : (c | v_used_chars[i]);
+	   last_cid = i * 8 + 7;
+	   break;
+	}
       }
     }
     if (last_cid > 0) {
