From 44b5a4aedb63fadf3e4980dba7c26d700297eba8 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Wed, 7 Oct 2020 21:01:34 +0000 Subject: Fix a problem introduced by the changes on 2020/10/03. (S. Hirata) git-svn-id: svn://tug.org/texlive/trunk@56586 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfm-x/ChangeLog | 11 ++++++ Build/source/texk/dvipdfm-x/configure | 22 ++++++------ Build/source/texk/dvipdfm-x/configure.ac | 2 +- Build/source/texk/dvipdfm-x/dvi.c | 32 +++++++++++++----- Build/source/texk/dvipdfm-x/spc_pdfm.c | 58 ++++++++++++++++++++------------ 5 files changed, 84 insertions(+), 41 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 16f25f21e65..1f50eb42466 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,14 @@ +2020-10-08 Shunsaku Hirata + + * dvi.c: Fix problems introduced by the changes on 2020/10/03. + Fix a possible problem of invalid access. Fix a problem that + non-BMP characters are not handled properly for the "unicode" + encoding. + * spc_pdfm.c: pdf:bcolor and pdf:scolor accept both fill and + stroke color specified at the same time. Change the behavior + when an indirect object is specified for pdf:pageresources. + * configure.ac: Version 20201008. + 2020-10-06 Akira Kakuto * spc_dvips.c: Add an option -dALLOWPSTRANSPARENCY in diff --git a/Build/source/texk/dvipdfm-x/configure b/Build/source/texk/dvipdfm-x/configure index 8948d0a6d48..db7f26a1d7b 100755 --- a/Build/source/texk/dvipdfm-x/configure +++ b/Build/source/texk/dvipdfm-x/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20201006. +# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20201008. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvipdfm-x (TeX Live)' PACKAGE_TARNAME='dvipdfm-x--tex-live-' -PACKAGE_VERSION='20201006' -PACKAGE_STRING='dvipdfm-x (TeX Live) 20201006' +PACKAGE_VERSION='20201008' +PACKAGE_STRING='dvipdfm-x (TeX Live) 20201008' PACKAGE_BUGREPORT='dvipdfmx@tug.org' PACKAGE_URL='' @@ -1350,7 +1350,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dvipdfm-x (TeX Live) 20201006 to adapt to many kinds of systems. +\`configure' configures dvipdfm-x (TeX Live) 20201008 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1421,7 +1421,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20201006:";; + short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20201008:";; esac cat <<\_ACEOF @@ -1551,7 +1551,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvipdfm-x (TeX Live) configure 20201006 +dvipdfm-x (TeX Live) configure 20201008 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2390,7 +2390,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dvipdfm-x (TeX Live) $as_me 20201006, which was +It was created by dvipdfm-x (TeX Live) $as_me 20201008, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8077,7 +8077,7 @@ fi # Define the identity of the package. PACKAGE='dvipdfm-x--tex-live-' - VERSION='20201006' + VERSION='20201008' cat >>confdefs.h <<_ACEOF @@ -14746,7 +14746,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -dvipdfm-x (TeX Live) config.lt 20201006 +dvipdfm-x (TeX Live) config.lt 20201008 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -16636,7 +16636,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dvipdfm-x (TeX Live) $as_me 20201006, which was +This file was extended by dvipdfm-x (TeX Live) $as_me 20201008, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16706,7 +16706,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dvipdfm-x (TeX Live) config.status 20201006 +dvipdfm-x (TeX Live) config.status 20201008 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/dvipdfm-x/configure.ac b/Build/source/texk/dvipdfm-x/configure.ac index 477306a9492..f75a75b1e0b 100644 --- a/Build/source/texk/dvipdfm-x/configure.ac +++ b/Build/source/texk/dvipdfm-x/configure.ac @@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -AC_INIT([dvipdfm-x (TeX Live)], [20201006], [dvipdfmx@tug.org]) +AC_INIT([dvipdfm-x (TeX Live)], [20201008], [dvipdfmx@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([agl.c]) AC_CONFIG_AUX_DIR([../../build-aux]) diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c index 2289e328070..2bd395757d4 100644 --- a/Build/source/texk/dvipdfm-x/dvi.c +++ b/Build/source/texk/dvipdfm-x/dvi.c @@ -168,6 +168,7 @@ static struct loaded_font float slant; float embolden; + int is_unicode; int minbytes; char padbytes[4]; } *loaded_fonts = NULL; @@ -1041,6 +1042,7 @@ dvi_locate_font (const char *tfm_name, spt_t ptsize) loaded_fonts[cur_id].padbytes[2] = (mrec->opt.mapc >> 8) & 0xff; } if (mrec->enc_name && !strcmp(mrec->enc_name, "unicode")) { + loaded_fonts[cur_id].is_unicode = 1; if (mrec->opt.mapc >= 0) { loaded_fonts[cur_id].padbytes[0] = (mrec->opt.mapc >> 24) & 0xff; loaded_fonts[cur_id].padbytes[1] = (mrec->opt.mapc >> 16) & 0xff; @@ -1050,6 +1052,10 @@ dvi_locate_font (const char *tfm_name, spt_t ptsize) loaded_fonts[cur_id].minbytes = pdf_dev_font_minbytes(font_id); loaded_fonts[cur_id].type = PHYSICAL; loaded_fonts[cur_id].font_id = font_id; + if (loaded_fonts[cur_id].minbytes > 4) { + WARN("Input encoding requries more than 4 bytes per char... (unsupported)"); + loaded_fonts[cur_id].minbytes = 4; + } if (dpx_conf.verbose_level > 0) MESG(">"); @@ -1106,6 +1112,10 @@ dvi_locate_native_font (const char *filename, uint32_t index, loaded_fonts[cur_id].size = ptsize; loaded_fonts[cur_id].type = NATIVE; loaded_fonts[cur_id].minbytes = pdf_dev_font_minbytes(loaded_fonts[cur_id].font_id); + if (loaded_fonts[cur_id].minbytes > 4) { + WARN("Input encoding requries more than 4 bytes per char... (unsupprted)"); + loaded_fonts[cur_id].minbytes = 4; + } RELEASE(fontmap_key); if (is_type1) { @@ -1314,7 +1324,7 @@ dvi_set (int32_t ch) struct loaded_font *font; spt_t width, height, depth; unsigned char wbuf[4]; - int cbytes = 1; + int n, cbytes; if (current_font < 0) { ERROR("No font selected!"); @@ -1340,12 +1350,11 @@ dvi_set (int32_t ch) dvi_right(width); /* Will actually move left */ memcpy(wbuf, font->padbytes, 4); - cbytes = font->minbytes; switch (font->type) { case PHYSICAL: if (ch > 65535) { /* FIXME: uptex specific undocumented */ - if (tfm_is_jfm(font->tfm_id)) { + if (!font->is_unicode && tfm_is_jfm(font->tfm_id)) { wbuf[0] = (UTF32toUTF16HS(ch) >> 8) & 0xff; wbuf[1] = UTF32toUTF16HS(ch) & 0xff; wbuf[2] = (UTF32toUTF16LS(ch) >> 8) & 0xff; @@ -1356,17 +1365,21 @@ dvi_set (int32_t ch) wbuf[2] = (ch >> 8) & 0xff; wbuf[3] = ch & 0xff; } - cbytes = 4; + n = 4; } else if (ch > 255) { wbuf[2] = (ch >> 8) & 0xff; wbuf[3] = ch & 0xff; + n = 2; } else if (font->subfont_id >= 0) { uint16_t uch = lookup_sfd_record(font->subfont_id, (unsigned char) ch); wbuf[2] = (uch >> 8) & 0xff; wbuf[3] = uch & 0xff; + n = 2; } else { wbuf[3] = (unsigned char) ch; + n = 1; } + cbytes = font->minbytes > n ? font->minbytes : n; set_string(dvi_state.h, -dvi_state.v, wbuf + 4 - cbytes, cbytes, width, font->font_id); if (dvi_is_tracking_boxes()) { pdf_rect rect; @@ -1401,7 +1414,7 @@ dvi_put (int32_t ch) struct loaded_font *font; spt_t width, height, depth; unsigned char wbuf[4]; - int cbytes = 1; + int n, cbytes; if (current_font < 0) { ERROR("No font selected!"); @@ -1410,7 +1423,6 @@ dvi_put (int32_t ch) font = &loaded_fonts[current_font]; memcpy(wbuf, font->padbytes, 4); - cbytes = font->minbytes; switch (font->type) { case PHYSICAL: width = tfm_get_fw_width(font->tfm_id, ch); @@ -1420,7 +1432,7 @@ dvi_put (int32_t ch) */ if (ch > 65535) { /* FIXME: uptex specific undocumented */ - if (tfm_is_jfm(font->tfm_id)) { + if (!font->is_unicode && tfm_is_jfm(font->tfm_id)) { wbuf[0] = (UTF32toUTF16HS(ch) >> 8) & 0xff; wbuf[1] = UTF32toUTF16HS(ch) & 0xff; wbuf[2] = (UTF32toUTF16LS(ch) >> 8) & 0xff; @@ -1431,17 +1443,21 @@ dvi_put (int32_t ch) wbuf[2] = (ch >> 8) & 0xff; wbuf[3] = ch & 0xff; } - cbytes = 4; + n = 4; } else if (ch > 255) { wbuf[2] = (ch >> 8) & 0xff; wbuf[3] = ch & 0xff; + n = 2; } else if (font->subfont_id >= 0) { uint16_t uch = lookup_sfd_record(font->subfont_id, (unsigned char) ch); wbuf[2] = (uch >> 8) & 0xff; wbuf[3] = uch & 0xff; + n = 2; } else { wbuf[3] = (unsigned char) ch; + n = 1; } + cbytes = font->minbytes > n ? font->minbytes : n; set_string(dvi_state.h, -dvi_state.v, wbuf + 4 - cbytes, cbytes, width, font->font_id); if (dvi_is_tracking_boxes()) { pdf_rect rect; diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index 50310b707e7..481943cce5f 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -272,7 +272,7 @@ int forallresourcecategory (pdf_obj *kp, pdf_obj *vp, void *dp) dict = pdf_deref_obj(dict); pdf_release_obj(dict); /* FIXME: jus to decrement link counter */ } -#if 1 +#if 0 /* This will leave garbage (object "res") since object "res" * supplied as resource dictionary will have label but we copy the * content of res here and never use reference to it. @@ -895,19 +895,27 @@ spc_handler_pdfm_bcolor (struct spc_env *spe, struct spc_arg *ap) pdf_color fc, sc; pdf_color *pfc, *psc; + skip_white(&ap->curptr, ap->endptr); + pdf_color_get_current(&psc, &pfc); - if (ap->curptr <= ap->endptr + strlen("fill") && - !memcmp(ap->curptr, "fill", strlen("fill"))) { - ap->curptr += strlen("fill"); - skip_white(&ap->curptr, ap->endptr); - error = spc_util_read_pdfcolor(spe, &fc, ap, pfc); + if (ap->curptr < ap->endptr && + (ap->curptr[0] == 'f' || ap->curptr[0] == 's')) { pdf_color_copycolor(&sc, psc); - } else if (ap->curptr <= ap->endptr + strlen("stroke") && - !memcmp(ap->curptr, "stroke", strlen("stroke"))) { - ap->curptr += strlen("stroke"); - skip_white(&ap->curptr, ap->endptr); - error = spc_util_read_pdfcolor(spe, &sc, ap, psc); pdf_color_copycolor(&fc, pfc); + while (!error && ap->curptr < ap->endptr) { + if (ap->curptr <= ap->endptr + strlen("fill") && + !memcmp(ap->curptr, "fill", strlen("fill"))) { + ap->curptr += strlen("fill"); + skip_white(&ap->curptr, ap->endptr); + error = spc_util_read_pdfcolor(spe, &fc, ap, pfc); + } else if (ap->curptr <= ap->endptr + strlen("stroke") && + !memcmp(ap->curptr, "stroke", strlen("stroke"))) { + ap->curptr += strlen("stroke"); + skip_white(&ap->curptr, ap->endptr); + error = spc_util_read_pdfcolor(spe, &sc, ap, psc); + } + skip_white(&ap->curptr, ap->endptr); + } } else { error = spc_util_read_pdfcolor(spe, &fc, ap, pfc); if (!error) { @@ -940,19 +948,27 @@ spc_handler_pdfm_scolor (struct spc_env *spe, struct spc_arg *ap) pdf_color fc, sc; pdf_color *pfc, *psc; + skip_white(&ap->curptr, ap->endptr); + pdf_color_get_current(&psc, &pfc); - if (ap->curptr <= ap->endptr + strlen("fill") && - !memcmp(ap->curptr, "fill", strlen("fill"))) { - ap->curptr += strlen("fill"); - skip_white(&ap->curptr, ap->endptr); - error = spc_util_read_pdfcolor(spe, &fc, ap, pfc); + if (ap->curptr < ap->endptr && + (ap->curptr[0] == 'f' || ap->curptr[0] == 's')) { pdf_color_copycolor(&sc, psc); - } else if (ap->curptr <= ap->endptr + strlen("stroke") && - !memcmp(ap->curptr, "stroke", strlen("stroke"))) { - ap->curptr += strlen("stroke"); - skip_white(&ap->curptr, ap->endptr); - error = spc_util_read_pdfcolor(spe, &sc, ap, psc); pdf_color_copycolor(&fc, pfc); + while (!error && ap->curptr < ap->endptr) { + if (ap->curptr <= ap->endptr + strlen("fill") && + !memcmp(ap->curptr, "fill", strlen("fill"))) { + ap->curptr += strlen("fill"); + skip_white(&ap->curptr, ap->endptr); + error = spc_util_read_pdfcolor(spe, &fc, ap, pfc); + } else if (ap->curptr <= ap->endptr + strlen("stroke") && + !memcmp(ap->curptr, "stroke", strlen("stroke"))) { + ap->curptr += strlen("stroke"); + skip_white(&ap->curptr, ap->endptr); + error = spc_util_read_pdfcolor(spe, &sc, ap, psc); + } + skip_white(&ap->curptr, ap->endptr); + } } else { error = spc_util_read_pdfcolor(spe, &fc, ap, pfc); if (!error) { -- cgit v1.2.3