diff options
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfencoding.c | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 709472bedae..9fb69c5a280 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,9 @@ +2019-04-01 Shunsaku Hirata <shunsaku.hirata74@gmail.com> + + * pdfencoding.c: Fix a bug that dvipdfmx wrongly tries to + create ToUnicode CMap even when there is no valid mapping + entry. It just results in "Invalid CMap" warning. + 2019-03-30 Akira Kakuto <kakuto@w32tex.org> * spc_xtx.c: "ap->curptr" was copied to "buffer" without diff --git a/Build/source/texk/dvipdfm-x/pdfencoding.c b/Build/source/texk/dvipdfm-x/pdfencoding.c index 492e22ff976..0b7744f4cc9 100644 --- a/Build/source/texk/dvipdfm-x/pdfencoding.c +++ b/Build/source/texk/dvipdfm-x/pdfencoding.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2008-2018 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + Copyright (C) 2002-2019 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -643,12 +643,15 @@ pdf_create_ToUnicode_CMap (const char *enc_name, { pdf_obj *stream; CMap *cmap; - int code, total_fail; + int code, count, total_fail; char *cmap_name; unsigned char *p, *endptr; ASSERT(enc_name && enc_vec); + if (!is_used) + return NULL; + cmap_name = NEW(strlen(enc_name)+strlen("-UTF16")+1, char); sprintf(cmap_name, "%s-UTF16", enc_name); @@ -661,6 +664,7 @@ pdf_create_ToUnicode_CMap (const char *enc_name, CMap_add_codespacerange(cmap, range_min, range_max, 1); + count = 0; total_fail = 0; for (code = 0; code <= 0xff; code++) { if (is_used && !is_used[code]) @@ -677,6 +681,7 @@ pdf_create_ToUnicode_CMap (const char *enc_name, total_fail++; } else { CMap_add_bfchar(cmap, wbuf, 1, wbuf + 1, len); + count++; } } } @@ -685,7 +690,7 @@ pdf_create_ToUnicode_CMap (const char *enc_name, if (dpx_conf.verbose_level > 0) WARN("Glyphs with no Unicode mapping found. Removing ToUnicode CMap."); } - stream = total_fail > 0 ? NULL : CMap_create_stream(cmap); + stream = (count == 0 || total_fail > 0) ? NULL : CMap_create_stream(cmap); CMap_release(cmap); RELEASE(cmap_name); |