diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-08-08 10:50:58 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-08-08 10:50:58 +0000 |
commit | de9ca7eda14337c01d1f75c831fdd2e78ef97381 (patch) | |
tree | ef8e1fb83568345217b05a1c726f711316e9f57a /Build | |
parent | e565d5d60693a481de552c3345c1538252caf705 (diff) |
dvipdfm-x: Bug fix - handle pdf:bann, pdf:eann, and pdf:ann specials
git-svn-id: svn://tug.org/texlive/trunk@31386 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
38 files changed, 343 insertions, 343 deletions
diff --git a/Build/source/texk/dvipdf-x/ChangeLog b/Build/source/texk/dvipdf-x/ChangeLog index 2e780b84764..14a39fb0497 100644 --- a/Build/source/texk/dvipdf-x/ChangeLog +++ b/Build/source/texk/dvipdf-x/ChangeLog @@ -1,3 +1,9 @@ +2013-08-08 Peter Breitenlohner <peb@mppmu.mpg.de> + + * src/dvipdfmx.c, src/pdfdoc.[ch], src/spc_pdfm.c, + src/spc_util.c: Bug fix: handle pdf:bann, pdf:eann, and pdf:ann + specials. + 2013-06-29 Peter Breitenlohner <peb@mppmu.mpg.de> * src/dvipdfmx.h, xsrc/spc_xtx.[ch]: Moved to the top-level. diff --git a/Build/source/texk/dvipdf-x/Makefile.am b/Build/source/texk/dvipdf-x/Makefile.am index 912596679fc..e75d53fdb40 100644 --- a/Build/source/texk/dvipdf-x/Makefile.am +++ b/Build/source/texk/dvipdf-x/Makefile.am @@ -28,7 +28,7 @@ bin_PROGRAMS += xdvipdfmx endif XDVIPDFMX EXTRA_PROGRAMS = dvipdfmx xdvipdfmx -AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) +AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(PAPER_INCLUDES) dvipdfmx_CPPFLAGS = -I$(srcdir)/src $(AM_CPPFLAGS) xdvipdfmx_CPPFLAGS = -DXETEX -I$(srcdir)/xsrc $(FREETYPE2_INCLUDES) $(AM_CPPFLAGS) AM_CFLAGS = $(WARNING_CFLAGS) @@ -36,7 +36,7 @@ AM_CFLAGS = $(WARNING_CFLAGS) nodist_dvipdfmx_SOURCES = $(common_sources) $(dvipdfmx_sources) nodist_xdvipdfmx_SOURCES = $(common_sources) $(xdvipdfmx_sources) -dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) +dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) $(PAPER_LIBS) xdvipdfmx_LDADD = $(FREETYPE2_LIBS) $(dvipdfmx_LDADD) $(dvipdfmx_OBJECTS): config.force @@ -316,14 +316,10 @@ if XDVIPDFMX TESTS += $(xdvipdfmx_tests) endif XDVIPDFMX EXTRA_DIST += $(dvipdfmx_tests) $(xdvipdfmx_tests) -## -## FIXME -XFAIL_TESTS = dvipdfm-ann.test ## Test Data -## EXTRA_DIST += tests/dvipdfmx.cfg tests/psfonts.map EXTRA_DIST += tests/image.jpeg tests/image.pdf tests/image.png EXTRA_DIST += tests/image.dvi tests/image.tex -EXTRA_DIST += tests/cmr10.pfb tests/cmr10.tfm tests/grahn.dvi tests/grahn.tex -DISTCLEANFILES += img*.* pic*.* image*.pdf grahn*.pdf +EXTRA_DIST += tests/cmr10.pfb tests/cmr10.tfm tests/annot.dvi tests/annot.tex +DISTCLEANFILES += img*.* pic*.* image*.pdf annot*.pdf diff --git a/Build/source/texk/dvipdf-x/Makefile.in b/Build/source/texk/dvipdf-x/Makefile.in index 0fe5d4e93c5..da7d4085922 100644 --- a/Build/source/texk/dvipdf-x/Makefile.in +++ b/Build/source/texk/dvipdf-x/Makefile.in @@ -113,10 +113,10 @@ DIST_COMMON = $(top_srcdir)/../../am/bin_links.am \ @XDVIPDFMX_TRUE@am__append_6 = $(xdvipdfmx_tests) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/cho-libs.m4 \ - $(top_srcdir)/../../m4/kpse-common.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ $(top_srcdir)/../../m4/kpse-freetype2-flags.m4 \ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ + $(top_srcdir)/../../m4/kpse-libpaper.m4 \ $(top_srcdir)/../../m4/kpse-libpng-flags.m4 \ $(top_srcdir)/../../m4/kpse-lt-hack.m4 \ $(top_srcdir)/../../m4/kpse-warnings.m4 \ @@ -193,7 +193,7 @@ nodist_dvipdfmx_OBJECTS = $(am__objects_1) $(am__objects_2) dvipdfmx_OBJECTS = $(nodist_dvipdfmx_OBJECTS) am__DEPENDENCIES_1 = dvipdfmx_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__objects_3 = xdvipdfmx-agl.$(OBJEXT) xdvipdfmx-cid.$(OBJEXT) \ xdvipdfmx-cmap.$(OBJEXT) xdvipdfmx-cmap_read.$(OBJEXT) \ xdvipdfmx-cmap_write.$(OBJEXT) xdvipdfmx-cs_type2.$(OBJEXT) \ @@ -248,7 +248,7 @@ am__objects_4 = xsrc/xdvipdfmx-bmpimage.$(OBJEXT) \ nodist_xdvipdfmx_OBJECTS = $(am__objects_3) $(am__objects_4) xdvipdfmx_OBJECTS = $(nodist_xdvipdfmx_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) xdvipdfmx_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) am__dist_bin_SCRIPTS_DIST = dvipdft am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -642,6 +642,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAPER_INCLUDES = @PAPER_INCLUDES@ +PAPER_LIBS = @PAPER_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ @@ -710,13 +712,13 @@ ACLOCAL_AMFLAGS = -I ../../m4 SUBDIRS = data $(am__append_1) bin_links = $(am__append_3) @DVIPDFMX_TRUE@@WIN32_FALSE@dist_bin_SCRIPTS = dvipdft -AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) +AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(PAPER_INCLUDES) dvipdfmx_CPPFLAGS = -I$(srcdir)/src $(AM_CPPFLAGS) xdvipdfmx_CPPFLAGS = -DXETEX -I$(srcdir)/xsrc $(FREETYPE2_INCLUDES) $(AM_CPPFLAGS) AM_CFLAGS = $(WARNING_CFLAGS) nodist_dvipdfmx_SOURCES = $(common_sources) $(dvipdfmx_sources) nodist_xdvipdfmx_SOURCES = $(common_sources) $(xdvipdfmx_sources) -dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) +dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) $(PAPER_LIBS) xdvipdfmx_LDADD = $(FREETYPE2_LIBS) $(dvipdfmx_LDADD) common_sources = \ agl.c \ @@ -943,14 +945,13 @@ EXTRA_DIST = $(common_sources) $(dvipdfmx_sources) \ tests/dvipdfmx.cfg tests/psfonts.map tests/image.jpeg \ tests/image.pdf tests/image.png tests/image.dvi \ tests/image.tex tests/cmr10.pfb tests/cmr10.tfm \ - tests/grahn.dvi tests/grahn.tex + tests/annot.dvi tests/annot.tex call_dvipdfmx_CPPFLAGS = -DEXEPROG=\"dvipdfmx.exe\" nodist_call_dvipdfmx_SOURCES = callexe.c -DISTCLEANFILES = config.force img*.* pic*.* image*.pdf grahn*.pdf +DISTCLEANFILES = config.force img*.* pic*.* image*.pdf annot*.pdf TESTS = $(am__append_5) $(am__append_6) dvipdfmx_tests = dvipdfmx.test dvipdfm-ann.test xdvipdfmx_tests = xdvipdfmx.test xdvipdfm-ann.test -XFAIL_TESTS = dvipdfm-ann.test all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive diff --git a/Build/source/texk/dvipdf-x/aclocal.m4 b/Build/source/texk/dvipdf-x/aclocal.m4 index 7b601c3d0f0..a0babfe9e96 100644 --- a/Build/source/texk/dvipdf-x/aclocal.m4 +++ b/Build/source/texk/dvipdf-x/aclocal.m4 @@ -1220,10 +1220,10 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([../../m4/cho-libs.m4]) m4_include([../../m4/kpse-common.m4]) m4_include([../../m4/kpse-freetype2-flags.m4]) m4_include([../../m4/kpse-kpathsea-flags.m4]) +m4_include([../../m4/kpse-libpaper.m4]) m4_include([../../m4/kpse-libpng-flags.m4]) m4_include([../../m4/kpse-lt-hack.m4]) m4_include([../../m4/kpse-warnings.m4]) diff --git a/Build/source/texk/dvipdf-x/config.h.in b/Build/source/texk/dvipdf-x/config.h.in index e43c8606b66..f5e7527b596 100644 --- a/Build/source/texk/dvipdf-x/config.h.in +++ b/Build/source/texk/dvipdf-x/config.h.in @@ -15,12 +15,6 @@ /* Define to 1 if you have the `close' function. */ #undef HAVE_CLOSE -/* Define to 1 if you have the `compress' function. */ -#undef HAVE_COMPRESS - -/* Define to 1 if you have the `compress2' function. */ -#undef HAVE_COMPRESS2 - /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -80,9 +74,6 @@ /* Define to 1 if you have the `open' function. */ #undef HAVE_OPEN -/* Define to 1 if you have the `png_get_image_width' function. */ -#undef HAVE_PNG_GET_IMAGE_WIDTH - /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV diff --git a/Build/source/texk/dvipdf-x/configure b/Build/source/texk/dvipdf-x/configure index 167d4020465..c65b9e1b330 100755 --- a/Build/source/texk/dvipdf-x/configure +++ b/Build/source/texk/dvipdf-x/configure @@ -643,6 +643,8 @@ WIN32_CALL_FALSE WIN32_CALL_TRUE WIN32_FALSE WIN32_TRUE +PAPER_LIBS +PAPER_INCLUDES FREETYPE2_RULE FREETYPE2_DEPEND FREETYPE2_LIBS @@ -805,7 +807,8 @@ with_zlib_includes with_zlib_libdir with_system_libpng with_system_freetype2 -with_paper +with_paper_includes +with_paper_libdir ' ac_precious_vars='build_alias host_alias @@ -1477,7 +1480,9 @@ Optional Packages: pkg-config) --with-system-freetype2 use installed freetype2 headers and library (requires freetype-config) - --with-paper=DIR use paper include/library files from DIR + --with-paper-includes=DIR + paper headers installed in DIR + --with-paper-libdir=DIR paper library installed in DIR Some influential environment variables: CC C compiler command @@ -15710,6 +15715,10 @@ ${top_builddir}/../../libs/freetype2/ft2build.h: fi +kpse_save_CPPFLAGS=$CPPFLAGS +kpse_save_LIBS=$LIBS + + if test "x$enable_build" != xno || test -f config.force; then eval CPPFLAGS=\"$KPATHSEA_INCLUDES \$CPPFLAGS\" @@ -15727,130 +15736,97 @@ fi eval CPPFLAGS=\"$ZLIB_INCLUDES \$CPPFLAGS\" eval LIBS=\"$ZLIB_LIBS \$LIBS\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib header files and library" >&5 -$as_echo_n "checking for zlib header files and library... " >&6; } -if ${cho_cv_have_zlib+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <zlib.h> int main () { -z_stream p; +Bytef *dst,*src; uLong dstlen, srclen; int lvl, err; + err=compress2(dst, &dstlen, src, srclen, lvl); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - cho_cv_have_zlib=yes + else - cho_cv_have_zlib=no + as_fn_error $? "Sorry, you need zlib with compress2" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cho_cv_have_zlib" >&5 -$as_echo "$cho_cv_have_zlib" >&6; } -if test "x$cho_cv_have_zlib" = xyes; then : - for ac_func in compress -do : - ac_fn_c_check_func "$LINENO" "compress" "ac_cv_func_compress" -if test "x$ac_cv_func_compress" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_COMPRESS 1 -_ACEOF - -$as_echo "#define HAVE_ZLIB 1" >>confdefs.h - - for ac_func in compress2 -do : - ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" -if test "x$ac_cv_func_compress2" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_COMPRESS2 1 -_ACEOF - -$as_echo "#define HAVE_ZLIB_COMPRESS2 1" >>confdefs.h - -fi -done - -fi -done - -fi - eval CPPFLAGS=\"$LIBPNG_INCLUDES \$CPPFLAGS\" eval LIBS=\"$LIBPNG_LIBS \$LIBS\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng header files and library" >&5 -$as_echo_n "checking for libpng header files and library... " >&6; } -if ${cho_cv_have_png+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <png.h> int main () { -png_infop p; +png_const_structp png; png_const_infop info; int err; + err=png_get_image_width(png, info); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - cho_cv_have_png=yes + else - cho_cv_have_png=no + as_fn_error $? "Sorry, you need libpng" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cho_cv_have_png" >&5 -$as_echo "$cho_cv_have_png" >&6; } -if test "x$cho_cv_have_png" = xyes; then : - for ac_func in png_get_image_width -do : - ac_fn_c_check_func "$LINENO" "png_get_image_width" "ac_cv_func_png_get_image_width" -if test "x$ac_cv_func_png_get_image_width" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PNG_GET_IMAGE_WIDTH 1 -_ACEOF -$as_echo "#define HAVE_LIBPNG 1" >>confdefs.h +CPPFLAGS=$kpse_save_CPPFLAGS +LIBS=$kpse_save_LIBS -fi -done +echo timestamp >config.force fi -CPPFLAGS=$kpse_save_CPPFLAGS -LIBS=$kpse_save_LIBS +$as_echo "#define HAVE_ZLIB 1" >>confdefs.h -echo timestamp >config.force -fi +$as_echo "#define HAVE_ZLIB_COMPRESS2 1" >>confdefs.h + + +$as_echo "#define HAVE_LIBPNG 1" >>confdefs.h + if test "x$enable_texlive_build" != xyes || test ! -d $srcdir/../kpathsea; then - _cppflags=$CPPFLAGS _ldflags=$LDFLAGS -# Check whether --with-paper was given. -if test "${with_paper+set}" = set; then : - withval=$with_paper; if test -d "$withval"; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" - fi + +# Check whether --with-paper-includes was given. +if test "${with_paper_includes+set}" = set; then : + withval=$with_paper_includes; fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for paper header files" >&5 +# Check whether --with-paper-libdir was given. +if test "${with_paper_libdir+set}" = set; then : + withval=$with_paper_libdir; +fi +case $with_paper_includes in #( + "" | yes) : + PAPER_INCLUDES= ;; #( + *) : + PAPER_INCLUDES="-I$with_paper_includes" ;; +esac +case $with_paper_libdir in #( + "" | yes) : + PAPER_LIBS= ;; #( + *) : + PAPER_LIBS="-L$with_paper_libdir" ;; +esac +CPPFLAGS="$CPPFLAGS $PAPER_INCLUDES" +LIBS="$LIBS $PAPER_LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for paper header files" >&5 $as_echo_n "checking for paper header files... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +result=no +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <paper.h> int @@ -15862,9 +15838,7 @@ struct paper *p; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing paperpswidth" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing paperpswidth" >&5 $as_echo_n "checking for library containing paperpswidth... " >&6; } if ${ac_cv_search_paperpswidth+:} false; then : $as_echo_n "(cached) " >&6 @@ -15918,17 +15892,34 @@ ac_res=$ac_cv_search_paperpswidth if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -$as_echo "#define HAVE_LIBPAPER 1" >>confdefs.h - fi -else - CPPFLAGS=$_cppflags - LDDFLAGS=$_ldflags - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + case $ac_cv_search_paperpswidth in #( + no) : + : ;; #( + "none required") : + result=yes ;; #( + *) : + result=yes + PAPER_LIBS="$PAPER_LIBS $ac_cv_search_paperpswidth" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +case $result in #( + no) : + PAPER_INCLUDES= PAPER_LIBS= ;; #( + *) : + +$as_echo "#define HAVE_LIBPAPER 1" >>confdefs.h + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 +$as_echo "$result" >&6; } + + +CPPFLAGS=$kpse_save_CPPFLAGS +LIBS=$kpse_save_LIBS + fi diff --git a/Build/source/texk/dvipdf-x/configure.ac b/Build/source/texk/dvipdf-x/configure.ac index 43533b9d6f0..f708f7c9079 100644 --- a/Build/source/texk/dvipdf-x/configure.ac +++ b/Build/source/texk/dvipdf-x/configure.ac @@ -58,6 +58,8 @@ KPSE_ZLIB_FLAGS KPSE_LIBPNG_FLAGS KPSE_FREETYPE2_FLAGS +KPSE_SAVE_FLAGS + if test "x$enable_build" != xno || test -f config.force; then KPSE_ADD_FLAGS([kpathsea]) @@ -65,20 +67,33 @@ AC_CHECK_HEADER([kpathsea/version.h], [], [AC_MSG_ERROR([Sorry, kpathsea too old])]) KPSE_ADD_FLAGS([zlib]) -CHO_CHECK_ZLIB +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], + [[Bytef *dst,*src; uLong dstlen, srclen; int lvl, err; + err=compress2(dst, &dstlen, src, srclen, lvl);]])], + [], + [AC_MSG_ERROR([Sorry, you need zlib with compress2])]) KPSE_ADD_FLAGS([libpng]) -CHO_CHECK_LIBPNG +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <png.h>]], + [[png_const_structp png; png_const_infop info; int err; + err=png_get_image_width(png, info);]])], + [], + [AC_MSG_ERROR([Sorry, you need libpng])]) KPSE_RESTORE_FLAGS echo timestamp >config.force fi +dnl We require zlib with compress2 and libpng +AC_DEFINE([HAVE_ZLIB], 1, [Define if you have zlib and its headers.]) +AC_DEFINE([HAVE_ZLIB_COMPRESS2], 1, [Define if your zlib has the compress2 function.]) +AC_DEFINE([HAVE_LIBPNG], 1, [Define if you have libpng and its headers.]) + dnl Check for additional libraries. if test "x$enable_texlive_build" != xyes || test ! -d $srcdir/../kpathsea; then - CHO_CHECK_LIBPAPER + KPSE_LIBPAPER fi KPSE_WIN32_CALL diff --git a/Build/source/texk/dvipdf-x/data/Makefile.in b/Build/source/texk/dvipdf-x/data/Makefile.in index e9b08e88636..b4c95e868f4 100644 --- a/Build/source/texk/dvipdf-x/data/Makefile.in +++ b/Build/source/texk/dvipdf-x/data/Makefile.in @@ -83,10 +83,10 @@ DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_cmapdata_DATA) $(dist_configdata_DATA) \ $(dist_glyphlistdata_DATA) $(dist_mapdata_DATA) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/cho-libs.m4 \ - $(top_srcdir)/../../m4/kpse-common.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ $(top_srcdir)/../../m4/kpse-freetype2-flags.m4 \ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ + $(top_srcdir)/../../m4/kpse-libpaper.m4 \ $(top_srcdir)/../../m4/kpse-libpng-flags.m4 \ $(top_srcdir)/../../m4/kpse-lt-hack.m4 \ $(top_srcdir)/../../m4/kpse-warnings.m4 \ @@ -224,6 +224,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAPER_INCLUDES = @PAPER_INCLUDES@ +PAPER_LIBS = @PAPER_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ diff --git a/Build/source/texk/dvipdf-x/dvipdfm-ann.test b/Build/source/texk/dvipdf-x/dvipdfm-ann.test index f574bd4da81..74e1021692b 100755 --- a/Build/source/texk/dvipdf-x/dvipdfm-ann.test +++ b/Build/source/texk/dvipdf-x/dvipdfm-ann.test @@ -13,8 +13,8 @@ export TEXMFCNF TEXFONTS DVIPDFMXINPUTS TEXPICTS failed= -echo "*** dvipdfmx -v -o grahn1.pdf grahn" && echo \ - && ./dvipdfmx -v -o grahn1.pdf ${srcdir}/tests/grahn \ +echo "*** dvipdfmx -v -o annot1.pdf annot" && echo \ + && ./dvipdfmx -v -o annot1.pdf ${srcdir}/tests/annot \ && echo && echo "dvipdfmx-ann tests OK" && echo \ || failed="$failed dvipdfmx-ann" diff --git a/Build/source/texk/dvipdf-x/man/Makefile.in b/Build/source/texk/dvipdf-x/man/Makefile.in index 68f6eb367a9..cd6f58f4e01 100644 --- a/Build/source/texk/dvipdf-x/man/Makefile.in +++ b/Build/source/texk/dvipdf-x/man/Makefile.in @@ -81,10 +81,10 @@ DIST_COMMON = $(top_srcdir)/../../am/man1_links.am \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am $(dist_man1_MANS) subdir = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/cho-libs.m4 \ - $(top_srcdir)/../../m4/kpse-common.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ $(top_srcdir)/../../m4/kpse-freetype2-flags.m4 \ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ + $(top_srcdir)/../../m4/kpse-libpaper.m4 \ $(top_srcdir)/../../m4/kpse-libpng-flags.m4 \ $(top_srcdir)/../../m4/kpse-lt-hack.m4 \ $(top_srcdir)/../../m4/kpse-warnings.m4 \ @@ -221,6 +221,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAPER_INCLUDES = @PAPER_INCLUDES@ +PAPER_LIBS = @PAPER_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ diff --git a/Build/source/texk/dvipdf-x/src/dvipdfmx.c b/Build/source/texk/dvipdf-x/src/dvipdfmx.c index cde17f051a6..b57243e8142 100644 --- a/Build/source/texk/dvipdf-x/src/dvipdfmx.c +++ b/Build/source/texk/dvipdf-x/src/dvipdfmx.c @@ -888,7 +888,7 @@ main (int argc, char *argv[]) #ifdef MIKTEX miktex_initialize(); #else - kpse_set_program_name(argv[0], PACKAGE); + kpse_set_program_name(argv[0], "dvipdfmx"); /* we pretend to be dvipdfmx for kpse purposes */ #endif paperinit(); diff --git a/Build/source/texk/dvipdf-x/src/pdfdoc.c b/Build/source/texk/dvipdf-x/src/pdfdoc.c index 862789ec714..4b69d17faa4 100644 --- a/Build/source/texk/dvipdf-x/src/pdfdoc.c +++ b/Build/source/texk/dvipdf-x/src/pdfdoc.c @@ -1645,7 +1645,7 @@ pdf_doc_close_names (pdf_doc *p) void pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, - pdf_obj *annot_dict, int new_annot) + pdf_obj *annot_dict) { pdf_doc *p = &pdoc; pdf_page *page; @@ -1686,9 +1686,6 @@ pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, pdf_add_array(page->annots, pdf_ref_obj(annot_dict)); - if (new_annot) - pdf_doc_add_goto(annot_dict); - return; } @@ -2646,10 +2643,9 @@ pdf_doc_end_grabbing (pdf_obj *attrib) static struct { int dirty; - int broken; pdf_obj *annot_dict; pdf_rect rect; -} breaking_state = {0, 0, NULL, {0.0, 0.0, 0.0, 0.0}}; +} breaking_state = {0, NULL, {0.0, 0.0, 0.0, 0.0}}; static void reset_box (void) @@ -2663,7 +2659,6 @@ void pdf_doc_begin_annot (pdf_obj *dict) { breaking_state.annot_dict = dict; - breaking_state.broken = 0; reset_box(); } @@ -2684,10 +2679,8 @@ pdf_doc_break_annot (void) annot_dict = pdf_new_dict(); pdf_merge_dict(annot_dict, breaking_state.annot_dict); pdf_doc_add_annot(pdf_doc_current_page_number(), &(breaking_state.rect), - annot_dict, !breaking_state.broken); + annot_dict); pdf_release_obj(annot_dict); - - breaking_state.broken = 1; } reset_box(); } diff --git a/Build/source/texk/dvipdf-x/src/pdfdoc.h b/Build/source/texk/dvipdf-x/src/pdfdoc.h index 2281f036fd2..0b9b27553e9 100644 --- a/Build/source/texk/dvipdf-x/src/pdfdoc.h +++ b/Build/source/texk/dvipdf-x/src/pdfdoc.h @@ -115,8 +115,7 @@ extern void pdf_doc_end_grabbing (pdf_obj *attrib); /* Annotation */ extern void pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, - pdf_obj *annot_dict, - int dest_is_new); + pdf_obj *annot_dict); /* Annotation with auto- clip and line (or page) break */ extern void pdf_doc_begin_annot (pdf_obj *dict); diff --git a/Build/source/texk/dvipdf-x/src/spc_pdfm.c b/Build/source/texk/dvipdf-x/src/spc_pdfm.c index 6ae6a94fded..0015538e80c 100644 --- a/Build/source/texk/dvipdf-x/src/spc_pdfm.c +++ b/Build/source/texk/dvipdf-x/src/spc_pdfm.c @@ -573,7 +573,7 @@ spc_handler_pdfm_annot (struct spc_env *spe, struct spc_arg *args) if (ident) spc_push_object(ident, pdf_link_obj(annot_dict)); /* This add reference. */ - pdf_doc_add_annot(pdf_doc_current_page_number(), &rect, annot_dict, 1); + pdf_doc_add_annot(pdf_doc_current_page_number(), &rect, annot_dict); if (ident) { spc_flush_object(ident); diff --git a/Build/source/texk/dvipdf-x/src/spc_util.c b/Build/source/texk/dvipdf-x/src/spc_util.c index 83fc0651377..ff56d0d2f90 100644 --- a/Build/source/texk/dvipdf-x/src/spc_util.c +++ b/Build/source/texk/dvipdf-x/src/spc_util.c @@ -286,26 +286,39 @@ spc_util_read_length (struct spc_env *spe, double *vp /* ret. */, struct spc_arg v = atof(q); RELEASE(q); + skip_white(&ap->curptr, ap->endptr); q = parse_c_ident(&ap->curptr, ap->endptr); if (q) { - if (strlen(q) > strlen("true") && + char *qq = q; + if (strlen(q) >= strlen("true") && !memcmp(q, "true", strlen("true"))) { u /= spe->mag != 0.0 ? spe->mag : 1.0; /* inverse magnify */ q += strlen("true"); } - for (k = 0; ukeys[k] && strcmp(ukeys[k], q); k++); - switch (k) { - case K_UNIT__PT: u *= 72.0 / 72.27; break; - case K_UNIT__IN: u *= 72.0; break; - case K_UNIT__CM: u *= 72.0 / 2.54 ; break; - case K_UNIT__MM: u *= 72.0 / 25.4 ; break; - case K_UNIT__BP: u *= 1.0 ; break; - default: - spc_warn(spe, "Unknown unit of measure: %s", q); - error = -1; - break; + if (strlen(q) == 0) { + RELEASE(qq); + skip_white(&ap->curptr, ap->endptr); + qq = q = parse_c_ident(&ap->curptr, ap->endptr); + } + if (q) { + for (k = 0; ukeys[k] && strcmp(ukeys[k], q); k++); + switch (k) { + case K_UNIT__PT: u *= 72.0 / 72.27; break; + case K_UNIT__IN: u *= 72.0; break; + case K_UNIT__CM: u *= 72.0 / 2.54 ; break; + case K_UNIT__MM: u *= 72.0 / 25.4 ; break; + case K_UNIT__BP: u *= 1.0 ; break; + default: + spc_warn(spe, "Unknown unit of measure: %s", q); + error = -1; + break; + } + RELEASE(qq); + } + else { + spc_warn(spe, "Missing unit of measure after \"true\""); + error = -1; } - RELEASE(q); } *vp = v * u; diff --git a/Build/source/texk/dvipdf-x/tests/annot.dvi b/Build/source/texk/dvipdf-x/tests/annot.dvi Binary files differnew file mode 100644 index 00000000000..7ea86daa1f5 --- /dev/null +++ b/Build/source/texk/dvipdf-x/tests/annot.dvi diff --git a/Build/source/texk/dvipdf-x/tests/annot.tex b/Build/source/texk/dvipdf-x/tests/annot.tex new file mode 100644 index 00000000000..c57f2ca5786 --- /dev/null +++ b/Build/source/texk/dvipdf-x/tests/annot.tex @@ -0,0 +1,22 @@ +% +\special{pdf:obj @tug <</S/URI /URI (http://www.tug.org)>>} + +\special{pdf:bann <</Subtype/Link /A @tug>>}% +TUG on the web +\special{pdf:eann}% + +\vskip 20 bp + +some text +\special{pdf:ann @foo width 15 pt height 10truebp depth 5 true bp <</Subtype/Link /A @tug>>} +\hskip 15 pt +more text + +\vskip 150 bp + +some more text +\special{pdf:ann @bar bbox 0 0 180 90 <</Subtype/Link /A @tug>>} +\hskip 180 bp +final text text + +\bye diff --git a/Build/source/texk/dvipdf-x/tests/grahn.dvi b/Build/source/texk/dvipdf-x/tests/grahn.dvi Binary files differdeleted file mode 100644 index 39cbb802741..00000000000 --- a/Build/source/texk/dvipdf-x/tests/grahn.dvi +++ /dev/null diff --git a/Build/source/texk/dvipdf-x/tests/grahn.tex b/Build/source/texk/dvipdf-x/tests/grahn.tex deleted file mode 100644 index eda2974a6fb..00000000000 --- a/Build/source/texk/dvipdf-x/tests/grahn.tex +++ /dev/null @@ -1,8 +0,0 @@ -% -\special{pdf:obj @tug <</S/URI /URI (http://www.tug.org)>>} - -\special{pdf:bann <</Subtype/Link /A @tug>>}% -TUG on the web -\special{pdf:eann}% - -\bye diff --git a/Build/source/texk/dvipdf-x/xdvipdfm-ann.test b/Build/source/texk/dvipdf-x/xdvipdfm-ann.test index bdb35cad5f3..5ea0d0be35a 100755 --- a/Build/source/texk/dvipdf-x/xdvipdfm-ann.test +++ b/Build/source/texk/dvipdf-x/xdvipdfm-ann.test @@ -13,8 +13,8 @@ export TEXMFCNF TEXFONTS DVIPDFMXINPUTS TEXPICTS failed= -echo "*** xdvipdfmx -v -o grahn2.pdf grahn" && echo \ - && ./xdvipdfmx -v -o grahn2.pdf ${srcdir}/tests/grahn \ +echo "*** xdvipdfmx -v -o annot2.pdf annot" && echo \ + && ./xdvipdfmx -v -o annot2.pdf ${srcdir}/tests/annot \ && echo && echo "xdvipdfmx-ann tests OK" && echo \ || failed="$failed xdvipdfmx-ann" diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 820afc6506d..9902e8f2459 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,7 +1,19 @@ +2013-08-08 Peter Breitenlohner <peb@mppmu.mpg.de> + + * pdfdoc.[ch], pdfnames.c, spc_pdfm.c: Bug fix: handle pdf:bann, + pdf:eann, and pdf:ann specials. + +2013-08-07 Peter Breitenlohner <peb@mppmu.mpg.de> + + * configure.ac: Avoid that config.h depends on $enable_build. + Replace CHO_CHECK_{ZLIB,LIBPNG} => AC_LINK_IFELSE and + CHO_CHECK_LIBPAPER => KPSE_LIBPAPER. + Makefile.am: Use $(PAPER_INCLUDES) and (PAPER_LIBS). + 2013-08-06 Peter Breitenlohner <peb@mppmu.mpg.de> * (x)dvipdfm-ann.test: Additional tests. - * tests/cmr10.{pfb,tfm}, tests/grahn.{dvi,tex}, + * tests/cmr10.{pfb,tfm}, tests/annot.{dvi,tex}, tests/psfonts.map: Additional test input files. * Makefile.am, dvipdfmx.cfg: Adapted. diff --git a/Build/source/texk/dvipdfm-x/Makefile.am b/Build/source/texk/dvipdfm-x/Makefile.am index d974f56834c..0f9ce460813 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.am +++ b/Build/source/texk/dvipdfm-x/Makefile.am @@ -20,7 +20,7 @@ EXTRA_PROGRAMS = dvipdfmx xdvipdfmx EXTRA_LIBRARIES = libutil.a AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -common_cppflags = $(AM_CPPFLAGS) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) +common_cppflags = $(AM_CPPFLAGS) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(PAPER_INCLUDES) dvipdfmx_CPPFLAGS = -I$(srcdir)/src $(common_cppflags) xdvipdfmx_CPPFLAGS = -DXETEX -I$(srcdir)/xsrc $(FREETYPE2_INCLUDES) $(common_cppflags) AM_CFLAGS = $(WARNING_CFLAGS) @@ -179,7 +179,7 @@ dvipdfmx_SOURCES = \ nodist_xdvipdfmx_SOURCES = $(dvipdfmx_SOURCES) -dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) libutil.a +dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) $(PAPER_LIBS) libutil.a xdvipdfmx_LDADD = $(FREETYPE2_LIBS) $(dvipdfmx_LDADD) $(dvipdfmx_OBJECTS) $(xdvipdfmx_OBJECTS): config.force @@ -279,16 +279,12 @@ if XDVIPDFMX TESTS += $(xdvipdfmx_tests) endif XDVIPDFMX EXTRA_DIST = $(dvipdfmx_tests) $(xdvipdfmx_tests) -## -## FIXME -XFAIL_TESTS = dvipdfm-ann.test xdvipdfm-ann.test ## Test Data -## EXTRA_DIST += tests/dvipdfmx.cfg tests/psfonts.map EXTRA_DIST += tests/image.jpeg tests/imgjpeg.bb tests/imgjpeg.xbb tests/picjpeg.bb tests/picjpeg.xbb EXTRA_DIST += tests/image.pdf tests/imgpdf.bb tests/imgpdf.xbb tests/picpdf.bb tests/picpdf.xbb EXTRA_DIST += tests/image.png tests/imgpng.bb tests/imgpng.xbb tests/picpng.bb tests/picpng.xbb EXTRA_DIST += tests/image.dvi tests/image.tex -EXTRA_DIST += tests/cmr10.pfb tests/cmr10.tfm tests/grahn.dvi tests/grahn.tex -DISTCLEANFILES += img*.* pic*.* image*.pdf grahn*.pdf +EXTRA_DIST += tests/cmr10.pfb tests/cmr10.tfm tests/annot.dvi tests/annot.tex +DISTCLEANFILES += img*.* pic*.* image*.pdf annot*.pdf diff --git a/Build/source/texk/dvipdfm-x/Makefile.in b/Build/source/texk/dvipdfm-x/Makefile.in index 4b250a759b2..dab8f3b5f39 100644 --- a/Build/source/texk/dvipdfm-x/Makefile.in +++ b/Build/source/texk/dvipdfm-x/Makefile.in @@ -116,10 +116,10 @@ DIST_COMMON = $(top_srcdir)/../../am/bin_links.am \ @XDVIPDFMX_TRUE@am__append_6 = $(xdvipdfmx_tests) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../m4/cho-libs.m4 \ - $(top_srcdir)/../../m4/kpse-common.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \ $(top_srcdir)/../../m4/kpse-freetype2-flags.m4 \ $(top_srcdir)/../../m4/kpse-kpathsea-flags.m4 \ + $(top_srcdir)/../../m4/kpse-libpaper.m4 \ $(top_srcdir)/../../m4/kpse-libpng-flags.m4 \ $(top_srcdir)/../../m4/kpse-lt-hack.m4 \ $(top_srcdir)/../../m4/kpse-warnings.m4 \ @@ -198,7 +198,7 @@ am_dvipdfmx_OBJECTS = dvipdfmx-agl.$(OBJEXT) \ dvipdfmx_OBJECTS = $(am_dvipdfmx_OBJECTS) am__DEPENDENCIES_1 = dvipdfmx_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) libutil.a + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libutil.a am__objects_1 = xdvipdfmx-agl.$(OBJEXT) xdvipdfmx-bmpimage.$(OBJEXT) \ xdvipdfmx-cff.$(OBJEXT) xdvipdfmx-cff_dict.$(OBJEXT) \ xdvipdfmx-cid.$(OBJEXT) xdvipdfmx-cidtype2.$(OBJEXT) \ @@ -230,7 +230,7 @@ am__objects_1 = xdvipdfmx-agl.$(OBJEXT) xdvipdfmx-bmpimage.$(OBJEXT) \ nodist_xdvipdfmx_OBJECTS = $(am__objects_1) xdvipdfmx_OBJECTS = $(nodist_xdvipdfmx_OBJECTS) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) libutil.a + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libutil.a xdvipdfmx_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) am__dist_bin_SCRIPTS_DIST = dvipdft am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -588,6 +588,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAPER_INCLUDES = @PAPER_INCLUDES@ +PAPER_LIBS = @PAPER_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ @@ -656,7 +658,7 @@ ACLOCAL_AMFLAGS = -I ../../m4 @DVIPDFMX_TRUE@@WIN32_FALSE@dist_bin_SCRIPTS = dvipdft EXTRA_LIBRARIES = libutil.a AM_CPPFLAGS = $(KPATHSEA_INCLUDES) -common_cppflags = $(AM_CPPFLAGS) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) +common_cppflags = $(AM_CPPFLAGS) $(LIBPNG_INCLUDES) $(ZLIB_INCLUDES) $(PAPER_INCLUDES) dvipdfmx_CPPFLAGS = -I$(srcdir)/src $(common_cppflags) xdvipdfmx_CPPFLAGS = -DXETEX -I$(srcdir)/xsrc $(FREETYPE2_INCLUDES) $(common_cppflags) AM_CFLAGS = $(WARNING_CFLAGS) @@ -813,7 +815,7 @@ dvipdfmx_SOURCES = \ xbb.c nodist_xdvipdfmx_SOURCES = $(dvipdfmx_SOURCES) -dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) libutil.a +dvipdfmx_LDADD = $(KPATHSEA_LIBS) $(LIBPNG_LIBS) $(ZLIB_LIBS) $(PAPER_LIBS) libutil.a xdvipdfmx_LDADD = $(FREETYPE2_LIBS) $(dvipdfmx_LDADD) bin_links = $(am__append_3) call_dvipdfmx_CPPFLAGS = -DEXEPROG=\"dvipdfmx.exe\" @@ -831,7 +833,7 @@ mapdatadir = $(datarootdir)/texmf-dist/fonts/map/dvipdfmx dist_mapdata_DATA = data/cid-x.map cmapdatadir = $(datarootdir)/texmf-dist/fonts/cmap/dvipdfmx dist_cmapdata_DATA = data/EUC-UCS2 -DISTCLEANFILES = config.force img*.* pic*.* image*.pdf grahn*.pdf +DISTCLEANFILES = config.force img*.* pic*.* image*.pdf annot*.pdf TESTS = $(am__append_5) $(am__append_6) dvipdfmx_tests = dvipdfmx.test dvipdfm-ann.test dvipdfm-bb.test xdvipdfmx_tests = xdvipdfmx.test xdvipdfm-ann.test xdvipdfm-bb.test @@ -842,9 +844,8 @@ EXTRA_DIST = $(dvipdfmx_tests) $(xdvipdfmx_tests) tests/dvipdfmx.cfg \ tests/picpdf.bb tests/picpdf.xbb tests/image.png \ tests/imgpng.bb tests/imgpng.xbb tests/picpng.bb \ tests/picpng.xbb tests/image.dvi tests/image.tex \ - tests/cmr10.pfb tests/cmr10.tfm tests/grahn.dvi \ - tests/grahn.tex -XFAIL_TESTS = dvipdfm-ann.test xdvipdfm-ann.test + tests/cmr10.pfb tests/cmr10.tfm tests/annot.dvi \ + tests/annot.tex all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am diff --git a/Build/source/texk/dvipdfm-x/aclocal.m4 b/Build/source/texk/dvipdfm-x/aclocal.m4 index 7b601c3d0f0..a0babfe9e96 100644 --- a/Build/source/texk/dvipdfm-x/aclocal.m4 +++ b/Build/source/texk/dvipdfm-x/aclocal.m4 @@ -1220,10 +1220,10 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([../../m4/cho-libs.m4]) m4_include([../../m4/kpse-common.m4]) m4_include([../../m4/kpse-freetype2-flags.m4]) m4_include([../../m4/kpse-kpathsea-flags.m4]) +m4_include([../../m4/kpse-libpaper.m4]) m4_include([../../m4/kpse-libpng-flags.m4]) m4_include([../../m4/kpse-lt-hack.m4]) m4_include([../../m4/kpse-warnings.m4]) diff --git a/Build/source/texk/dvipdfm-x/config.h.in b/Build/source/texk/dvipdfm-x/config.h.in index e43c8606b66..f5e7527b596 100644 --- a/Build/source/texk/dvipdfm-x/config.h.in +++ b/Build/source/texk/dvipdfm-x/config.h.in @@ -15,12 +15,6 @@ /* Define to 1 if you have the `close' function. */ #undef HAVE_CLOSE -/* Define to 1 if you have the `compress' function. */ -#undef HAVE_COMPRESS - -/* Define to 1 if you have the `compress2' function. */ -#undef HAVE_COMPRESS2 - /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -80,9 +74,6 @@ /* Define to 1 if you have the `open' function. */ #undef HAVE_OPEN -/* Define to 1 if you have the `png_get_image_width' function. */ -#undef HAVE_PNG_GET_IMAGE_WIDTH - /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV diff --git a/Build/source/texk/dvipdfm-x/configure b/Build/source/texk/dvipdfm-x/configure index 6e7090b963b..bb1e8982449 100755 --- a/Build/source/texk/dvipdfm-x/configure +++ b/Build/source/texk/dvipdfm-x/configure @@ -643,6 +643,8 @@ WIN32_CALL_FALSE WIN32_CALL_TRUE WIN32_FALSE WIN32_TRUE +PAPER_LIBS +PAPER_INCLUDES FREETYPE2_RULE FREETYPE2_DEPEND FREETYPE2_LIBS @@ -805,7 +807,8 @@ with_zlib_includes with_zlib_libdir with_system_libpng with_system_freetype2 -with_paper +with_paper_includes +with_paper_libdir ' ac_precious_vars='build_alias host_alias @@ -1478,7 +1481,9 @@ Optional Packages: pkg-config) --with-system-freetype2 use installed freetype2 headers and library (requires freetype-config) - --with-paper=DIR use paper include/library files from DIR + --with-paper-includes=DIR + paper headers installed in DIR + --with-paper-libdir=DIR paper library installed in DIR Some influential environment variables: CC C compiler command @@ -15713,6 +15718,10 @@ ${top_builddir}/../../libs/freetype2/ft2build.h: fi +kpse_save_CPPFLAGS=$CPPFLAGS +kpse_save_LIBS=$LIBS + + if test "x$enable_build" != xno || test -f config.force; then eval CPPFLAGS=\"$KPATHSEA_INCLUDES \$CPPFLAGS\" @@ -15730,130 +15739,97 @@ fi eval CPPFLAGS=\"$ZLIB_INCLUDES \$CPPFLAGS\" eval LIBS=\"$ZLIB_LIBS \$LIBS\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib header files and library" >&5 -$as_echo_n "checking for zlib header files and library... " >&6; } -if ${cho_cv_have_zlib+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <zlib.h> int main () { -z_stream p; +Bytef *dst,*src; uLong dstlen, srclen; int lvl, err; + err=compress2(dst, &dstlen, src, srclen, lvl); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - cho_cv_have_zlib=yes + else - cho_cv_have_zlib=no + as_fn_error $? "Sorry, you need zlib with compress2" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cho_cv_have_zlib" >&5 -$as_echo "$cho_cv_have_zlib" >&6; } -if test "x$cho_cv_have_zlib" = xyes; then : - for ac_func in compress -do : - ac_fn_c_check_func "$LINENO" "compress" "ac_cv_func_compress" -if test "x$ac_cv_func_compress" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_COMPRESS 1 -_ACEOF - -$as_echo "#define HAVE_ZLIB 1" >>confdefs.h - - for ac_func in compress2 -do : - ac_fn_c_check_func "$LINENO" "compress2" "ac_cv_func_compress2" -if test "x$ac_cv_func_compress2" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_COMPRESS2 1 -_ACEOF - -$as_echo "#define HAVE_ZLIB_COMPRESS2 1" >>confdefs.h - -fi -done - -fi -done - -fi - eval CPPFLAGS=\"$LIBPNG_INCLUDES \$CPPFLAGS\" eval LIBS=\"$LIBPNG_LIBS \$LIBS\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng header files and library" >&5 -$as_echo_n "checking for libpng header files and library... " >&6; } -if ${cho_cv_have_png+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <png.h> int main () { -png_infop p; +png_const_structp png; png_const_infop info; int err; + err=png_get_image_width(png, info); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - cho_cv_have_png=yes + else - cho_cv_have_png=no + as_fn_error $? "Sorry, you need libpng" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cho_cv_have_png" >&5 -$as_echo "$cho_cv_have_png" >&6; } -if test "x$cho_cv_have_png" = xyes; then : - for ac_func in png_get_image_width -do : - ac_fn_c_check_func "$LINENO" "png_get_image_width" "ac_cv_func_png_get_image_width" -if test "x$ac_cv_func_png_get_image_width" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PNG_GET_IMAGE_WIDTH 1 -_ACEOF -$as_echo "#define HAVE_LIBPNG 1" >>confdefs.h +CPPFLAGS=$kpse_save_CPPFLAGS +LIBS=$kpse_save_LIBS -fi -done +echo timestamp >config.force fi -CPPFLAGS=$kpse_save_CPPFLAGS -LIBS=$kpse_save_LIBS +$as_echo "#define HAVE_ZLIB 1" >>confdefs.h -echo timestamp >config.force -fi +$as_echo "#define HAVE_ZLIB_COMPRESS2 1" >>confdefs.h + + +$as_echo "#define HAVE_LIBPNG 1" >>confdefs.h + if test "x$enable_texlive_build" != xyes || test ! -d $srcdir/../kpathsea; then - _cppflags=$CPPFLAGS _ldflags=$LDFLAGS -# Check whether --with-paper was given. -if test "${with_paper+set}" = set; then : - withval=$with_paper; if test -d "$withval"; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" - fi + +# Check whether --with-paper-includes was given. +if test "${with_paper_includes+set}" = set; then : + withval=$with_paper_includes; fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for paper header files" >&5 +# Check whether --with-paper-libdir was given. +if test "${with_paper_libdir+set}" = set; then : + withval=$with_paper_libdir; +fi +case $with_paper_includes in #( + "" | yes) : + PAPER_INCLUDES= ;; #( + *) : + PAPER_INCLUDES="-I$with_paper_includes" ;; +esac +case $with_paper_libdir in #( + "" | yes) : + PAPER_LIBS= ;; #( + *) : + PAPER_LIBS="-L$with_paper_libdir" ;; +esac +CPPFLAGS="$CPPFLAGS $PAPER_INCLUDES" +LIBS="$LIBS $PAPER_LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for paper header files" >&5 $as_echo_n "checking for paper header files... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +result=no +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <paper.h> int @@ -15865,9 +15841,7 @@ struct paper *p; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing paperpswidth" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing paperpswidth" >&5 $as_echo_n "checking for library containing paperpswidth... " >&6; } if ${ac_cv_search_paperpswidth+:} false; then : $as_echo_n "(cached) " >&6 @@ -15921,17 +15895,34 @@ ac_res=$ac_cv_search_paperpswidth if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -$as_echo "#define HAVE_LIBPAPER 1" >>confdefs.h - fi -else - CPPFLAGS=$_cppflags - LDDFLAGS=$_ldflags - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + case $ac_cv_search_paperpswidth in #( + no) : + : ;; #( + "none required") : + result=yes ;; #( + *) : + result=yes + PAPER_LIBS="$PAPER_LIBS $ac_cv_search_paperpswidth" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +case $result in #( + no) : + PAPER_INCLUDES= PAPER_LIBS= ;; #( + *) : + +$as_echo "#define HAVE_LIBPAPER 1" >>confdefs.h + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5 +$as_echo "$result" >&6; } + + +CPPFLAGS=$kpse_save_CPPFLAGS +LIBS=$kpse_save_LIBS + fi diff --git a/Build/source/texk/dvipdfm-x/configure.ac b/Build/source/texk/dvipdfm-x/configure.ac index 5bf99589e79..b0efb6c6363 100644 --- a/Build/source/texk/dvipdfm-x/configure.ac +++ b/Build/source/texk/dvipdfm-x/configure.ac @@ -62,6 +62,8 @@ KPSE_ZLIB_FLAGS KPSE_LIBPNG_FLAGS KPSE_FREETYPE2_FLAGS +KPSE_SAVE_FLAGS + if test "x$enable_build" != xno || test -f config.force; then KPSE_ADD_FLAGS([kpathsea]) @@ -69,20 +71,33 @@ AC_CHECK_HEADER([kpathsea/version.h], [], [AC_MSG_ERROR([Sorry, kpathsea too old])]) KPSE_ADD_FLAGS([zlib]) -CHO_CHECK_ZLIB +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], + [[Bytef *dst,*src; uLong dstlen, srclen; int lvl, err; + err=compress2(dst, &dstlen, src, srclen, lvl);]])], + [], + [AC_MSG_ERROR([Sorry, you need zlib with compress2])]) KPSE_ADD_FLAGS([libpng]) -CHO_CHECK_LIBPNG +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <png.h>]], + [[png_const_structp png; png_const_infop info; int err; + err=png_get_image_width(png, info);]])], + [], + [AC_MSG_ERROR([Sorry, you need libpng])]) KPSE_RESTORE_FLAGS echo timestamp >config.force fi +dnl We require zlib with compress2 and libpng +AC_DEFINE([HAVE_ZLIB], 1, [Define if you have zlib and its headers.]) +AC_DEFINE([HAVE_ZLIB_COMPRESS2], 1, [Define if your zlib has the compress2 function.]) +AC_DEFINE([HAVE_LIBPNG], 1, [Define if you have libpng and its headers.]) + dnl Check for additional libraries. if test "x$enable_texlive_build" != xyes || test ! -d $srcdir/../kpathsea; then - CHO_CHECK_LIBPAPER + KPSE_LIBPAPER fi KPSE_WIN32_CALL diff --git a/Build/source/texk/dvipdfm-x/dvipdfm-ann.test b/Build/source/texk/dvipdfm-x/dvipdfm-ann.test index f574bd4da81..74e1021692b 100755 --- a/Build/source/texk/dvipdfm-x/dvipdfm-ann.test +++ b/Build/source/texk/dvipdfm-x/dvipdfm-ann.test @@ -13,8 +13,8 @@ export TEXMFCNF TEXFONTS DVIPDFMXINPUTS TEXPICTS failed= -echo "*** dvipdfmx -v -o grahn1.pdf grahn" && echo \ - && ./dvipdfmx -v -o grahn1.pdf ${srcdir}/tests/grahn \ +echo "*** dvipdfmx -v -o annot1.pdf annot" && echo \ + && ./dvipdfmx -v -o annot1.pdf ${srcdir}/tests/annot \ && echo && echo "dvipdfmx-ann tests OK" && echo \ || failed="$failed dvipdfmx-ann" diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.c b/Build/source/texk/dvipdfm-x/pdfdoc.c index 8a1b679c328..80c0d32881c 100644 --- a/Build/source/texk/dvipdfm-x/pdfdoc.c +++ b/Build/source/texk/dvipdfm-x/pdfdoc.c @@ -1646,7 +1646,7 @@ pdf_doc_close_names (pdf_doc *p) void pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, - pdf_obj *annot_dict, int new_annot) + pdf_obj *annot_dict) { pdf_doc *p = &pdoc; pdf_page *page; @@ -1691,9 +1691,6 @@ pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, pdf_add_array(page->annots, pdf_ref_obj(annot_dict)); - if (new_annot) - pdf_doc_add_goto(annot_dict); - return; } @@ -2650,10 +2647,9 @@ pdf_doc_end_grabbing (pdf_obj *attrib) static struct { int dirty; - int broken; pdf_obj *annot_dict; pdf_rect rect; -} breaking_state = {0, 0, NULL, {0.0, 0.0, 0.0, 0.0}}; +} breaking_state = {0, NULL, {0.0, 0.0, 0.0, 0.0}}; static void reset_box (void) @@ -2667,7 +2663,6 @@ void pdf_doc_begin_annot (pdf_obj *dict) { breaking_state.annot_dict = dict; - breaking_state.broken = 0; reset_box(); } @@ -2688,10 +2683,8 @@ pdf_doc_break_annot (void) annot_dict = pdf_new_dict(); pdf_merge_dict(annot_dict, breaking_state.annot_dict); pdf_doc_add_annot(pdf_doc_current_page_number(), &(breaking_state.rect), - annot_dict, !breaking_state.broken); + annot_dict); pdf_release_obj(annot_dict); - - breaking_state.broken = 1; } reset_box(); } diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.h b/Build/source/texk/dvipdfm-x/pdfdoc.h index 2281f036fd2..0b9b27553e9 100644 --- a/Build/source/texk/dvipdfm-x/pdfdoc.h +++ b/Build/source/texk/dvipdfm-x/pdfdoc.h @@ -115,8 +115,7 @@ extern void pdf_doc_end_grabbing (pdf_obj *attrib); /* Annotation */ extern void pdf_doc_add_annot (unsigned page_no, const pdf_rect *rect, - pdf_obj *annot_dict, - int dest_is_new); + pdf_obj *annot_dict); /* Annotation with auto- clip and line (or page) break */ extern void pdf_doc_begin_annot (pdf_obj *dict); diff --git a/Build/source/texk/dvipdfm-x/pdfnames.c b/Build/source/texk/dvipdfm-x/pdfnames.c index 894382a2591..323b7d38a75 100644 --- a/Build/source/texk/dvipdfm-x/pdfnames.c +++ b/Build/source/texk/dvipdfm-x/pdfnames.c @@ -111,7 +111,6 @@ pdf_new_name_tree (void) return names; } -#ifdef XETEX static void flush_objects (struct ht_table *ht_tab) { @@ -142,42 +141,13 @@ flush_objects (struct ht_table *ht_tab) ht_clear_iter(&iter); } } -#else -static void -check_objects_defined (struct ht_table *ht_tab) -{ - struct ht_iter iter; - - if (ht_set_iter(ht_tab, &iter) >= 0) { - do { - char *key; - int keylen; - struct obj_data *value; - - key = ht_iter_getkey(&iter, &keylen); - value = ht_iter_getval(&iter); - ASSERT(value->object); - if (PDF_OBJ_UNDEFINED(value->object)) { - pdf_names_add_object(ht_tab, key, keylen, pdf_new_null()); - WARN("Object @%s used, but not defined. Replaced by null.", - printable_key(key, keylen)); - } - } while (ht_iter_next(&iter) >= 0); - ht_clear_iter(&iter); - } -} -#endif void pdf_delete_name_tree (struct ht_table **names) { ASSERT(names && *names); -#ifdef XETEX flush_objects (*names); -#else - check_objects_defined(*names); -#endif ht_clear_table(*names); RELEASE(*names); diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index e5ae24f1294..a30ba031954 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -685,7 +685,7 @@ spc_handler_pdfm_annot (struct spc_env *spe, struct spc_arg *args) if (ident) spc_push_object(ident, pdf_link_obj(annot_dict)); /* Add this reference. */ - pdf_doc_add_annot(pdf_doc_current_page_number(), &rect, annot_dict, 1); + pdf_doc_add_annot(pdf_doc_current_page_number(), &rect, annot_dict); if (ident) { spc_flush_object(ident); diff --git a/Build/source/texk/dvipdfm-x/tests/annot.dvi b/Build/source/texk/dvipdfm-x/tests/annot.dvi Binary files differnew file mode 100644 index 00000000000..7ea86daa1f5 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/annot.dvi diff --git a/Build/source/texk/dvipdfm-x/tests/annot.tex b/Build/source/texk/dvipdfm-x/tests/annot.tex new file mode 100644 index 00000000000..c57f2ca5786 --- /dev/null +++ b/Build/source/texk/dvipdfm-x/tests/annot.tex @@ -0,0 +1,22 @@ +% +\special{pdf:obj @tug <</S/URI /URI (http://www.tug.org)>>} + +\special{pdf:bann <</Subtype/Link /A @tug>>}% +TUG on the web +\special{pdf:eann}% + +\vskip 20 bp + +some text +\special{pdf:ann @foo width 15 pt height 10truebp depth 5 true bp <</Subtype/Link /A @tug>>} +\hskip 15 pt +more text + +\vskip 150 bp + +some more text +\special{pdf:ann @bar bbox 0 0 180 90 <</Subtype/Link /A @tug>>} +\hskip 180 bp +final text text + +\bye diff --git a/Build/source/texk/dvipdfm-x/tests/grahn.dvi b/Build/source/texk/dvipdfm-x/tests/grahn.dvi Binary files differdeleted file mode 100644 index 39cbb802741..00000000000 --- a/Build/source/texk/dvipdfm-x/tests/grahn.dvi +++ /dev/null diff --git a/Build/source/texk/dvipdfm-x/tests/grahn.tex b/Build/source/texk/dvipdfm-x/tests/grahn.tex deleted file mode 100644 index eda2974a6fb..00000000000 --- a/Build/source/texk/dvipdfm-x/tests/grahn.tex +++ /dev/null @@ -1,8 +0,0 @@ -% -\special{pdf:obj @tug <</S/URI /URI (http://www.tug.org)>>} - -\special{pdf:bann <</Subtype/Link /A @tug>>}% -TUG on the web -\special{pdf:eann}% - -\bye diff --git a/Build/source/texk/dvipdfm-x/xdvipdfm-ann.test b/Build/source/texk/dvipdfm-x/xdvipdfm-ann.test index bdb35cad5f3..5ea0d0be35a 100755 --- a/Build/source/texk/dvipdfm-x/xdvipdfm-ann.test +++ b/Build/source/texk/dvipdfm-x/xdvipdfm-ann.test @@ -13,8 +13,8 @@ export TEXMFCNF TEXFONTS DVIPDFMXINPUTS TEXPICTS failed= -echo "*** xdvipdfmx -v -o grahn2.pdf grahn" && echo \ - && ./xdvipdfmx -v -o grahn2.pdf ${srcdir}/tests/grahn \ +echo "*** xdvipdfmx -v -o annot2.pdf annot" && echo \ + && ./xdvipdfmx -v -o annot2.pdf ${srcdir}/tests/annot \ && echo && echo "xdvipdfmx-ann tests OK" && echo \ || failed="$failed xdvipdfmx-ann" diff --git a/Build/source/texk/dvipdfm-x/xdvipdfmx.test b/Build/source/texk/dvipdfm-x/xdvipdfmx.test index 6e858aa5612..d9354034a8a 100755 --- a/Build/source/texk/dvipdfm-x/xdvipdfmx.test +++ b/Build/source/texk/dvipdfm-x/xdvipdfmx.test @@ -21,16 +21,11 @@ echo "*** xdvipdfmx --help" \ && echo && echo "xdvipdfmx-help tests OK" && echo \ || failed="$failed xdvipdfmx-help" -# This test can fail (why?) and is skipped unless XDVIPDFMX_IMAGE is non-empty. -if test -z "$XDVIPDFMX_IMAGE"; then :; else - echo "*** xdvipdfmx -v -o image2.pdf image" && echo \ && ./xdvipdfmx -v -o image2.pdf ${srcdir}/tests/image \ && echo && echo "xdvipdfmx-image tests OK" && echo \ || failed="$failed xdvipdfmx-image" -fi - test -z "$failed" && exit 0 echo echo "failed tests:$failed" |