summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorJjgod Jiang <gzjjgod@gmail.com>2014-08-05 19:57:17 +0000
committerJjgod Jiang <gzjjgod@gmail.com>2014-08-05 19:57:17 +0000
commit40177427f4c83e9facd363c67acc200c5334bfdb (patch)
tree593306b8f03bdf59aec900c979e7e8384366a211 /Build
parent97fa7b3630528845d9934ad227bc9f3a0c9d1d98 (diff)
Fix xdvipdfmx ToUnicode regression caused by r34831
git-svn-id: svn://tug.org/texlive/trunk@34848 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipdfm-x/ChangeLog9
-rw-r--r--Build/source/texk/dvipdfm-x/pdffont.c2
-rw-r--r--Build/source/texk/dvipdfm-x/tt_cmap.c17
-rw-r--r--Build/source/texk/dvipdfm-x/type0.c9
-rw-r--r--Build/source/texk/dvipdfm-x/type0.h2
5 files changed, 20 insertions, 19 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog
index 06566108559..0b5cf6563f4 100644
--- a/Build/source/texk/dvipdfm-x/ChangeLog
+++ b/Build/source/texk/dvipdfm-x/ChangeLog
@@ -1,3 +1,12 @@
+2014-08-05 Jiang Jiang <gzjjgod@gmail.com>
+
+ * tt_cmap.c (otf_create_ToUnicode_stream, create_ToUnicode_cmap):
+ Only load CMAP_TYPE_CODE_TO_CID cmap to do reverse lookup when
+ constructing ToUnicode streams for PDF.
+
+ * type0.c, type0.h, pdffont.c: Remove redundant pdf_font_findfont()
+ function.
+
2014-08-05 Peter Breitenlohner <peb@mppmu.mpg.de>
* pst_obj.c, t1_char.c: ANSI C function protos and definitions,
diff --git a/Build/source/texk/dvipdfm-x/pdffont.c b/Build/source/texk/dvipdfm-x/pdffont.c
index f0189d74195..56a354a15db 100644
--- a/Build/source/texk/dvipdfm-x/pdffont.c
+++ b/Build/source/texk/dvipdfm-x/pdffont.c
@@ -656,7 +656,7 @@ pdf_font_findresource (const char *tex_name,
*/
int type0_id, found = 0;
- type0_id = pdf_font_findfont0(mrec->font_name, cmap_id, &mrec->opt);
+ type0_id = Type0Font_cache_find(mrec->font_name, cmap_id, &mrec->opt);
if (type0_id < 0) {
return -1;
}
diff --git a/Build/source/texk/dvipdfm-x/tt_cmap.c b/Build/source/texk/dvipdfm-x/tt_cmap.c
index 26b340f8f57..f288891a195 100644
--- a/Build/source/texk/dvipdfm-x/tt_cmap.c
+++ b/Build/source/texk/dvipdfm-x/tt_cmap.c
@@ -1087,7 +1087,7 @@ create_ToUnicode_cmap (tt_cmap *ttcmap,
CMap *cmap_add,
const char *used_glyphs,
sfnt *sfont,
- CMap *cmap_loaded)
+ CMap *code_to_cid_cmap)
{
pdf_obj *stream = NULL;
CMap *cmap;
@@ -1103,7 +1103,7 @@ create_ToUnicode_cmap (tt_cmap *ttcmap,
CMap_set_CIDSysInfo(cmap, &CSI_UNICODE);
CMap_add_codespacerange(cmap, srange_min, srange_max, 2);
- if (cmap_loaded && cffont && is_cidfont) {
+ if (code_to_cid_cmap && cffont && is_cidfont) {
for (i = 0; i < 8192; i++) {
int j;
long len;
@@ -1120,7 +1120,7 @@ create_ToUnicode_cmap (tt_cmap *ttcmap,
continue;
cid = cff_charsets_lookup_inverse(cffont, gid);
- ch = CMap_reverse_decode(cmap_loaded, cid);
+ ch = CMap_reverse_decode(code_to_cid_cmap, cid);
if (ch >= 0) {
unsigned char *p = wbuf + 2;
wbuf[0] = (cid >> 8) & 0xff;
@@ -1188,7 +1188,7 @@ otf_create_ToUnicode_stream (const char *font_name,
pdf_obj *cmap_ref = NULL;
long res_id;
pdf_obj *cmap_obj = NULL;
- CMap *cmap_add, *cmap_loaded;
+ CMap *cmap_add, *code_to_cid_cmap;
int cmap_add_id;
tt_cmap *ttcmap;
char *normalized_font_name;
@@ -1196,7 +1196,7 @@ otf_create_ToUnicode_stream (const char *font_name,
FILE *fp = NULL;
sfnt *sfont;
long offset = 0;
- int i;
+ int i, cmap_type;
/* replace slash in map name with dash to make the output cmap name valid,
* happens when XeTeX embeds full font path
@@ -1256,7 +1256,10 @@ otf_create_ToUnicode_stream (const char *font_name,
ERROR("Could not read OpenType/TrueType table directory.");
}
- cmap_loaded = CMap_cache_get(cmap_id);
+ code_to_cid_cmap = CMap_cache_get(cmap_id);
+ cmap_type = CMap_get_type(code_to_cid_cmap);
+ if (cmap_type != CMAP_TYPE_CODE_TO_CID)
+ code_to_cid_cmap = NULL;
cmap_add_id = CMap_cache_find(cmap_name);
if (cmap_add_id < 0) {
@@ -1273,7 +1276,7 @@ otf_create_ToUnicode_stream (const char *font_name,
if (ttcmap->format == 4 || ttcmap->format == 12) {
cmap_obj = create_ToUnicode_cmap(ttcmap, cmap_name, cmap_add, used_glyphs,
- sfont, cmap_loaded);
+ sfont, code_to_cid_cmap);
break;
}
}
diff --git a/Build/source/texk/dvipdfm-x/type0.c b/Build/source/texk/dvipdfm-x/type0.c
index 9015941f20c..060c9b9cfe8 100644
--- a/Build/source/texk/dvipdfm-x/type0.c
+++ b/Build/source/texk/dvipdfm-x/type0.c
@@ -591,15 +591,6 @@ Type0Font_cache_close (void)
__cache.capacity = 0;
}
-
-/************************************************************************/
-
-int
-pdf_font_findfont0 (const char *font_name, int cmap_id, fontmap_opt *fmap_opt)
-{
- return Type0Font_cache_find(font_name, cmap_id, fmap_opt);
-}
-
/******************************** COMPAT ********************************/
#ifndef WITHOUT_COMPAT
diff --git a/Build/source/texk/dvipdfm-x/type0.h b/Build/source/texk/dvipdfm-x/type0.h
index da75a2ee87b..c22d41e3da0 100644
--- a/Build/source/texk/dvipdfm-x/type0.h
+++ b/Build/source/texk/dvipdfm-x/type0.h
@@ -43,8 +43,6 @@ extern pdf_obj *Type0Font_get_resource (Type0Font *font);
extern void Type0Font_set_ToUnicode (Type0Font *font, pdf_obj *cmap_ref);
#include "fontmap.h"
-extern int pdf_font_findfont0 (const char *font_name,
- int cmap_id, fontmap_opt *fmap_opt);
/******************************** CACHE ********************************/