diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-02-17 08:41:35 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-02-17 08:41:35 +0000 |
commit | 77cea4c016ed732551b4b94fc5c452180a894123 (patch) | |
tree | 73c4ebafd79c155c763829277f5255212c36f6d1 | |
parent | 9c6def6021823454892b24da379284c7487992d9 (diff) |
dvipdfm-x version 20180217: Accept PDF version tag 2.0. (S. Hirata)
git-svn-id: svn://tug.org/texlive/trunk@46658 c570f23f-e606-0410-a88d-b1316a301751
26 files changed, 208 insertions, 150 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index ebd6258ceac..fe41a4ed77d 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,14 @@ +2018-02-17 Shunsaku Hirata <shunsaku.hirata74@gmail.com> + + * cid.c, dpxfile.[ch], dvipdfmx.c, epdf.c, jp2image.c, + jpegimage.c, pdfcolor.c, pdfencoding.c, pdfencrypt.c, + pdflimits.h, pdfobj.[ch], pdfximage.c, pngimage.c, + spc_dvips.c, spc_pdfm.c, spc_tpic.c, type0.c, xbb.c: + Accept PDF version tag 2.0. + * numbers.[ch], tfm.c: Remove format specific number + representation from numbers.[ch]. + * configure.ac: Version 20180217. + 2018-01-27 Hironobu Yamashita <h.y.acetaminophen@gmail.com> * tfm.c, number.[ch]: Support new JFM spec (3-byte characters diff --git a/Build/source/texk/dvipdfm-x/cid.c b/Build/source/texk/dvipdfm-x/cid.c index ad8c8bbfedb..5e11cc7262e 100644 --- a/Build/source/texk/dvipdfm-x/cid.c +++ b/Build/source/texk/dvipdfm-x/cid.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. This program is free software; you can redistribute it and/or modify @@ -62,15 +62,22 @@ static struct { /* Heighest Supplement values supported by PDF-1.0, 1.1, ...; see * also http://partners.adobe.com/public/developer/font/index.html#ckf */ - int supplement[16]; + int supplement[21]; } CIDFont_stdcc_def[] = { - {"Adobe", "UCS", {-1, -1, 0, 0, 0, 0, 0, 0}}, - {"Adobe", "GB1", {-1, -1, 0, 2, 4, 4, 4, 4}}, - {"Adobe", "CNS1", {-1, -1, 0, 0, 3, 4, 4, 4}}, - {"Adobe", "Japan1", {-1, -1, 2, 2, 4, 5, 6, 6}}, - {"Adobe", "Korea1", {-1, -1, 1, 1, 2, 2, 2, 2}}, - {"Adobe", "Identity", {-1, -1, 0, 0, 0, 0, 0, 0}}, - {NULL, NULL, { 0, 0, 0, 0, 0, 0, 0, 0}} + {"Adobe", "UCS", {-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}}, + {"Adobe", "GB1", {-1, -1, 0, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4}}, + {"Adobe", "CNS1", {-1, -1, 0, 0, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4}}, + {"Adobe", "Japan1", {-1, -1, 2, 2, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6}}, + {"Adobe", "Korea1", {-1, -1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2}}, + {"Adobe", "Identity", {-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}}, + {NULL, NULL, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0}} }; #define UCS_CC 0 #define ACC_START 1 @@ -711,10 +718,10 @@ static CIDSysInfo * get_cidsysinfo (const char *map_name, fontmap_opt *fmap_opt) { CIDSysInfo *csi = NULL; - int pdf_ver; + int sup_idx; int i, csi_idx = -1, n, m; - pdf_ver = pdf_get_version(); + sup_idx = pdf_get_version() - 10; if (!fmap_opt || !fmap_opt->charcoll) return NULL; @@ -733,7 +740,7 @@ get_cidsysinfo (const char *map_name, fontmap_opt *fmap_opt) if (strlen(fmap_opt->charcoll) > n) { csi->supplement = (int) strtoul(&(fmap_opt->charcoll[n]), NULL, 10); } else { /* Use heighest supported value for current output PDF version. */ - csi->supplement = CIDFont_stdcc_def[csi_idx].supplement[pdf_ver]; + csi->supplement = CIDFont_stdcc_def[csi_idx].supplement[sup_idx]; } break; } @@ -785,11 +792,12 @@ get_cidsysinfo (const char *map_name, fontmap_opt *fmap_opt) } if (csi && csi_idx >= 0) { - if (csi->supplement > CIDFont_stdcc_def[csi_idx].supplement[pdf_ver] + if (csi->supplement > CIDFont_stdcc_def[csi_idx].supplement[sup_idx] && (fmap_opt->flags & FONTMAP_OPT_NOEMBED)) { - WARN("%s: Heighest supplement number supported in PDF-1.%d for %s-%s is %d.", - CIDFONT_DEBUG_STR, pdf_ver, csi->registry, csi->ordering, - CIDFont_stdcc_def[csi_idx].supplement[pdf_ver]); + WARN("%s: Heighest supplement number supported in PDF-%d.%d for %s-%s is %d.", + CIDFONT_DEBUG_STR, pdf_get_version_major(), pdf_get_version_minor(), + csi->registry, csi->ordering, + CIDFont_stdcc_def[csi_idx].supplement[sup_idx]); WARN("%s: Some character may not shown without embedded font (--> %s).", CIDFONT_DEBUG_STR, map_name); } diff --git a/Build/source/texk/dvipdfm-x/configure b/Build/source/texk/dvipdfm-x/configure index 543bc34d7c0..157cbb3bb30 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) 20170918. +# Generated by GNU Autoconf 2.69 for dvipdfm-x (TeX Live) 20180217. # # Report bugs to <tex-k@tug.org>. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvipdfm-x (TeX Live)' PACKAGE_TARNAME='dvipdfm-x--tex-live-' -PACKAGE_VERSION='20170918' -PACKAGE_STRING='dvipdfm-x (TeX Live) 20170918' +PACKAGE_VERSION='20180217' +PACKAGE_STRING='dvipdfm-x (TeX Live) 20180217' PACKAGE_BUGREPORT='tex-k@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) 20170918 to adapt to many kinds of systems. +\`configure' configures dvipdfm-x (TeX Live) 20180217 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) 20170918:";; + short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20180217:";; 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 20170918 +dvipdfm-x (TeX Live) configure 20180217 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 20170918, which was +It was created by dvipdfm-x (TeX Live) $as_me 20180217, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8075,7 +8075,7 @@ fi # Define the identity of the package. PACKAGE='dvipdfm-x--tex-live-' - VERSION='20170918' + VERSION='20180217' cat >>confdefs.h <<_ACEOF @@ -14744,7 +14744,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -dvipdfm-x (TeX Live) config.lt 20170918 +dvipdfm-x (TeX Live) config.lt 20180217 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -16624,7 +16624,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 20170918, which was +This file was extended by dvipdfm-x (TeX Live) $as_me 20180217, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16694,7 +16694,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 20170918 +dvipdfm-x (TeX Live) config.status 20180217 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 3871bc589ea..1e23a4f1c02 100644 --- a/Build/source/texk/dvipdfm-x/configure.ac +++ b/Build/source/texk/dvipdfm-x/configure.ac @@ -7,7 +7,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)], [20170918], [tex-k@tug.org]) +AC_INIT([dvipdfm-x (TeX Live)], [20180217], [tex-k@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/dpxfile.c b/Build/source/texk/dvipdfm-x/dpxfile.c index 34530269c3a..3a3860412f9 100644 --- a/Build/source/texk/dvipdfm-x/dpxfile.c +++ b/Build/source/texk/dvipdfm-x/dpxfile.c @@ -1,5 +1,5 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2007-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -1016,8 +1016,7 @@ dpx_delete_temp_file (char *tmp, int force) */ int dpx_file_apply_filter (const char *cmdtmpl, - const char *input, const char *output, - unsigned char version) + const char *input, const char *output, int version) { char *cmd = NULL; const char *p, *q; @@ -1061,7 +1060,7 @@ if ((l) + (n) >= (m)) { \ break; case 'v': /* Version number, e.g. 1.4 */ { char buf[6]; - sprintf(buf, "1.%hu", (unsigned short) version); + sprintf(buf, "%d.%d", version/10, version%10); need(cmd, n, size, strlen(buf)); strcpy(cmd + n, buf); n += strlen(buf); break; diff --git a/Build/source/texk/dvipdfm-x/dpxfile.h b/Build/source/texk/dvipdfm-x/dpxfile.h index 5f980e8cf68..835e4182975 100644 --- a/Build/source/texk/dvipdfm-x/dpxfile.h +++ b/Build/source/texk/dvipdfm-x/dpxfile.h @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -60,7 +60,7 @@ extern void dpx_file_set_verbose (void); extern int dpx_file_apply_filter (const char *cmdtmpl, const char *input, const char *output, - unsigned char version); + int version); extern char *dpx_create_temp_file (void); extern char *dpx_create_fix_temp_file (const char *filename); extern void dpx_delete_old_cache (int life); diff --git a/Build/source/texk/dvipdfm-x/dvipdfmx.c b/Build/source/texk/dvipdfm-x/dvipdfmx.c index f262951deac..7bf7c9d3db1 100644 --- a/Build/source/texk/dvipdfm-x/dvipdfmx.c +++ b/Build/source/texk/dvipdfm-x/dvipdfmx.c @@ -2,7 +2,7 @@ DVIPDFMx, an eXtended version of DVIPDFM by Mark A. Wicks. - Copyright (C) 2002-2017 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the DVIPDFMx project team. Copyright (c) 2006 SIL. (xdvipdfmx extensions for XeTeX support) @@ -164,8 +164,8 @@ show_version (void) if (*my_name == 'x') printf ("an extended version of DVIPDFMx, which in turn was\n"); printf ("an extended version of dvipdfm-0.13.2c developed by Mark A. Wicks.\n"); - printf ("\nCopyright (C) 2002-2017 the DVIPDFMx project team\n"); - printf ("Copyright (C) 2006-2017 SIL International.\n"); + printf ("\nCopyright (C) 2002-2018 the DVIPDFMx project team\n"); + printf ("Copyright (C) 2006-2018 SIL International.\n"); printf ("\nThis is free software; you can redistribute it and/or modify\n"); printf ("it under the terms of the GNU General Public License as published by\n"); printf ("the Free Software Foundation; either version 2 of the License, or\n"); @@ -227,7 +227,8 @@ show_usage (void) printf (" -O number\tSet maximum depth of open bookmark items [0]\n"); printf (" -P number\tSet permission flags for PDF encryption [0x003C]\n"); printf (" -S \t\tEnable PDF encryption\n"); - printf (" -V number\tSet PDF minor version [%d]\n", PDF_VERSION_DEFAULT); + printf (" -V number\tSet PDF version [%d.%d]\n", + PDF_VERSION_DEFAULT/10,PDF_VERSION_DEFAULT%10); printf ("\nAll dimensions entered on the command line are \"true\" TeX dimensions.\n"); printf ("Argument of \"-s\" lists physical page ranges separated by commas,\n"); printf ("\te.g., \"-s 1-3,5-6\".\n"); @@ -584,17 +585,29 @@ do_args (int argc, char *argv[], const char *source, int unsafe) case 'V': { - int ver_minor = atoi(optarg); - if (ver_minor < PDF_VERSION_MIN) { - WARN("PDF version 1.%d not supported. Using PDF 1.%d instead.", - ver_minor, PDF_VERSION_MIN); + int version, ver_major, ver_minor; + + if (strchr(optarg, '.')) { /* new format X.X */ + double tmp = atof(optarg); + ver_major = (int) tmp; + ver_minor = (int) (10 * (tmp - ver_major) + 0.5); + } else { + ver_major = 1; + ver_minor = atoi(optarg); + } + version = ver_major * 10 + ver_minor; + if (version < PDF_VERSION_MIN) { + WARN("PDF version %d.%d not supported. Using PDF %d.%d instead.", + ver_major, ver_minor, PDF_VERSION_MIN/10, PDF_VERSION_MIN%10); ver_minor = PDF_VERSION_MIN; - } else if (ver_minor > PDF_VERSION_MAX) { - WARN("PDF version 1.%d not supported. Using PDF 1.%d instead.", - ver_minor, PDF_VERSION_MAX); + version = ver_major * 10 + ver_minor; + } else if (version > PDF_VERSION_MAX) { + WARN("PDF version %d.%d not supported. Using PDF %d.%d instead.", + ver_major, ver_minor, PDF_VERSION_MAX/10, PDF_VERSION_MAX%10); ver_minor = PDF_VERSION_MAX; + version = ver_major * 10 + ver_minor; } - pdf_set_version((unsigned) ver_minor); + pdf_set_version(version); break; } @@ -1060,7 +1073,7 @@ main (int argc, char *argv[]) pdf_enc_compute_id_string(dvi_filename, pdf_filename); if (do_encryption) { - if (key_bits > 40 && pdf_get_version() < 4) + if (key_bits > 40 && pdf_check_version(1, 4) < 0) ERROR("Chosen key length requires at least PDF 1.4. " "Use \"-V 4\" to change."); pdf_enc_set_passwd(key_bits, permission, NULL, NULL); @@ -1071,7 +1084,7 @@ main (int argc, char *argv[]) y_offset = 0.0; dvi2pts = 0.01; /* dvi2pts controls accuracy. */ } else { - int ver_major = 0, ver_minor = 0; + int version, ver_major = 1, ver_minor = 0; char owner_pw[MAX_PWD_LEN], user_pw[MAX_PWD_LEN]; /* Dependency between DVI and PDF side is rather complicated... */ dvi2pts = dvi_init(dvi_filename, mag); @@ -1090,8 +1103,9 @@ main (int argc, char *argv[]) /* FIXME: pdf_set_version() should come before ecrcyption setting. * It's too late to set here... */ - if (ver_minor >= PDF_VERSION_MIN && ver_minor <= PDF_VERSION_MAX) { - pdf_set_version(ver_minor); + version = ver_major * 10 + ver_minor; + if (version >= PDF_VERSION_MIN && version <= PDF_VERSION_MAX) { + pdf_set_version(version); } } else { dvi_scan_specials(0, @@ -1099,14 +1113,15 @@ main (int argc, char *argv[]) &x_offset, &y_offset, &landscape_mode, &ver_major, &ver_minor, &do_encryption, &key_bits, &permission, owner_pw, user_pw); - if (ver_minor >= PDF_VERSION_MIN && ver_minor <= PDF_VERSION_MAX) { - pdf_set_version(ver_minor); + version = ver_major * 10 + ver_minor; + if (version >= PDF_VERSION_MIN && version <= PDF_VERSION_MAX) { + pdf_set_version(version); } if (do_encryption) { if (!(key_bits >= 40 && key_bits <= 128 && (key_bits % 8 == 0)) && key_bits != 256) ERROR("Invalid encryption key length specified: %u", key_bits); - else if (key_bits > 40 && pdf_get_version() < 4) + else if (key_bits > 40 && pdf_check_version(1, 4) < 0) ERROR("Chosen key length requires at least PDF 1.4. " \ "Use \"-V 4\" to change."); do_encryption = 1; diff --git a/Build/source/texk/dvipdfm-x/epdf.c b/Build/source/texk/dvipdfm-x/epdf.c index 3f7258abdfb..00af7a252a9 100644 --- a/Build/source/texk/dvipdfm-x/epdf.c +++ b/Build/source/texk/dvipdfm-x/epdf.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2017 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2007-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -402,9 +402,10 @@ pdf_include_page (pdf_ximage *ximage, if (!pf) return -1; - if (pdf_file_get_version(pf) > pdf_get_version()) { + if (pdf_file_check_version(pf, pdf_get_version()) < 0) { WARN("Trying to include PDF file which has newer version number " \ - "than output PDF: 1.%d.", pdf_get_version()); + "than output PDF: %d.%d.", + pdf_get_version_major(), pdf_get_version_minor()); } pdf_ximage_init_form_info(&info); diff --git a/Build/source/texk/dvipdfm-x/jp2image.c b/Build/source/texk/dvipdfm-x/jp2image.c index 251db18cdbe..40435ba607f 100644 --- a/Build/source/texk/dvipdfm-x/jp2image.c +++ b/Build/source/texk/dvipdfm-x/jp2image.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Matthias Franz, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Matthias Franz, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -362,14 +362,12 @@ check_for_jp2 (FILE *fp) int jp2_include_image (pdf_ximage *ximage, FILE *fp) { - unsigned pdf_version; int smask = 0; pdf_obj *stream, *stream_dict; ximage_info info; - pdf_version = pdf_get_version(); - if (pdf_version < 5) { - WARN("JPEG 2000 support requires PDF version >= 1.5 (Current setting 1.%d)\n", pdf_version); + if (pdf_check_version(1, 5) < 0) { + WARN("JPEG 2000 support requires PDF version >= 1.5 (Current setting %d.%d)\n", pdf_get_version_major(), pdf_get_version_minor()); return -1; } diff --git a/Build/source/texk/dvipdfm-x/jpegimage.c b/Build/source/texk/dvipdfm-x/jpegimage.c index f9bfb2bca91..31ab76f03a4 100644 --- a/Build/source/texk/dvipdfm-x/jpegimage.c +++ b/Build/source/texk/dvipdfm-x/jpegimage.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2017 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -273,7 +273,7 @@ jpeg_include_image (pdf_ximage *ximage, FILE *fp) pdf_add_dict(stream_dict, pdf_new_name("Filter"), pdf_new_name("DCTDecode")); /* XMP Metadata */ - if (pdf_get_version() >= 4) { + if (pdf_check_version(1, 4) >= 0) { if (j_info.flags & HAVE_APPn_XMP) { pdf_obj *XMP_stream; diff --git a/Build/source/texk/dvipdfm-x/numbers.c b/Build/source/texk/dvipdfm-x/numbers.c index dd616c66ebc..fcad7f7536c 100644 --- a/Build/source/texk/dvipdfm-x/numbers.c +++ b/Build/source/texk/dvipdfm-x/numbers.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -84,16 +84,6 @@ unsigned int get_unsigned_triple(FILE *file) return triple; } -#ifndef WITHOUT_ASCII_PTEX -unsigned int get_unsigned_triple_kanji(FILE *file) -{ - unsigned int triple = get_unsigned_byte(file); - triple = (triple << 8) | get_unsigned_byte(file); - triple = triple | (get_unsigned_byte(file)<<16); - return triple; -} -#endif - signed int get_signed_triple(FILE *file) { int i; @@ -179,4 +169,3 @@ int32_t sqxfw (int32_t sq, fixword fw) result += j << 28; return (sign > 0) ? result : -result; } - diff --git a/Build/source/texk/dvipdfm-x/numbers.h b/Build/source/texk/dvipdfm-x/numbers.h index 7e9e290fdd3..c274336e93c 100644 --- a/Build/source/texk/dvipdfm-x/numbers.h +++ b/Build/source/texk/dvipdfm-x/numbers.h @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -59,9 +59,6 @@ extern unsigned short get_unsigned_pair (FILE *); extern unsigned short sget_unsigned_pair (unsigned char *); extern signed short get_signed_pair (FILE *); extern unsigned int get_unsigned_triple (FILE *); -#ifndef WITHOUT_ASCII_PTEX -extern unsigned int get_unsigned_triple_kanji (FILE *); -#endif extern signed int get_signed_triple (FILE *); extern int32_t get_signed_quad (FILE *); extern uint32_t get_unsigned_quad (FILE *); diff --git a/Build/source/texk/dvipdfm-x/pdfcolor.c b/Build/source/texk/dvipdfm-x/pdfcolor.c index d1adc6f00fb..b5c67f3999a 100644 --- a/Build/source/texk/dvipdfm-x/pdfcolor.c +++ b/Build/source/texk/dvipdfm-x/pdfcolor.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -596,19 +596,22 @@ static struct {0x04, 0x00}, /* PDF-1.5 */ {0x04, 0x00}, /* PDF-1.6 */ {0x04, 0x20}, /* PDF-1.7 */ + {0x04, 0x20}, /* Dummy(1.8)*/ + {0x04, 0x20}, /* Dummy(1.9) */ + {0x04, 0x20} /* PDF-2.0 */ }; static int iccp_version_supported (int major, int minor) { - int pdf_ver; + int idx; - pdf_ver = pdf_get_version(); - if (pdf_ver < 8) { - if (icc_versions[pdf_ver].major < major) + idx = pdf_get_version() - 10; + if (idx < 11) { + if (icc_versions[idx].major < major) return 0; - else if (icc_versions[pdf_ver].major == major && - icc_versions[pdf_ver].minor < minor) + else if (icc_versions[idx].major == major && + icc_versions[idx].minor < minor) return 0; else { return 1; diff --git a/Build/source/texk/dvipdfm-x/pdfencoding.c b/Build/source/texk/dvipdfm-x/pdfencoding.c index ca8b4c6feff..1d2a5812f90 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-2016 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + Copyright (C) 2008-2018 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -470,7 +470,7 @@ void pdf_encoding_complete (void) * we do use a base encodings for PDF versions >= 1.3. */ int with_base = !(encoding->flags & FLAG_USED_BY_TYPE3) - || pdf_get_version() >= 4; + || pdf_check_version(1, 4) >= 0; ASSERT(!encoding->resource); encoding->resource = create_encoding_resource(encoding, with_base ? encoding->baseenc : NULL); @@ -676,7 +676,7 @@ pdf_create_ToUnicode_CMap (const char *enc_name, /* Adobe glyph naming conventions are not used by viewers, * hence even ligatures (e.g, "f_i") must be explicitly defined */ - if (pdf_get_version() < 5 || !agln || !agln->is_predef) { + if (pdf_check_version(1, 5) < 0 || !agln || !agln->is_predef) { wbuf[0] = (code & 0xff); p = wbuf + 1; endptr = wbuf + WBUF_SIZE; diff --git a/Build/source/texk/dvipdfm-x/pdfencrypt.c b/Build/source/texk/dvipdfm-x/pdfencrypt.c index c29543f7e25..d5cb1cf046e 100644 --- a/Build/source/texk/dvipdfm-x/pdfencrypt.c +++ b/Build/source/texk/dvipdfm-x/pdfencrypt.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. This program is free software; you can redistribute it and/or modify @@ -463,14 +463,14 @@ getpass (const char *prompt) static void check_version (struct pdf_sec *p, int version) { - if (p->V > 2 && version < 4) { + if (p->V > 2 && version < 14) { WARN("Current encryption setting requires PDF version >= 1.4."); p->V = 1; p->key_size = 5; - } else if (p->V == 4 && version < 5) { + } else if (p->V == 4 && version < 15) { WARN("Current encryption setting requires PDF version >= 1.5."); p->V = 2; - } else if (p->V ==5 && version < 7) { + } else if (p->V ==5 && version < 17) { WARN("Current encryption setting requires PDF version >= 1.7" \ " (plus Adobe Extension Level 3)."); p->V = 4; diff --git a/Build/source/texk/dvipdfm-x/pdflimits.h b/Build/source/texk/dvipdfm-x/pdflimits.h index 18894aa7b16..693c1c80c8a 100644 --- a/Build/source/texk/dvipdfm-x/pdflimits.h +++ b/Build/source/texk/dvipdfm-x/pdflimits.h @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -28,9 +28,9 @@ * NOTE: Don't forget to update CIDFont_stdcc_def[] in cid.c * if you increase PDF_VERSION_MAX! */ -#define PDF_VERSION_MIN 3 -#define PDF_VERSION_MAX 7 -#define PDF_VERSION_DEFAULT 5 +#define PDF_VERSION_MIN 13 +#define PDF_VERSION_MAX 20 +#define PDF_VERSION_DEFAULT 15 /* * PDF_NAME_LEN_MAX: see, Appendix C of PDF Ref. v1.3, 2nd. ed. diff --git a/Build/source/texk/dvipdfm-x/pdfobj.c b/Build/source/texk/dvipdfm-x/pdfobj.c index 2076a83f8ed..70d25a13a4e 100644 --- a/Build/source/texk/dvipdfm-x/pdfobj.c +++ b/Build/source/texk/dvipdfm-x/pdfobj.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2007-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -271,10 +271,10 @@ pdf_set_use_predictor (int bval) compression_use_predictor = bval ? 1 : 0; } -static unsigned pdf_version = PDF_VERSION_DEFAULT; +static int pdf_version = PDF_VERSION_DEFAULT; void -pdf_set_version (unsigned version) +pdf_set_version (int version) { /* Don't forget to update CIDFont_stdcc_def[] in cid.c too! */ if (version >= PDF_VERSION_MIN && version <= PDF_VERSION_MAX) { @@ -282,13 +282,31 @@ pdf_set_version (unsigned version) } } -unsigned +int pdf_get_version (void) { return pdf_version; } int +pdf_get_version_major (void) +{ + return pdf_version/10; +} + +int +pdf_get_version_minor (void) +{ + return pdf_version%10; +} + +int +pdf_check_version (int major, int minor) +{ + return (pdf_version >= major*10+minor) ? 0 : -1; +} + +int pdf_obj_get_verbose(void) { return verbose; @@ -329,7 +347,7 @@ pdf_out_init (const char *filename, int do_encryption, int enable_objstm) add_xref_entry(0, 0, 0, 0xffff); next_label = 1; - if (pdf_version >= 5) { + if (pdf_version >= 15) { if (enable_objstm) { xref_stream = pdf_new_stream(STREAM_COMPRESS); xref_stream->flags |= OBJ_NO_ENCRYPT; @@ -362,8 +380,11 @@ pdf_out_init (const char *filename, int do_encryption, int enable_objstm) ERROR("Unable to open file."); } } - pdf_out(pdf_output_file, "%PDF-1.", strlen("%PDF-1.")); - v = '0' + pdf_version; + pdf_out(pdf_output_file, "%PDF-", strlen("%PDF-")); + v = '0' + (pdf_version / 10); + pdf_out(pdf_output_file, &v, 1); + pdf_out(pdf_output_file, ".", 1); + v = '0' + (pdf_version % 10); pdf_out(pdf_output_file, &v, 1); pdf_out(pdf_output_file, "\n", 1); pdf_out(pdf_output_file, BINARY_MARKER, strlen(BINARY_MARKER)); @@ -510,7 +531,7 @@ pdf_out_flush (void) if (verbose) { if (compression_level > 0) { MESG("Compression saved %ld bytes%s\n", compression_saved, - pdf_version < 5 ? ". Try \"-V 5\" for better compression" : ""); + pdf_version < 15 ? ". Try \"-V 1.5\" for better compression" : ""); } } #if !defined(LIBDPX) @@ -3724,6 +3745,13 @@ pdf_file_get_version (pdf_file *pf) return pf->version; } +int +pdf_file_check_version (pdf_file *pf, int version) +{ + ASSERT(pf); + return (pf->version >= version ? 0 : -1); +} + pdf_obj * pdf_file_get_trailer (pdf_file *pf) { @@ -3754,13 +3782,12 @@ pdf_open (const char *ident, FILE *file) pdf_obj *new_version; int version = check_for_pdf_version(file); - if (version < 1 || version > pdf_version) { - WARN("pdf_open: Not a PDF 1.[1-%u] file.", pdf_version); -/* - Try to embed the PDF image, even if the PDF version is newer than - the setting. - return NULL; -*/ + if (version < 10) + WARN("Unrecognized PDF version specified for input PDF file: %d.%d", + pdf_version/10, pdf_version%10); + else if (version > pdf_version) { + WARN("Trying to inlucde PDF file with version newer than current " \ + "output PDF setting: %d.%d", version/10, version%10); } pf = pdf_file_new(file); @@ -3782,17 +3809,17 @@ pdf_open (const char *ident, FILE *file) new_version = pdf_deref_obj(pdf_lookup_dict(pf->catalog, "Version")); if (new_version) { - unsigned int minor; + unsigned int major, minor; if (!PDF_OBJ_NAMETYPE(new_version) || - sscanf(pdf_name_value(new_version), "1.%u", &minor) != 1) { + sscanf(pdf_name_value(new_version), "%u.%u", &major, &minor) != 2) { pdf_release_obj(new_version); WARN("Illegal Version entry in document catalog. Broken PDF file?"); goto error; } - if (pf->version < minor) - pf->version = minor; + if (pf->version < major*10+minor) + pf->version = major*10+minor; pdf_release_obj(new_version); } @@ -3826,12 +3853,12 @@ pdf_files_close (void) static int check_for_pdf_version (FILE *file) { - unsigned int minor; + unsigned int major, minor; rewind(file); return (ungetc(fgetc(file), file) == '%' && - fscanf(file, "%%PDF-1.%u", &minor) == 1) ? minor : -1; + fscanf(file, "%%PDF-%u.%u", &major, &minor) == 2) ? (major*10+minor) : -1; } int @@ -3845,8 +3872,8 @@ check_for_pdf (FILE *file) if (version <= pdf_version) return 1; - WARN("Version of PDF file (1.%d) is newer than version limit specification.", - version); + WARN("Version of PDF file (%d.%d) is newer than version limit specification.", + version/10, version%10); return 1; } diff --git a/Build/source/texk/dvipdfm-x/pdfobj.h b/Build/source/texk/dvipdfm-x/pdfobj.h index ab365f3ad64..8012e38bdf2 100644 --- a/Build/source/texk/dvipdfm-x/pdfobj.h +++ b/Build/source/texk/dvipdfm-x/pdfobj.h @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2007-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -59,8 +59,10 @@ extern void pdf_error_cleanup (void); extern void pdf_out_init (const char *filename, int enable_encrypt, int enable_objstm); extern void pdf_out_flush (void); -extern void pdf_set_version (unsigned version); -extern unsigned pdf_get_version (void); +extern void pdf_set_version (int version); +extern int pdf_get_version (void); +extern int pdf_get_version_major (void); +extern int pdf_get_version_minor (void); extern void pdf_release_obj (pdf_obj *object); extern int pdf_obj_typeof (pdf_obj *object); @@ -188,8 +190,9 @@ extern int check_for_pdf (FILE *file); extern pdf_file *pdf_open (const char *ident, FILE *file); extern void pdf_close (pdf_file *pf); extern pdf_obj *pdf_file_get_trailer (pdf_file *pf); -extern int pdf_file_get_version (pdf_file *pf); extern pdf_obj *pdf_file_get_catalog (pdf_file *pf); +extern int pdf_file_get_version (pdf_file *pf); +extern int pdf_file_check_version (pdf_file *pf, int version); extern pdf_obj *pdf_deref_obj (pdf_obj *object); extern pdf_obj *pdf_import_object (pdf_obj *object); @@ -201,4 +204,6 @@ extern pdf_obj *pdf_new_indirect (pdf_file *pf, unsigned label, unsigned short extern time_t get_unique_time_if_given(void); #define INVALID_EPOCH_VALUE ((time_t)-1) +extern int pdf_check_version (int major, int minor); + #endif /* _PDFOBJ_H_ */ diff --git a/Build/source/texk/dvipdfm-x/pdfximage.c b/Build/source/texk/dvipdfm-x/pdfximage.c index 1da7f86abd6..0ca723aa2d0 100644 --- a/Build/source/texk/dvipdfm-x/pdfximage.c +++ b/Build/source/texk/dvipdfm-x/pdfximage.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2017 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2007-2019 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -961,7 +961,7 @@ ps_include_page (pdf_ximage *ximage, const char *filename, load_options options) MESG("pdf_image>> ..."); } error = dpx_file_apply_filter(distiller_template, filename, temp, - (unsigned char) pdf_get_version()); + pdf_get_version()); if (error) { WARN("Image format conversion for \"%s\" failed...", filename); dpx_delete_temp_file(temp, true); diff --git a/Build/source/texk/dvipdfm-x/pngimage.c b/Build/source/texk/dvipdfm-x/pngimage.c index c2d617d2c67..e4152177ef2 100644 --- a/Build/source/texk/dvipdfm-x/pngimage.c +++ b/Build/source/texk/dvipdfm-x/pngimage.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -190,7 +190,7 @@ png_include_image (pdf_ximage *ximage, FILE *png_file) /* Ask libpng to convert down to 8-bpc. */ if (bpc > 8) { - if (pdf_get_version() < 5) { + if (pdf_check_version(1, 5) < 0) { WARN("%s: 16-bpc PNG requires PDF version 1.5.", PNG_DEBUG_STR); png_set_strip_16(png_ptr); bpc = 8; @@ -354,7 +354,7 @@ png_include_image (pdf_ximage *ximage, FILE *png_file) * flag of iTxt chunks. */ #if PNG_LIBPNG_VER >= 10614 - if (pdf_get_version() >= 4) { + if (pdf_check_version(1, 4) >= 0) { png_textp text_ptr; pdf_obj *XMP_stream, *XMP_stream_dict; int i, num_text; @@ -438,13 +438,11 @@ static int check_transparency (png_structp png_ptr, png_infop info_ptr) { int trans_type; - unsigned pdf_version; png_byte color_type; png_color_16p trans_values; png_bytep trans; int num_trans; - pdf_version = pdf_get_version(); color_type = png_get_color_type(png_ptr, info_ptr); /* @@ -486,8 +484,8 @@ check_transparency (png_structp png_ptr, png_infop info_ptr) * We can convert alpha cahnnels to explicit mask via user supplied alpha- * threshold value. But I will not do that. */ - if (( pdf_version < 3 && trans_type != PDF_TRANS_TYPE_NONE ) || - ( pdf_version < 4 && trans_type == PDF_TRANS_TYPE_ALPHA )) { + if (( pdf_check_version(1, 3) < 0 && trans_type != PDF_TRANS_TYPE_NONE ) || + ( pdf_check_version(1, 4) < 0 && trans_type == PDF_TRANS_TYPE_ALPHA )) { /* * No transparency supported but PNG uses transparency, or Soft-Mask * required but no support for it is available in this version of PDF. @@ -504,9 +502,9 @@ check_transparency (png_structp png_ptr, png_infop info_ptr) bg.red = 255; bg.green = 255; bg.blue = 255; bg.gray = 255; bg.index = 0; png_set_background(png_ptr, &bg, PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); WARN("%s: Transparency will be ignored. (no support in PDF ver. < 1.3)", PNG_DEBUG_STR); - if (pdf_version < 3) + if (pdf_check_version(1, 3) < 0) WARN("%s: Please use -V 3 option to enable binary transparency support.", PNG_DEBUG_STR); - if (pdf_version < 4) + if (pdf_check_version(1, 4) < 0) WARN("%s: Please use -V 4 option to enable full alpha channel support.", PNG_DEBUG_STR); trans_type = PDF_TRANS_TYPE_NONE; } diff --git a/Build/source/texk/dvipdfm-x/spc_dvips.c b/Build/source/texk/dvipdfm-x/spc_dvips.c index 1d2f3f101b1..7813c0114a4 100644 --- a/Build/source/texk/dvipdfm-x/spc_dvips.c +++ b/Build/source/texk/dvipdfm-x/spc_dvips.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -606,7 +606,7 @@ spc_handler_ps_tricks_parse_path (struct spc_env *spe, struct spc_arg *args) fclose(fp); error = dpx_file_apply_filter(distiller_template, gs_in, gs_out, - (unsigned char) pdf_get_version()); + pdf_get_version()); if (error) { WARN("Image format conversion for PSTricks failed."); RELEASE(gs_in); @@ -701,7 +701,7 @@ spc_handler_ps_tricks_render (struct spc_env *spe, struct spc_arg *args) fclose(fp); error = dpx_file_apply_filter(distiller_template, gs_in, gs_out, - (unsigned char) pdf_get_version()); + pdf_get_version()); if (error) { WARN("Image format conversion for PSTricks failed."); RELEASE(gs_in); diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index 37b0ee5b184..b9ce71ee4dd 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2007-2017 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2007-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -1971,6 +1971,7 @@ static struct spc_handler pdfm_handlers[] = { {"code", spc_handler_pdfm_code}, {"minorversion", spc_handler_pdfm_do_nothing}, + {"majorversion", spc_handler_pdfm_do_nothing}, {"encrypt", spc_handler_pdfm_do_nothing}, }; diff --git a/Build/source/texk/dvipdfm-x/spc_tpic.c b/Build/source/texk/dvipdfm-x/spc_tpic.c index 4fc80ddd78f..f4c9c99c752 100644 --- a/Build/source/texk/dvipdfm-x/spc_tpic.c +++ b/Build/source/texk/dvipdfm-x/spc_tpic.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -763,7 +763,8 @@ spc_handler_tpic__init (struct spc_env *spe, void *dp) tp->num_points = 0; tp->max_points = 0; - if (tp->mode.fill != TPIC_MODE__FILL_SOLID && pdf_get_version() < 4) { + if (tp->mode.fill != TPIC_MODE__FILL_SOLID && + pdf_check_version(1, 4) < 0) { spc_warn(spe, "Tpic shading support requires PDF version 1.4."); tp->mode.fill = TPIC_MODE__FILL_SOLID; } @@ -957,7 +958,7 @@ spc_handler_tpic__setopts (struct spc_env *spe, error = pdf_foreach_dict(dict, tpic_filter_getopts, tp); if (!error) { if (tp->mode.fill != TPIC_MODE__FILL_SOLID && - pdf_get_version() < 4) { + pdf_check_version(1, 4) < 0) { spc_warn(spe, "Transparent fill mode requires PDF version 1.4."); tp->mode.fill = TPIC_MODE__FILL_SOLID; } @@ -1115,4 +1116,3 @@ spc_load_tpic_special (struct spc_env *spe, pdf_obj *lopts) return 0; } #endif /* 0 */ - diff --git a/Build/source/texk/dvipdfm-x/tfm.c b/Build/source/texk/dvipdfm-x/tfm.c index 3a8b0b61d56..37f406698a9 100644 --- a/Build/source/texk/dvipdfm-x/tfm.c +++ b/Build/source/texk/dvipdfm-x/tfm.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -455,6 +455,14 @@ tfm_get_sizes (FILE *tfm_file, off_t tfm_file_size, struct tfm_font *tfm) } #ifndef WITHOUT_ASCII_PTEX +unsigned int get_unsigned_triple_kanji(FILE *file) +{ + unsigned int triple = get_unsigned_byte(file); + triple = (triple << 8) | get_unsigned_byte(file); + triple = triple | (get_unsigned_byte(file)<<16); + return triple; +} + static void jfm_do_char_type_array (FILE *tfm_file, struct tfm_font *tfm) { diff --git a/Build/source/texk/dvipdfm-x/type0.c b/Build/source/texk/dvipdfm-x/type0.c index 38390666399..4a0f6ec016d 100644 --- a/Build/source/texk/dvipdfm-x/type0.c +++ b/Build/source/texk/dvipdfm-x/type0.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. This program is free software; you can redistribute it and/or modify @@ -392,10 +392,8 @@ Type0Font_cache_find (const char *map_name, int cmap_id, fontmap_opt *fmap_opt) CIDSysInfo *csi; char *fontname = NULL; int cid_id = -1, parent_id = -1, wmode = 0; - int pdf_ver; - pdf_ver = pdf_get_version(); - if (!map_name || cmap_id < 0 || pdf_ver < 2) + if (!map_name || cmap_id < 0 || pdf_check_version(1, 2) < 0) return -1; /* diff --git a/Build/source/texk/dvipdfm-x/xbb.c b/Build/source/texk/dvipdfm-x/xbb.c index 63d1fcffae4..597d08e1f01 100644 --- a/Build/source/texk/dvipdfm-x/xbb.c +++ b/Build/source/texk/dvipdfm-x/xbb.c @@ -1,5 +1,5 @@ /* This is extractbb, a bounding box extraction program. - Copyright (C) 2008-2017 by Jin-Hwan Cho and Matthias Franz + Copyright (C) 2008-2018 by Jin-Hwan Cho and Matthias Franz and the dvipdfmx project team. This program is free software; you can redistribute it and/or modify @@ -180,7 +180,7 @@ static void write_xbb(char *fname, fprintf(fp, "%%%%HiResBoundingBox: %f %f %f %f\n", bbllx_f, bblly_f, bburx_f, bbury_f); if (pdf_version >= 0) { - fprintf(fp, "%%%%PDFVersion: 1.%d\n", pdf_version); + fprintf(fp, "%%%%PDFVersion: %d.%d\n", pdf_version/10, pdf_version%10); fprintf(fp, "%%%%Pages: %d\n", pagecount); } } |