From 143b6c7a6abbcb2d62758617328168e53f3dc475 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Wed, 15 Dec 2010 16:03:07 +0000 Subject: dvipng 1.14 git-svn-id: svn://tug.org/texlive/trunk@20753 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/README | 3 +- Build/source/texk/dvipng/ChangeLog | 5 + Build/source/texk/dvipng/configure | 26 +- Build/source/texk/dvipng/configure.ac | 5 +- Build/source/texk/dvipng/doc/dvipng.help | 8 +- Build/source/texk/dvipng/doc/dvipng.info | 330 +++--- Build/source/texk/dvipng/doc/dvipng.texi | 173 ++- .../texk/dvipng/dvipng-1.13-PATCHES/ChangeLog | 62 - .../texk/dvipng/dvipng-1.13-PATCHES/TL-Changes | 17 - .../dvipng/dvipng-1.13-PATCHES/patch-20-rpl_malloc | 36 - .../texk/dvipng/dvipng-1.13-PATCHES/patch-21-win32 | 23 - .../dvipng-1.13-PATCHES/patch-22-win32-bugfix | 93 -- Build/source/texk/dvipng/dvipng-1.13/COPYING | 674 ----------- .../source/texk/dvipng/dvipng-1.13/COPYING.LESSER | 165 --- Build/source/texk/dvipng/dvipng-1.13/ChangeLog | 1185 ------------------- Build/source/texk/dvipng/dvipng-1.13/ChangeLog.0 | 903 -------------- Build/source/texk/dvipng/dvipng-1.13/INSTALL | 168 --- Build/source/texk/dvipng/dvipng-1.13/Makefile.in | 168 --- Build/source/texk/dvipng/dvipng-1.13/README | 128 -- Build/source/texk/dvipng/dvipng-1.13/RELEASE | 13 - Build/source/texk/dvipng/dvipng-1.13/aclocal.m4 | 237 ---- Build/source/texk/dvipng/dvipng-1.13/color.c | 443 ------- Build/source/texk/dvipng/dvipng-1.13/commands.h | 196 ---- Build/source/texk/dvipng/dvipng-1.13/config.h.in | 224 ---- Build/source/texk/dvipng/dvipng-1.13/configure.ac | 225 ---- Build/source/texk/dvipng/dvipng-1.13/draw.c | 395 ------- Build/source/texk/dvipng/dvipng-1.13/dvi.c | 484 -------- Build/source/texk/dvipng/dvipng-1.13/dvipng.1 | 508 -------- Build/source/texk/dvipng/dvipng-1.13/dvipng.c | 164 --- Build/source/texk/dvipng/dvipng-1.13/dvipng.h | 566 --------- Build/source/texk/dvipng/dvipng-1.13/enc.c | 128 -- Build/source/texk/dvipng/dvipng-1.13/font.c | 356 ------ Build/source/texk/dvipng/dvipng-1.13/fontmap.c | 340 ------ Build/source/texk/dvipng/dvipng-1.13/ft.c | 173 --- Build/source/texk/dvipng/dvipng-1.13/miktex.h | 272 ----- Build/source/texk/dvipng/dvipng-1.13/miktex.mak | 196 ---- Build/source/texk/dvipng/dvipng-1.13/misc.c | 848 -------------- Build/source/texk/dvipng/dvipng-1.13/papersiz.c | 73 -- Build/source/texk/dvipng/dvipng-1.13/pk.c | 403 ------- Build/source/texk/dvipng/dvipng-1.13/ppagelist.c | 189 --- Build/source/texk/dvipng/dvipng-1.13/set.c | 289 ----- Build/source/texk/dvipng/dvipng-1.13/sfd.c | 176 --- Build/source/texk/dvipng/dvipng-1.13/special.c | 902 -------------- Build/source/texk/dvipng/dvipng-1.13/t1.c | 192 --- .../source/texk/dvipng/dvipng-1.13/test_dvipng.tex | 48 - Build/source/texk/dvipng/dvipng-1.13/tfm.c | 75 -- Build/source/texk/dvipng/dvipng-1.13/vf.c | 144 --- .../texk/dvipng/dvipng-1.14-PATCHES/ChangeLog | 71 ++ .../texk/dvipng/dvipng-1.14-PATCHES/TL-Changes | 17 + .../dvipng-1.14-PATCHES/patch-01-gd-copyright | 47 + .../texk/dvipng/dvipng-1.14-PATCHES/patch-02-const | 15 + Build/source/texk/dvipng/dvipng-1.14/COPYING | 674 +++++++++++ .../source/texk/dvipng/dvipng-1.14/COPYING.LESSER | 165 +++ Build/source/texk/dvipng/dvipng-1.14/ChangeLog | 1230 ++++++++++++++++++++ Build/source/texk/dvipng/dvipng-1.14/ChangeLog.0 | 903 ++++++++++++++ Build/source/texk/dvipng/dvipng-1.14/INSTALL | 168 +++ Build/source/texk/dvipng/dvipng-1.14/Makefile.in | 169 +++ Build/source/texk/dvipng/dvipng-1.14/README | 128 ++ Build/source/texk/dvipng/dvipng-1.14/RELEASE | 15 + Build/source/texk/dvipng/dvipng-1.14/aclocal.m4 | 237 ++++ Build/source/texk/dvipng/dvipng-1.14/color.c | 443 +++++++ Build/source/texk/dvipng/dvipng-1.14/commands.h | 196 ++++ Build/source/texk/dvipng/dvipng-1.14/config.h.in | 224 ++++ Build/source/texk/dvipng/dvipng-1.14/configure.ac | 225 ++++ Build/source/texk/dvipng/dvipng-1.14/draw.c | 395 +++++++ Build/source/texk/dvipng/dvipng-1.14/dvi.c | 484 ++++++++ Build/source/texk/dvipng/dvipng-1.14/dvipng.1 | 513 ++++++++ Build/source/texk/dvipng/dvipng-1.14/dvipng.c | 164 +++ Build/source/texk/dvipng/dvipng-1.14/dvipng.h | 566 +++++++++ Build/source/texk/dvipng/dvipng-1.14/dvipng.texi | 1034 ++++++++++++++++ Build/source/texk/dvipng/dvipng-1.14/enc.c | 129 ++ Build/source/texk/dvipng/dvipng-1.14/font.c | 356 ++++++ Build/source/texk/dvipng/dvipng-1.14/fontmap.c | 340 ++++++ Build/source/texk/dvipng/dvipng-1.14/ft.c | 173 +++ Build/source/texk/dvipng/dvipng-1.14/install.texi | 203 ++++ Build/source/texk/dvipng/dvipng-1.14/macros.texi | 61 + Build/source/texk/dvipng/dvipng-1.14/miktex.h | 272 +++++ Build/source/texk/dvipng/dvipng-1.14/miktex.mak | 196 ++++ Build/source/texk/dvipng/dvipng-1.14/misc.c | 867 ++++++++++++++ Build/source/texk/dvipng/dvipng-1.14/papersiz.c | 74 ++ Build/source/texk/dvipng/dvipng-1.14/pk.c | 403 +++++++ Build/source/texk/dvipng/dvipng-1.14/ppagelist.c | 189 +++ Build/source/texk/dvipng/dvipng-1.14/readme.texi | 161 +++ Build/source/texk/dvipng/dvipng-1.14/set.c | 289 +++++ Build/source/texk/dvipng/dvipng-1.14/sfd.c | 179 +++ Build/source/texk/dvipng/dvipng-1.14/special.c | 850 ++++++++++++++ Build/source/texk/dvipng/dvipng-1.14/t1.c | 192 +++ .../source/texk/dvipng/dvipng-1.14/test_dvipng.tex | 48 + Build/source/texk/dvipng/dvipng-1.14/tfm.c | 75 ++ Build/source/texk/dvipng/dvipng-1.14/vf.c | 144 +++ 90 files changed, 13617 insertions(+), 12098 deletions(-) delete mode 100644 Build/source/texk/dvipng/dvipng-1.13-PATCHES/ChangeLog delete mode 100644 Build/source/texk/dvipng/dvipng-1.13-PATCHES/TL-Changes delete mode 100644 Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-20-rpl_malloc delete mode 100644 Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-21-win32 delete mode 100644 Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-22-win32-bugfix delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/COPYING delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/COPYING.LESSER delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/ChangeLog delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/ChangeLog.0 delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/INSTALL delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/Makefile.in delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/README delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/RELEASE delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/aclocal.m4 delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/color.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/commands.h delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/config.h.in delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/configure.ac delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/draw.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/dvi.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/dvipng.1 delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/dvipng.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/dvipng.h delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/enc.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/font.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/fontmap.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/ft.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/miktex.h delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/miktex.mak delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/misc.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/papersiz.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/pk.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/ppagelist.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/set.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/sfd.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/special.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/t1.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/test_dvipng.tex delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/tfm.c delete mode 100644 Build/source/texk/dvipng/dvipng-1.13/vf.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog create mode 100644 Build/source/texk/dvipng/dvipng-1.14-PATCHES/TL-Changes create mode 100644 Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-01-gd-copyright create mode 100644 Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-02-const create mode 100644 Build/source/texk/dvipng/dvipng-1.14/COPYING create mode 100644 Build/source/texk/dvipng/dvipng-1.14/COPYING.LESSER create mode 100644 Build/source/texk/dvipng/dvipng-1.14/ChangeLog create mode 100644 Build/source/texk/dvipng/dvipng-1.14/ChangeLog.0 create mode 100644 Build/source/texk/dvipng/dvipng-1.14/INSTALL create mode 100644 Build/source/texk/dvipng/dvipng-1.14/Makefile.in create mode 100644 Build/source/texk/dvipng/dvipng-1.14/README create mode 100644 Build/source/texk/dvipng/dvipng-1.14/RELEASE create mode 100644 Build/source/texk/dvipng/dvipng-1.14/aclocal.m4 create mode 100644 Build/source/texk/dvipng/dvipng-1.14/color.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/commands.h create mode 100644 Build/source/texk/dvipng/dvipng-1.14/config.h.in create mode 100644 Build/source/texk/dvipng/dvipng-1.14/configure.ac create mode 100644 Build/source/texk/dvipng/dvipng-1.14/draw.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/dvi.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/dvipng.1 create mode 100644 Build/source/texk/dvipng/dvipng-1.14/dvipng.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/dvipng.h create mode 100644 Build/source/texk/dvipng/dvipng-1.14/dvipng.texi create mode 100644 Build/source/texk/dvipng/dvipng-1.14/enc.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/font.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/fontmap.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/ft.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/install.texi create mode 100644 Build/source/texk/dvipng/dvipng-1.14/macros.texi create mode 100644 Build/source/texk/dvipng/dvipng-1.14/miktex.h create mode 100644 Build/source/texk/dvipng/dvipng-1.14/miktex.mak create mode 100644 Build/source/texk/dvipng/dvipng-1.14/misc.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/papersiz.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/pk.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/ppagelist.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/readme.texi create mode 100644 Build/source/texk/dvipng/dvipng-1.14/set.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/sfd.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/special.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/t1.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/test_dvipng.tex create mode 100644 Build/source/texk/dvipng/dvipng-1.14/tfm.c create mode 100644 Build/source/texk/dvipng/dvipng-1.14/vf.c (limited to 'Build') diff --git a/Build/source/texk/README b/Build/source/texk/README index b75ad32e621..a05d4491424 100644 --- a/Build/source/texk/README +++ b/Build/source/texk/README @@ -50,10 +50,9 @@ dvipdfmx - checked 5apr10 http://project.ktug.or.kr/dvipdfmx/snapshot/latest/dvipdfmx-20100328.tar.gz dvipdfmx@project.ktug.or.kr (ChoF, Matthias, Hirata) -dvipng - checked 18mar10 +dvipng 1.14 - checked 15dec10 http://www.ctan.org/tex-archive/dviware/dvipng/ (but maybe stale) http://savannah.nongnu.org/files/?group=dvipng - http://mirror.cinquix.com/pub/savannah/dvipng/dvipng-1.13.tar.gz dvipos - ? diff --git a/Build/source/texk/dvipng/ChangeLog b/Build/source/texk/dvipng/ChangeLog index c6920a87d3c..2a31f5ab086 100644 --- a/Build/source/texk/dvipng/ChangeLog +++ b/Build/source/texk/dvipng/ChangeLog @@ -1,3 +1,8 @@ +2010-12-15 Peter Breitenlohner + + * Imported release 1.14 from savannah.nongnu.org. + * configure.ac: Adapted. + 2010-05-30 Vladimir Volovich * dvipng.test: use `...` not $(...). diff --git a/Build/source/texk/dvipng/configure b/Build/source/texk/dvipng/configure index 26781706232..5c9821e518c 100755 --- a/Build/source/texk/dvipng/configure +++ b/Build/source/texk/dvipng/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for dvipng 1.13. +# Generated by GNU Autoconf 2.68 for dvipng 1.14. # # Report bugs to . # @@ -570,12 +570,12 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvipng' PACKAGE_TARNAME='dvipng' -PACKAGE_VERSION='1.13' -PACKAGE_STRING='dvipng 1.13' +PACKAGE_VERSION='1.14' +PACKAGE_STRING='dvipng 1.14' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' -ac_unique_file="dvipng-1.13/dvipng.c" +ac_unique_file="dvipng-1.14/dvipng.c" # Factoring default headers for most tests. ac_includes_default="\ #include @@ -1356,7 +1356,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 dvipng 1.13 to adapt to many kinds of systems. +\`configure' configures dvipng 1.14 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1426,7 +1426,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvipng 1.13:";; + short | recursive ) echo "Configuration of dvipng 1.14:";; esac cat <<\_ACEOF @@ -1559,7 +1559,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvipng configure 1.13 +dvipng configure 1.14 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2166,7 +2166,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 dvipng $as_me 1.13, which was +It was created by dvipng $as_me 1.14, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -7523,7 +7523,7 @@ fi # Define the identity of the package. PACKAGE='dvipng' - VERSION='1.13' + VERSION='1.14' cat >>confdefs.h <<_ACEOF @@ -14809,7 +14809,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -dvipng config.lt 1.13 +dvipng config.lt 1.14 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. @@ -16394,7 +16394,7 @@ $as_echo " ac_config_headers="$ac_config_headers config.h" -DVIPNG_TREE=dvipng-1.13 +DVIPNG_TREE=dvipng-1.14 ac_config_files="$ac_config_files Makefile help/Makefile doc/Makefile" @@ -16958,7 +16958,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 dvipng $as_me 1.13, which was +This file was extended by dvipng $as_me 1.14, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17024,7 +17024,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="\\ -dvipng config.status 1.13 +dvipng config.status 1.14 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/dvipng/configure.ac b/Build/source/texk/dvipng/configure.ac index d67c2a95e05..4ae238768d1 100644 --- a/Build/source/texk/dvipng/configure.ac +++ b/Build/source/texk/dvipng/configure.ac @@ -13,7 +13,7 @@ dnl Copyright (C) 2002-2008 Jan- dnl dnl ********************************************************************* dnl -m4_define([dvipng_version], [1.13])[]dnl using unmodified dvipng source tree +m4_define([dvipng_version], [1.14])[]dnl using unmodified dvipng source tree AC_INIT([dvipng], dvipng_version, [tex-k@tug.org]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR([dvipng-]dvipng_version[/dvipng.c]) @@ -192,8 +192,7 @@ AC_MSG_RESULT([ AC_CONFIG_HEADERS([config.h]) -DVIPNG_TREE=[dvipng-]dvipng_version -AC_SUBST([DVIPNG_TREE]) +AC_SUBST([DVIPNG_TREE], [dvipng-]dvipng_version) AC_CONFIG_FILES([Makefile help/Makefile doc/Makefile]) diff --git a/Build/source/texk/dvipng/doc/dvipng.help b/Build/source/texk/dvipng/doc/dvipng.help index 39222a917ac..5bf62a29297 100644 --- a/Build/source/texk/dvipng/doc/dvipng.help +++ b/Build/source/texk/dvipng/doc/dvipng.help @@ -1,4 +1,4 @@ -This is ./dvipng 1.13 Copyright 2002-2010 Jan-Ake Larsson +This is ./dvipng 1.14 Copyright 2002-2010 Jan-Ake Larsson Usage: ./dvipng [OPTION]... FILENAME[.dvi] Options are chosen to be similar to dvips' options where possible: @@ -22,12 +22,13 @@ These do not correspond to dvips options: --dvinum* Use TeX page numbers in output filenames -fg s Foreground color (TeX-style color) --follow* Wait for data at end-of-file - --freetype* FreeType font rendering (default on) + --freetype* FreeType font rendering (preferred, default on) --gamma # Control color interpolation --gif Output GIF images (dvigif default) --height* Output the image height on stdout - --noghostscript* Don't use ghostscript for PostScript specials + --nogs* Don't use ghostscript for PostScript specials --nogssafer* Don't use -dSAFER in ghostscript calls + --norawps* Don't convert raw PostScript specials --palette* Force palette output --picky When a warning occurs, don't output image --png Output PNG images (dvipng default) @@ -35,6 +36,7 @@ These do not correspond to dvips options: --t1lib* T1lib font rendering (default on) --truecolor* Truecolor output -Q # Quality (T1lib and PK subsampling) + --width* Output the image width on stdout -z # PNG compression level # = number f = file s = string * = suffix, '0' to turn off diff --git a/Build/source/texk/dvipng/doc/dvipng.info b/Build/source/texk/dvipng/doc/dvipng.info index 5f5a66fef70..62d070278ad 100644 --- a/Build/source/texk/dvipng/doc/dvipng.info +++ b/Build/source/texk/dvipng/doc/dvipng.info @@ -1,5 +1,4 @@ -This is ../../../../texk/dvipng/doc/dvipng.info, produced by makeinfo -version 4.13 from ../../../../texk/dvipng/doc/dvipng.texi. +This is dvipng.info, produced by makeinfo version 4.13 from dvipng.texi. INFO-DIR-SECTION TeX START-INFO-DIR-ENTRY @@ -16,7 +15,7 @@ dvipng This manual documents dvipng, a program to translate a DVI (DeVice Independent) file into PNG (Portable Network Graphics). - This file documents dvipng version 1.13 + This file documents dvipng version 1.14 Corrections or perhaps rewrites of sections are _very welcome_. @@ -290,14 +289,15 @@ output as `foo1.png', `foo2.png', `foo3.png', and `foo4.png', respectively. If you have enabled the PostScript font support (via FreeType or -T1lib), fonts will be rendered as they are needed. Otherwise, if you -use fonts that have not been used on your system before, they may be -automatically generated; this process can take a few minutes, so -progress reports appear by default. The next time the same font is -used, it will have been saved on disk, so rendering will go much -faster. (If dvipng tries to endlessly generate the same fonts over and -over again, something is wrong. *Note Unable to generate fonts: -(kpathsea)Unable to generate fonts.) +T1lib), fonts will be rendered as they are needed. Otherwise, dvipng +will use bitmapped (PK) fonts, and if you use PK fonts that have not +been used on your system before, they may be automatically generated; +this process can take a few minutes, so progress reports appear by +default. The next time the same font is used, it will have been saved +on disk, so rendering will go much faster. (If dvipng tries to +endlessly generate the same fonts over and over again, something is +wrong. *Note Unable to generate fonts: (kpathsea)Unable to generate +fonts.) Many options are available (see the next section). For a brief summary of available options, just type @@ -327,7 +327,7 @@ File: dvipng.info, Node: Option summary, Next: Option details, Up: Command-li Here is a handy summary of the options; it is printed out when you run dvipng with no arguments or with the standard `--help' option. - This is ./dvipng 1.13 Copyright 2002-2010 Jan-Ake Larsson + This is ./dvipng 1.14 Copyright 2002-2010 Jan-Ake Larsson Usage: ./dvipng [OPTION]... FILENAME[.dvi] Options are chosen to be similar to dvips' options where possible: @@ -351,12 +351,13 @@ dvipng with no arguments or with the standard `--help' option. --dvinum* Use TeX page numbers in output filenames -fg s Foreground color (TeX-style color) --follow* Wait for data at end-of-file - --freetype* FreeType font rendering (default on) + --freetype* FreeType font rendering (preferred, default on) --gamma # Control color interpolation --gif Output GIF images (dvigif default) --height* Output the image height on stdout - --noghostscript* Don't use ghostscript for PostScript specials + --nogs* Don't use ghostscript for PostScript specials --nogssafer* Don't use -dSAFER in ghostscript calls + --norawps* Don't convert raw PostScript specials --palette* Force palette output --picky When a warning occurs, don't output image --png Output PNG images (dvipng default) @@ -364,6 +365,7 @@ dvipng with no arguments or with the standard `--help' option. --t1lib* T1lib font rendering (default on) --truecolor* Truecolor output -Q # Quality (T1lib and PK subsampling) + --width* Output the image width on stdout -z # PNG compression level # = number f = file s = string * = suffix, '0' to turn off @@ -404,9 +406,11 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. *Note Color::. `--bdpi NUM' - Set the base (Metafont) resolution, both horizontal and vertical, - to NUM dpi (dots per inch). This option is necessary when manually - selecting Metafont mode with the -mode option (see below). + This option only has an effect when using bitmapped (PK) fonts. The + option sets the base (Metafont) resolution, both horizontal and + vertical, to NUM dpi (dots per inch). This option is necessary + when manually selecting Metafont mode with the -mode option (see + below). `-bg COLOR_SPEC' Choose background color for the images. This option will be @@ -480,12 +484,12 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. PostScript Type1 and TrueType fonts internally, rather than using `gsftopk' for rendering the fonts. If you have PostScript versions of Computer Modern installed, there will be no need to generate - bitmapped variants on disk of these. Then, you can render images - at different (and unusual) resolutions without cluttering the disk - with lots of bitmapped fonts. Note that if you have both FreeType - and T1lib on your system, FreeType will be preferred by dvipng. If - you for some reason would want to use T1lib rendering, use this - option. + bitmapped (PK) variants on disk of these. Then, you can render + images at different (and unusual) resolutions without cluttering + the disk with lots of bitmapped fonts. Note that if you have both + FreeType and T1lib on your system, FreeType will be preferred by + dvipng. If you for some reason would want to use T1lib rendering, + use this option. `--gamma NUM' Control the interpolation of colors in the greyscale anti-aliasing @@ -518,22 +522,21 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. document, no matter what the pages are actually numbered. `--mode MODE' - Use MODE as the Metafont device name for the PK fonts (both for - path searching and font generation). This needs to be augmented - with the base device resolution, given with the `--bdpi' option. - See the file `ftp://ftp.tug.org/tex/modes.mf' for a list of + This option only has an effect when using bitmapped (PK) fonts. Use + MODE as the Metafont device name for the PK fonts (both for path + searching and font generation). This needs to be augmented with + the base device resolution, given with the `--bdpi' option. See + the file `ftp://ftp.tug.org/tex/modes.mf' for a list of resolutions and mode names for most devices. *Note Unable to generate fonts: (kpathsea)Unable to generate fonts. `-M*' - Turns off automatic PK font generation (`mktexpk'). This will have - no effect when using PostScript fonts, since no PK font generation - will be done anyway. + This option only has an effect when using bitmapped (PK) fonts. It + turns off automatic PK font generation (`mktexpk'). -`--noghostscript*' +`--nogs*' This switch prohibits the internal call to GhostScript for - displaying PostScript specials. `--noghostscript0' turns the call - back on. + displaying PostScript specials. `--nogs0' turns the call back on. `--nogssafer*' Normally, if GhostScript is used to render PostScript specials, the @@ -543,6 +546,12 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. as deletefile, to prevent possibly malicious PostScript programs from having any effect. +`--norawps*' + Some packages generate raw PostScript specials, even non-rendering + such specials. This switch turns off the internal call to + GhostScript intended to display these raw PostScript specials. + `--norawps0' turns the call back on. + `-o NAME' Send output to the file NAME. A single occurrence of `%d' or `%01d', ..., `%09d' will be exchanged for the physical page number @@ -566,14 +575,13 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. the document, no matter what the pages are actually numbered. `--palette*' - Starting from `dvipng' 1.8, the output PNG will be a truecolor png - when an external image is included, to avoid unnecessary delay and - quality reduction, and enable the EPS translator to draw on a - transparent background and outside of the boundingbox. This switch - will force palette (256-color) output and make `dvipng' revert to - the old behaviour, where included images were opaque and always - clipped to the boundingbox. This will also override the - `--truecolor' switch if present. + When an external image is included, `dvipng' will automatically + switch to truecolor mode, to avoid unnecessary delay and quality + reduction, and enable the EPS translator to draw on a transparent + background and outside of the boundingbox. This switch will force + palette (256-color) output and make `dvipng' revert to opaque + clipped image inclusion. This will also override the `--truecolor' + switch if present. `--picky*' No images are output when a warning occurs. Normally, dvipng will @@ -612,10 +620,10 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. `-Q NUM' Set the quality to NUM. That is, choose the number of antialiasing - levels for PK and T1lib rendering to be NUM*NUM+1. The default - value is 4 which gives 17 levels of antialiasing for antialiased - fonts from these two. If FreeType is available, its rendering is - unaffected by this option. + levels for bitmapped fonts (PK) and fonts rendered using T1lib, to + be NUM*NUM+1. The default value is 4 which gives 17 levels of + antialiasing for antialiased fonts from these two. If FreeType is + available, its rendering is unaffected by this option. `-r*' Toggle output of pages in reverse/forward order. By default, the @@ -639,17 +647,17 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. all ink put on the page, producing neat images. `--t1lib*' - Enable/disable T1lib font rendering (default on). This option is - available if the T1lib font library was present at compilation - time. If this is the case, dvipng will have direct support for - PostScript Type1 fonts internally, rather than using `gsftopk' for - rendering the fonts. If you have PostScript versions of Computer - Modern installed, there will be no need to generate bitmapped - variants on disk of these. Then, you can render images at - different (and unusual) resolutions without cluttering the disk - with lots of bitmapped fonts. Note that if you have both FreeType - and T1lib on your system FreeType will be preferred by dvipng, and - if you for some reason rather want to use T1lib, give the option + Enable T1lib font rendering (default on). This option is available + if the T1lib font library was present at compilation time. If this + is the case, dvipng will have direct support for PostScript Type1 + fonts internally, rather than using `gsftopk' for rendering the + fonts. If you have PostScript versions of Computer Modern + installed, there will be no need to generate bitmapped variants on + disk of these. Then, you can render images at different (and + unusual) resolutions without cluttering the disk with lots of + bitmapped fonts. Note that if you have both FreeType and T1lib on + your system, FreeType will be preferred by dvipng, and if you for + some reason rather want to use T1lib, give the option `--freetype0' (see above). `--truecolor*' @@ -667,12 +675,14 @@ reversal, use `-r0'. Such options are marked with a trailing `*'. Report the width of the image. See also `--height' and `--depth'. `-x NUM' - Set the x magnification ratio to NUM/1000. Overrides the - magnification specified in the DVI file. Must be between 10 and - 100000. It is recommended that you use standard magstep values - (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help - reduce the total number of PK files generated. NUM may be a real - number, not an integer, for increased precision. + This option is deprecated; it should not be used. It is much + better to select the output resolution directly with the `-D' + option. This option sets the magnification ratio to NUM/1000 and + overrides the magnification specified in the DVI file. Must be + between 10 and 100000. It is recommended that you use standard + magstep values (1095, 1200, 1440, 1728, 2074, 2488, 2986, and so + on) to help reduce the total number of PK files generated. NUM + may be a real number, not an integer, for increased precision. `-z NUM' Set the PNG compression level to NUM. This option is enabled if @@ -699,12 +709,15 @@ File: dvipng.info, Node: Graphics, Next: Color, Prev: Command-line options, `graphics' packages, without the need of specifying a driver to these packages. This means that it recognizes the encapsulated postscript inclusion meant for `dvips', but is also able (from version 1.8) to -include bitmapped graphics, see the details below. +include bitmapped graphics. It also tries to handle some of the raw +PostScript that is output from various packages. Some of the +possibilities and problems are mentioned below. * Menu: * Encapsulated PostScript:: An internal call to GhostScript * Bitmapped graphics:: PNG, JPEG and GIF +* Raw PostScript:: Ignore or give to GhostScript  File: dvipng.info, Node: Encapsulated PostScript, Next: Bitmapped graphics, Up: Graphics @@ -736,7 +749,7 @@ can be specified in the `\includegraphics' call, as in this example \includegraphics[bb=10 20 100 200]{imagename.eps}  -File: dvipng.info, Node: Bitmapped graphics, Prev: Encapsulated PostScript, Up: Graphics +File: dvipng.info, Node: Bitmapped graphics, Next: Raw PostScript, Prev: Encapsulated PostScript, Up: Graphics 5.2 Bitmapped graphics ====================== @@ -762,6 +775,48 @@ on. Simple, eh? The example above at 200 dpi would be 1.5 inches wide: \includegraphics[bb=0 0 300 400,witdh=1.5in]{imagename.png} + +File: dvipng.info, Node: Raw PostScript, Prev: Bitmapped graphics, Up: Graphics + +5.3 Raw PostScript +================== + +dvipng attempts to handle raw PostScript. Rendering raw PostScript +specials is done on top of the page by including a transparent image +generated by the `pngalpha' device in GhostScript (automatically +selecting `truecolor' mode in dvipng). + + Included PostScript headers are respected, and if the header +`tex.pro' is included, dvipng also throws in `color.pro' and +`special.pro'. The package `xcolor' includes its own headers with color +names, and this is not only kept as a PostScript header, but is also +read and interpreted by dvipng itself. An attempt is also made to +respect the PGF header. The non-rendering specials from `hyperref' are +handled via some heuristics and do not give an error. + + Really rendering and moving things with raw PostScript specials is +more troublesome. The \rotatebox macro serves as a good example. The +dvips driver of the graphicx package surrounds DVI glyphs with +PostScript code so that after conversion by dvips, the glyphs (now +themselves in PostScript) will be rotated in the desired way. dvipng +does not handle this, at present. An attempt has been made to handle +the rendering specials output by PGF (tikz), and also PSTricks. Some +things work, but others do not. This is especially clear when mixing +PostScript and DVI rendering commands such as glyphs. dvipng cannot at +present detect if PostScript code moves `currentpoint' or rotates the +frame since GhostScript does not return such information. A +recommendation would be to produce images from these packages as EPS +files and include them into your document in the standard manner. + + Another way to handle this would be to use a slower fallback (with +dvips and gs, for example). If you want to disable raw PostScript +handling in dvipng, use the switch `--norawps'. This switch turns off +the internal call to GhostScript intended to display these raw +PostScript specials. Further, when dvipng encounters raw PostScript and +the gs call is turned off, it gives a warning. It is now possible to +use the switch `--picky' to disable page rendering of pages with +warnings, and use the slower fallback for these pages. +  File: dvipng.info, Node: Color, Next: Diagnosing problems, Prev: Graphics, Up: Top @@ -1051,103 +1106,106 @@ Index [index] * Menu: -* -dSAFER: Option details. (line 167) -* absolute page number, and -l: Option details. (line 140) -* absolute page number, and -p: Option details. (line 188) -* antialiasing levels, number of: Option details. (line 242) -* background color (option): Option details. (line 40) +* -dSAFER: Option details. (line 168) +* absolute page number, and -l: Option details. (line 142) +* absolute page number, and -p: Option details. (line 195) +* antialiasing levels, number of: Option details. (line 248) +* background color (option): Option details. (line 42) * base resolution, setting: Option details. (line 35) -* baseline reporting: Option details. (line 76) +* baseline reporting: Option details. (line 78) * color specifications: Color specifications. (line 6) * command-line options: Command-line options. (line 6) * compilation: Installation. (line 6) -* compression: Option details. (line 306) +* compression: Option details. (line 314) * configuration, of dvipng: Installation. (line 6) -* dark fonts: Option details. (line 119) +* dark fonts: Option details. (line 121) * debugging <1>: Diagnosing problems. (line 6) -* debugging: Option details. (line 54) -* depth reporting: Option details. (line 76) -* exit on erroneous images: Option details. (line 253) -* first page printed: Option details. (line 188) -* follow mode: Option details. (line 97) -* font generation, avoiding: Option details. (line 157) -* forcing palette output: Option details. (line 197) -* foreground color (option): Option details. (line 91) -* FreeType font rendering: Option details. (line 105) -* fuzzy images: Option details. (line 119) -* gamma: Option details. (line 119) -* GhostScript and -dSAFER: Option details. (line 167) -* GhostScript, turning off: Option details. (line 162) -* GIF image format: Option details. (line 125) -* height reporting: Option details. (line 132) +* debugging: Option details. (line 56) +* depth reporting: Option details. (line 78) +* exit on erroneous images: Option details. (line 259) +* first page printed: Option details. (line 195) +* follow mode: Option details. (line 99) +* font generation, avoiding: Option details. (line 160) +* forcing palette output: Option details. (line 204) +* foreground color (option): Option details. (line 93) +* FreeType font rendering: Option details. (line 107) +* fuzzy images: Option details. (line 121) +* gamma: Option details. (line 121) +* GhostScript and -dSAFER: Option details. (line 168) +* GhostScript, turning off: Option details. (line 164) +* GIF image format: Option details. (line 127) +* height reporting: Option details. (line 134) * installation, of dvipng: Installation. (line 6) * invoking dvipng: Basic usage. (line 6) -* last page printed: Option details. (line 140) -* light fonts: Option details. (line 119) -* magnification, overriding DVI: Option details. (line 298) -* Metafont mode, specifying: Option details. (line 149) -* mktexpk, avoiding: Option details. (line 157) -* mode name, specifying: Option details. (line 149) -* no erroneous images: Option details. (line 207) -* offset pages: Option details. (line 182) +* last page printed: Option details. (line 142) +* light fonts: Option details. (line 121) +* magnification, overriding DVI: Option details. (line 304) +* Metafont mode, specifying: Option details. (line 151) +* mktexpk, avoiding: Option details. (line 160) +* mode name, specifying: Option details. (line 151) +* no erroneous images: Option details. (line 213) +* offset pages: Option details. (line 189) * option, details of: Option details. (line 6) * options, dvipng: Command-line options. (line 6) * options, reading from standard input: Option details. (line 11) * options, summary: Option summary. (line 6) -* output resolution, setting: Option details. (line 60) -* output, redirecting: Option details. (line 175) -* page range: Option details. (line 220) -* page, first printed: Option details. (line 188) -* page, last printed: Option details. (line 140) -* physical page number, and -l: Option details. (line 140) -* physical page number, and -p: Option details. (line 188) -* PNG image format: Option details. (line 216) +* output resolution, setting: Option details. (line 62) +* output, redirecting: Option details. (line 182) +* page range: Option details. (line 226) +* page, first printed: Option details. (line 195) +* page, last printed: Option details. (line 142) +* physical page number, and -l: Option details. (line 142) +* physical page number, and -p: Option details. (line 195) +* PNG image format: Option details. (line 222) * PostScript inclusion problems: Encapsulated PostScript. (line 21) +* PostScript, turning off raw PostScript specials: Option details. + (line 176) * problems: Diagnosing problems. (line 6) -* quality: Option details. (line 242) -* quiet operation: Option details. (line 238) -* reverse pagination: Option details. (line 249) -* silent operation: Option details. (line 238) +* quality: Option details. (line 248) +* quiet operation: Option details. (line 244) +* reverse pagination: Option details. (line 255) +* silent operation: Option details. (line 244) * standard input, reading options from: Option details. (line 11) -* standard output, output to: Option details. (line 175) -* T1lib font rendering: Option details. (line 270) +* standard output, output to: Option details. (line 182) +* T1lib font rendering: Option details. (line 276) * transparent border fallback color: Option details. (line 25) * transparent border width: Option details. (line 25) * trouble: Diagnosing problems. (line 6) -* truecolor output: Option details. (line 284) -* warnings, suppressing: Option details. (line 238) -* width reporting: Option details. (line 295) +* truecolor output: Option details. (line 290) +* warnings, suppressing: Option details. (line 244) +* width reporting: Option details. (line 301)  Tag Table: -Node: Top353 -Node: Introduction1248 -Node: Installation3487 -Node: Prerequisites3834 -Node: Configure6324 -Node: Build/install8363 -Node: Installation outside the texmf tree8831 -Node: Advice for non-privileged users9538 -Node: Basic usage10546 -Node: Command-line options11673 -Node: Option summary12097 -Node: Option details14406 -Node: Graphics29868 -Node: Encapsulated PostScript30433 -Node: Bitmapped graphics31776 -Node: Color32976 -Node: Color specifications33364 -Node: Color specials34463 -Node: Diagnosing problems35875 -Node: Contact information36358 -Node: Debug options37099 -Node: Credits38134 -Node: Copying42135 -Node: Index42915 +Node: Top297 +Node: Introduction1192 +Node: Installation3431 +Node: Prerequisites3778 +Node: Configure6268 +Node: Build/install8307 +Node: Installation outside the texmf tree8775 +Node: Advice for non-privileged users9482 +Node: Basic usage10490 +Node: Command-line options11662 +Node: Option summary12086 +Node: Option details14512 +Node: Graphics30430 +Node: Encapsulated PostScript31182 +Node: Bitmapped graphics32525 +Node: Raw PostScript33748 +Node: Color35987 +Node: Color specifications36375 +Node: Color specials37474 +Node: Diagnosing problems38886 +Node: Contact information39369 +Node: Debug options40110 +Node: Credits41145 +Node: Copying45146 +Node: Index45926  End Tag Table diff --git a/Build/source/texk/dvipng/doc/dvipng.texi b/Build/source/texk/dvipng/doc/dvipng.texi index b48a2419955..0ceb68b301f 100644 --- a/Build/source/texk/dvipng/doc/dvipng.texi +++ b/Build/source/texk/dvipng/doc/dvipng.texi @@ -9,8 +9,8 @@ dvipng [options] [filename] - @c man end @end ifset -@set version 1.13 -@set month-year March 2010 +@set version 1.14 +@set month-year October 2010 @c Put everything in one index (arbitrarily chosen to be the concept index). @syncodeindex fn cp @@ -132,13 +132,14 @@ be output as @file{foo1.png}, @file{foo2.png}, @file{foo3.png}, and @file{foo4.png}, respectively. If you have enabled the PostScript font support (via FreeType or T1lib), -fonts will be rendered as they are needed. Otherwise, if you use fonts -that have not been used on your system before, they may be automatically -generated; this process can take a few minutes, so progress reports -appear by default. The next time the same font is used, it will have -been saved on disk, so rendering will go much faster. (If dvipng tries -to endlessly generate the same fonts over and over again, something is -wrong. @xref{Unable to generate fonts,,, kpathsea, Kpathsea}.) +fonts will be rendered as they are needed. Otherwise, dvipng will use +bitmapped (PK) fonts, and if you use PK fonts that have not been used on +your system before, they may be automatically generated; this process +can take a few minutes, so progress reports appear by default. The next +time the same font is used, it will have been saved on disk, so +rendering will go much faster. (If dvipng tries to endlessly generate +the same fonts over and over again, something is wrong. @xref{Unable to +generate fonts,,, kpathsea, Kpathsea}.) Many options are available (see the next section). For a brief summary of available options, just type @@ -213,9 +214,11 @@ fallback color makes the default border width 1 px. @xref{Color}. @item --bdpi @var{num} @cindex base resolution, setting -Set the base (Metafont) resolution, both horizontal and vertical, to -@var{num} dpi (dots per inch). This option is necessary when manually -selecting Metafont mode with the --mode option (see below). +This option only has an effect when using bitmapped (PK) fonts. The +option sets the base (Metafont) resolution, both horizontal and +vertical, to @var{num} dpi (dots per inch). This option is necessary +when manually selecting Metafont mode with the --mode option (see +below). @item -bg @var{color_spec} @cindex background color (option) @@ -340,12 +343,12 @@ available if the FreeType2 font library was present at compilation time. If this is the case, dvipng will have direct support for PostScript Type1 and TrueType fonts internally, rather than using @samp{gsftopk} for rendering the fonts. If you have PostScript versions of Computer -Modern installed, there will be no need to generate bitmapped variants -on disk of these. Then, you can render images at different (and unusual) -resolutions without cluttering the disk with lots of bitmapped fonts. -Note that if you have both FreeType and T1lib on your system, FreeType -will be preferred by dvipng. If you for some reason would want to use -T1lib rendering, use this option. +Modern installed, there will be no need to generate bitmapped (PK) +variants on disk of these. Then, you can render images at different (and +unusual) resolutions without cluttering the disk with lots of bitmapped +fonts. Note that if you have both FreeType and T1lib on your system, +FreeType will be preferred by dvipng. If you for some reason would want +to use T1lib rendering, use this option. @item --gamma @var{num} @cindex gamma @@ -392,20 +395,20 @@ no matter what the pages are actually numbered. @item --mode @var{mode} @cindex mode name, specifying @cindex Metafont mode, specifying -Use @var{mode} as the Metafont device name for the PK fonts (both for -path searching and font generation). This needs to be augmented with the -base device resolution, given with the @samp{--bdpi} option. See the -file @url{ftp://ftp.tug.org/tex/modes.mf} for a list of resolutions and -mode names for most devices. @xref{Unable to generate fonts,,, kpathsea, +This option only has an effect when using bitmapped (PK) fonts. Use +@var{mode} as the Metafont device name for the PK fonts (both for path +searching and font generation). This needs to be augmented with the base +device resolution, given with the @samp{--bdpi} option. See the file +@url{ftp://ftp.tug.org/tex/modes.mf} for a list of resolutions and mode +names for most devices. @xref{Unable to generate fonts,,, kpathsea, Kpathsea}. @item -M* @cindex font generation, avoiding @pindex mktexpk@r{, avoiding} @c this description repeated in kpathsea.texi -Turns off automatic PK font generation (@file{mktexpk}). This will have -no effect when using PostScript fonts, since no PK font generation will -be done anyway. +This option only has an effect when using bitmapped (PK) fonts. It turns +off automatic PK font generation (@file{mktexpk}). @ignore @flindex missfont.log If @code{mktexpk}, the invocation is appended to a file @@ -421,10 +424,10 @@ overridden by the @samp{MISSFONT_LOG} environment variable or configuration file value. @end ignore -@item --noghostscript* +@item --nogs* @cindex GhostScript, turning off This switch prohibits the internal call to GhostScript for displaying -PostScript specials. @samp{--noghostscript0} turns the call back on. +PostScript specials. @samp{--nogs0} turns the call back on. @item --nogssafer* @cindex GhostScript and -dSAFER @@ -436,6 +439,13 @@ GhostScript interpreter is run with the option @samp{-dSAFER}. The as deletefile, to prevent possibly malicious PostScript programs from having any effect. +@item --norawps* +@cindex PostScript, turning off raw PostScript specials +Some packages generate raw PostScript specials, even non-rendering such +specials. This switch turns off the internal call to GhostScript +intended to display these raw PostScript specials. @samp{--norawps0} +turns the call back on. + @item -o @var{name} @cindex output, redirecting @cindex standard output, output to @@ -469,14 +479,13 @@ the document, no matter what the pages are actually numbered. @item --palette* @cindex forcing palette output -Starting from @samp{dvipng} 1.8, the output PNG will be a truecolor -png when an external image is included, to avoid unnecessary delay and -quality reduction, and enable the EPS translator to draw on a -transparent background and outside of the boundingbox. This switch -will force palette (256-color) output and make @samp{dvipng} revert to -the old behaviour, where included images were opaque and always -clipped to the boundingbox. This will also override the -@samp{--truecolor} switch if present. +When an external image is included, @samp{dvipng} will automatically +switch to truecolor mode, to avoid unnecessary delay and quality +reduction, and enable the EPS translator to draw on a transparent +background and outside of the boundingbox. This switch will force +palette (256-color) output and make @samp{dvipng} revert to opaque +clipped image inclusion. This will also override the @samp{--truecolor} +switch if present. @item --picky* @cindex no erroneous images @@ -524,10 +533,10 @@ output; report no warnings (only errors) to standard error. @cindex antialiasing levels@r{, number of} @cindex quality Set the quality to @var{num}. That is, choose the number of antialiasing -levels for PK and T1lib rendering to be @var{num}*@var{num}+1. The default -value is 4 which gives 17 levels of antialiasing for antialiased fonts -from these two. If FreeType is available, its rendering is unaffected by -this option. +levels for bitmapped fonts (PK) and fonts rendered using T1lib, to be +@var{num}*@var{num}+1. The default value is 4 which gives 17 levels of +antialiasing for antialiased fonts from these two. If FreeType is +available, its rendering is unaffected by this option. @item -r* @cindex reverse pagination @@ -586,17 +595,17 @@ only include all ink put on the page, producing neat images. @item --t1lib* @cindex T1lib font rendering -Enable/disable T1lib font rendering (default on). This option is -available if the T1lib font library was present at compilation time. If -this is the case, dvipng will have direct support for PostScript Type1 -fonts internally, rather than using @samp{gsftopk} for rendering the -fonts. If you have PostScript versions of Computer Modern installed, -there will be no need to generate bitmapped variants on disk of these. -Then, you can render images at different (and unusual) resolutions -without cluttering the disk with lots of bitmapped fonts. Note that if -you have both FreeType and T1lib on your system FreeType will be -preferred by dvipng, and if you for some reason rather want to use -T1lib, give the option @samp{--freetype0} (see above). +Enable T1lib font rendering (default on). This option is available if +the T1lib font library was present at compilation time. If this is the +case, dvipng will have direct support for PostScript Type1 fonts +internally, rather than using @samp{gsftopk} for rendering the fonts. If +you have PostScript versions of Computer Modern installed, there will be +no need to generate bitmapped variants on disk of these. Then, you can +render images at different (and unusual) resolutions without cluttering +the disk with lots of bitmapped fonts. Note that if you have both +FreeType and T1lib on your system, FreeType will be preferred by dvipng, +and if you for some reason rather want to use T1lib, give the option +@samp{--freetype0} (see above). @item --truecolor* @cindex truecolor output @@ -617,12 +626,14 @@ Report the width of the image. See also @samp{--height} and @item -x @var{num} @cindex magnification, overriding DVI -Set the @math{x} magnification ratio to @math{@var{num}/1000}. Overrides -the magnification specified in the DVI file. Must be between 10 and -100000. It is recommended that you use standard magstep values (1095, -1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the total -number of PK files generated. @var{num} may be a real number, not an -integer, for increased precision. +This option is deprecated; it should not be used. It is much better to +select the output resolution directly with the @samp{-D} option. This +option sets the magnification ratio to @math{@var{num}/1000} and +overrides the magnification specified in the DVI file. Must be between +10 and 100000. It is recommended that you use standard magstep values +(1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the +total number of PK files generated. @var{num} may be a real number, not +an integer, for increased precision. @item -z @var{num} @cindex compression @@ -659,12 +670,14 @@ correspond directly to the zlib compression levels.'' @samp{graphicx} and @samp{graphics} packages, without the need of specifying a driver to these packages. This means that it recognizes the encapsulated postscript inclusion meant for @samp{dvips}, but is -also able (from version 1.8) to include bitmapped graphics, see the -details below. +also able (from version 1.8) to include bitmapped graphics. It also +tries to handle some of the raw PostScript that is output from various +packages. Some of the possibilities and problems are mentioned below. @menu * Encapsulated PostScript:: An internal call to GhostScript * Bitmapped graphics:: PNG, JPEG and GIF +* Raw PostScript:: Ignore or give to GhostScript @end menu @node Encapsulated PostScript @@ -727,6 +740,46 @@ wide: \includegraphics[bb=0 0 300 400,witdh=1.5in]@{imagename.png@} @end example +@node Raw PostScript +@section Raw PostScript + +dvipng attempts to handle raw PostScript. Rendering raw PostScript +specials is done on top of the page by including a transparent image +generated by the @samp{pngalpha} device in GhostScript (automatically +selecting @samp{truecolor} mode in dvipng). + +Included PostScript headers are respected, and if the header +@samp{tex.pro} is included, dvipng also throws in @samp{color.pro} and +@samp{special.pro}. The package @samp{xcolor} includes its own headers +with color names, and this is not only kept as a PostScript header, but +is also read and interpreted by dvipng itself. An attempt is also made +to respect the PGF header. The non-rendering specials from +@samp{hyperref} are handled via some heuristics and do not give an +error. + +Really rendering and moving things with raw PostScript specials is more +troublesome. The \rotatebox macro serves as a good example. The dvips +driver of the graphicx package surrounds DVI glyphs with PostScript code +so that after conversion by dvips, the glyphs (now themselves in +PostScript) will be rotated in the desired way. dvipng does not handle +this, at present. An attempt has been made to handle the rendering +specials output by PGF (tikz), and also PSTricks. Some things work, but +others do not. This is especially clear when mixing PostScript and DVI +rendering commands such as glyphs. dvipng cannot at present detect if +PostScript code moves @samp{currentpoint} or rotates the frame since +GhostScript does not return such information. A recommendation would be +to produce images from these packages as EPS files and include them into +your document in the standard manner. + +Another way to handle this would be to use a slower fallback (with dvips +and gs, for example). If you want to disable raw PostScript handling in +dvipng, use the switch @samp{--norawps}. This switch turns off the +internal call to GhostScript intended to display these raw PostScript +specials. Further, when dvipng encounters raw PostScript and the gs call +is turned off, it gives a warning. It is now possible to use the switch +@samp{--picky} to disable page rendering of pages with warnings, and use +the slower fallback for these pages. + @node Color @chapter Color @@ -938,7 +991,7 @@ Although their code does not appear in the current release, the authors also wis @ifset man @c man begin NOTES -The full manual is accessible in the info format, on most systems by typing +The full manual is accessible in info format, on most systems by typing @example info dvipng @end example diff --git a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/ChangeLog b/Build/source/texk/dvipng/dvipng-1.13-PATCHES/ChangeLog deleted file mode 100644 index 11f85b81164..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/ChangeLog +++ /dev/null @@ -1,62 +0,0 @@ -2010-10-02 Peter Breitenlohner - - * patch-22-win32-bugfix (new): WIN32 bug fix from Akira Kakuto. - -2010-03-18 Peter Breitenlohner - - * Imported release 1.13 from savannah.nongnu.org. - * patch-[01]?-* (removed): Included in 1.13. - - * patch-20-rpl_malloc (new): Avoid implicit decl of malloc(). - * patch-21-win32 (new): Avoid unnecessary warning in WIN32 code. - -2010-03-09 Peter Breitenlohner - - * patch-12-set_program_name: Replace kpse_set_progname() by - kpse_set_program_name(). - -2010-02-24 Peter Breitenlohner - - * patch-10-mmap-for-WIN32 (new): Former MIKTEX code for mmap - from Fabrice Popineau (?) now used for all WIN32 variants. - * patch-11-win32-fork-and-pipe (new): WIN32 specific replacement - for fork and pipe, using code from Akira Kakuto. - -2010-02-21 Peter Breitenlohner - - * patch-07-always-undef (new): Always undefine min/max before - redefining them (for MinGW32). - * patch-08-HAVE_MMAP (new): #include only - #if defined(HAVE_MMAP) (for MinGW32). - * patch-09-sleep (new): Use Sleep and #include - (for WIN32/MinGW32). - -2010-01-29 Karl Berry - - * patch-06-mathptmx (new): Do not use \usepackage{mathptmx} - in test_dvipng.tex. - -2009-06-12 Peter Breitenlohner - - * patch-05-warnings (new): Avoid more compiler warnings. - -2009-06-09 Peter Breitenlohner - - * patch-04-static (new): Avoid warnings when compiling with - 'gcc --Wmissing-prototypes'. - -2009-02-22 Peter Breitenlohner - - * patch-03-have-ft2 (new): Bug fix - skip FT2 code when - compiling without FT2 library. - -2009-03-25 Peter Breitenlohner - - * patch-02-use-ifdef (new): Use #ifdef instead of #if to avoid - preprocessor warnings. - -2009-03-24 Peter Breitenlohner - - * patch-01-portability (new): Portability fix - put variable - declarations at the beginning of the block. - diff --git a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/TL-Changes b/Build/source/texk/dvipng/dvipng-1.13-PATCHES/TL-Changes deleted file mode 100644 index e3f760264a1..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/TL-Changes +++ /dev/null @@ -1,17 +0,0 @@ -Changes applied to the dvipng-1.13 tree as obtained from: - http://savannah.nongnu.org/files/?group=dvipng - -Removed: - configure - install-sh - mkinstalldirs - -Created Autoconf macro files ../m4/gs-device.m4 and ../m4/makeinfo.m4 - adapting code in aclocal.m4. - -Moved these files to ../doc/: - dvipng.texi - install.texi - macros.texi - readme.texi - diff --git a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-20-rpl_malloc b/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-20-rpl_malloc deleted file mode 100644 index 3f3e2b9cb5b..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-20-rpl_malloc +++ /dev/null @@ -1,36 +0,0 @@ - Autoconf may define malloc to rpl_malloc. - - Undefine this before including any system headers to avoid - implicit declaration of malloc(), e.g., for MinGW32. - -diff -ur dvipng-1.13.orig/dvipng.h dvipng-1.13/dvipng.h ---- dvipng-1.13.orig/dvipng.h 2010-03-17 22:41:51.000000000 +0100 -+++ dvipng-1.13/dvipng.h 2010-03-18 12:22:28.897998191 +0100 -@@ -26,6 +26,13 @@ - #define DVIPNG_H - #include "config.h" - -+/* Autoconf may define malloc to rpl_malloc, if the system does not -+ * have a GNU Libc-compatible malloc (for which malloc(0) gives a -+ * valid pointer). We don't need that (yet) */ -+#ifdef malloc -+# undef malloc -+#endif -+ - #define STRSIZE 255 /* stringsize for file specifications */ - - #define FIRSTFNTCHAR 0 -@@ -105,13 +112,6 @@ - # endif - #endif - --/* Autoconf may define malloc to rpl_malloc, if the system does not -- * have a GNU Libc-compatible malloc (for which malloc(0) gives a -- * valid pointer). We don't need that (yet) */ --#ifdef malloc --# undef malloc --#endif -- - - /*************************************************************/ - /************************* protos.h ************************/ diff --git a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-21-win32 b/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-21-win32 deleted file mode 100644 index 7596248df4b..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-21-win32 +++ /dev/null @@ -1,23 +0,0 @@ - Avoid unnecessary cast from 'int *' to 'unsigned long*'. - -diff -ur dvipng-1.13.orig/special.c dvipng-1.13/special.c ---- dvipng-1.13.orig/special.c 2010-03-17 22:38:35.000000000 +0100 -+++ dvipng-1.13/special.c 2010-03-18 12:32:01.230697171 +0100 -@@ -147,7 +147,7 @@ - #ifndef MIKTEX - int downpipe[2], uppipe[2]; - #ifdef WIN32 -- int nexitcode = STILL_ACTIVE; -+ unsigned long nexitcode = STILL_ACTIVE; - HANDLE hchild; - int savestdin, savestdout; - #else /* !WIN32 */ -@@ -307,7 +307,7 @@ - #ifdef WIN32 - } - while(nexitcode == STILL_ACTIVE) -- GetExitCodeProcess((HANDLE)hchild, (unsigned long*)&nexitcode); -+ GetExitCodeProcess((HANDLE)hchild, &nexitcode); - - CloseHandle((HANDLE)hchild); - _dup2(savestdin, fileno(stdin)); diff --git a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-22-win32-bugfix b/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-22-win32-bugfix deleted file mode 100644 index 06e2c6b0b11..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13-PATCHES/patch-22-win32-bugfix +++ /dev/null @@ -1,93 +0,0 @@ -diff -ur dvipng-1.13.orig/ChangeLog dvipng-1.13/ChangeLog ---- dvipng-1.13.orig/ChangeLog 2010-03-17 22:59:40.000000000 +0100 -+++ dvipng-1.13/ChangeLog 2010-10-02 13:16:12.428050971 +0200 -@@ -1,3 +1,12 @@ -+2010-10-02 Peter Breitenlohner -+ -+ * special.c (ps2png): Drop unused 'bool showpage' for WIN32. -+ -+2010-09-20 Akira Kakuto -+ -+ * special.c (ps2png): fix WIN32 bug that dvipng.exe waits -+ infinitely for some kind of eps files. -+ - 2010-03-17 Jan-Ake Larsson - - * Release 1.13 -diff -ur dvipng-1.13.orig/special.c dvipng-1.13/special.c ---- dvipng-1.13.orig/special.c 2010-03-18 12:32:01.000000000 +0100 -+++ dvipng-1.13/special.c 2010-10-02 13:05:54.952668093 +0200 -@@ -167,7 +167,9 @@ - char resolution[STRSIZE]; - /* char devicesize[STRSIZE]; */ - gdImagePtr psimage=NULL; -+#ifndef WIN32 - static bool showpage=false; -+#endif - - sprintf(resolution, "-r%dx%d",hresolution,vresolution); - /* Future extension for \rotatebox -@@ -290,11 +292,41 @@ - fprintf(psstream, "gsave %f %f %f setrgbcolor clippath fill grestore", - bgred/255.0, bggreen/255.0, bgblue/255.0); - } -+ -+/* WIN32 -+write the following at the top of an eps: -+ -+%! -+/DVIPNGDICT 100 dict def -+DVIPNGDICT begin /showpage {} def end -+DVIPNGDICT begin -+*/ -+ -+#ifdef WIN32 -+ fprintf(psstream, "\n%%!\n/DVIPNGDICT 100 dict def\n"); -+ fprintf(psstream, "DVIPNGDICT begin /showpage {} def end\n"); -+ fprintf(psstream, "DVIPNGDICT begin\n"); -+#endif - writepscode(pscodep,psstream); -+ -+/* WIN32 -+write the following at the very end of an eps: -+ -+end -+showpage -+*/ -+ -+#ifdef WIN32 -+ fprintf(psstream, "\nend\nshowpage\n"); -+#endif -+ -+#ifndef WIN32 - if (showpage) { - DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\tshowpage")); - fprintf(psstream, " showpage "); - } -+#endif -+ - fclose(psstream); - } - if (pngstream) { -@@ -323,6 +355,12 @@ - - if (psimage == NULL) { - DEBUG_PRINT(DEBUG_GS,("\n GS OUTPUT:\tNO IMAGE ")); -+ -+/* -+ For WIN32 we always output showpage. -+*/ -+ -+#ifndef WIN32 - if (!showpage) { - showpage=true; - DEBUG_PRINT(DEBUG_GS,("(will try adding \"showpage\") ")); -@@ -331,6 +369,8 @@ - bgred,bggreen,bgblue); - showpage=false; - } -+#endif -+ - #ifdef DEBUG - } else { - DEBUG_PRINT(DEBUG_GS,("\n GS OUTPUT:\t%dx%d image ", diff --git a/Build/source/texk/dvipng/dvipng-1.13/COPYING b/Build/source/texk/dvipng/dvipng-1.13/COPYING deleted file mode 100644 index 94a9ed024d3..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/Build/source/texk/dvipng/dvipng-1.13/COPYING.LESSER b/Build/source/texk/dvipng/dvipng-1.13/COPYING.LESSER deleted file mode 100644 index fc8a5de7edf..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/COPYING.LESSER +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/Build/source/texk/dvipng/dvipng-1.13/ChangeLog b/Build/source/texk/dvipng/dvipng-1.13/ChangeLog deleted file mode 100644 index a0791cd29eb..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/ChangeLog +++ /dev/null @@ -1,1185 +0,0 @@ -2010-10-02 Peter Breitenlohner - - * special.c (ps2png): Drop unused 'bool showpage' for WIN32. - -2010-09-20 Akira Kakuto - - * special.c (ps2png): fix WIN32 bug that dvipng.exe waits - infinitely for some kind of eps files. - -2010-03-17 Jan-Ake Larsson - - * Release 1.13 - - * misc.c: Correct copyright year - - * RELEASE: Prepare for 1.13 - -2010-03-17 Peter Breitenlohner - - * configure.ac: Check for kpse_set_program_name() as used in - dvipng.c instead of kpse_set_progname(). - - Support WIN32 builds (native or MinGW32). - * dvipng.h (min, max): Always undefine before defining. - * dvi.c: For WIN32 use Sleep(1000) instead of sleeep(1). - * misc.c: #include depends on HAVE_MMAP. - * dvipng.h, font.c, misc.c: For mmap code use '#ifdef WIN32' - instead of '#ifdef MIKTEX'. - * special.c: WIN32 specific replacement for fork and pipe, using - code from Akira Kakuto, (e-mail from 23 Feb 2010 23:33:58). - -2010-03-17 Jan-Ake Larsson - - * test_dvipng.tex: Don't use mathptmx - - * color.c, dvi.c, dvipng.h, fontmap.c, misc.c, papersiz.c, - ppagelist.c, special.c: Avoid compiler warnings - - * dvipng.texi, configure.ac: Prepare for 1.13 - - * draw.c, dvipng.h, set.c, vf.c: Adjust glyph-index bounds - test. Remove possible segfault from isprint(). - -2010-02-11 Jan-Ake Larsson - - * color.c, draw.c, dvi.c, enc.c, font.c, fontmap.c, ft.c, - papersiz.c, pk.c, ppagelist.c, set.c, sfd.c, special.c, t1.c: - Declare functions used only in one file as static to avoid - warnings when compiling with 'gcc --Wmissing-prototypes', - suggested by Peter Breitenlohner - -2010-01-28 Jan-Ake Larsson - - * draw.c, dvipng.h, dvipng.texi, misc.c: Add width reporting - -2009-04-14 Jan-Ake Larsson - - * fontmap.c: Make the thing build without FT2 - -2009-03-28 Jan-Ake Larsson - - * config.h.in: Remove the last remnants of alloca - -2009-03-26 Jan-Ake Larsson - - * configure.ac, dvipng.h: Remove the last remnants of alloca - - * draw.c, font.c, ft.c, pk.c, t1.c, vf.c: Make the name element of - the font struct a pointer, not an array - - * dvi.c, ppagelist.c: Change error msg to mention malloc - - * color.c, enc.c, pk.c, set.c, sfd.c, special.c, tfm.c: Don't use - alloca - -2009-03-25 Jan-Ake Larsson - - * config.h.in, configure.ac: Check for libgen.h, not libgen - - * special.c: Put declarations before code - - * color.c, dvipng.h, fontmap.c, ft.c, misc.c, pk.c, set.c, t1.c, - tfm.c: Exchange #if for #ifdef - -2009-02-23 Jan-Ake Larsson - - * Release 1.12 - - * INSTALL, README, install.texi, readme.texi, special.c: Correct - date for copyright - - * RELEASE, configure.ac, dvipng.1, dvipng.texi: Prepare for 1.12 - -2009-01-23 Jan-Ake Larsson - - * special.c: Keep transparent background in rescaled included - bitmaps - -2008-06-04 Jan-Ake Larsson - - * special.c: Add the color PostScript prologue - -2008-06-03 Jan-Ake Larsson - - * dvipng.h, special.c: Support xcolor PostScript prologue - - * color.c: Support x11nam.def, fix handling of xcolor - multiple-model color values, and xcolor PostScript prologue - -2008-06-02 Jan-Ake Larsson - - * special.c: Some (most?) literal PostScript specials seem to - depend on tex.pro and possibly special.pro, always load these - - * configure.ac: Fix gs checks - - * misc.c: Correct last mmap element - -2008-05-27 Jan-Ake Larsson - - * readme.texi: Mention new color models in xcolor - - * color.c: Adjust for new version of xcolor, mainly color prefixes - -2008-05-14 Jan-Ake Larsson - - * Release 1.11 - - * configure.ac, dvipng.1, dvipng.texi, RELEASE: Prepare for 1.11 - - * special.c: Fix PS inclusion regression - -2008-05-09 Jan-Ake Larsson - - * Release 1.10 - - * RELEASE: Prepare for 1.10 - -2008-05-08 Jan-Ake Larsson - - * special.c: Add warning about DVI code in PS environment - -2008-05-07 Jan-Ake Larsson - - * README, readme.texi: Mention gs interpreter lib in TODO - - * aclocal.m4, configure.ac: Move gs device check so that it can be - called from different points - -2008-05-05 Jan-Ake Larsson - - * draw.c, dvi.c, dvipng.h: Revert creation of dvi command struct - - * draw.c, dvi.c: Init dvi command struct - - * draw.c, dvi.c, dvipng.h: Create dvi command struct - - * special.c: Rearrange code - - * color.c, dvipng.h, enc.c, fontmap.c, misc.c, pk.c, sfd.c, - special.c, tfm.c, vf.c: Change name of fmmap struct element - -2008-04-29 Jan-Ake Larsson - - * dvipng.1: Prepare for 1.10 - - * configure.ac: Prepare for 1.10, check for gdImageCreateJpeg - - * aclocal.m4: Cosmetic changes - - * special.c: Change to HAVE_...JPEG - - * dvipng.h: Remove c++ comment - - * dvipng.texi: Prepare for 1.10. Use 'active' in the 'preview' - package, remove unused text - - * Makefile.in: - Install dvipng.1 from the tarball, mark maintainer targets - -2008-02-08 Jan-Ake Larsson - - * Makefile.in, INSTALL, README, color.c, commands.h, configure.ac, - * draw.c, dvi.c, dvipng.1, dvipng.c, dvipng.h, dvipng.texi, enc.c, - * font.c, fontmap.c, ft.c, install.texi, macros.texi, miktex.h, - * misc.c, papersiz.c, pk.c, ppagelist.c, readme.texi, set.c, sfd.c, - * special.c, t1.c, test_dvipng.tex, tfm.c, vf.c, COPYING, - * COPYING.LESSER: Change to LGPLv3 - - * install.texi: - * README: - * dvipng.texi: Add blurb about MediaWiki, and cosmetic changes - -2008-01-10 Jan-Ake Larsson - - * set.c: Correct typo - -2007-12-12 Jan-Ake Larsson - - * special.c: Correct header test, add proper ps::[start] and - ps::[end] detection, add code to make tikz/pgf dvips (~PostScript) - specials work - -2007-10-26 Jan-Ake Larsson - - * draw.c: - * dvi.c: - * special.c: Change DVIGetCommand so that the command is - zero-terminated. This simplifies string operations on specials and - makes the length argument to SetSpecial unnecessary. Handle - preview-bop-hook correctly - - * special.c: Simplify PostScript header and multi-special - handling - - * color.c: - * draw.c: - * dvi.c: - * dvipng.h: - * font.c: - * ft.c: - * misc.c: - * set.c: - * special.c: - * t1.c: Split the flags variable into page_flags, option_flags and - dvi->flags - - * dvi.c: - * dvipng.c: dvi->flags resets now when the dvi is reopened - -2007-08-06 Jan-Ake Larsson - - * ft.c: - * misc.c: - * t1.c: - * tfm.c: - * vf.c: Memory fixes - -2007-07-24 Jan-Ake Larsson - - * special.c: Fix PostScript header usage - -2007-07-22 Jan-Ake Larsson - - * misc.c: Change version info slightly - - * ft.c: Change debug info slightly - -2007-07-21 Jan-Ake Larsson - - * special.c: Rewrite to allow for raw PostScript specials, also - use PostScript headers - - * dvipng.h: - * dvi.c: Add read-ahead for PostScript specials - - * config.h.in: - * configure.ac: Add test for gd pointer->image conversion - -2007-03-19 Jan-Ake Larsson - - * draw.c: Better handling of glyph index bounds - - * set.c: Check bounds for glyph index - -2006-12-11 Jan-Ake Larsson - - * readme.texi: Fix TODO, mention MediaWiki - - * dvipng.h: Fix for alloca under AIX - - * Makefile.in: mkinstalldirs is in $(srcdir) - -2006-11-11 Jan-Ake Larsson - - * Release 1.9 - - * INSTALL: - * README: Update for 1.9 - - * Makefile.in: Make the test fail if fonts not found - - * configure.ac: Don't use "which". Add info about the selfauto - stuff. Report if CJK support present - - * test_dvipng.tex: Remove the (intentional) failing special - -2006-11-07 Jan-Ake Larsson - - * fontmap.c: Don't warn if ttfonts.map is missing, fix pointer - - * Makefile.in: Adjust manpage target so manual intervention isn't - needed anymore - - * dvipng.1: Update manpage - - * dvipng.texi: Update for 1.9 - - * COPYING, Makefile.in, color.c, commands.h, configure.ac, draw.c, - dvi.c, dvipng.c, dvipng.h, dvipng.texi, enc.c, font.c, fontmap.c, - ft.c, macros.texi, miktex.h, miktex.mak, misc.c, papersiz.c, pk.c, - ppagelist.c, set.c, sfd.c, special.c, t1.c, test_dvipng.tex, - tfm.c, vf.c: Update FSF address - - * fontmap.c: Add ttfonts.map to the searched font maps - - * RELEASE: Prepare for 1.9 - -2006-11-02 Jan-Ake Larsson - - * dvipng.texi: Nitpicking on bitmapped graphics - -2006-10-13 Jan-Ake Larsson - - * readme.texi: Add note about subfont (CJK) support - - * install.texi: Add that FreeType2 is needed for subfont (CJK) support - -2006-10-12 Jan-Ake Larsson - - * readme.texi: Fix todo - -2006-10-11 Jan-Ake Larsson - - * sfd.c: Change && to || so that multiple subfonts work - - * ft.c: Adjust debug output - - * configure.ac: Add sfd.o - -2006-10-04 Jan-Ake Larsson - - * configure.ac: Prepare for 1.9 - - * sfd.c: Only look for subfont file on recent kpathsea - - * dvipng.c, ft.c, fontmap.c, dvipng.h: Prepare for subfonts (CJK) - - * sfd.c: Added. Used for subfonts (CJK) - - * configure.ac: Change wording of gs helptext - - * ft.c: Adjust debug message, and encoding selection - - * special.c: Adjust debug messages - - * dvipng.texi: Document the --strict option - - * dvipng.c: Fix timer - - * Makefile.in: Add dist target, simplify distclean - - * fontmap.c: Remove segfault occuring for non-existent font - -2006-08-08 Jan-Ake Larsson - - * special.c: Make showpage flag static - - * special.c: - Fix bug with -dSAFER and non-. paths, and bug with pngalpha and - background color - -2006-05-17 Jan-Ake Larsson - - * fontmap.c: Rearrange, simplify, speed up - -2006-05-16 Jan-Ake Larsson - - * ft.c: FT_LOAD_TARGET_LIGHT does not work in some cases, fall - back to FT_LOAD_NO_HINTING - -2006-05-08 Jan-Ake Larsson - - * dvipng.texi: Add credit - - * Makefile.in: add www target - - * README: - * readme.texi: Update capabilities info and preview-latex link - -2006-03-30 Jan-Ake Larsson - - * Release 1.8 - - * RELEASE: Update for 1.8 - - * set.c: - * readme.texi: - * install.texi: - * ft.c: - * dvi.c: - * draw.c: - * README: - * INSTALL: Update copyright - -2006-03-29 Jan-Ake Larsson - - * dvipng.1: - * dvipng.texi: Document new switch, new PostScript inclusion, - rearrange and adjust - - * misc.c: - * INSTALL: - * README: - * install.texi: - * readme.texi: Minimal documentation adjustments - -2006-03-27 Jan-Ake Larsson - - * ft.c: Change to FT_LOAD_TARGET_LIGHT - - * draw.c: Fix segfault in debug mode - - * aclocal.m4: Make sure the kpse_enc_format test fails for the - right reason only - -2006-02-27 Jan-Ake Larsson - - * special.c: Use gs' pngalpha device, render without clipping, - adjust image position - - * set.c: Simplify code, make color cache (page-)persistent - - * draw.c: Reset new flag - - * misc.c: New switch, remove some old switches from fast-help, use - new flag name - - * dvipng.h: New flags - - * configure.ac: - * config.h.in: Simplify gd tests - - * configure.ac: - * aclocal.m4: Check gs devices - -2006-02-10 Jan-Ake Larsson - - * special.c: Use execlp for gs call - -2006-02-03 Jan-Ake Larsson - * special.c: - Revert message about file type, debug information is enough - - * special.c: Warn for nonexistent image decoder - -2006-02-01 Jan-Ake Larsson - - * special.c: Warn with file type when unable to load included image - - * special.c: Read the first byte of file to be included and - compare with magic number - -2006-01-31 Jan-Ake Larsson - - * special.c: Temporary version, just try the different image - decoders and see - - * special.c: Use correct variables - -2006-01-29 Jan-Ake Larsson - - * special.c: Add code to check image access permission - -2006-01-28 Jan-Ake Larsson - - * special.c: Simplify some code - - * papersiz.c: Fix rounding error for length calculation - -2006-01-26 Jan-Ake Larsson - - * color.c: Fix typo that gave a segfault - - * config.h.in: Remove unneeded function check - - * configure.ac: Update for 1.8, remove unneeded function check - - * dvipng.h: Switch debug numbers to coincide with the manual - - * misc.c: Remove isdigit - - * special.c: Add code to include PNG, JPEG and GIF images - -2006-01-12 Jan-Ake Larsson - - * special.c: Add a space in message - - * misc.c: Do more tests for numeric-parameter options - - * dvi.c: Outfilename: only remove .dvi extension, not others - -2005-10-11 Jan-Ake Larsson - - * Release 1.7 - - * INSTALL: Typographic changes - - * README: - * RELEASE: - * configure.ac: - * dvipng.1: - * dvipng.texi: Adjust for 1.7 - - * install.texi: Insert space - - * miktex.h: Adjust for 1.7, I am uncertain which of the new calls - are available in the MIKTeX environment - - * readme.texi: Remove reference to my old laptop - -2005-09-30 Jan-Ake Larsson - - * config.h.in, configure.ac, ft.c: - Only use FT_Library_Version if available - -2005-07-05 jalar - - * Makefile.in: Enable srcdir != builddir - -2005-07-04 jalar - - * font.c: Add length check for font name - -2005-06-28 Jan-Ake Larsson - - * special.c: Read preview-latex version - -2005-06-27 Jan-Ake Larsson - - * Release 1.6 - - * RELEASE: Report what fixes have been done - - * dvipng.texi: Document xcolor adaptations - - * misc.c: Add 'Transparent' in the quick-help - - * special.c: Cosmetics, do a _small_ message for bop-hook redef - -2005-06-16 Jan-Ake Larsson - - * dvipng.h: - * dvipng.c: - * color.c: Revamp colorname interpreter for xcolor - -2005-06-14 Jan-Ake Larsson - - * misc.c: Adjust MIKTeX stuff - -2005-06-13 Jan-Ake Larsson - - * color.c: Don't use strtok, adjust for xcolor - - * special.c: Don't use strtok - -2005-04-25 Jan-Ake Larsson - - * config.h.in: - * configure.ac: - * set.c: Don't do alpha blending in truecolor mode, write alpha - channel to file - -2005-04-20 Jan-Ake Larsson - - * dvipng.texi: Add Credits - -2005-04-19 Jan-Ake Larsson - - * dvipng.h: Fix for sys/types.h conflict in old IRIX systems - - * special.c: Adjust tightpage test - -2005-04-04 Jan-Ake Larsson - - * special.c: Make tightpage option backwards compatible - - * RELEASE: Prepare for 1.6 - - * dvipng.1: Regenerate man page - - * configure.ac: - * dvipng.texi: - * miktex.h: Update version info - - * configure.ac: - * dvipng.texi: - * README: - * readme.texi: Update mailing list address - - * configure.ac: - * config.h.in: - * special.c: Simplify string search - -2005-04-03 Jan-Ake Larsson - - * special.c: Try to detect all preview-latex versions tightpage - code - -2005-03-02 Jan-Ake Larsson - - * set.c: Remove extra debug printout - - * t1.c: Sizes are given in big points in T1lib, in TeX points in - DVI files - - * ft.c: Sizes are given in big points in FreeType, in TeX points - in DVI files - - * dvipng.h: Fix boolean type again - -2005-02-10 Jan-Ake Larsson - - * config.h.in: - * configure.ac: - * dvipng.texi: - * dvipng.h: - * misc.c: - * set.c: Add proper alpha channel - -2005-02-04 Jan-Ake Larsson - - * color.c: - * draw.c: - * dvi.c: - * dvipng.c: - * font.c: - * ft.c: - * misc.c: - * papersiz.c: - * pk.c: - * set.c: - * special.c: - * t1.c: - * tfm.c: - * vf.c: Cosmetic changes to warnings and fatals - - * Release 1.5 - - * RELEASE: Prepare for 1.5 - - * INSTALL: - * Makefile.in: - * README: - * color.c: - * commands.h: - * configure.ac: - * draw.c: - * dvi.c: - * dvipng.1: - * dvipng.c: - * dvipng.h: - * dvipng.texi: - * enc.c: - * font.c: - * fontmap.c: - * ft.c: - * install.texi: - * macros.texi: - * miktex.h: - * misc.c: - * papersiz.c: - * pk.c: - * ppagelist.c: - * readme.texi: - * set.c: - * special.c: - * t1.c: - * test_dvipng.tex: - * tfm.c: - * vf.c: Update Copyright, set version 1.5 - -2005-02-03 Jan-Ake Larsson - - * draw.c: - * dvipng.h: - * set.c: Fix bug in --picky mode - -2005-01-27 Jan-Ake Larsson - - * dvipng.c: Restore --mfmode and --bdpi functionality - -2005-01-25 Jan-Ake Larsson - - * color.c: Fix segfault when trying to find nonexisting dvipsnam - color - - * dvipng.c: Make dvipsnam colors available on command line - -2004-12-10 Jan-Ake Larsson - - * Release 1.4 - - * RELEASE: - * configure.ac: - * dvipng.1: - * dvipng.texi: Set version 1.4 - - * README: Fix formatting - - * misc.c: Use mmap test. Hopefully, it will fail on ULTRIX, mmap - only works on character special devices (and not on regular files) - -2004-12-02 Jan-Ake Larsson - - * config.h.in: - * configure.ac: - * dvipng.h: Move int64_t and uint64_t tests entirely to autoconf - - * dvi.c: Fix signedness - -2004-11-30 Jan-Ake Larsson - - * misc.c: Fix NULL dereference. - -2004-11-25 Jan-Ake Larsson - - * Release 1.3 - - * Makefile.in, README, dvipng.1, readme.texi: Fix dvigif - installation and docs - - * INSTALL: - * README: Add license - - * dvipng.c: Remove duplicate copyright - - * config.h.in: - * configure.ac: Add some tests - - * dvipng.1: - * dvipng.texi: Add some minor things - -2004-11-24 Jan-Ake Larsson - - * config.h.in: - * configure.ac: Test for 64-bit types. - - * dvipng.h: Use char* arithmetic, not void*. And enable use of - gcc -ansi -pedantic. - - * special.c: Don't use C++ comments. - - * papersiz.c: Rewrite - - * draw.c: - * dvi.c: - * font.c: - * ft.c: - * misc.c: - * pk.c: - * tfm.c: - * vf.c: Fix signedness - -2004-11-15 Reiner Steib - - * draw.c, dvipng.c, enc.c, font.c, ft.c, pk.c, special.c, t1.c: - Don't use C++ comments. - -2004-11-05 David Kastrup - - * Makefile.in (install-dvigif): Don't fail if dvigif already - exists. - -2004-11-02 Jan-Åke Larsson - - * dvipng.h: Fix boolean type - -2004-11-01 Jan-Åke Larsson - - * RELEASE: Update for 1.3 - - * dvipng.h: Load alloca.h when available - - * font.c: - * fontmap.c: Remove inline - - * Makefile.in: - * commands.h: - * config.h.in: - * configure.ac: - * install.texi: - * macros.texi: - * miktex.h: - * readme.texi: - * test_dvipng.tex: Add copyright notice - - * color.c: - * draw.c: - * dvi.c: - * dvipng.c: - * dvipng.h: - * enc.c: - * font.c: - * fontmap.c: - * ft.c: - * misc.c: - * papersiz.c: - * pk.c: - * ppagelist.c: - * set.c: - * special.c: - * t1.c: - * tfm.c: - * vf.c: Change c-in-a-circle to (C) - -2004-10-27 Jan-Åke Larsson - - * dvipng.1: - * dvipng.texi: Amend docs - - * misc.c: Amend helptext - -2004-10-26 Jan-Åke Larsson - - * set.c: - * misc.c: - * dvipng.h: Change background transparency - - * configure.ac: Bump version, add test for libz - -2004-10-07 Jan-Åke Larsson - - * dvipng.texi: document change in -o switch - -2004-10-06 Jan-Åke Larsson - - * set.c: Allow longer pagenumbers in output file (e.g., %06d) - -2004-08-18 Jan-Åke Larsson - - * Release 1.2 - - * RELEASE: Change for 1.2 - - * config.h.in: Update - - * dvipng.1: change help text - - * dvipng.texi: update mailing list text. And version. - - * README: - * readme.texi: update info and todo list - - * draw.c, misc.c, dvipng.c, dvipng.h: - Add an intermediate exit status - -2004-08-17 Jan-Åke Larsson - - * misc.c: add --gamma switch - - * special.c: Fix comment - - * set.c: - * dvipng.h: new Gamma function - - * configure.ac: libm is needed by new gamma code - - * dvipng.1: - * dvipng.texi: document new switches - - * draw.c: change name of picky flag - - * special.c: do not call ghostscript when switch given - - * misc.c: add picky and ghostscript switches - - * dvipng.h: add picky and ghostscript flags - -2004-08-06 Jan-Åke Larsson - - * dvipng.texi: Document --png, --gif, and --picky - - * .cvsignore: Add *.gif - - * Makefile.in: Install 'dvigif' if we have GIF support - - * configure.ac: Test for gdImageGif and 'ln -s' - - * config.h.in: GIF support - - * set.c: GIF writing - - * misc.c: basename fixes, --png and --gif fixes, - --no-image-on-warn changes name to --picky - - * dvi.c: basename fixes - - * dvipng.h: Portability fixes, add GIF image flag - -2004-08-02 Jan-Åke Larsson - - * draw.c: Fix behaviour of --no-image-on-warn - -2004-07-01 Jan-Åke Larsson - - * miktex.mak: New, for MIKTeX - - * dvi.c: - * dvipng.c: - * dvipng.h: - * special.c: Adjust for MIKTeX - - * color.c: - * enc.c: - * font.c: - * fontmap.c: - * misc.c: - * pk.c: - * tfm.c: - * vf.c: Move file-mmapping to misc.c, adjust it for MIKTeX - -2004-06-29 Jan-Åke Larsson - - * configure.ac: - * dvipng.h: inttypes.h not available on all platforms - - * special.c: Remove snprintf, not available on certain platforms - -2004-06-27 Jan-Åke Larsson - - * dvipng.c: Fix case of missing font libs - - * fontmap.c: Remove debug printf - - * draw.c: Fix for case of absent font lib(s), correct typo - -2004-06-24 Jan-Åke Larsson - - * fontmap.c: - * pk.c: - * vf.c: More memory fixes - -2004-06-21 Jan-Åke Larsson - - * config.h.in: - * configure.ac: Test for stdbool, munmap and strtol - - * test_dvipng.tex: Change color test - - * dvipng.h: - * misc.c: - * ppagelist.c: Fix -r switch - - * dvipng.h: - * font.c: - * misc.c: - * ppagelist.c: - * special.c: - * t1.c: - * tfm.c: Use stdbool - - * color.c: - * dvi.c: - * dvipng.c: - * dvipng.h: - * enc.c: - * font.c: - * fontmap.c: - * ppagelist.c: - * special.c: Fix memory leak(s) - - * color.c: - * draw.c: - * dvi.c: - * dvipng.h: - * misc.c: - * set.c: - * special.c: Fix color stack - - * draw.c: - * dvipng.h: - * ft.c: - * pk.c: - * set.c: - * t1.c: - * tfm.c: - * vf.c: Simplify char structs - - * color.c: - * draw.c: - * dvi.c: - * dvipng.c: - * dvipng.h: - * enc.c: - * font.c: - * fontmap.c: - * ft.c: - * misc.c: - * papersiz.c: - * pk.c: - * ppagelist.c: - * set.c: - * special.c: - * t1.c: - * tfm.c: - * vf.c: Add copyright notice - -2004-05-31 Jan-Åke Larsson - - * dvipng.1: - * configure.ac: - * RELEASE: - * INSTALL: Release 1.1 - -2004-05-26 Jan-Åke Larsson - - * special.c: Handle source specials - - * test_dvipng.tex: Add failing special and color test - - * dvipng.c: Adjust coment about SELFAUTO... - - * dvi.c: Fix possible overflow - -2004-05-24 Jan-Åke Larsson - - * misc.c: Remove -t, it is not implemented yet - - * dvipng.h: Undef malloc, if defined - -2004-05-18 Jan-Åke Larsson - - * dvipng.texi: Fix build - -2004-05-14 Jan-Åke Larsson - - * config.h.in: Use more tests - - * dvipng.1: Add documentation - - * dvipng.texi: Fix build. Revert to four-argument @node, my - makeinfo cannot handle the one-argument form (yet). - -2004-05-11 Jan-Åke Larsson - - * configure.ac: More tests - -2004-05-09 Jan-Åke Larsson - - * install.texi: T1lib docs - - * dvipng.1: - * dvipng.texi: Add documentation, and spellcheck - - * special.c: - * color.c: Make colors work again. - -2004-05-08 David Kastrup - - * Create new ChangeLog for dvipng - -2004-05-05 Jan-Åke Larsson - - * fontmap.c: Use both kpse_fontmap_format and - _dvips_header_ - - * enc.c: Use configure test - - * configure.ac: Add test for kpse_enc_format, reorder gd - and png tests - - * aclocal.m4: Add test for kpse_enc_format - - * special.c: More informative warnings - -2004-05-04 Jan-Åke Larsson - - * enc.c: - Use the new kpathsea search format kpse_enc_format if available, - otherwise use kpse_tex_ps_header_format - - * fontmap.c: - Fix new kpathsea search type kpse_fontmap_format, use - kpse_dvips_config_format if not available - - * ft.c: Fix sizing - - * draw.c: Simplify LoadT1 call - - * t1.c: Shorten call, fix sizing - - * dvipng.h: Simplify char-storing structure - -2004-05-03 Jan-Åke Larsson - - * fontmap.c, font.c, t1.c, ft.c: - Fix for ps fonts not in psfontmap - -2004-05-02 Jan-Åke Larsson - - * Makefile.in: - * config.h.in: - * configure.ac: - * draw.c: - * dvipng.c: - * dvipng.h: - * enc.c: - * font.c: - * fontmap.c: - * ft.c: - * t1.c: - * misc.c: Add t1lib support - -2004-04-05 Jan-Åke Larsson - - * dvipng.1: - * readme.texi: - * dvipng.texi: - * Makefile.in: Add man page - -2004-03-27 Jan-Åke Larsson - - * dvipng.texi: Fix debug documentations - - * dvipng.c: Dont fail on --mode without --bdpi, output a warning. - -2004-03-26 Jan-Åke Larsson - - * papersiz.c: Remove compiler warning - - * dvipng.texi: - * misc.c: Change year - -2004-03-25 Jan-Åke Larsson - - * special.c: Revert change, not only resolution but also - offset is needed when generating png from ps - - * misc.c: Change helptext - - * configure.ac: Change version number - - * README: Checkin updated README - - * pk.c: - * ft.c: Speed up color cache - - * dvipng.texi: Add info on resolution, change version number - -2004-03-24 Jan-Åke Larsson - - * special.c: Fix missing 'showpage' and a memory leak - - * font.c: Adjust error message - - * dvipng.h: - * ft.c: - * pk.c: Change ink darkness map - - * draw.c: Output page numbers more often. If the user has a - slow terminal he's to blame himself, not me. - - * tfm.c: Include alloca.h if present - -2004-03-23 Jan-Åke Larsson - - * dvipng.texi: Adjust for the new -D option - -2004-03-19 dakas - - * RELEASE: Remove spurious blanks. - -2004-03-19 Jan-Åke Larsson - - * RELEASE: Update, shorten - -2004-03-18 Jan-Åke Larsson - - * RELEASE: - * dvi.c: - * dvipng.c: - * dvipng.h: - * font.c: - * misc.c: - * papersiz.c: - * special.c: Change the behaviour of the -D switch - -2004-03-08 Jan-Åke Larsson - - * font.c: Don't retry on PK generation failure - -2004-03-02 David Kastrup - - * dvi.c (DVIOpen): Fix a buffer overrun error. diff --git a/Build/source/texk/dvipng/dvipng-1.13/ChangeLog.0 b/Build/source/texk/dvipng/dvipng-1.13/ChangeLog.0 deleted file mode 100644 index 3c4689ad8c4..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/ChangeLog.0 +++ /dev/null @@ -1,903 +0,0 @@ -2004-01-16 Jan-Åke Larsson - - * font.c: fix compile without FT2 - -2004-01-12 Jan-Ake Larsson - - * RELEASE: Prepare for 0.9 - - * misc.c: Enable --expand-bbox - - * color.c: - * draw.c: - * dvipng.h: - * font.c: - * misc.c: - * special.c: Enable --no-image-on-warn - - * draw.c: - * dvi.c: - * dvipng.c: - * dvipng.h: - * readme.texi: - * special.c: Fix tightpage behaviour - -2004-01-09 Jan-Ake Larsson - - * special.c: Add preview-latex's "tightpage" code - -2004-01-08 Jan-Ake Larsson - - * dvipng.texi: - * configure.ac: Prepare for 0.9 - - * Makefile.in: clean target - -2004-01-07 Jan-Ake Larsson - - * color.c: - * draw.c: - * dvi.c: - * dvipng.c: - * dvipng.h: - * enc.c: - * font.c: - * fontmap.c: - * ft.c: - * pk.c: - * set.c: - * special.c: - * tfm.c: - * vf.c: Speedup DEBUG - - * pk.c: Fix subpixel offsets - - * dvipng.c: - * dvipng.h: - * font.c: - * misc.c: - * set.c: - * special.c: Fix flags - - * draw.c: Fix bbox - - * dvipng.h: Adjust for freetype >= 2.1.6 - -2003-12-15 Jan-Ake Larsson - - * tfm.c: - * fontmap.c: - * font.c: Fix freeeeeeeeeing - -2003-12-08 Jan-Ake Larsson - - * dvipng.texi: - * configure.ac: - * RELEASE: Prepare for 0.8 - - * ft.c: Fix debug output - - * draw.c: - * dvipng.h: - * dvipng.texi: - * misc.c: Add --height option - - * test_dvipng.tex: A nice equation is true. Behave! - -2003-12-07 Jan-Ake Larsson - - * enc.c: Encodings are _ps_header_s - -2003-12-05 Jan-Åke Larsson - - * misc.c: - * dvipng.texi: - * dvipng.h: - * draw.c: Change --baseline to --depth - -2003-12-01 Jan-Ake Larsson - - * draw.c: - * dvipng.h: - * misc.c: Change to physical pagenumbers, instead of DVI - pagenumbers. DVI pagenumbers will be indicated on STDOUT if they - differ from physical pagenumbers, but the numbering of PNG files - is physical pagenumbers. Old behaviour can be chosen with the - option -dvinum. - - * ppagelist.c: - * misc.c: - * dvipng.texi: Make negative pages render. Now -pp handles - negative pages gracefully too. Remove -pp code taken from dvips. - -2003-11-30 Jan-Ake Larsson - - * draw.c: - * dvipng.c: - * dvipng.h: - * font.c: - * ft.c: - * misc.c: - * pk.c: - * set.c: - * tfm.c: - * vf.c: Include alloca.h when necessary, start preparing - transition to subpixel rendering, do proper cleanup on exit - -2003-11-18 Jan-Åke Larsson - - * enc.c: Fix bug - - * ft.c: - * tfm.c: - * font.c: - * dvipng.h: Add fallback from FT to PK - -2003-11-14 Jan-Åke Larsson - - * Makefile.in: Use $DESTDIR - -2003-11-06 Jan-Åke Larsson - - * special.c: Fix postscript inclusion: placement and - background color - -2003-10-17 Jan-Åke Larsson - - * misc.c: - * font.c: - * dvipng.texi: - * dvipng.h: Add option for freetype activation - - * configure.ac: Add message when freetype is present - - * ft.c: Apparently FreeType hinting is a no-no. Load glyphs - with FT_LOAD_NO_HINTING. Only then output is acceptable. - -2003-10-15 Jan-Åke Larsson - - * fontmap.c: Remove erroneous match - -2003-10-13 Jan-Åke Larsson - - * font.c: Fix font searching order - - * RELEASE: Prepare for 0.7 - - * fontmap.c: - * psfontmap.c: - * configure.ac: Rename psfontmap.c to fontmap.c - -2003-10-08 Jan-Ake Larsson - - * psfontmap.c: Add third bare word: encoding - -2003-10-07 Jan-Ake Larsson - - * misc.c: - * dvipng.texi: Allow for -- on options - - * configure.ac: Prepare for 0.7 - - * Makefile.in: Adjust hint - - * configure.ac: - * config.h.in: Fix helptext in config.h.in - - * test_dvipng.tex: Add some tests for ligatures and sizes - -2003-10-03 Jan-Åke Larsson - - * readme.texi: Document new font support and switches - - * psfontmap.c: Redesign psfontmap loading to use the syntax - from dvips' docs - - * font.c: Enhance TrueType font finding - - * draw.c: Warn if setting char from null font - - * dvipng.h: - * color.c: Load and use psnames.def - -2003-09-28 Jan-Ake Larsson - - * misc.c: Warn for all bad options - -2003-09-24 Jan-Ake Larsson - - * dvipng.texi: - * install.texi: - * misc.c: Fix documentation - -2003-09-23 Jan-Ake Larsson - - * ft.c: - * enc.c: - * dvipng.h: Only load encodings once - -2003-09-18 Jan-Åke Larsson - - * draw.c: - * dvipng.h: - * misc.c: Add -baseline switch - -2003-09-17 Jan-Ake Larsson - - * font.c: Remove compiler warning - - * config.h.in: - * psfontmap.c: - * dvipng.c: - * configure.ac: Fix SELFAUTO... variables if dvipng is not - being installed in main texmf tree. This will make it find config - files and fonts anyway. - -2003-09-16 Jan-Ake Larsson - - * tfm.c: - * psfontmap.c: - * ft.c: - * enc.c: Added for postscript font handling with freetype - - * font.c: Use freetype font loading - - * dvipng.h: Add freetype-related types and declarations, - and simplify glyph rendering - - * pk.c: Simplify glyph rendering - - * dvipng.c: Init freetype - - * dvi.c: Fix strlen bugs - - * draw.c: Add FONT_TYPE_FT drawing - - * configure.ac: - * config.h.in: - * Makefile.in: Adjust for freetype things - -2003-08-29 Jan-Åke Larsson - - * special.c: fix color handling - - * dvipng.c: Increase TIMING output - - * misc.c: - * draw.c: small speedups - - * dvipng.h: - * configure.ac: - * config.h.in: - * Makefile.in: Change handling of the DEBUG and TIMING - flags - -2003-08-26 Jan-Åke Larsson - - * RELEASE, dvipng.texi, configure.ac: - prepare for 0.6 - - * Makefile.in: another install-docs fix - -2003-08-13 Jan-Åke Larsson - - * configure.ac: new test (ps inclusion speedup) - - * draw.c: simplify preprocessor processing, fix SetSpecial - call - - * special.c: speedup for ps image inclusion, fix SetSpecial - call - - * Makefile.in: fix install-docs - -2003-08-04 Jan-Åke Larsson - - * special.c: Argh!, fix compilation for non-truecolor version - - * dvipng.h: Argh!, fix image cache - - * dvipng.texi: - * configure.ac: - * RELEASE: Prepare for 0.5 - - * misc.c: - * dvipng.h: - * set.c: Add preliminary truecolor support - - * pk.c: Benchmark truecolor rendering, no real code change - - * special.c: - * misc.c: - * dvipng.h: Add preliminary image cacheing - - * draw.c: Small adjustments - -2003-07-30 Jan-Åke Larsson - - * draw.c: Fix two bugs so that bounding box again is - correct - - * configure.ac: configuration printout improved - - -2003-07-02 Jan-Åke Larsson - - * dvipng.h: Add prototypes - - * draw.c: minor change - - * RELEASE: prepare for 0.4 - -2003-07-01 Jan-Åke Larsson - - * draw.c, set.c: - Fix rules (again), this time taking maxdrift into account. - - * pk.c: Unfortunately gdImageColorResolveAlpha only works - on truecolor images. Some other day, then. I did fix the - performance of PROPER_OVERSTRIKE, though. - - * readme.texi: Add todo - -2003-06-30 Jan-Åke Larsson - - * dvipng.texi: small fixes - - * vf.c: Speedup macro start/end - - * set.c: Handle offset in draw.c only, allow choice of - compression if gd can do this - - * pk.c: Handle overstrike, either with gd alpha level, if - support exists for that, or "manually". The latter is active if - PROPER_OVERSTRIKE is #defined, currently yes, at roughly 5% - performance loss. - - * misc.c: -z option: choose compression if gd can do this - - * dvipng.h: Proper rounding, gd bells and whistles - - * draw.c: Allow drift a la dvitype, maxdrift=1, handle - offset here only, speedup vf macro start/end - - * config.h.in: - * configure.ac: New tests for gd bells and whistles - - * Makefile.in: Clean README - - * .cvsignore: More files - -2003-06-23 Jan-Åke Larsson - - * configure.ac: - * config.h.in: Added tests for newly added C code - - * Makefile.in: - * dvipng.texi: Reflect move of readme - - * README: - * readme.texi: Moved from README to readme.texi - -2003-06-19 Jan-Åke Larsson - - * special.c: Fix crash on file not found - - * set.c: Code reformatting - - * misc.c: Fix switches, and send warnings/errors to stderr. - - * vf.c: - * pk.c: - * draw.c: Include header only used in this file, here. - - * commands.h: Make draw.c compile without -DDEBUG - - * Makefile.in: Use --disable-debug, fix docs - generation/install, and add 'test' target. - - * README: Update info - - * configure.ac: Add --disable-debug - - * install.texi: Minor changes - - * dvipng.texi: Document difference between -pp and -p + -l - - * dvipng.h: Fix FreeBSD non-C99 header issue - -2003-06-12 Jan-Åke Larsson - - * Makefile.in: Fix SunOS make suffix rule wierdness - - * color.c: Change comment - - * dvi.c (DVIOpen): bugfix ".dvi" completion - - * dvipng.h (PIXROUND): Round down instead of up, SetRule - now has its own rounding mechanism - - * set.c (SetRule): Refine rule drawing, make sure rule is - inside bounding box - -2003-06-10 Jan-Åke Larsson - - * README: - * RELEASE: - * Makefile.in: - * configure.ac: - * dvipng.texi: Prepare for 0.3 - - * vf.c: - * set.c: - * pk.c: - * font.c: - * dvi.c: - * draw.c: simplify DEBUG_PRINT - - * configure.ac: Look for gs - - * special.c: Fixes to gs interaction - - * set.c: Enable -o for output file, no segfault on empty - image, reposition rule to match dvips - - * draw.c: simplify DEBUG_PRINT macro - - * dvi.c: - * misc.c: Enable -o for output file - - * dvipng.h: Enable -o for output file, simplify DEBUG_PRINT - macro - -2003-04-17 Jan-Ake Larsson - - * install.texi: - * dvipng.texi: Rewrite stuff - - * dvipng.h: New debug flag - - * configure.ac: - * config.h.in: Configure GS_PATH - - * special.c: No tempfiles anymore. Communicate with child - through two pipes. - - * configure.ac: - * Makefile.in: Make docs - -2003-04-15 Jan-Åke Larsson - - * macros.texi: Added - - * install.texi, dvipng.texi: Initial version - -2003-03-28 Jan-Åke Larsson - - * README: - * RELEASE: Release 0.2, PostScript type1 font support and - PostScript inclusion. - - * configure.ac: Added configure error message about where - to find libgd. - - * dvipng.h: - * draw.c (DrawCommand): - * special.c (SetSpecial): Postscript inclusion now works. - - * misc.c (DecodeArgs): Fix --help message - - * COPYING: - * RELEASE: - * README: Added files to repository - -2003-03-12 Jan-Åke Larsson - - * dvi.c (DVIFollowToggle): - * misc.c (DecodeArgs): - * dvipng.h: Added '-follow' switch, and code that - implements a follow mode. - -2003-02-27 Jan-Åke Larsson - - * draw.c (DrawPages): - * misc.c (Message): Speed up slightly when not in DEBUG - mode. - - * misc.c (DecodeArgs): Adjust copyright notice. - - * set.c (SetRule): Reposition rules, one dot up. - -2003-01-30 Jan-Åke Larsson - - * Makefile.in: - * configure.ac: Fix includes and linking - - * draw.c: - * font.c: - * pk.c: - * vf.c: - * dvipng.h (font_entry): remove unnamed union - - * dvipng.h: simplify includes - -2003-01-15 Jan-Ake Larsson - - * misc.c: Use autoconf's stuff, use atoi, fix warning - message - - * dvipng.c: - * dvipng.h: Localize position and spacing to draw.c. Fix - timing - - * pk.c: - * set.c: - * special.c: - * vf.c: - * draw.c: Localize position and spacing to draw.c - - * configure.ac: Require gd and kpathsea - -2002-12-03 Jan-Ake Larsson - - * draw.c: unfinished change: repairing - - * draw.c: - * font.c: - * vf.c: use void* in function call - - * dvipng.h: - * draw.c: - * color.c: - * set.c: change names of some functions - - * dvipng.h: - * draw.c: - * dvi.c: - * ppagelist.c: make dvi data more local - - * .cvsignore: - * dvipng.h: - * special.c: - * font.c: - * misc.c: - * dvipng.c: - * configure.ac: - * config.h.in: - * Makefile.in: autoconfiscate - -2002-11-07 Jan-Ake Larsson - - * dvipng.h: - * dvipng.c (main): - * dvi.c (DVIReOpen): Don't re-init, re-open - -2002-10-31 Jan-Ake Larsson - - * dvipng.h: - * dvi.c: Remove globals and Reopen DVI on change (check - mtime) - - * dvipng.c: Reopen DVI on change (check mtime) - -2002-10-30 Jan-Ake Larsson - - * pk.c: Declaration moved here from dvipng.h - - * Makefile: No io.c, no pagequeue.c but ppagelist.c - - * dvipng.h: Rearranged, some new declarations - - * dvipng.c (main): minor changes - - * draw.c (DoPages): use new page-finding mechanisms - - * dvi.c: outfilename handling fixed, page-finding - mechanisms added. - - * misc.c: Ppagelist handling improved, outfilename now - works, added functionality from io.c - - * ppagelist.c: Added. Functionality slightly different from - pagequeue.c - - * pagequeue.c: Revamped. Functionality changed and moved to - ppagelist.c - - * io.c: Removed. Functionality in misc.c - - * .cvsignore: Additions - -2002-10-24 Jan-Ake Larsson - - * dvipng.c (main): - * dvipng.h: - * misc.c (DecodeString): Improve stdin parser - -2002-10-21 Jan-Ake Larsson - - * dvipng.h: Remove globals, fix message output - - * vf.c (SetVF, InitVF), - * font.c (FontDef), - * draw.c (DrawCommand): Bugfix VF handling, fix message - output - - * pk.c (SetPK, InitPK), - * dvi.c (DVIOpen): Fix message output - - * papersiz.c: use int32_t, fix overflow - - * misc.c (DecodeArgs, Message): Fix -d option, remove - globals, fix message output - -2002-10-16 Jan-Ake Larsson - - * dvipng.h: Remove globals - - * dvipng.c (main): Remove globals, improve stdin parser - - * misc.c (DecodeArgs): remove globals, fix helptext - - * pagequeue.c (FindQdPage, QueuePage, QueueParse): - remove globals - - * dvi.c (FindPage): Remove unnecessary test - - * draw.c (DoPages): Do more normal read-ahead - -2002-10-15 Jan-Ake Larsson - - * pk.c, font.c: Minor change - - * misc.c: Simplify, remove (some) globals, fix helptext - - * pagequeue.c, dvipng.h, dvipng.c, - dvi.c, draw.c: Simplify, remove (some) globals - -2002-10-14 Jan-Ake Larsson - - * misc.c, dvipng.h, draw.c: - Added '-T tight' switch - -2002-10-11 Angus Leeming - - * draw.c: - * dvi.c: - * dvipng.[ch]: - * font.c: - * io.c: - * misc.c: - * pagequeue.c: - * papersiz.c: - * pk.c: - * set.c: - * special.c: - * vf.c: remove function prototype macros. - - * dvi.c (DVIGetCommand, CommandLength): - * set.c (SetChar): add a 'break' to the end of the switch - statements (prevents a warning with gcc 3.2). - -2002-10-11 Jan-Ake Larsson - - * special.c: Fix DEBUG, prototypes, and code pruning - - * vf.c, set.c, pk.c, io.c, - font.c, draw.c: Fix DEBUG - - * misc.c, dvi.c, pagequeue.c, - dvipng.h, dvipng.c: Fix pagelist and DEBUG - - -2002-09-20 Jan-Ake Larsson - - * dvipng.h: change font structures, add dvi struct, remove old - global variables, include relevant bits of config.h, restructure - somewhat - - * dvipng.c: remove explicit vf stack - - * special.c: use dvi struct - - * misc.c: minor changes - - * io.c: close file descriptors, not FILE pointers. - - * draw.c: simplify, remove explicit vf stack. - - * set.c: use dvi struct, remove explicit dvi stack. - - * vf.c: use mmap, remove explicit vf stack. - - * pk.c: use mmap - - * font.c: enable dvi struct, prepare for mmap (file descriptors, - not FILE pointers), explicit vf stack removed. - - * dvi.c: use dvi struct - - * Makefile: config.h removed - - * config.h, klibtool, klibtool.config: removed. - -2002-08-30 Jan-Ake Larsson - - * dvi.c: fix bug in STRSIZE zap - - * vf.c: simplify, fix debug info, zap STRSIZE limit - - * misc.c: Fix background transparency - - * dvipng.h, draw.c: Fix FormFeed bug (outfilename - wrong) - - * set.c: Fix FormFeed bug (outfilename wrong), and background - transparency - -2002-08-29 Jan-Ake Larsson - - * dvipng.h: type changes, dvi-io abstraction - - * color.c: comment changed - - * dvipng.c: dvi-io abstraction - - * font.c: type changes, STRSIZE killed - - * io.c: ReadCommand and CommandLength moved to dvi.c, preparations - for mmap - - * set.c: type changes - - * vf.c, pk.c: prepare for mmap, type changes - - * pagequeue.c: type change - - * misc.c: dvi fopen moved to dvi.c, type changes - - * Makefile: pagelist.o gone, dvi.o new - - * draw.c: SetVF moved to vf.c, type and dvi-io abstraction - changes - - * commands.h: added length and debug texts - - * dvi.c: Functionality moved from pagelist.c and misc.c to - dvi.c. Still needs work, but is initial stab at proper abstraction - of dvi-reading stuff. STRSIZE killed. - - * pagelist.c: Functionality moved to dvi.c - - * special.c: DoSpecial now takes a const char* argument, as - opposed to before. - -2002-08-19 Jan-Ake Larsson - - * misc.c: Added -mode switch - -2002-08-14 Jan-Ake Larsson - - * dvipng.h: VF additions, general cleanup - - * dvipng.c: Small adjustments connected to the VF support - - * config.h: Remove unnecessary things - - * pagelist.c: Simplifications - - * color.c: Comment changed - - * special.c, set.c: Scale always equal h/v - - * Makefile: Make vf.o - - * io.c: Start pre-conversion to mmap. Much still to be done. - - * misc.c, set.c, font.c, pk.c, draw.c: Adjust for VF support - - * vf.c: VF support added to dvipng - -2002-06-24 Jan-Ake Larsson - - * Makefile: Cleaned. Vacuumed, in fact. - -2002-06-19 Jan-Ake Larsson - - * pagelist.c: remove Debug bug (!) - -2002-06-13 Jan-Ake Larsson - - * Makefile: new object files - - * special.c, set.c, dvipng.h: cleanup - - * misc.c (ActualFactor): moved to font.c + cleanup - - * font.c (ActualFactor): moved here from misc.c - - * draw.c, dvipng.c, pagelist.c: functionality from dvipng.c spread - to these three - - * pagequeue.c, pages.c: functionality moved from pages.c to - pagequeue.c - - * commands.h: minor adjustments - -2002-06-12 Jan-Ake Larsson - - * special.c: on unimplemented \special, give pixel position - - * misc.c: Bugfix + literal response on stdin interface - - * font.c, dvipng.h: Font handling fixed - - * dvipng.c: prompt on stdin interface - -2002-06-11 Jan-Ake Larsson - - * set.c (SetChar): load chars on PASS_DRAW - -T -O bug fixed - -2002-06-11 Jan-Ake Larsson - - * set.c: Cleanup. Still buggy wrt -O, though. - - * Makefile: DEBUG on for now, postamble.? removed - - * postamble.c: Postamble is no longer read - - * pages.c: Improve page handling: now a queue, not an unordered - set - - * font.c: Improve font handling: search for fonts only when used - - * dvipng.h: Cleanup - - * dvipng.c: Major rewrite: page handling improved - - * misc.c: Fix DVI init + cleanup - -2002-05-30 Jan-Ake Larsson - - * misc.c: Transparent border: '-bd' - - * dvipng.h, set.c: Tiding up + transparent border - - * dvipng.c, font.c: Tidying up - -2002-05-29 Jan-Ake Larsson - - * color.c: Fix cmyk->rgb. - - * misc.c: Add '-fg' and '-bg'. - - * font.c: Tidy up - -2002-05-29 Jan-Ake Larsson - - * dvipng.h: Tidying up, and new global vars - - * io.c: Tidying up - - * papersiz.c: Pagesize matters, adapted from dvips - - * pages.c: Page choosing, from dvips. Not sufficient for our - purposes, but a start - - * dvipng.c, color.c, Makefile, misc.c, set.c: Changed to make - pagesize (-T), offset (-O), page choosing (-pp), and output file - (-o) work. - -2002-05-27 Jan-Ake Larsson - - * pk.c: Changed comments - - * .cvsignore, special.c, set.c, postamble.c, pk.c, misc.c, io.c, - font.c, dvipng.c, color.c, commands.h, dvipng.h: Initial version - - * config.h, Makefile: Initial version, to be replaced by - autoconf'ism - - * klibtool.config, klibtool: Included for now. To be - removed. diff --git a/Build/source/texk/dvipng/dvipng-1.13/INSTALL b/Build/source/texk/dvipng/dvipng-1.13/INSTALL deleted file mode 100644 index bef302aebd8..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/INSTALL +++ /dev/null @@ -1,168 +0,0 @@ -Installing dvipng -***************** - -Installing dvipng should be simple: merely `./configure', `make', and -`make install'. - -Prerequisites -============= - - * The GD Graphics Draw library, libgd - - The drawing library `libgd' is necessary, and is downloadable at - `http://www.boutell.com/gd', and there are binary packages for - most operating systems from their respective distributors. In any - case, the latest version of the library installs using `autoconf' - so it should not be difficult for you to install it from source, - and then proceed with installing dvipng. - - * The path-searching library kpathsea - - Kpathsea is most likely included in your LaTeX installation, but it - may happen that ./configure does not find it; see below. If you do - not have it, download it from `http://www.ctan.org' and compile it. - I have no experience with this, so I cannot help much here. - - * The font-rendering library FreeType 2 - - While not strictly necessary, a recent FreeType 2 is recommended - since dvipng currently will produce better-quality images when - this library is available. To take advantage of this, you should - have at least FreeType 2.1.9. - - FreeType 2 will enable direct support for PostScript and TrueType - fonts, so that dvipng will not need to generate bitmapped variants - on disk of the TeX fonts since modern TeX distributions include - PostScript versions of them. Then, you can render images at - different (and unusual) resolutions without cluttering the disk - with lots of bitmapped fonts. - - Finally, it will enable subfont support in dvipng. That is, if you - want to render CJK-LaTeX characters, you must have FreeType 2 - installed. - - * The font-rendering library T1lib - - An alternative to FreeType 2 is T1lib, but this will enable only - PostScript fonts in dvipng and will not include subfont support. - Also here, you can render images at different (and unusual) - resolutions without cluttering the disk with lots of bitmapped - fonts. If both FreeType 2 and T1lib are present, FreeType will be - internally preferred by dvipng but T1lib can be chosen at runtime. - - * libpng and libz - - To be able to compress and write PNG files to disk, dvipng (or - really libgd) uses libpng which in turn uses libz. These should be - available on any modern system, if not, download them and install - them. - - * The `texinfo' package - - This is needed for building the documentation. - -Configure -========= - -The first step is to configure the source code, telling it where -various files will be. To do so, run - - ./configure OPTIONS - - (Note: if you have fetched dvipng from CVS rather than a regular -release, you will have to first generate `./configure' by running -`autoconf' 2.53 or later.) - - On many machines, you will not need to specify any options, but if -`configure' cannot determine something on its own, you'll need to help -it out. For a list of the options type - - ./configure --help - - On some machines, the libraries will be installed in directories that -are not in the linker's search path. This will generate an error when -running `./configure', indicating that it cannot find libgd or -libkpathsea (most likely). You then need to specify the path to the -respective library's object files. They are typically called e.g., -`libgd.a' or `libgd.so'. If they are located in e.g., `/sw/local/lib', -do - - ./configure LDFLAGS=-L/sw/local/lib - - If the library is available as a shared object file (`.so'), the -runtime linker may also need to be told where to find the library, then -use - - ./configure LDFLAGS='-L/sw/local/lib -R/sw/local/lib' - - When either of these is necessary, it is likely that the C header -files are also installed in directories that are not in the C -preprocessor's search path. This will also generate an error when -running `./configure', indicating that it cannot find e.g., `gd.h' or -`kpathsea.h' (most likely). You then need to specify the path to the -respective library's C header files. If they are located in e.g., -`/sw/local/include', do - - ./configure CPPFLAGS=-I/sw/local/include - - On my SUN Solaris workstation, I had to combine this into - - ./configure CPPFLAGS='-I/sw/local/include -I/sw/tex/teTeX/1.0/include'\ - LDFLAGS='-L/sw/local/lib -R/sw/local/lib -L/sw/tex/teTeX/1.0/lib/' - -where the backslash denotes a continuation of the line. - -Build/install -============= - -Once `configure' has been run, simply enter - - make - -at the prompt to compile the C code, and build the documentation files. -To install the files into the locations chosen earlier, type - - make install - -You may need special privileges to install, e.g., if you are installing -into system directories. - -Installation outside the texmf tree -=================================== - -In some cases, a dvipng binary installed outside the texmf tree will -not be able to find virtual fonts, or the PostScript font maps -(normally used by dvips). This may be because _only_ $SELFAUTOLOC, -$SELFAUTODIR, and $SELFAUTOPARENT are used in the texmf tree -configuration file `texmf.cnf'. If so, give the switch -`--enable-selfauto-set' to `./configure'. This will make dvipng adjust -these three internally so that kpathsea thinks that dvipng _is_ -installed in the texmf tree. - -Installation for non-privileged users -===================================== - -Often people without system administration privileges want to install -software for their private use. In that case you need to specify more -options to the `configure' script, usually this is done by using the -`--prefix' option to the `configure' script, and let it point to the -personal home directory. In that way, resulting binaries will be -installed under the `bin' subdirectory of your home directory, manual -pages under `man' and so on. That way, it is reasonably easy to -maintain a bunch of additional packages, since the prefix argument is -supported by most `configure' scripts. - - You'll have to add something like `/home/myself/bin' to your `PATH' -shell variable, if it isn't there already, and similarly set the -`INFOPATH' and `MANPATH' variables to be able to access the -documentation. - -Copying -======= - -This program is released under the GNU Lesser General Public License -version 3, see the COPYING file in the dvipng distribution or -`http://www.gnu.org/licenses/'. - - Copyright (C) 2002-2009 Jan-AAke Larsson - diff --git a/Build/source/texk/dvipng/dvipng-1.13/Makefile.in b/Build/source/texk/dvipng/dvipng-1.13/Makefile.in deleted file mode 100644 index 0e2ce2eaa00..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/Makefile.in +++ /dev/null @@ -1,168 +0,0 @@ -# Makefile is generated by 'configure' from Makefile.in - -#************************************************************************ -# -# Part of the dvipng distribution -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program. If not, see -# . -# -# Copyright (C) 2002-2008 Jan-Åke Larsson -# -#************************************************************************ - -PACKAGE_STRING="@PACKAGE_STRING@" - -CC = @CC@ -CFLAGS = @CFLAGS@ -Wall -CPPFLAGS = @CPPFLAGS@ -I. -LN_S = @LN_S@ - -LIBS = @LIBS@ -LDFLAGS = @LDFLAGS@ - -srcdir = @srcdir@ -VPATH = @srcdir@ - -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -infodir = @infodir@ -mandir = @mandir@ -DESTDIR= -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -MKINSTALLDIRS = $(srcdir)/mkinstalldirs - -MAKEINFO=@MAKEINFO@ @MAKEINFO_MACROS@ -INSTALL_INFO=@INSTALL_INFO@ -TEX=tex -TEXIDVI=texi2dvi -TEXIHTML=texi2html -DVIPS=dvips -TEXIFILES = dvipng.texi readme.texi install.texi macros.texi dvipng.help - -objects = dvipng.o color.o draw.o dvi.o font.o misc.o pk.o \ - set.o special.o papersiz.o ppagelist.o \ - vf.o @PSFONTS_O@ - -all: dvipng docs - -install: @INSTALL_BIN_TARGET@ @INSTALL_BIN_TARGET@-docs - -####################################### The program - -dvipng: $(objects) - $(CC) $(LDFLAGS) $(objects) -o dvipng $(LIBS) - -$(objects): dvipng.h commands.h config.h - -install-dvipng: dvipng - -$(MKINSTALLDIRS) $(DESTDIR)$(bindir) - $(INSTALL) dvipng $(DESTDIR)$(bindir) - -install-dvigif: install-dvipng - (cd $(DESTDIR)$(bindir) && rm -f dvigif && $(LN_S) dvipng dvigif) - -####################################### The documentation - -docs: dvipng.dvi dvipng.info - -dvipng.dvi: $(TEXIFILES) - -$(TEXIDVI) -I $(srcdir) $(srcdir)/dvipng.texi - -dvipng.ps: dvipng.dvi - $(DVIPS) -Ppdf dvipng.dvi - -dvipng.info: $(TEXIFILES) dvipng.help - -$(MAKEINFO) -I$(srcdir) $(srcdir)/dvipng.texi - -dvipng.help: dvipng - -./dvipng > dvipng.tmp - ( test -r dvipng.help && diff dvipng.tmp dvipng.help ) \ - || cp dvipng.tmp dvipng.help - rm -f dvipng.tmp - -www: $(TEXIFILES) dvipng.help - texi2html -split chapter -nosec-nav -subdir html \ - -I $(srcdir) $(srcdir)/dvipng.texi - (cd html; for i in *; do \ - sed -e "s/Jan-A/Jan-\Å\;/g" $$i > ../www/$$i; \ - done) - cp www/dvipng.html www/index.html - rm -rf html - -dvipng_mono.html: $(TEXIFILES) dvipng.help - texi2html --monolithic -nomenu -nosec_nav -o dvipng_mono.html \ - -I $(srcdir) $(srcdir)/dvipng.texi - -install-docs: docs - -$(MKINSTALLDIRS) $(DESTDIR)$(infodir) - for x in dvipng.info* ; do \ - $(INSTALL_DATA) $$x $(DESTDIR)$(infodir) ; \ - done - -$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) dvipng.info - -$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1 - $(INSTALL_DATA) $(srcdir)/dvipng.1 $(DESTDIR)$(mandir)/man1 - -install-dvipng-docs: install-docs - -install-dvigif-docs: install-docs - (cd $(DESTDIR)$(mandir)/man1 && rm -f dvigif.1 && $(LN_S) dvipng.1 dvigif.1) - -####################################### The test - -test: test_dvipng.dvi dvipng - ./dvipng -T tight -strict test_dvipng - echo View the result e.g. with xv test_dvipng\*.png - -test_dvipng.dvi: test_dvipng.tex - latex $(srcdir)/test_dvipng.tex - -####################################### The cleaning up - -clean: - rm -f *.o dvipng *.help *.info* *dvipng.dvi *.aux *.log - rm -f *dvipng.ps *.cp *.fn *.ky *~ \#*\# \ - *.tp *.vr *.pg *.toc *.tp *.bak *.cps *.kys *.tps \ - *.fns *.vrs *.pgs *.html *.tmp - -distclean: clean - rm -f Makefile - rm -f config.status config.log config.cache c-auto.h - -####################################### Maintainer targets - -INSTALL: install.texi - -$(MAKEINFO) -D rawfile --no-headers --no-validate \ - --no-number-sections \ - -I$(srcdir) $(srcdir)/install.texi --output INSTALL - -README: readme.texi - -$(MAKEINFO) -D rawfile --no-headers --no-validate \ - --no-number-sections \ - -I$(srcdir) $(srcdir)/readme.texi --output README - -dvipng.1: dvipng.texi readme.texi - texi2pod.pl -D man $(srcdir)/dvipng.texi | \ - sed -es/@//g -es/previewlatex/preview-latex/g -es/{}//g > dvipng.pod - pod2man --center="User commands" --release=$(PACKAGE_STRING)\ - dvipng.pod > dvipng.1 - rm dvipng.pod - -dist: INSTALL README dvipng.1 distclean - -# SunOS make suffix rule wierdness -.cps.h: - diff --git a/Build/source/texk/dvipng/dvipng-1.13/README b/Build/source/texk/dvipng/dvipng-1.13/README deleted file mode 100644 index da9ba557f4c..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/README +++ /dev/null @@ -1,128 +0,0 @@ -dvipng -****** - -This program makes PNG and/or GIF graphics from DVI files as obtained -from TeX and its relatives. - - If GIF support is enabled, GIF output is chosen by using the -`dvigif' binary or with the `--gif' option. - - It is intended to produce anti-aliased screen-resolution images as -fast as is possible. The target audience is people who need to generate -and regenerate many images again and again. The primary target is the -preview-latex (X)Emacs package, a package to preview formulas from -within (X)Emacs. Yes, you get to see your formulas in the (X)Emacs -buffer, see `http://www.gnu.org/software/auctex/preview-latex.html'. - - Another example is WeBWorK, an internet-based method for delivering -homework problems to students over the internet, giving students -instant feedback as to whether or not their answers are correct, see -`http://webwork.math.rochester.edu'. - - A more recent addition to the dvipng-using applications out there is -MediaWiki, the software behind Wikipedia and many other wikis out -there. Dvipng is used to render mathematical formulae from version -1.8.0 of MediaWiki, see `http://www.mediawiki.org'. - - Other applications may also benefit, like web applications as -latex2html and WYSIWYG editors like LyX. - -Benefits of dvipng -================== - - The benefits of `dvipng'/`dvigif' include - - * Speed. It is a very fast bitmap-rendering code for DVI files, which - makes it suitable for generating large amounts of images - on-the-fly, as needed in preview-latex, WeBWorK and others. - - * It does not read the postamble, so it can be started before TeX - finishes. There is a `--follow' switch that makes dvipng wait at - end-of-file for further output, unless it finds the POST marker - that indicates the end of the DVI. - - * Interactive query of options. dvipng can read options interactively - through stdin, and all options are usable. It is even possible to - change the input file through this interface. - - * Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts - (i.e., as used in CJK-LaTeX), color specials, and inclusion of - PostScript, PNG, JPEG or GIF images. - - * and more... - - -Installation -============ - -Read `INSTALL', included in the distribution. - -Usage -===== - -To use dvipng at its simplest, simply type - - dvipng foo - -where `foo.dvi' is the output of TeX that you want to convert to PNG -format. If there are four pages in `foo.dvi', those pages will be -output as `foo1.png', `foo2.png', `foo3.png', and `foo4.png', -respectively. - - Many options are available (see the info manual). For a brief -summary of available options, just type - - dvipng --help - -Availability -============ - -The dvipng package is available at Savannah, the GNU project site. Since -dvipng is not part of the GNU project, although released under the GNU -GPL, the web address is `http://savannah.nongnu.org/projects/dvipng'. -Instructions for anonymous CVS access can be found at -`http://savannah.nongnu.org/cvs/?group=dvipng'. - -Contacts -======== - -Bug reports should be sent to . - - Questions, suggestions for new features, pleas for help, and/or -praise should go to . For more information on this -mailing list, send a message with just the word `help' as subject or -body to or look at -`http://lists.nongnu.org/mailman/listinfo/dvipng'. - - Offers to support further development will be appreciated. For -developer access, ask on . - -Copying -======= - -This program is released under the GNU Lesser General Public License -version 3, see the COPYING file in the dvipng distribution or -`http://www.gnu.org/licenses/'. - - Copyright (C) 2002-2009 Jan-AAke Larsson - -Todo -==== - - * Use gs interpreter library for speed and possibly for - functionality. - - * Add more color models for xcolor compatibility - - * Fix T1lib and PK rendering so it is on par with Freetype. - - * Enable a named pipe as DVI - - * Further speed improvements. - - * Other output specials and source specials. - - * Clean internal structures. Overhaul file handling. - - * Fix the SELFAUTO stuff at runtime rather than at build time - diff --git a/Build/source/texk/dvipng/dvipng-1.13/RELEASE b/Build/source/texk/dvipng/dvipng-1.13/RELEASE deleted file mode 100644 index d2716760775..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/RELEASE +++ /dev/null @@ -1,13 +0,0 @@ -Release notes for version 1.13 of the dvipng package: - -This program makes PNG graphics from DVI files as obtained from TeX -and its relatives. - - -This release adds the possibility to report the output image width. -Other than that, a segfault occuring from faulty DVIs has been -removed, and a number of build issues have been corrected. - - - -Report any bugs you find, see README for instructions. diff --git a/Build/source/texk/dvipng/dvipng-1.13/aclocal.m4 b/Build/source/texk/dvipng/dvipng-1.13/aclocal.m4 deleted file mode 100644 index 0cd4eddf92e..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/aclocal.m4 +++ /dev/null @@ -1,237 +0,0 @@ -# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- - -# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# Configure paths for FreeType2 -# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor - -dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS -dnl -AC_DEFUN(AC_CHECK_FT2, -[dnl -dnl Get the cflags and libraries from the freetype-config script -dnl -AC_ARG_WITH(ft-prefix, -[ --with-ft-prefix=PREFIX - Prefix where FreeType is installed (optional)], - ft_config_prefix="$withval", ft_config_prefix="") -AC_ARG_WITH(ft-exec-prefix, -[ --with-ft-exec-prefix=PREFIX - Exec prefix where FreeType is installed (optional)], - ft_config_exec_prefix="$withval", ft_config_exec_prefix="") -AC_ARG_ENABLE(freetypetest, -[ --disable-freetypetest Do not try to compile and run - a test FreeType program], - [], enable_fttest=yes) - -if test x$ft_config_exec_prefix != x ; then - ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" - if test x${FT2_CONFIG+set} != xset ; then - FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config - fi -fi -if test x$ft_config_prefix != x ; then - ft_config_args="$ft_config_args --prefix=$ft_config_prefix" - if test x${FT2_CONFIG+set} != xset ; then - FT2_CONFIG=$ft_config_prefix/bin/freetype-config - fi -fi -AC_PATH_PROG(FT2_CONFIG, freetype-config, no) - -min_ft_version=ifelse([$1], ,6.1.0,$1) -AC_MSG_CHECKING(for FreeType - version >= $min_ft_version) -no_ft="" -if test "$FT2_CONFIG" = "no" ; then - no_ft=yes -else - FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` - FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` - ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - ft_min_major_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - ft_min_minor_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - ft_min_micro_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test x$enable_fttest = xyes ; then - ft_config_is_lt="" - if test $ft_config_major_version -lt $ft_min_major_version ; then - ft_config_is_lt=yes - else - if test $ft_config_major_version -eq $ft_min_major_version ; then - if test $ft_config_minor_version -lt $ft_min_minor_version ; then - ft_config_is_lt=yes - else - if test $ft_config_minor_version -eq $ft_min_minor_version ; then - if test $ft_config_micro_version -lt $ft_min_micro_version ; then - ft_config_is_lt=yes - fi - fi - fi - fi - fi - if test x$ft_config_is_lt = xyes ; then - no_ft=yes - else - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $FT2_CFLAGS" - LIBS="$FT2_LIBS $LIBS" -dnl -dnl Sanity checks for the results of freetype-config to some extent -dnl - AC_TRY_RUN([ -#include -#include FT_FREETYPE_H -#include -#include - -int -main() -{ - FT_Library library; - FT_Error error; - - error = FT_Init_FreeType(&library); - - if (error) - return 1; - else - { - FT_Done_FreeType(library); - return 0; - } -} -],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi # test $ft_config_version -lt $ft_min_version - fi # test x$enable_fttest = xyes -fi # test "$FT2_CONFIG" = "no" -if test x$no_ft = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) -else - AC_MSG_RESULT(no) - if test "$FT2_CONFIG" = "no" ; then - echo "*** The freetype-config script installed by FreeType 2 could not be found." - echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the FT2_CONFIG environment variable to the" - echo "*** full path to freetype-config." - else - if test x$ft_config_is_lt = xyes ; then - echo "*** Your installed version of the FreeType 2 library is too old." - echo "*** If you have different versions of FreeType 2, make sure that" - echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix" - echo "*** are used, or set the FT2_CONFIG environment variable to the" - echo "*** full path to freetype-config." - else - echo "*** The FreeType test program failed to run. If your system uses" - echo "*** shared libraries and they are installed outside the normal" - echo "*** system library path, make sure the variable LD_LIBRARY_PATH" - echo "*** (or whatever is appropiate for your system) is correctly set." - fi - fi - FT2_CFLAGS="" - FT2_LIBS="" - ifelse([$3], , :, [$3]) -fi -AC_SUBST(FT2_CFLAGS) -AC_SUBST(FT2_LIBS) -]) - - -dnl -dnl MAKEINFO_CHECK_MACRO( MACRO, [ACTION-IF-FOUND -dnl [, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN(MAKEINFO_CHECK_MACRO, -[if test -n "$MAKEINFO" -a "$makeinfo" != ":"; then - AC_MSG_CHECKING([for @$1{}]) - echo \\\\input texinfo > conftest.texi - echo @$1{test} >> conftest.texi - if $MAKEINFO conftest.texi > /dev/null 2> /dev/null; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - ifelse([$3], , :, [$3]) - fi - rm -f conftest.texi conftest.info -fi -]) - -dnl -dnl MAKEINFO_CHECK_MACROS( MACRO ... [, ACTION-IF-FOUND -dnl [, ACTION-IF-NOT-FOUND]]) -dnl -AC_DEFUN(MAKEINFO_CHECK_MACROS, -[for ac_macro in $1; do - MAKEINFO_CHECK_MACRO($ac_macro, $2, - [MAKEINFO_MACROS="-D no-$ac_macro $MAKEINFO_MACROS" - $3])dnl - done -AC_SUBST(MAKEINFO_MACROS) -]) - - -dnl -dnl Check for enc, cmap, sfd formats -dnl -AC_DEFUN(AC_HAS_KPSE_ENC_FORMATS, - [AC_MSG_CHECKING([for kpse_enc_format]) - AC_TRY_COMPILE([ - #include - #include ], - [kpse_enc_format;kpse_cmap_format;kpse_sfd_format], - [AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KPSE_ENC_FORMATS, 1, - [Define to 1 if your kpathsea has kpse_enc_format])], - [AC_MSG_RESULT(no)])]) - - -dnl -dnl Check devices for GS -dnl AC_GS_HAS_DEVICE(DEVICE,ACTION-IF-FAILED) -dnl -AC_DEFUN(AC_GS_HAS_DEVICE, - [AC_MSG_CHECKING([whether $GS has the $1 device]) - if $GS -h | grep $1 >/dev/null; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - $2 - fi -]) - -dnl -dnl GS_CHECK_DEVICES -dnl -AC_DEFUN(GS_CHECK_DEVICES, - [GS_WARN="" - AC_GS_HAS_DEVICE(pngalpha, - [GS_WARN="Your EPS inclusions will be cropped to the - boundingbox, and rendered on an opaque background. - Upgrade GhostScript to avoid this." - AC_GS_HAS_DEVICE(png16m, - [GS_WARN="Your EPS inclusions may not work. - Upgrade/install GhostScript to avoid this."])]) - if test -n "$GS_WARN"; then - AC_MSG_WARN([$GS_WARN]) - fi -]) diff --git a/Build/source/texk/dvipng/dvipng-1.13/color.c b/Build/source/texk/dvipng/dvipng-1.13/color.c deleted file mode 100644 index 3bc3495a59b..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/color.c +++ /dev/null @@ -1,443 +0,0 @@ -/* color.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -/* - * Color. We delete and recreate the gdImage for each new page. This - * means that the stack must contain rgb value not color index. - * Besides, the current antialiasing implementation needs rgb anyway. -*/ - -struct colorname { - struct colorname *next; - char* color; - char name[1]; -} *colornamep=NULL,*xcp=NULL; - -const char *colordef[]={"xcolor.sty","dvipsnam.def", - "svgnam.def","x11nam.def",NULL}; -char *xcpname=NULL; - -void initcolor(void) -{ - csp = 1; - cstack[0].red=255; - cstack[0].green=255; - cstack[0].blue=255; - cstack[1].red=0; - cstack[1].green=0; - cstack[1].blue=0; -} - -static struct colorname * NewColor(const char* prefix, int nprefix, - char* name, int nname, - char* model, int nmodel, - char* values, int nvalues) -{ - struct colorname *tmp = - malloc(sizeof(struct colorname)+3+nprefix+nname+nmodel+nvalues); - if (tmp==NULL) - Fatal("Cannot malloc space for color name"); - tmp->color=tmp->name+nprefix+nname+1; - strncpy(tmp->name,prefix,nprefix); - strncpy(tmp->name+nprefix,name,nname); - tmp->name[nprefix+nname]='\0'; - strncpy(tmp->color,model,nmodel); - tmp->color[nmodel]=' '; - strncpy(tmp->color+nmodel+1,values,nvalues); - tmp->color[nmodel+nvalues+1]='\0'; - model=tmp->color; - while(*model!='\0') { - if (*model==',') - *model=' '; - model++; - } - DEBUG_PRINT(DEBUG_COLOR,("\n COLOR NAME:\t'%s' '%s'", - tmp->name,tmp->color)); - return(tmp); -} - -#define FINDWORD(s) while(snext=list; - list=tmp; - } else if ((pos+15next=list; - list=tmp; - FINDWORD(pos); - } - } else { - pos++; - while (posnext; - free(xcp); - xcp=next; - } - if (xcpname!=NULL) { - free(xcpname); - xcpname=NULL; - } -} - -void ClearColorNames(void) -{ - struct colorname *next; - while (colornamep) { - next=colornamep->next; - free(colornamep); - colornamep=next; - } - ClearXColorPrologue(); -} - -void InitXColorPrologue(const char* name) -{ - ClearXColorPrologue(); - xcpname=malloc(strlen(name)+1); - if (xcpname==NULL) - Fatal("cannot malloc memory for xcolor prologue name"); - strcpy(xcpname,name); -} - -static struct colorname* LoadXColorPrologue(void) -{ - struct colorname *list=NULL,*tmp=NULL; - char *filepath,*pos,*max; - const char *prefix=""; - char *name,*values,*model; - int nprefix=0,nname,nvalues,nmodel; - struct filemmap fmmap; - boolean mmapfailed; - - filepath=kpse_find_file(xcpname,kpse_program_text_format,false); - if (filepath == NULL) - return NULL; - DEBUG_PRINT(DEBUG_COLOR,("\n OPEN XCOLOR PROLOGUE:\t'%s'", filepath)); - mmapfailed = MmapFile(filepath,&fmmap); - free(filepath); - if (mmapfailed) - return NULL; - pos=fmmap.data; - max=fmmap.data+fmmap.size; - while(posnext=list; - list=tmp; - } - } - UnMmapFile(&fmmap); - return(list); -} - -#define FTO255(a) ((int) (255*a+0.5)) -#define WARN_IF_FAILED(a,b) if (a==b) { page_flags |= PAGE_GAVE_WARN; \ - Warning("missing color-specification value, treated as zero"); } - -#define SKIPSPACES(s) while(s && *s==' ' && *s!='\0') s++ -#define NEXTFLOAT255(c) FTO255(strtod(c,&end)); WARN_IF_FAILED(c,end); c=end -#define NEXTFLOAT(c) strtod(c,&end); WARN_IF_FAILED(c,end); c=end -#define NEXTINT(c) strtol(c,&end,10); WARN_IF_FAILED(c,end); c=end -#define NEXTHEX(c) strtol(c,&end,16); WARN_IF_FAILED(c,end); c=end - -void stringrgb(const char* color,int *r,int *g,int *b) -{ - char* end; - static int unloaded=1; - - DEBUG_PRINT(DEBUG_COLOR,("\n COLOR SPEC:\t'%s' (",color)); - SKIPSPACES(color); - if (strcmp(color,"Black")==0) { - *r = *g = *b = 0; - } else if (strcmp(color,"White")==0) { - *r = *g = *b = 255; - } else if (strncmp(color,"gray ",5)==0) { - color+=5; - *r = *g = *b = NEXTFLOAT255(color); - } else if (strncmp(color,"rgb ",4)==0) { - color+=4; - *r = NEXTFLOAT255(color); - *g = NEXTFLOAT255(color); - *b = NEXTFLOAT255(color); - } else if (strncmp(color,"Gray ",5)==0) { - color+=5; - *r = *g = *b = NEXTINT(color); - } else if (strncmp(color,"RGB ",4)==0) { - color+=4; - *r = NEXTINT(color); - *g = NEXTINT(color); - *b = NEXTINT(color); - } else if (strncmp(color,"HTML ",5)==0) { - color+=5; - *b = NEXTHEX(color); - *r = *b/65536; - *g = *b/256; - *b -= *g*256; - *g -= *r*256; - } else if (strncmp(color,"cmy ",4)==0 - || strncmp(color,"cmyk ",5)==0) { - int c,m,y,k; - color+=3; - k=(*color=='k'); - if (k) - color++; - c = NEXTFLOAT255(color); - m = NEXTFLOAT255(color); - y = NEXTFLOAT255(color); - if (k) - k = NEXTFLOAT255(color); - *r = c+k<255 ? 255-(c+k) : 0; - *g = m+k<255 ? 255-(m+k) : 0; - *b = y+k<255 ? 255-(y+k) : 0; - } else if (strncmp(color,"hsb ",4)==0 - || strncmp(color,"HSB ",4)==0) { - /* The hsb and HSB models really need more presicion. - Use double and convert back*/ - double hu,sa,br,f,R,G,B; - int i; - if (*color=='h') { - color+=4; - hu = NEXTFLOAT(color); - sa = NEXTFLOAT(color); - br = NEXTFLOAT(color); - } else { - color+=4; - hu = (float)NEXTINT(color); hu /= 255; - sa = (float)NEXTINT(color); sa /= 255; - br = (float)NEXTINT(color); br /= 255; - } - i=6*hu; - f=6*hu-i; - switch(i) { - case 0: - R = br*(1-sa*0); G = br*(1-sa*(1-f)); B = br*(1-sa*1); break; - case 1: - R = br*(1-sa*f); G = br*(1-sa*0); B = br*(1-sa*1); break; - case 2: - R = br*(1-sa*1); G = br*(1-sa*0); B = br*(1-sa*(1-f)); break; - case 3: - R = br*(1-sa*1); G = br*(1-sa*f); B = br*(1-sa*0); break; - case 4: - R = br*(1-sa*(1-f)); G = br*(1-sa*1); B = br*(1-sa*0); break; - case 5: - R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*f); break; - default: - R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*1); - } - *r=FTO255(R); - *g=FTO255(G); - *b=FTO255(B); - } else { - /* Model not found, probably a color name */ - struct colorname *tmp; - - if (xcp==NULL && xcpname!=NULL) - xcp=LoadXColorPrologue(); - tmp=xcp; - while(tmp!=NULL && strcmp(color,tmp->name)!=0) - tmp=tmp->next; - if (tmp==NULL) { - if (colornamep==NULL) - colornamep=LoadColornameFile(colordef[0]); - tmp=colornamep; - while((tmp->next!=NULL || colordef[unloaded]!=NULL) - && strcmp(color,tmp->name)!=0) { - if (tmp->next==NULL) - tmp->next=LoadColornameFile(colordef[unloaded++]); - tmp=tmp->next; - } - } - if (strcmp(color,tmp->name)==0) { - /* Found: one-level recursion */ - DEBUG_PRINT(DEBUG_COLOR,("\n ---RECURSION--- ")) - stringrgb(tmp->color,r,g,b); - } else { - /* Not found, warn */ - page_flags |= PAGE_GAVE_WARN; - Warning("unimplemented color specification '%s'",color); - } - } - DEBUG_PRINT(DEBUG_COLOR,("%d %d %d) ",*r,*g,*b)) -} - -void background(const char* p) -{ - stringrgb(p, &cstack[0].red, &cstack[0].green, &cstack[0].blue); - DEBUG_PRINT(DEBUG_COLOR,("\n BACKGROUND:\t(%d %d %d) ", - cstack[0].red, cstack[0].green, cstack[0].blue)); -} - -void pushcolor(const char * p) -{ - if ( ++csp == STACK_SIZE ) - Fatal("out of color stack space") ; - stringrgb(p, &cstack[csp].red, &cstack[csp].green, &cstack[csp].blue); - DEBUG_PRINT(DEBUG_COLOR,("\n COLOR PUSH:\t(%d %d %d) ", - cstack[csp].red, cstack[csp].green, cstack[csp].blue)) -} - -void popcolor(void) -{ - if (csp > 1) csp--; /* Last color is global */ - DEBUG_PRINT(DEBUG_COLOR,("\n COLOR POP\t")) -} - -void resetcolorstack(const char * p) -{ - if ( csp > 1 ) - Warning("global color change within nested colors"); - csp=0; - pushcolor(p) ; - DEBUG_PRINT(DEBUG_COLOR,("\n RESET COLOR:\tbottom of stack:")) -} - -void StoreColorStack(struct page_list *tpagep) -{ - int i=0; - - DEBUG_PRINT(DEBUG_COLOR,("\n STORE COLOR STACK:\t %d ", csp)); - tpagep->csp=csp; - while ( i <= csp ) { - DEBUG_PRINT(DEBUG_COLOR,("\n COLOR STACK:\t %d (%d %d %d) ",i, - cstack[i].red, cstack[i].green, cstack[i].blue)); - tpagep->cstack[i].red = cstack[i].red; - tpagep->cstack[i].green = cstack[i].green; - tpagep->cstack[i].blue = cstack[i].blue; - i++; - } -} - -void ReadColorStack(struct page_list *tpagep) -{ - int i=0; - - DEBUG_PRINT(DEBUG_COLOR,("\n READ COLOR STACK:\t %d ", tpagep->csp)); - csp=tpagep->csp; - while ( i <= tpagep->csp ) { - DEBUG_PRINT(DEBUG_COLOR,("\n COLOR STACK:\t %d (%d %d %d) ",i, - cstack[i].red, cstack[i].green, cstack[i].blue)); - cstack[i].red = tpagep->cstack[i].red; - cstack[i].green = tpagep->cstack[i].green; - cstack[i].blue = tpagep->cstack[i].blue; - i++; - } -} - -void StoreBackgroundColor(struct page_list *tpagep) -{ - /* Background color changes affect the _whole_ page */ - tpagep->cstack[0].red = cstack[0].red; - tpagep->cstack[0].green = cstack[0].green; - tpagep->cstack[0].blue = cstack[0].blue; -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/commands.h b/Build/source/texk/dvipng/dvipng-1.13/commands.h deleted file mode 100644 index e2a5404bb32..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/commands.h +++ /dev/null @@ -1,196 +0,0 @@ -/* commands.h */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2008 Jan-Åke Larsson - -************************************************************************/ - -/* DVI COMMANDS */ -#define DVIFORMAT 2 - -#define SETC_000 0 /* typeset character 0 and move right */ -#define SETC_127 127 /* typeset character 127 and move right */ -#define SET1 128 /* typeset a character and move right */ -#define SET2 129 /* ??? */ -#define SET3 130 /* ??? */ -#define SET4 131 /* ??? */ -#define SET_RULE 132 /* typeset a rule and move right */ -#define PUT1 133 /* typeset a character */ -#define PUT2 134 /* ??? */ -#define PUT3 135 /* ??? */ -#define PUT4 136 /* ??? */ -#define PUT_RULE 137 /* typeset a rule */ -#define NOP 138 /* no operation */ -#define BOP 139 /* beginning of page */ -#define EOP 140 /* ending of page */ -#define PUSH 141 /* save the current positions */ -#define POP 142 /* restore previous positions */ -#define RIGHT1 143 /* move right */ -#define RIGHT2 144 /* ??? */ -#define RIGHT3 145 /* ??? */ -#define RIGHT4 146 /* ??? */ -#define W0 147 /* move right by |w| */ -#define W1 148 /* move right and set |w| */ -#define W2 149 /* ??? */ -#define W3 150 /* ??? */ -#define W4 151 /* ??? */ -#define X0 152 /* move right by |x| */ -#define X1 153 /* move right and set |x| */ -#define X2 154 /* ??? */ -#define X3 155 /* ??? */ -#define X4 156 /* ??? */ -#define DOWN1 157 /* move down */ -#define DOWN2 158 /* ??? */ -#define DOWN3 159 /* ??? */ -#define DOWN4 160 /* ??? */ -#define Y0 161 /* move down by |y| */ -#define Y1 162 /* move down and set |y| */ -#define Y2 163 /* ??? */ -#define Y3 164 /* ??? */ -#define Y4 165 /* ??? */ -#define Z0 166 /* move down by |z| */ -#define Z1 167 /* move down and set |z| */ -#define Z2 168 /* ??? */ -#define Z3 169 /* ??? */ -#define Z4 170 /* ??? */ -#define FONT_00 171 /* set current font to 0 */ -#define FONT_63 234 /* set current font to 63 */ -#define FNT1 235 /* set current font */ -#define FNT2 236 /* Same as FNT1, except that arg is 2 bytes */ -#define FNT3 237 /* Same as FNT1, except that arg is 3 bytes */ -#define FNT4 238 /* Same as FNT1, except that arg is 4 bytes */ -#define XXX1 239 /* extension to \.DVI primitives */ -#define XXX2 240 /* Like XXX1, but 0<=k<65536 */ -#define XXX3 241 /* Like XXX1, but 0<=k<@t$2^{24}$@> */ -#define XXX4 242 /* potentially long extension to \.DVI - primitives */ -#define FNT_DEF1 243 /* define the meaning of a font number */ -#define FNT_DEF2 244 /* ??? */ -#define FNT_DEF3 245 /* ??? */ -#define FNT_DEF4 246 /* ??? */ -#define PRE 247 /* preamble */ -#define POST 248 /* postamble beginning */ -#define POST_POST 249 /* postamble ending */ - -/* undefined_commands 250,251,252,253,254,255 */ - -EXTERN const int8_t dvi_commandlength[256] -#ifdef MAIN -={ - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1, /* SETC_000 --- SETC_127 */ - 2,3,4,5,9, /* SET1 --- SET4, SET_RULE */ - 2,3,4,5,9, /* PUT1 --- PUT4, PUT_RULE */ - 1,45,1,1,1, /* NOP, BOP, EOP, PUSH, POP */ - 2,3,4,5, /* RIGHT1 --- RIGHT4 */ - 1,2,3,4,5, /* W0 --- W4 */ - 1,2,3,4,5, /* X0 --- X4 */ - 2,3,4,5, /* DOWN1 --- DOWN4 */ - 1,2,3,4,5, /* Y0 --- Y4 */ - 1,2,3,4,5, /* Z0 --- Z4 */ - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1, /* FONT_00 --- FONT_63 */ - 2,3,4,5, /* FNT1 --- FNT4 */ - 2,3,4,5, /* XXX1 --- XXX4 + special string */ - 16,17,18,19, /* FNT_DEF1 --- FNT_DEF4 + font name */ - 15, /* PRE + TeX comment */ - 29, /* POST */ - 10, /* POST_POST minimum */ - -1,-1,-1,-1,-1,-1 /* undefined */ -} -#endif -; - -EXTERN const char* dvi_commands[256] -#ifdef MAIN -={ -"SETC_000","SETC_001","SETC_002","SETC_003","SETC_004", -"SETC_005","SETC_006","SETC_007","SETC_008","SETC_009", -"SETC_010","SETC_011","SETC_012","SETC_013","SETC_014", -"SETC_015","SETC_016","SETC_017","SETC_018","SETC_019", -"SETC_020","SETC_021","SETC_022","SETC_023","SETC_024", -"SETC_025","SETC_026","SETC_027","SETC_028","SETC_029", -"SETC_030","SETC_031","SETC_032","SETC_033","SETC_034", -"SETC_035","SETC_036","SETC_037","SETC_038","SETC_039", -"SETC_040","SETC_041","SETC_042","SETC_043","SETC_044", -"SETC_045","SETC_046","SETC_047","SETC_048","SETC_049", -"SETC_050","SETC_051","SETC_052","SETC_053","SETC_054", -"SETC_055","SETC_056","SETC_057","SETC_058","SETC_059", -"SETC_060","SETC_061","SETC_062","SETC_063","SETC_064", -"SETC_065","SETC_066","SETC_067","SETC_068","SETC_069", -"SETC_070","SETC_071","SETC_072","SETC_073","SETC_074", -"SETC_075","SETC_076","SETC_077","SETC_078","SETC_079", -"SETC_080","SETC_081","SETC_082","SETC_083","SETC_084", -"SETC_085","SETC_086","SETC_087","SETC_088","SETC_089", -"SETC_090","SETC_091","SETC_092","SETC_093","SETC_094", -"SETC_095","SETC_096","SETC_097","SETC_098","SETC_099", -"SETC_100","SETC_101","SETC_102","SETC_103","SETC_104", -"SETC_105","SETC_106","SETC_107","SETC_108","SETC_109", -"SETC_110","SETC_111","SETC_112","SETC_113","SETC_114", -"SETC_115","SETC_116","SETC_117","SETC_118","SETC_119", -"SETC_120","SETC_121","SETC_122","SETC_123","SETC_124", -"SETC_125","SETC_126","SETC_127", -"SET1","SET2","SET3","SET4","SET_RULE", -"PUT1","PUT2","PUT3","PUT4","PUT_RULE", -"NOP","BOP","EOP","PUSH","POP", -"RIGHT1","RIGHT2","RIGHT3","RIGHT4", -"W0","W1","W2","W3","W4", -"X0","X1","X2","X3","X4", -"DOWN1","DOWN2","DOWN3","DOWN4", -"Y0","Y1","Y2","Y3","Y4", -"Z0","Z1","Z2","Z3","Z4", -"FONT_00","FONT_01","FONT_02","FONT_03","FONT_04", -"FONT_05","FONT_06","FONT_07","FONT_08","FONT_09", -"FONT_10","FONT_11","FONT_12","FONT_13","FONT_14", -"FONT_15","FONT_16","FONT_17","FONT_18","FONT_19", -"FONT_20","FONT_21","FONT_22","FONT_23","FONT_24", -"FONT_25","FONT_26","FONT_27","FONT_28","FONT_29", -"FONT_30","FONT_31","FONT_32","FONT_33","FONT_34", -"FONT_35","FONT_36","FONT_37","FONT_38","FONT_39", -"FONT_40","FONT_41","FONT_42","FONT_43","FONT_44", -"FONT_45","FONT_46","FONT_47","FONT_48","FONT_49", -"FONT_50","FONT_51","FONT_52","FONT_53","FONT_54", -"FONT_55","FONT_56","FONT_57","FONT_58","FONT_59", -"FONT_60","FONT_61","FONT_62","FONT_63", -"FNT1","FNT2","FNT3","FNT4", -"XXX1","XXX2","XXX3","XXX4", -"FNT_DEF1","FNT_DEF2","FNT_DEF3","FNT_DEF4", -"PRE","POST","POST_POST", -"UNDEF_250","UNDEF_251","UNDEF_252","UNDEF_253","UNDEF_254","UNDEF_255" -} -#endif -; - diff --git a/Build/source/texk/dvipng/dvipng-1.13/config.h.in b/Build/source/texk/dvipng/dvipng-1.13/config.h.in deleted file mode 100644 index 9c51686b9df..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/config.h.in +++ /dev/null @@ -1,224 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define as 1 to get the debug (-d) option. */ -#undef DEBUG - -/* The environment setting for $SELFAUTODIR */ -#undef ENV_SELFAUTODIR - -/* The environment setting for $SELFAUTOLOC */ -#undef ENV_SELFAUTOLOC - -/* The environment setting for $SELFAUTOPARENT */ -#undef ENV_SELFAUTOPARENT - -/* Define as the path to GhostScript. */ -#undef GS_PATH - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if you have freetype2 */ -#undef HAVE_FT2 - -/* Define to 1 if you have the `ftime' function. */ -#undef HAVE_FTIME - -/* Define to 1 if you have the `FT_Library_Version' function. */ -#undef HAVE_FT_LIBRARY_VERSION - -/* Define to 1 if you have the `gdImageCreateFromJpeg' function. */ -#undef HAVE_GDIMAGECREATEFROMJPEG - -/* Define to 1 if you have the `gdImageCreateFromPngPtr' function. */ -#undef HAVE_GDIMAGECREATEFROMPNGPTR - -/* Define to 1 if you have the `gdImageCreateTrueColor' function. */ -#undef HAVE_GDIMAGECREATETRUECOLOR - -/* Define to 1 if you have the `gdImageGif' function. */ -#undef HAVE_GDIMAGEGIF - -/* Define to 1 if you have the `gdImagePngEx' function. */ -#undef HAVE_GDIMAGEPNGEX - -/* Define to 1 if you have the header file. */ -#undef HAVE_GD_H - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_KPATHSEA_KPATHSEA_H - -/* Define to 1 if your kpathsea has kpse_enc_format */ -#undef HAVE_KPSE_ENC_FORMATS - -/* Define to 1 if you have the `gd' library (-lgd). */ -#undef HAVE_LIBGD - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBGEN_H - -/* Define to 1 if you have the `kpathsea' library (-lkpathsea). */ -#undef HAVE_LIBKPATHSEA - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `png' library (-lpng). */ -#undef HAVE_LIBPNG - -/* Define to 1 if you have the `t1' library (-lt1). */ -#undef HAVE_LIBT1 - -/* Define to 1 if you have the `z' library (-lz). */ -#undef HAVE_LIBZ - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the header file. */ -#undef HAVE_PNG_H - -/* Define to 1 if you have the `pow' function. */ -#undef HAVE_POW - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_T1LIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vfork' function. */ -#undef HAVE_VFORK - -/* Define to 1 if you have the header file. */ -#undef HAVE_VFORK_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if `fork' works. */ -#undef HAVE_WORKING_FORK - -/* Define to 1 if `vfork' works. */ -#undef HAVE_WORKING_VFORK - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define as 1 to get execution time output. */ -#undef TIMING - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `long long' if does not define it. */ -#undef int64_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to `unsigned long long' if does not define it. */ -#undef uint64_t - -/* Define as `fork' if `vfork' does not work. */ -#undef vfork diff --git a/Build/source/texk/dvipng/dvipng-1.13/configure.ac b/Build/source/texk/dvipng/dvipng-1.13/configure.ac deleted file mode 100644 index 09e04353fd0..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/configure.ac +++ /dev/null @@ -1,225 +0,0 @@ -# configure.ac - -#************************************************************************ -# -# Part of the dvipng distribution -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program. If not, see -# . -# -# Copyright (C) 2002-2010 Jan-Åke Larsson -# -#************************************************************************ - -# Process this file with autoconf to produce a configure script. -AC_INIT([dvipng], [1.13], [dvipng@nongnu.org]) -AC_CONFIG_SRCDIR([dvipng.c]) - -AC_ARG_ENABLE(debug, - AC_HELP_STRING([--disable-debug],[Compile without debug (-d) option]), - [ if test "$enableval" = yes ; then - AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.]) - fi ], - [ enable_debug="yes"; - AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.])]) -AC_ARG_ENABLE(timing, - AC_HELP_STRING([--enable-timing],[Output execution time of dvipng]), - [ if test "$enableval" = yes ; then - AC_DEFINE(TIMING, 1, [Define as 1 to get execution time output.]) - fi ]) - -# Checks for programs. -AC_SET_MAKE -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LN_S -AC_ARG_WITH(gs, - AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Hard-wire the location of GhostScript]), - [if test "x$withval" != xno ; then - AC_PATH_PROG(GS,["$withval"]) - AC_DEFINE_UNQUOTED(GS_PATH, "$GS", [Define as the path to GhostScript.]) - GS_CHECK_DEVICES - fi], - [AC_CHECK_PROG(GS,gs,gs) - AC_DEFINE_UNQUOTED(GS_PATH, "gs", [Define as the path to GhostScript.]) - if test -n "$GS"; then - GS_CHECK_DEVICES - else - AC_MSG_WARN([Cannot find GhostScript in your PATH]) - fi -]) - -# Checks for libraries. -AC_CHECK_LIB(m, pow) -AC_CHECK_LIB(z, deflate) -AC_CHECK_LIB([png], [png_read_image],, - [AC_MSG_ERROR([cannot find/use libpng])]) -AC_CHECK_LIB([gd], [gdImageCreate],, - [AC_MSG_ERROR([cannot find/use libgd -This drawing library can be downloaded at http://www.boutell.com/gd])]) -AC_CHECK_LIB([kpathsea], [kpse_set_program_name],, - AC_MSG_ERROR([cannot find/use libkpathsea])) -AC_CHECK_LIB([t1], [T1_InitLib]) -PSFONTS_O="" -if test "$ac_cv_lib_t1_T1_InitLib" = yes; then - PSFONTS_O="t1.o" -fi -AC_SUBST(PSFONTS_O) - -# Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS([gd.h png.h kpathsea/kpathsea.h],, - [AC_MSG_ERROR([cannot find/use $ac_header])]) -AC_CHECK_HEADERS([t1lib.h libgen.h]) -AC_CHECK_FT2(,[CFLAGS="$FT2_CFLAGS $CFLAGS" - LIBS="$FT2_LIBS $LIBS" - PSFONTS_O="$PSFONTS_O sfd.o ft.o" - AC_DEFINE(HAVE_FT2, 1, [Define to 1 if you have freetype2]) - ac_have_freetype2="yes"], - [ac_have_freetype2="no"]) -if test -n "$PSFONTS_O"; then - PSFONTS_O="$PSFONTS_O enc.o fontmap.o tfm.o" -fi -AC_HEADER_SYS_WAIT -AC_HEADER_TIME -AC_HEADER_STDBOOL -AC_CHECK_HEADERS([fcntl.h sys/time.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_PID_T -AC_TYPE_SIZE_T -if test "$ac_cv_header_inttypes_h" = "yes"; then - # Sometimes we want to use gcc -ansi -pedantic as a portability test - # The typedef of int64_t is not in the system header file in that - # case. Then, #define int64_t as "long long", which is non-ansi, but - # is present in most modern compilers. Using a #define rather than a - # typedef can be a problem, but in dvipng int64_t is only used as - # typecast, and there are no problems. autoconf 2.13 equivalent: - # AC_CHECK_TYPE(int64_t, long long) - # AC_CHECK_TYPE(uint64_t, unsigned long long) - AC_CHECK_TYPE([int64_t],, - [AC_DEFINE_UNQUOTED([int64_t], [long long], - [Define to `long long' if - does not define it.])]) - AC_CHECK_TYPE([uint64_t],, - [AC_DEFINE_UNQUOTED([uint64_t], [unsigned long long], - [Define to `unsigned long long' if - does not define it.])]) -fi -AC_HAS_KPSE_ENC_FORMATS - - -# Checks for library functions. -AC_FUNC_FORK -AC_FUNC_MALLOC -AC_FUNC_MMAP -AC_FUNC_STRTOD -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([dup2 memset munmap pow putenv strchr strrchr strtol strstr]) -if test "$enable_timing" = "yes"; then - AC_CHECK_FUNCS([ftime gettimeofday]) -fi -AC_CHECK_FUNCS([gdImageCreateTrueColor gdImageCreateFromJpeg gdImagePngEx gdImageCreateFromPngPtr gdImageGif FT_Library_Version]) -if test "$ac_cv_func_gdImageGif" = "yes"; then - INSTALL_BIN_TARGET="install-dvigif" -else - INSTALL_BIN_TARGET="install-dvipng" -fi -AC_SUBST(INSTALL_BIN_TARGET) - -# Documentation-related checks -AC_PATH_PROG(MAKEINFO, makeinfo, :) -MAKEINFO_CHECK_MACROS(acronym env option) -AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH /usr/sbin /sbin) - -# SELFAUTO -AC_ARG_ENABLE(selfauto-set, - AC_HELP_STRING([--enable-selfauto-set], - [This option will make the final binary explicitly set the - $SELFAUTO... variables to make it look as dvipng is installed in the - main texmf tree, even if it isn't. This is necessary when texmf.cnf - only uses $SELFAUTO... variables and dvipng is not installed in the - texmf tree. Otherwise, dvipng may not be able to find virtual - fonts, or psfonts.map. To find out, first build the binary and do - 'make test'. If the test fails, you need this switch.]), - [ if test "$enableval" = yes ; then - AC_MSG_CHECKING([for \$SELFAUTOLOC]) - SELFAUTOLOC=`kpsewhich -expand-var=\\\$SELFAUTOLOC` - AC_DEFINE_UNQUOTED(ENV_SELFAUTOLOC,["SELFAUTOLOC=$SELFAUTOLOC"], - [The environment setting for $SELFAUTOLOC]) - AC_MSG_RESULT([$SELFAUTOLOC]) - AC_MSG_CHECKING([for \$SELFAUTODIR]) - SELFAUTODIR=`kpsewhich -expand-var=\\\$SELFAUTODIR` - AC_DEFINE_UNQUOTED(ENV_SELFAUTODIR,["SELFAUTODIR=$SELFAUTODIR"], - [The environment setting for $SELFAUTODIR]) - AC_MSG_RESULT([$SELFAUTODIR]) - AC_MSG_CHECKING([for \$SELFAUTOPARENT]) - SELFAUTOPARENT=`kpsewhich -expand-var=\\\$SELFAUTOPARENT` - AC_DEFINE_UNQUOTED(ENV_SELFAUTOPARENT,["SELFAUTOPARENT=$SELFAUTOPARENT"], - [The environment setting for $SELFAUTOPARENT]) - AC_MSG_RESULT([$SELFAUTOPARENT]) - fi ], - [AC_MSG_CHECKING([for texmf.cnf]) - TEXMF_CNF=`kpsewhich texmf.cnf` - AC_MSG_RESULT([$TEXMF_CNF]) - AC_PATH_PROG(KPSEWHICH, kpsewhich) - AC_MSG_CHECKING([for psfonts.map]) - cp $KPSEWHICH . - PSFONTS_MAP=`./kpsewhich psfonts.map` - rm -f ./kpsewhich - if test -n "$PSFONTS_MAP"; then - AC_MSG_RESULT([$PSFONTS_MAP]) - else - AC_MSG_RESULT([not found from outside the texmf tree]) - AC_MSG_CHECKING([for \$SELFAUTO in texmf.cnf]) - if grep SELFAUTO "$TEXMF_CNF" > /dev/null 2> /dev/null; then - AC_MSG_RESULT([yes -*************************************************************** -texmf.cnf is using \$SELFAUTO... variables. If you are going to -install dvipng outside the texmf tree, you may need to use ---enable-selfauto-set. To find out, do 'make ; make test'. If the test -is unsuccessful, add the mentioned switch and rebuild. -***************************************************************]) - else - AC_MSG_RESULT([no]) - fi - fi]) - -AC_MSG_RESULT([ -** Configuration summary for $PACKAGE_STRING: - - The -d (debug) switch is enabled: $enable_debug - Your gd is new enough (>=2.0) to enable - the --truecolor switch, full alpha - transparency, proper rescaling of - included bitmaps, and jpeg inclusion: $ac_cv_func_gdImageCreateTrueColor - Your gd has jpeg inclusion enabled: $ac_cv_func_gdImageCreateFromJpeg - Your gd is new enough (>=2.0.12) to - enable transparent backgrounds for EPS - inclusion and the -z (compression) - switch: $ac_cv_func_gdImagePngEx - Your gd is new enough (>=2.0.21) to - allow image creation from memory $ac_cv_func_gdImageCreateFromPngPtr - Your gd is new enough (>=2.0.28) to - enable gif inclusion and output - (dvigif): $ac_cv_func_gdImageGif - FreeType font rendering available: $ac_have_freetype2 - Support for subfonts (CJK-LaTeX): $ac_have_freetype2 - T1lib font rendering available: $ac_cv_lib_t1_T1_InitLib -]) - -AC_CONFIG_HEADER([config.h]) -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/Build/source/texk/dvipng/dvipng-1.13/draw.c b/Build/source/texk/dvipng/dvipng-1.13/draw.c deleted file mode 100644 index a32bd9f19c2..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/draw.c +++ /dev/null @@ -1,395 +0,0 @@ -/* draw.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -#ifdef DEBUG -#include /* isprint */ -#endif - -struct stack_entry { - dviunits h, v, w, x, y, z; /* stack entry */ - subpixels hh,vv; -} stack[STACK_SIZE+1]; /* stack + space for current pos */ -struct stack_entry* dvi_stack=stack; - -#define MAXDRIFT 1 -#define CHECK_MAXDRIFT(x,xx) \ - if ( xx-PIXROUND(x,dvi->conv*shrinkfactor) < -MAXDRIFT ) { \ - DEBUG_PRINT(DEBUG_DVI,(" add 1 to")); \ - xx += 1; \ - } \ - if ( xx-PIXROUND(x,dvi->conv*shrinkfactor) > MAXDRIFT ) { \ - DEBUG_PRINT(DEBUG_DVI,(" sub 1 to")); \ - xx -= 1; \ - } \ - if (PIXROUND(dvi_stack->h,dvi->conv*shrinkfactor) != dvi_stack->hh \ - || PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor) != dvi_stack->vv)\ - DEBUG_PRINT(DEBUG_DVI, \ - (" drift (%d,%d)", \ - dvi_stack->hh-PIXROUND(dvi_stack->h,dvi->conv*shrinkfactor), \ - dvi_stack->vv-PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor))); - -#define MoveRight(x) \ - temp=x; dvi_stack->h += temp; \ - if ( currentfont==NULL \ - || temp > currentfont->s/6 || temp < -currentfont->s/6*4 ) \ - dvi_stack->hh = PIXROUND(dvi_stack->h,dvi->conv*shrinkfactor); \ - else \ - dvi_stack->hh += PIXROUND( temp,dvi->conv*shrinkfactor ); \ - CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh) - -#define MoveDown(x) \ - temp=x; dvi_stack->v += temp; \ - if ( currentfont==NULL \ - || temp > currentfont->s/6*5 || temp < currentfont->s/6*(-5) ) \ - dvi_stack->vv = PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor); \ - else \ - dvi_stack->vv += PIXROUND( temp,dvi->conv*shrinkfactor ); \ - CHECK_MAXDRIFT(dvi_stack->v,dvi_stack->vv) - -#define DO_VFCONV(a) ((((struct font_entry*) parent)->type==DVI_TYPE)?a:\ - (dviunits)((int64_t) a * ((struct font_entry*) parent)->s / (1 << 20))) - - -dviunits SetChar(int32_t c) -{ - struct char_entry* ptr=NULL; - - if (currentfont==NULL) - Fatal("faulty DVI, trying to set character from null font"); - if (c<0 || c>LASTFNTCHAR) { - Warning("glyph index out of range (%d), skipping",c); - return(0); - } - ptr=currentfont->chr[c]; - if (ptr==NULL) { - Warning("unable to draw glyph %d, skipping",c); - return(0); - } -#ifdef DEBUG - switch (currentfont->type) { - case FONT_TYPE_VF: DEBUG_PRINT(DEBUG_DVI,("\n VF CHAR:\t")); break; - case FONT_TYPE_PK: DEBUG_PRINT(DEBUG_DVI,("\n PK CHAR:\t")); break; - case FONT_TYPE_T1: DEBUG_PRINT(DEBUG_DVI,("\n T1 CHAR:\t")); break; - case FONT_TYPE_FT: DEBUG_PRINT(DEBUG_DVI,("\n FT CHAR:\t")); break; - default: DEBUG_PRINT(DEBUG_DVI,("\n NO CHAR:\t")) - } - if (debug & DEBUG_DVI && c>=0 && c<=UCHAR_MAX && isprint(c)) - DEBUG_PRINT(DEBUG_DVI,("'%c' ",c)); - DEBUG_PRINT(DEBUG_DVI,("%d at (%d,%d) tfmw %d", c, - dvi_stack->hh,dvi_stack->vv,ptr?ptr->tfmw:0)); -#endif - if (currentfont->type==FONT_TYPE_VF) { - return(SetVF(ptr)); - } else { - if (ptr->data == NULL) - switch(currentfont->type) { - case FONT_TYPE_PK: LoadPK(c, ptr); break; -#ifdef HAVE_LIBT1 - case FONT_TYPE_T1: LoadT1(c, ptr); break; -#endif -#ifdef HAVE_FT2 - case FONT_TYPE_FT: LoadFT(c, ptr); break; -#endif - default: - Fatal("undefined fonttype %d",currentfont->type); - } - if (page_imagep != NULL) - return(SetGlyph(ptr, dvi_stack->hh, dvi_stack->vv)); - else { - /* Expand bounding box if necessary */ - min(x_min,dvi_stack->hh - ptr->xOffset/shrinkfactor); - min(y_min,dvi_stack->vv - ptr->yOffset/shrinkfactor); - max(x_max,dvi_stack->hh - ptr->xOffset/shrinkfactor + ptr->w); - max(y_max,dvi_stack->vv - ptr->yOffset/shrinkfactor + ptr->h); - return(ptr->tfmw); - } - } - return(0); -} - -void DrawCommand(unsigned char* command, void* parent /* dvi/vf */) - /* To be used both in plain DVI drawing and VF drawing */ -{ - dviunits temp; - - if (/*command >= SETC_000 &&*/ *command <= SETC_127) { - temp = SetChar((int32_t)*command); - dvi_stack->h += temp; - dvi_stack->hh += PIXROUND(temp,dvi->conv*shrinkfactor); - CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh); - } else if (*command >= FONT_00 && *command <= FONT_63) { - SetFntNum((int32_t)*command - FONT_00,parent); - } else switch (*command) { - case PUT1: case PUT2: case PUT3: case PUT4: - DEBUG_PRINT(DEBUG_DVI,(" %d", - UNumRead(command+1, dvi_commandlength[*command]-1))); - (void) SetChar(UNumRead(command+1, dvi_commandlength[*command]-1)); - break; - case SET1: case SET2: case SET3: case SET4: - DEBUG_PRINT(DEBUG_DVI,(" %d", - UNumRead(command+1, dvi_commandlength[*command]-1))); - { - temp = SetChar(UNumRead(command+1, dvi_commandlength[*command]-1)); - dvi_stack->h += temp; - dvi_stack->hh += PIXROUND(temp,dvi->conv*shrinkfactor); - CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh); - } - break; - case SET_RULE: - DEBUG_PRINT(DEBUG_DVI,(" %d %d", - UNumRead(command+1, 4), UNumRead(command+5, 4))); - temp = SetRule(DO_VFCONV(UNumRead(command+1, 4)), - DO_VFCONV(UNumRead(command+5, 4)), - dvi_stack->hh, dvi_stack->vv); - dvi_stack->h += temp; - dvi_stack->hh += PIXROUND(temp,dvi->conv*shrinkfactor); - CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh); - break; - case PUT_RULE: - DEBUG_PRINT(DEBUG_DVI,(" %d %d", - UNumRead(command+1, 4), UNumRead(command+5, 4))); - (void) SetRule(DO_VFCONV(UNumRead(command+1, 4)), - DO_VFCONV(UNumRead(command+5, 4)), - dvi_stack->hh, dvi_stack->vv); - break; - case BOP: - Fatal("BOP occurs within page"); - break; - case EOP: - break; - case PUSH: - /* is next item on stack? */ - if (dvi_stack == &stack[STACK_SIZE-1]) - Fatal("DVI stack overflow"); - { - struct stack_entry *next=dvi_stack+1; - next->h = dvi_stack->h; - next->v = dvi_stack->v; - next->w = dvi_stack->w; - next->x = dvi_stack->x; - next->y = dvi_stack->y; - next->z = dvi_stack->z; - next->hh = dvi_stack->hh; - next->vv = dvi_stack->vv; - dvi_stack=next; - } - break; - case POP: - if (dvi_stack == stack) - Fatal("DVI stack underflow"); - dvi_stack--; - break; - case RIGHT1: case RIGHT2: case RIGHT3: case RIGHT4: - DEBUG_PRINT(DEBUG_DVI,(" %d", - SNumRead(command+1, dvi_commandlength[*command]-1))); - MoveRight(DO_VFCONV(SNumRead(command+1, dvi_commandlength[*command]-1))); - break; - case W1: case W2: case W3: case W4: - dvi_stack->w = SNumRead(command+1, dvi_commandlength[*command]-1); - DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->w)); - case W0: - MoveRight(DO_VFCONV(dvi_stack->w)); - break; - case X1: case X2: case X3: case X4: - dvi_stack->x = SNumRead(command+1, dvi_commandlength[*command]-1); - DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->x)); - case X0: - MoveRight(DO_VFCONV(dvi_stack->x)); - break; - case DOWN1: case DOWN2: case DOWN3: case DOWN4: - DEBUG_PRINT(DEBUG_DVI,(" %d", - SNumRead(command+1, dvi_commandlength[*command]-1))); - MoveDown(DO_VFCONV(SNumRead(command+1, dvi_commandlength[*command]-1))); - break; - case Y1: case Y2: case Y3: case Y4: - dvi_stack->y = SNumRead(command+1, dvi_commandlength[*command]-1); - DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->y)); - case Y0: - MoveDown(DO_VFCONV(dvi_stack->y)); - break; - case Z1: case Z2: case Z3: case Z4: - dvi_stack->z = SNumRead(command+1, dvi_commandlength[*command]-1); - DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->z)); - case Z0: - MoveDown(DO_VFCONV(dvi_stack->z)); - break; - case FNT1: case FNT2: case FNT3: case FNT4: - DEBUG_PRINT(DEBUG_DVI,(" %d", - UNumRead(command+1, dvi_commandlength[*command]-1))); - SetFntNum(UNumRead(command+1, dvi_commandlength[*command]-1),parent); - break; - case XXX1: case XXX2: case XXX3: case XXX4: - DEBUG_PRINT(DEBUG_DVI,(" %d", - UNumRead(command+1, dvi_commandlength[*command]-1))); - SetSpecial((char*)command + dvi_commandlength[*command], - dvi_stack->hh,dvi_stack->vv); - break; - case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: - if (((struct font_entry*)parent)->type==DVI_TYPE) { - FontDef(command, parent); - } else { - Fatal("%s within VF macro from %s",dvi_commands[*command], - ((struct font_entry*)parent)->n); - } - break; - case PRE: case POST: case POST_POST: - Fatal("%s occurs within page",dvi_commands[*command]); - break; - case NOP: - break; - default: - Fatal("%s is an undefined command",dvi_commands[*command]); - break; - } -} - -void BeginVFMacro(struct font_entry* currentvf) -{ - struct stack_entry *next=dvi_stack+1; - if (dvi_stack == &stack[STACK_SIZE-1]) - Fatal("DVI stack overflow"); - next->h = dvi_stack->h; - next->v = dvi_stack->v; - next->w = next->x = next->y = next->z = 0; - next->hh = dvi_stack->hh; - next->vv = dvi_stack->vv; - dvi_stack = next; - DEBUG_PRINT(DEBUG_DVI,("\n START VF:\tPUSH, W = X = Y = Z = 0")); - SetFntNum(currentvf->defaultfont,currentvf); -} - -void EndVFMacro(void) -{ - if (dvi_stack == stack) - Fatal("DVI stack underflow"); - dvi_stack--; - DEBUG_PRINT(DEBUG_DVI,("\n END VF:\tPOP ")); -} - - -static void DrawPage(dviunits hoffset, dviunits voffset) - /* To be used after having read BOP and will exit cleanly when - * encountering EOP. - */ -{ - unsigned char* command; /* current command */ - - dvi_stack->h = hoffset; - dvi_stack->v = voffset; - dvi_stack->w = dvi_stack->x = dvi_stack->y = dvi_stack->z = 0; - dvi_stack->hh = PIXROUND( dvi_stack->h , dvi->conv*shrinkfactor ); - dvi_stack->vv = PIXROUND( dvi_stack->v , dvi->conv*shrinkfactor ); - currentfont = NULL; /* No default font */ - - command=DVIGetCommand(dvi); - DEBUG_PRINT(DEBUG_DVI,("DRAW CMD:\t%s", dvi_commands[*command])); - while (*command != EOP) { - DrawCommand(command,dvi); - command=DVIGetCommand(dvi); - DEBUG_PRINT(DEBUG_DVI,("DRAW CMD:\t%s", dvi_commands[*command])); - } -} - -void DrawPages(void) -{ - struct page_list *dvi_pos; - pixels x_width,y_width,x_offset,y_offset; - int pagecounter=(option_flags & DVI_PAGENUM)?0:10; - - dvi_pos=NextPPage(dvi,NULL); - if (dvi_pos!=NULL) { - while(dvi_pos!=NULL) { - SeekPage(dvi,dvi_pos); - Message(BE_NONQUIET,"[%d", dvi_pos->count[pagecounter]); - if (dvi_pos->count[pagecounter]!=dvi_pos->count[0]) - Message(BE_NONQUIET," (%d)", dvi_pos->count[0]); - x_max = y_max = INT32_MIN; - x_min = y_min = INT32_MAX; - DrawPage((dviunits)0,(dviunits)0); - /* Store background color. Background color of a page is given - by the color at EOP rather than the color at BOP. */ - StoreBackgroundColor(dvi_pos); - /* Store pagesize */ - if (dvi->flags & DVI_PREVIEW_LATEX_TIGHTPAGE) { - x_width_def=x_width_tightpage; - y_width_def=y_width_tightpage; - x_offset_def=x_offset_tightpage; - y_offset_def=y_offset_tightpage; - } - if (x_width_def >= 0) { /* extend BBOX */ - min(x_min,-x_offset_def); - max(x_max,x_min + x_width_def); - min(y_min,-y_offset_def); - max(y_max,y_min + y_width_def); - } - if (x_width_def <= 0 || option_flags & EXPAND_BBOX) { - x_width = x_max-x_min; - y_width = y_max-y_min; - x_offset = -x_min; /* offset by moving topleft corner */ - y_offset = -y_min; /* offset by moving topleft corner */ - } else { - x_width=x_width_def; - y_width=y_width_def; - x_offset=x_offset_def; - y_offset=y_offset_def; - } - DEBUG_PRINT(DEBUG_DVI,("\n IMAGE:\t%dx%d",x_width,y_width)); - SeekPage(dvi,dvi_pos); - CreateImage(x_width,y_width); -#ifdef DEBUG - DEBUG_PRINT(DEBUG_DVI,("\n@%d PAGE START:\tBOP",dvi_pos->offset)); - { - int i; - for (i=0;i<10;i++) - DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_pos->count[i])); - DEBUG_PRINT(DEBUG_DVI,(" (%d)\n",dvi_pos->count[10])); - } -#endif - Message(REPORT_DEPTH," depth=%d", y_width-y_offset-1); - Message(REPORT_HEIGHT," height=%d", y_offset+1); - Message(REPORT_WIDTH," width=%d", x_width); - page_flags &= ~PAGE_PREVIEW_BOP; - DrawPage(x_offset*dvi->conv*shrinkfactor, - y_offset*dvi->conv*shrinkfactor); - if ( ! (option_flags & MODE_PICKY && page_flags & PAGE_GAVE_WARN )) { - WriteImage(dvi->outname,dvi_pos->count[pagecounter]); -#ifdef TIMING - ++ndone; -#endif - } else { - exitcode=EXIT_FAILURE; - Message(BE_NONQUIET,"(page not rendered)"); - DestroyImage(); - } - Message(BE_NONQUIET,"] "); - fflush(stdout); - page_flags = 0; - dvi_pos=NextPPage(dvi,dvi_pos); - } - Message(BE_NONQUIET,"\n"); - ClearPpList(); - } -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/dvi.c b/Build/source/texk/dvipng/dvipng-1.13/dvi.c deleted file mode 100644 index a20290ecfd9..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/dvi.c +++ /dev/null @@ -1,484 +0,0 @@ -/* dvi.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" -#ifdef MIKTEX -# include -# define SLEEP Sleep(1000) -#else /* MIKTEX */ -# ifdef HAVE_LIBGEN_H -# include -# else -# define basename xbasename -# endif -# ifdef WIN32 -# define SLEEP Sleep(1000) -# include -# else -# define SLEEP sleep(1) -# endif /* WIN32 */ -#endif /* MIKTEX */ -#include - -bool followmode=0; - -bool DVIFollowToggle(void) -{ - return followmode = ! followmode; -} - -static unsigned char fgetc_follow(FILE* fp) -{ - int got=fgetc(fp); - - while(followmode && got==EOF) { - SLEEP; - got=fgetc(fp); - } - if (got==EOF) - Fatal("DVI file ends prematurely"); - return (unsigned char)got; -} - -static void DVIInit(struct dvi_data* dvi) -{ - int k; - unsigned char* pre; - struct stat stat; - - fseek(dvi->filep,0,SEEK_SET); - pre=DVIGetCommand(dvi); - if (*pre != PRE) { - Fatal("PRE does not occur first - are you sure this is a DVI file?"); - } - k = UNumRead(pre+1,1); - DEBUG_PRINT(DEBUG_DVI,("DVI START:\tPRE %d",k)); - if (k != DVIFORMAT) { - Fatal("DVI format = %d, can only process DVI format %d files", - k, DVIFORMAT); - } - dvi->num = UNumRead(pre+2, 4); - dvi->den = UNumRead(pre+6, 4); - DEBUG_PRINT(DEBUG_DVI,(" %d/%d",dvi->num,dvi->den)); - dvi->mag = UNumRead(pre+10, 4); /*FIXME, see font.c*/ - DEBUG_PRINT(DEBUG_DVI,(" %d",dvi->mag)); - if ( usermag > 0 && usermag != dvi->mag ) { - Warning("DVI magnification of %d over-ridden by user (%ld)", - (long)dvi->mag, usermag ); - dvi->mag = usermag; - } - dvi->conv = (1.0/(((double)dvi->num / (double)dvi->den) * - ((double)dvi->mag / 1000.0) * - ((double)dpi*shrinkfactor/254000.0)))+0.5; - DEBUG_PRINT(DEBUG_DVI,(" (%d)",dvi->conv)); - k = UNumRead(pre+14,1); - DEBUG_PRINT(DEBUG_DVI,(" '%.*s'",k,pre+15)); - Message(BE_VERBOSE,"'%.*s' -> %s\n",k,pre+15,dvi->outname); - fstat(fileno(dvi->filep), &stat); - dvi->mtime = stat.st_mtime; - dvi->pagelistp=NULL; - dvi->flags = 0; -} - -struct dvi_data* DVIOpen(char* dviname,char* outname) -{ - char* tmpstring; - struct dvi_data* dvi; - - if ((dvi = calloc(1,sizeof(struct dvi_data)))==NULL) - Fatal("cannot malloc memory for DVI struct"); - - dvi->type = DVI_TYPE; - dvi->fontnump=NULL; - - dvi->name = malloc(strlen(dviname)+5); - if (dvi->name==NULL) - Fatal("cannot malloc space for DVI filename"); - strcpy(dvi->name, dviname); - tmpstring = strrchr(dvi->name, '.'); - if (tmpstring == NULL || strcmp(tmpstring,".dvi") != 0) - strcat(dvi->name, ".dvi"); - - if (outname==NULL) { - dvi->outname = malloc(strlen(basename(dviname))+7); - if (dvi->outname==NULL) { - free(dvi->name); - free(dvi); - Fatal("cannot malloc space for output filename"); - } - strcpy(dvi->outname,basename(dviname)); - tmpstring = strrchr(dvi->outname, '.'); - if (tmpstring != NULL && strcmp(tmpstring,".dvi") == 0) - *tmpstring = '\0'; - strcat(dvi->outname, "%d.png"); - } else { - dvi->outname = malloc(strlen(outname)+1); - if (dvi->outname==NULL) { - free(dvi->name); - free(dvi); - Fatal("cannot malloc space for output filename"); - } - strcpy(dvi->outname,outname); - } - - if ((dvi->filep = fopen(dvi->name,"rb")) == NULL) { - /* do not insist on .dvi */ - tmpstring = strrchr(dvi->name, '.'); - *tmpstring='\0'; - dvi->filep = fopen(dvi->name,"rb"); - } - while((dvi->filep == NULL) && followmode) { - SLEEP; - *tmpstring='.'; - if ((dvi->filep = fopen(dvi->name,"rb")) == NULL) { - /* do not insist on .dvi */ - *tmpstring='\0'; - dvi->filep = fopen(dvi->name,"rb"); - } - } - if (dvi->filep == NULL) { - free(dvi->name); - free(dvi->outname); - free(dvi); - perror(dviname); - exit (EXIT_FAILURE); - } - DEBUG_PRINT(DEBUG_DVI,("OPEN FILE\t%s", dvi->name)); - DVIInit(dvi); - return(dvi); -} - -unsigned char* DVIGetCommand(struct dvi_data* dvi) - /* This function reads in and stores the next dvi command. */ - /* Mmap is not appropriate here, we may want to read from - half-written files. */ -{ - static unsigned char* command=NULL; - static uint32_t commlen=0; - unsigned char *current = command; - int length; - uint32_t strlength=0; - - if (commlen==0) { - commlen=STRSIZE; - if ((current=command=malloc(commlen))==NULL) - Fatal("cannot malloc memory for DVI command"); - } - DEBUG_PRINT(DEBUG_DVI,("\n@%ld ", ftell(dvi->filep))); - *(current++) = fgetc_follow(dvi->filep); - length = dvi_commandlength[*command]; - if (length < 0) - Fatal("undefined DVI op-code %d",*command); - while(current < command+length) - *(current++) = fgetc_follow(dvi->filep); - switch (*command) { - case XXX4: - strlength = *(current - 4); - case XXX3: - strlength = strlength * 256 + *(current - 3); - case XXX2: - strlength = strlength * 256 + *(current - 2); - case XXX1: - strlength = strlength * 256 + *(current - 1); - break; - case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: - strlength = *(current - 1) + *(current - 2); - break; - case PRE: - strlength = *(current - 1); - break; - } - if (strlength > 0) { /* Read string */ - if (strlength+1 + (uint32_t)length > commlen) { - /* string + command length exceeds that of buffer */ - commlen=strlength+1 + (uint32_t)length; - if ((command=realloc(command,commlen))==NULL) - Fatal("cannot malloc memory for DVI command"); - current = command + length; - } - while(current < command+length+strlength) - *(current++) = fgetc_follow(dvi->filep); - *current='\0'; - } - return(command); -} - -bool DVIIsNextPSSpecial(struct dvi_data* dvi) - /* This function checks if the next dvi command is a raw PS - special */ - /* Mmap is not appropriate here, we may want to read from - half-written files. */ -{ - long fpos; - uint32_t strlength=0; - bool israwps=false; - - DEBUG_PRINT(DEBUG_DVI,("\n CHECKING NEXT DVI COMMAND ")); - fpos=ftell(dvi->filep); - switch (fgetc_follow(dvi->filep)) { - case XXX4: - strlength = fgetc_follow(dvi->filep); - case XXX3: - strlength = strlength * 256 + fgetc_follow(dvi->filep); - case XXX2: - strlength = strlength * 256 + fgetc_follow(dvi->filep); - case XXX1: - strlength = strlength * 256 + fgetc_follow(dvi->filep); - } - if (strlength > 0) { - switch(fgetc_follow(dvi->filep)) { - case 'p': - if (strlength > 2 - && fgetc_follow(dvi->filep)=='s' - && fgetc_follow(dvi->filep)==':') - israwps=true; - break; - case '"': - israwps=true; - } - } - fseek(dvi->filep,fpos,SEEK_SET); - return(israwps); -} - -uint32_t CommandLength(unsigned char* command) -{ - /* generally 2^32+5 bytes max, but in practice 32 bit numbers suffice */ - uint32_t length=0; - - length = dvi_commandlength[*command]; - switch (*command) { - case XXX1: case XXX2: case XXX3: case XXX4: - length += UNumRead(command + 1,length - 1); - break; - case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: - length += *(command + length - 1) + *(command + length - 2); - break; - case PRE: - length += *(command + length - 1); - break; - } - return(length); -} - -static void SkipPage(struct dvi_data* dvi) -{ - /* Skip present page */ - unsigned char* command; - - command=DVIGetCommand(dvi); - while (*command != EOP) { - switch (*command) { - case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: - DEBUG_PRINT(DEBUG_DVI,("NOSKIP CMD:\t%s", dvi_commands[*command])); - FontDef(command,dvi); - break; - case XXX1: case XXX2: case XXX3: case XXX4: - DEBUG_PRINT(DEBUG_DVI,("NOSKIP CMD:\t%s %d", dvi_commands[*command], - UNumRead(command+1, dvi_commandlength[*command]-1))); - SetSpecial((char*)command + dvi_commandlength[*command],0,0); - break; - case BOP: case PRE: case POST: case POST_POST: - Fatal("%s occurs within page", dvi_commands[*command]); - break; -#ifdef DEBUG - default: - DEBUG_PRINT(DEBUG_DVI,("SKIP CMD:\t%s", dvi_commands[*command])); -#endif - } - command=DVIGetCommand(dvi); - } /* while */ - DEBUG_PRINT(DEBUG_DVI,("SKIP CMD:\t%s", dvi_commands[*command])); -} - -static struct page_list* InitPage(struct dvi_data* dvi) -{ - /* Find page start, return pointer to page_list entry if found */ - struct page_list* tpagelistp=NULL; - unsigned char* command; - - command=DVIGetCommand(dvi); - /* Skip until page start or postamble */ - while((*command != BOP) && (*command != POST)) { - switch(*command) { - case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: - DEBUG_PRINT(DEBUG_DVI,("NOPAGE CMD:\t%s", dvi_commands[*command])); - FontDef(command,dvi); - break; - case NOP: - DEBUG_PRINT(DEBUG_DVI,("NOPAGE CMD:\tNOP")); - break; - default: - Fatal("%s occurs outside page", dvi_commands[*command]); - } - command=DVIGetCommand(dvi); - } - if ((tpagelistp = - malloc(sizeof(struct page_list) - +(csp+1-2)*sizeof(struct dvi_color)))==NULL) - Fatal("cannot malloc memory for new page entry"); - tpagelistp->next = NULL; - if ( *command == BOP ) { /* Init page */ - int i; - DEBUG_PRINT(DEBUG_DVI,("PAGE START:\tBOP")); - StoreColorStack(tpagelistp); - tpagelistp->offset = ftell(dvi->filep)-45; - for (i = 0; i <= 9; i++) { - tpagelistp->count[i] = UNumRead(command + 1 + i*4, 4); - DEBUG_PRINT(DEBUG_DVI,(" %d",tpagelistp->count[i])); - } - if (dvi->pagelistp==NULL) - tpagelistp->count[10] = 1; - else - tpagelistp->count[10] = dvi->pagelistp->count[10]+1; - DEBUG_PRINT(DEBUG_DVI,(" (%d)", tpagelistp->count[10])); - } else { - DEBUG_PRINT(DEBUG_DVI,("DVI END:\tPOST")); - tpagelistp->offset = ftell(dvi->filep)-1; - tpagelistp->count[0] = PAGE_POST; /* POST */ - tpagelistp->count[10] = PAGE_POST; /* POST */ - } - return(tpagelistp); -} - -int SeekPage(struct dvi_data* dvi, struct page_list* page) -{ - ReadColorStack(page); - return(fseek(dvi->filep, - page->offset+((page->count[0]==PAGE_POST) ? 1L : 45L), - SEEK_SET)); -} - -struct page_list* NextPage(struct dvi_data* dvi, struct page_list* page) -{ - struct page_list* tpagelistp; - - /* if page points to POST there is no next page */ - if (page!=NULL && page->count[0]==PAGE_POST) - return(NULL); - - /* If we have read past the last page in our current list or the - * list is empty, sneak a look at the next page - */ - if (dvi->pagelistp==NULL - || dvi->pagelistp->offset+45L < ftell(dvi->filep)) { - tpagelistp=dvi->pagelistp; - dvi->pagelistp=InitPage(dvi); - dvi->pagelistp->next=tpagelistp; - } - - if (page!=dvi->pagelistp) { - /* also works if page==NULL, we'll get the first page then */ - tpagelistp=dvi->pagelistp; - while(tpagelistp!=NULL && tpagelistp->next!=page) - tpagelistp=tpagelistp->next; - } else { - /* dvi->pagelistp points to the last page we've read so far, - * the last page that we know where it is, so to speak - * So look at the next - */ - (void)SeekPage(dvi,dvi->pagelistp); - SkipPage(dvi); - tpagelistp=dvi->pagelistp; - dvi->pagelistp=InitPage(dvi); - dvi->pagelistp->next=tpagelistp; - tpagelistp=dvi->pagelistp; - } - return(tpagelistp); -} - -struct page_list* PrevPage(struct dvi_data* dvi, struct page_list* page) -{ - return(page->next); -} - - -struct page_list* FindPage(struct dvi_data* dvi, int32_t pagenum, bool abspage) - /* Find first page of certain number, - absolute number if abspage is set */ -{ - struct page_list* page=NextPage(dvi, NULL); - - if (pagenum==PAGE_LASTPAGE || pagenum==PAGE_POST) { - while(page!=NULL && page->count[0]!=PAGE_POST) - page=NextPage(dvi,page); - if (pagenum==PAGE_LASTPAGE) - page=PrevPage(dvi,page); - } else - if (pagenum!=PAGE_FIRSTPAGE) - while(page != NULL && pagenum != page->count[abspage ? 0 : 10]) - page=NextPage(dvi,page); - return(page); -} - - -static void DelPageList(struct dvi_data* dvi) -{ - struct page_list* temp; - - /* Delete the page list */ - - temp=dvi->pagelistp; - while(temp!=NULL) { - dvi->pagelistp=dvi->pagelistp->next; - free(temp); - temp=dvi->pagelistp; - } -} - -void DVIClose(struct dvi_data* dvi) -{ - if (dvi!=NULL) { - fclose(dvi->filep); - DelPageList(dvi); - ClearPSHeaders(); - free(dvi->outname); - free(dvi->name); - free(dvi); - } -} - -bool DVIReOpen(struct dvi_data* dvi) -{ - struct stat stat; - fstat(fileno(dvi->filep), &stat); - if (dvi->mtime != stat.st_mtime) { - fclose(dvi->filep); - dvi->filep=NULL; - DelPageList(dvi); - ClearPSHeaders(); - while(((dvi->filep = fopen(dvi->name,"rb")) == NULL) && followmode) { - SLEEP; - } - if (dvi->filep == NULL) { - perror(dvi->name); - exit(EXIT_FAILURE); - } - Message(PARSE_STDIN,"Reopened file\n"); - DEBUG_PRINT(DEBUG_DVI,("\nREOPEN FILE\t%s", dvi->name)); - DVIInit(dvi); - return(true); - } - return(false); -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/dvipng.1 b/Build/source/texk/dvipng/dvipng-1.13/dvipng.1 deleted file mode 100644 index 7bc3889a947..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/dvipng.1 +++ /dev/null @@ -1,508 +0,0 @@ -.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "DVIPNG 1" -.TH DVIPNG 1 "2009-02-23" "dvipng 1.12" "User commands" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -dvipng \- A DVI\-to\-PNG translator -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -dvipng [options] filename -.PP -dvipng [options] [filename] \- -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -This program makes \s-1PNG\s0 and/or \s-1GIF\s0 graphics from \s-1DVI\s0 files as obtained -from TeX and its relatives. -.PP -If \s-1GIF\s0 support is enabled, \s-1GIF\s0 output is chosen by using the -\&\fBdvigif\fR binary or with the \fB\-\-gif\fR option. -.PP -The benefits of \fBdvipng\fR/\fBdvigif\fR include -.IP "\(bu" 4 -Speed. It is a very fast bitmap-rendering code for \s-1DVI\s0 files, which -makes it suitable for generating large amounts of images on-the-fly, -as needed in preview-latex, WeBWorK and others. -.IP "\(bu" 4 -It does not read the postamble, so it can be started before TeX -finishes. There is a \fB\-\-follow\fR switch that makes dvipng wait at -end-of-file for further output, unless it finds the \s-1POST\s0 marker that -indicates the end of the \s-1DVI\s0. -.IP "\(bu" 4 -Interactive query of options. dvipng can read options interactively -through stdin, and all options are usable. It is even possible to change -the input file through this interface. -.IP "\(bu" 4 -Supports \s-1PK\s0, \s-1VF\s0, PostScript Type1, and TrueType fonts, subfonts (i.e., -as used in CJK-LaTeX), color specials, and inclusion of PostScript, -\&\s-1PNG\s0, \s-1JPEG\s0 or \s-1GIF\s0 images. -.IP "\(bu" 4 -and more... -.SH "OPTIONS" -.IX Header "OPTIONS" -Many of the parameterless options listed here can be turned off by -suffixing the option with a zero (\fB0\fR); for instance, to turn off -page reversal, use \fB\-r0\fR. Such options are marked with a trailing -\&\fB*\fR. -.IP "\fB\-\fR" 4 -.IX Item "-" -Read additional options from standard input after processing the command -line. -.IP "\fB\-\-help\fR" 4 -.IX Item "--help" -Print a usage message and exit. -.IP "\fB\-\-version\fR" 4 -.IX Item "--version" -Print the version number and exit. -.IP "\fB\-bd\fR \fInum\fR" 4 -.IX Item "-bd num" -.PD 0 -.IP "\fB\-bd\fR \fIcolor_spec\fR" 4 -.IX Item "-bd color_spec" -.IP "\fB\-bd '\fR\fInum\fR\fB \fR\fIcolor_spec\fR\fB'\fR" 4 -.IX Item "-bd 'num color_spec'" -.PD -Set the pixel width of the transparent border (default 0). Using this -option will make the image edges transparent, but it only affects pixels -with the background color. Giving a \fIcolor_spec\fR will set the -fallback color, to be used in viewers that cannot handle transparency -(the default is the background color). The color spec should be in -TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. Setting the -fallback color makes the default border width 1 px. -.IP "\fB\-\-bdpi\fR \fInum\fR" 4 -.IX Item "--bdpi num" -Set the base (Metafont) resolution, both horizontal and vertical, to -\&\fInum\fR dpi (dots per inch). This option is necessary when manually -selecting Metafont mode with the \-\-mode option (see below). -.IP "\fB\-bg\fR \fIcolor_spec\fR" 4 -.IX Item "-bg color_spec" -Choose background color for the images. This option will be ignored if -there is a background color \especial in the \s-1DVI\s0. The color spec should -be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. You can -also specify 'Transparent' or 'transparent' which will give you a -transparent background with the normal background as a fallback color. A -capitalized 'Transparent' will give a full-alpha transparency, while an -all-lowercase 'transparent' will give a simple fully transparent -background with non-transparent antialiased pixels. The latter would be -suitable for viewers who cannot cope with a true alpha channel. \s-1GIF\s0 -images do not support full alpha transparency, so in case of \s-1GIF\s0 output, -both variants will use the latter behaviour. -.IP "\fB\-d\fR \fInum\fR" 4 -.IX Item "-d num" -Set the debug flags, showing what dvipng (thinks it) is doing. This will -work unless dvipng has been compiled without the \f(CW\*(C`DEBUG\*(C'\fR option -(not recommended). Set the flags as you need them, use \fB\-d \-1\fR as -the first option for maximum output. -.IP "\fB\-D\fR \fInum\fR" 4 -.IX Item "-D num" -Set the output resolution, both horizontal and vertical, to \fInum\fR -dpi (dots per inch). -.Sp -One may want to adjust this to fit a certain text font size (e.g., on -a web page), and for a text font height of \fIfont_px\fR pixels (in -Mozilla) the correct formula is -.Sp -.Vb 1 -\& = * 72.27 / 10 [px * TeXpt/in / TeXpt] -.Ve -.Sp -The last division by ten is due to the standard font height 10pt in -your document, if you use 12pt, divide by 12. Unfortunately, some -proprietary browsers have font height in pt (points), not pixels. You -have to rescale that to pixels, using the screen resolution (default -is usually 96 dpi) which means the formula is -.Sp -.Vb 1 -\& = * 96 / 72 [pt * px/in / (pt/in)] -.Ve -.Sp -On some high-res screens, the value is instead 120 dpi. Good luck! -.IP "\fB\-\-depth*\fR" 4 -.IX Item "--depth*" -Report the depth of the image. This only works reliably when the -LaTeX style \fIpreview.sty\fR from preview-latex is used with -the \fBactive\fR option. It reports the number of pixels from the -bottom of the image to the baseline of the image. This can be used for -vertical positioning of the image in, e.g., web documents, where one -would use (Cascading StyleSheets 1) -.Sp -.Vb 1 -\& -.Ve -.Sp -The depth is a negative offset in this case, so the minus sign is -necessary, and the unit is pixels (px). -.IP "\fB\-\-dvinum*\fR" 4 -.IX Item "--dvinum*" -Set this option to make the output page number be the TeX page -numbers rather than the physical page number. See the \fB\-o\fR switch. -.IP "\fB\-fg\fR \fIcolor_spec\fR" 4 -.IX Item "-fg color_spec" -Choose foreground color for the images. This option will be ignored if -there is a foreground color \especial in the \s-1DVI\s0. The color spec should -be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. -.IP "\fB\-\-follow*\fR" 4 -.IX Item "--follow*" -Wait for data at end-of-file. One of the benefits of dvipng is that it -does not read the postamble, so it can be started before TeX -finishes. This switch makes dvipng wait at end-of-file for further -output, unless it finds the \s-1POST\s0 marker that indicates the end of the -\&\s-1DVI\s0. This is similar to \fBtail \-f\fR but for DVI-to-PNG conversion. -.IP "\fB\-\-freetype*\fR" 4 -.IX Item "--freetype*" -Enable/disable FreeType font rendering (default on). This option is -available if the FreeType2 font library was present at compilation time. -If this is the case, dvipng will have direct support for PostScript -Type1 and TrueType fonts internally, rather than using \fBgsftopk\fR -for rendering the fonts. If you have PostScript versions of Computer -Modern installed, there will be no need to generate bitmapped variants -on disk of these. Then, you can render images at different (and unusual) -resolutions without cluttering the disk with lots of bitmapped fonts. -Note that if you have both FreeType and T1lib on your system, FreeType -will be preferred by dvipng. If you for some reason would want to use -T1lib rendering, use this option. -.IP "\fB\-\-gamma\fR \fInum\fR" 4 -.IX Item "--gamma num" -Control the interpolation of colors in the greyscale anti-aliasing -color palette. Default value is 1.0. For 0 < \fInum\fR < 1, the -fonts will be lighter (more like the background), and for \fInum\fR > -1, the fonts will be darker (more like the foreground). -.IP "\fB\-\-gif*\fR" 4 -.IX Item "--gif*" -The images are output in the \s-1GIF\s0 format, if \s-1GIF\s0 support is enabled. -This is the default for the \fBdvigif\fR binary, which only will be -available when \s-1GIF\s0 support is enabled. \s-1GIF\s0 images are palette images -(see the \fB\-\-palette\fR option) and does not support true alpha -channels (see the \fB\-\-bg\fR option). See also the \fB\-\-png\fR -option. -.IP "\fB\-\-height*\fR" 4 -.IX Item "--height*" -Report the height of the image. This only works reliably when the -LaTeX style \fIpreview.sty\fR from preview-latex is used with -the \fBactive\fR option. It reports the number of pixels from the top -of the image to the baseline of the image. The total height of the -image is obtained as the sum of the values reported from -\&\fB\-\-height\fR and \fB\-\-depth\fR. -.IP "\fB\-l [=]\fR\fInum\fR" 4 -.IX Item "-l [=]num" -The last page printed will be the first one numbered \fInum\fR. Default -is the last page in the document. If \fInum\fR is prefixed by an equals -sign, then it (and the argument to the \fB\-p\fR option, if specified) -is treated as a physical (absolute) page number, rather than a value to -compare with the TeX \fB\ecount0\fR values stored in the \s-1DVI\s0 file. -Thus, using \fB\-l =9\fR will end with the ninth page of the document, -no matter what the pages are actually numbered. -.IP "\fB\-\-mode\fR \fImode\fR" 4 -.IX Item "--mode mode" -Use \fImode\fR as the Metafont device name for the \s-1PK\s0 fonts (both for -path searching and font generation). This needs to be augmented with the -base device resolution, given with the \fB\-\-bdpi\fR option. See the -file <\fBftp://ftp.tug.org/tex/modes.mf\fR> for a list of resolutions and -mode names for most devices. -.IP "\fB\-M*\fR" 4 -.IX Item "-M*" -Turns off automatic \s-1PK\s0 font generation (\fImktexpk\fR). This will have -no effect when using PostScript fonts, since no \s-1PK\s0 font generation will -be done anyway. -.IP "\fB\-\-noghostscript*\fR" 4 -.IX Item "--noghostscript*" -This switch prohibits the internal call to GhostScript for displaying -PostScript specials. \fB\-\-noghostscript0\fR turns the call back on. -.IP "\fB\-\-nogssafer*\fR" 4 -.IX Item "--nogssafer*" -Normally, if GhostScript is used to render PostScript specials, the -GhostScript interpreter is run with the option \fB\-dSAFER\fR. The -\&\fB\-\-nogssafer\fR option runs GhostScript without \fB\-dSAFER\fR. The -\&\fB\-dSAFER\fR option in Ghostscript disables PostScript operators such -as deletefile, to prevent possibly malicious PostScript programs from -having any effect. -.IP "\fB\-o\fR \fIname\fR" 4 -.IX Item "-o name" -Send output to the file \fIname\fR. A single occurrence of \fB\f(CB%d\fB\fR or -\&\fB\f(CB%01d\fB\fR, ..., \fB\f(CB%09d\fB\fR will be exchanged for the physical -page number (this can be changed, see the \fB\-\-dvinum\fR switch). The -default output filename is \fIfile\fR\fB\f(CB%d\fB.png\fR where the input \s-1DVI\s0 -file was \fIfile\fR\fB.dvi\fR. -.IP "\fB\-O\fR \fIx\-offset\fR\fB,\fR\fIy\-offset\fR" 4 -.IX Item "-O x-offset,y-offset" -Move the origin by \fIx\-offset\fR,\fIy\-offset\fR, a comma-separated -pair of dimensions such as \fB.1in,\-.3cm\fR. -The origin of the page is shifted from the default position -(of one inch down, one inch to the right from the upper left corner of -the paper) by this amount. -.IP "\fB\-p [=]\fR\fInum\fR" 4 -.IX Item "-p [=]num" -The first page printed will be the first one numbered \fInum\fR. Default -is the first page in the document. If \fInum\fR is prefixed by an -equals sign, then it (and the argument to the \fB\-l\fR option, if -specified) is treated as a physical (absolute) page number, rather than -a value to compare with the TeX \fB\ecount0\fR values stored in the -\&\s-1DVI\s0 file. Thus, using \fB\-p =3\fR will start with the third page of -the document, no matter what the pages are actually numbered. -.IP "\fB\-\-palette*\fR" 4 -.IX Item "--palette*" -Starting from \fBdvipng\fR 1.8, the output \s-1PNG\s0 will be a truecolor -png when an external image is included, to avoid unnecessary delay and -quality reduction, and enable the \s-1EPS\s0 translator to draw on a -transparent background and outside of the boundingbox. This switch -will force palette (256\-color) output and make \fBdvipng\fR revert to -the old behaviour, where included images were opaque and always -clipped to the boundingbox. This will also override the -\&\fB\-\-truecolor\fR switch if present. -.IP "\fB\-\-picky*\fR" 4 -.IX Item "--picky*" -No images are output when a warning occurs. Normally, dvipng will -output an image in spite of a warning, but there may be something -missing in this image. One reason to use this option would be if you -have a more complete but slower fallback converter. Mainly, this is -useful for failed figure inclusion and unknown \especial occurrences, -but warnings will also occur for missing or unknown color specs and -missing \s-1PK\s0 fonts. -.IP "\fB\-\-png*\fR" 4 -.IX Item "--png*" -The images are output in the \s-1PNG\s0 format. This is the default for the -\&\fBdvipng\fR binary. See also the \fB\-\-gif\fR option. -.IP "\fB\-pp\fR \fIfirstpage\fR\fB\-\fR\fIlastpage\fR" 4 -.IX Item "-pp firstpage-lastpage" -Print pages \fIfirstpage\fR through \fIlastpage\fR; but not quite -equivalent to \fB\-p\fR \fIfirstpage\fR \fB\-l\fR \fIlastpage\fR. For example, -when rendering a book, there may be several instances of a page in the -\&\s-1DVI\s0 file (one in \f(CW\*(C`\efrontmatter\*(C'\fR, one in \f(CW\*(C`\emainmatter\*(C'\fR, and one -in \f(CW\*(C`\ebackmatter\*(C'\fR). In case of several pages matching, \fB\-pp\fR -\&\fIfirstpage\fR\fB\-\fR\fIlastpage\fR will render \fIall\fR pages that -matches the specified range, while \fB\-p\fR \fIfirstpage\fR \fB\-l\fR -\&\fIlastpage\fR will render the pages from the \fIfirst\fR occurrence -of \fIfirstpage\fR to the \fIfirst\fR occurrence of \fIlastpage\fR. -This is the (undocumented) behaviour of dvips. In dvipng you can give -both kinds of options, in which case you get all pages that matches the -range in \fB\-pp\fR between the pages from \fB\-p\fR to \fB\-l\fR. Also -multiple \fB\-pp\fR options accumulate, unlike \fB\-p\fR and \fB\-l\fR. -The \fB\-\fR separator can also be \fB:\fR. Note that \fB\-pp \-1\fR -will be interpreted as \*(L"all pages up to and including 1\*(R", if you want a -page numbered \-1 (only the table of contents, say) put \fB\-pp \-1\-\-1\fR, -or more readable, \fB\-pp \-1:\-1\fR. -.IP "\fB\-q*\fR" 4 -.IX Item "-q*" -Run quietly. Don't chatter about pages converted, etc. to standard -output; report no warnings (only errors) to standard error. -.IP "\fB\-Q\fR \fInum\fR" 4 -.IX Item "-Q num" -Set the quality to \fInum\fR. That is, choose the number of antialiasing -levels for \s-1PK\s0 and T1lib rendering to be \fInum\fR*\fInum\fR+1. The default -value is 4 which gives 17 levels of antialiasing for antialiased fonts -from these two. If FreeType is available, its rendering is unaffected by -this option. -.IP "\fB\-r*\fR" 4 -.IX Item "-r*" -Toggle output of pages in reverse/forward order. By default, the first -page in the \s-1DVI\s0 is output first. -.IP "\fB\-\-strict*\fR" 4 -.IX Item "--strict*" -The program exits when a warning occurs. Normally, dvipng will output -an image in spite of a warning, but there may be something missing in -this image. One reason to use this option would be if you have a more -complete but slower fallback converter. See the \fB\-\-picky\fR option -above for a list of when warnings occur. -.IP "\fB\-T\fR \fIimage_size\fR" 4 -.IX Item "-T image_size" -Set the image size to \fIimage_size\fR which can be either of -\&\fBbbox\fR, \fBtight\fR, or a comma-separated pair of dimensions -\&\fIhsize\fR,\fIvsize\fR such as \fB.1in,.3cm\fR. The default is -\&\fBbbox\fR which produces a \s-1PNG\s0 that includes all ink put on the page -and in addition the \s-1DVI\s0 origin, located 1in from the top and 1in from -the left edge of the paper. This usually gives whitespace above and to -the left in the produced image. The value \fBtight\fR will make dvipng -only include all ink put on the page, producing neat images. -.IP "\fB\-\-t1lib*\fR" 4 -.IX Item "--t1lib*" -Enable/disable T1lib font rendering (default on). This option is -available if the T1lib font library was present at compilation time. If -this is the case, dvipng will have direct support for PostScript Type1 -fonts internally, rather than using \fBgsftopk\fR for rendering the -fonts. If you have PostScript versions of Computer Modern installed, -there will be no need to generate bitmapped variants on disk of these. -Then, you can render images at different (and unusual) resolutions -without cluttering the disk with lots of bitmapped fonts. Note that if -you have both FreeType and T1lib on your system FreeType will be -preferred by dvipng, and if you for some reason rather want to use -T1lib, give the option \fB\-\-freetype0\fR (see above). -.IP "\fB\-\-truecolor*\fR" 4 -.IX Item "--truecolor*" -This will make \fBdvipng\fR generate truecolor output. Note that -truecolor output is automatic if you include an external image in your -\&\s-1DVI\s0, e.g., via a PostScript special (i.e., the \fBgraphics\fR or -\&\fBgraphicx\fR package). This switch is overridden by the -\&\fB\-\-palette\fR switch. -.IP "\fB\-v*\fR" 4 -.IX Item "-v*" -Enable verbose operation. This will currently indicate what fonts is -used, in addition to the usual output. -.IP "\fB\-x\fR \fInum\fR" 4 -.IX Item "-x num" -Set the x magnification ratio to \fInum\fR/1000. Overrides -the magnification specified in the \s-1DVI\s0 file. Must be between 10 and -100000. It is recommended that you use standard magstep values (1095, -1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the total -number of \s-1PK\s0 files generated. \fInum\fR may be a real number, not an -integer, for increased precision. -.IP "\fB\-z\fR \fInum\fR" 4 -.IX Item "-z num" -Set the \s-1PNG\s0 compression level to \fInum\fR. This option is enabled if -your \fBlibgd\fR is new enough. The default compression level is 1, -which selects maximum speed at the price of slightly larger PNGs. For an -older \fBlibgd\fR, the hard-soldered value 5 is used. The include file -\&\fBpng.h\fR says -\&\*(L"Currently, valid values range from 0 \- 9, corresponding directly to -the zlib compression levels 0 \- 9 (0 \- no compression, 9 \- \*(R"maximal\*(L" -compression). Note that tests have shown that zlib compression levels -3\-6 usually perform as well as level 9 for \s-1PNG\s0 images, and do -considerably fewer calculations. In the future, these values may not -correspond directly to the zlib compression levels.\*(R" -.SH "NOTES" -.IX Header "NOTES" -The full manual is accessible in the info format, on most systems by typing -.PP -.Vb 1 -\& info dvipng -.Ve -.SH "COPYRIGHT" -.IX Header "COPYRIGHT" -This program is released under the \s-1GNU\s0 Lesser General Public License -version 3, see the \s-1COPYING\s0 file in the dvipng distribution or -<\fBhttp://www.gnu.org/licenses/gpl.html\fR>. -.PP -Copyright (c) 2002\-2008 Jan-AAke Larsson diff --git a/Build/source/texk/dvipng/dvipng-1.13/dvipng.c b/Build/source/texk/dvipng/dvipng-1.13/dvipng.c deleted file mode 100644 index 78b07c1a81f..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/dvipng.c +++ /dev/null @@ -1,164 +0,0 @@ -/* dvipng.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2008 Jan-Åke Larsson - -************************************************************************/ - -/* This program translates TeX's DVI-Code into Portable Network Graphics. */ - -#define MAIN -#include "dvipng.h" - -#ifdef MIKTEX -# define main __cdecl Main -#endif /* MIKTEX */ -/**********************************************************************/ -/******************************* main *******************************/ -/**********************************************************************/ -int main(int argc, char ** argv) -{ - bool parsestdin; - -#ifdef TIMING -# ifdef HAVE_GETTIMEOFDAY - gettimeofday(&Tp, NULL); - timer = Tp.tv_sec + Tp.tv_usec / 1000000.0; -# else -# ifdef HAVE_FTIME - ftime(&timebuffer); - timer = timebuffer.time + timebuffer.millitm / 1000.0; -# endif -# endif -#endif - /* setbuf(stderr, NULL); */ - -#ifdef HAVE_LIBKPATHSEA - /* Use extra paths as used by dvips */ - kpse_set_program_name(argv[0],"dvips"); - /* If dvipng is not installed in the texmf tree, and _only_ - * SELFAUTO... is used in texmf.cnf, kpathsea will not find a) - * Virtual fonts b) ps2pk.map or psfonts.map c) PostScript fonts - * - * We adjust these things here - */ - /* char selfautodir[MAXPATHLEN]; - FILE *self; - self = popen("kpsewhich -expand-var='$SELFAUTODIR'", "r"); - if (!self) - ... - if (!fgets(selfautodir, MAXPATHLEN, self)) - ... - fclose(self); */ -# ifdef ENV_SELFAUTOLOC - putenv(ENV_SELFAUTOLOC); -# endif -# ifdef ENV_SELFAUTODIR - putenv(ENV_SELFAUTODIR); -# endif -# ifdef ENV_SELFAUTOPARENT - putenv(ENV_SELFAUTOPARENT); -# endif - kpse_set_program_enabled (kpse_pk_format, makeTexPK, kpse_src_compile); -#endif - - initcolor(); - parsestdin = DecodeArgs(argc, argv); - -#ifdef HAVE_LIBKPATHSEA - if (user_mfmode) - if (user_bdpi) - kpse_init_prog("DVIPNG", user_bdpi, user_mfmode, "cmr10"); - else { - Warning("--mfmode given without --bdpi"); - /* this will give a lot of warnings but... */ - kpse_init_prog("DVIPNG", 300, user_mfmode, "cmr10"); - } - else - kpse_init_prog("DVIPNG", 300, "cx", "cmr10"); -#endif - -#ifdef HAVE_FT2_OR_LIBT1 - InitPSFontMap(); -#endif - - DrawPages(); - - if (parsestdin) { - char line[STRSIZE]; - - printf("%s> ",dvi!=NULL?dvi->name:""); - fgets(line,STRSIZE,stdin); - while(!feof(stdin)) { - DecodeString(line); - if (dvi!=NULL) { - DVIReOpen(dvi); - DrawPages(); - } - printf("%s> ",dvi!=NULL?dvi->name:""); - fgets(line,STRSIZE,stdin); - } - printf("\n"); - } - -#ifdef TIMING -# ifdef HAVE_GETTIMEOFDAY - gettimeofday(&Tp, NULL); - timer = Tp.tv_sec + Tp.tv_usec/1000000.0 - timer; -# else -# ifdef HAVE_FTIME - ftime(&timebuffer); - timer = timebuffer.time + timebuffer.millitm/1000.0 - timer; -# endif -# endif - - if (ndone > 0) - fprintf(stderr, - "Time of complete run: %.2f s, %d page(s), %.4f s/page.\n", - timer, ndone, timer / ndone); - if (my_toc >= 0.0001) - fprintf(stderr, - "Thereof in TIC/TOC region %.5f s.\n",my_toc); -#endif - - ClearFonts(); - DVIClose(dvi); - ClearColorNames(); -#ifdef HAVE_FT2_OR_LIBT1 - ClearPSFontMap(); - ClearEncoding(); -#endif -#ifdef HAVE_FT2 - ClearSubfont(); - if (libfreetype!=NULL && FT_Done_FreeType(libfreetype)) - Fatal("an error occured during freetype destruction"); - libfreetype = NULL; -#endif -#ifdef HAVE_LIBT1 - if (libt1!=NULL && T1_CloseLib()) - Fatal("an error occured during t1lib destruction"); - libt1 = NULL; -#endif - - exit(exitcode); -} - - - diff --git a/Build/source/texk/dvipng/dvipng-1.13/dvipng.h b/Build/source/texk/dvipng/dvipng-1.13/dvipng.h deleted file mode 100644 index 68b8cc3287c..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/dvipng.h +++ /dev/null @@ -1,566 +0,0 @@ -/* dvipng.h */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#ifndef DVIPNG_H -#define DVIPNG_H -#include "config.h" - -/* Autoconf may define malloc to rpl_malloc, if the system does not - * have a GNU Libc-compatible malloc (for which malloc(0) gives a - * valid pointer). We don't need that (yet) */ -#ifdef malloc -# undef malloc -#endif - -#define STRSIZE 255 /* stringsize for file specifications */ - -#define FIRSTFNTCHAR 0 -#define LASTFNTCHAR 255 -#define NFNTCHARS LASTFNTCHAR+1 - -#define STACK_SIZE 100 /* DVI-stack size */ - -#define DEFAULT_GAMMA 1.0 - -/* Name of the program which is called to generate missing pk files */ -#define MAKETEXPK "mktexpk" - -#ifdef HAVE_INTTYPES_H -# include -#else /* HAVE_INTTYPES_H */ -# ifndef __sgi -/* IRIX has the following types typedef'd in sys/types.h already, - * i.e., _old_ IRIX systems; newer ones have a working inttypes.h */ -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif /* ! __sgi */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef long long int64_t; -typedef unsigned long long uint64_t; -#endif /* HAVE_INTTYPES_H */ - -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif - -#include - -#ifdef HAVE_KPATHSEA_KPATHSEA_H -# include -#else -# error: kpathsea/kpathsea.h is missing from your system -#endif - -#ifdef HAVE_FT2 -#define HAVE_FT2_OR_LIBT1 -#include -#include FT_FREETYPE_H -#endif - -#ifdef HAVE_LIBT1 -#define HAVE_FT2_OR_LIBT1 -#include -#endif - -#ifdef HAVE_STDBOOL_H -# include -#else -# ifdef HAVE_KPATHSEA_KPATHSEA_H -/* boolean is an enum type from kpathsea/types.h loaded in - kpathsea/kpathsea.h, use it as fallback */ -# define bool boolean -# else -typedef int bool; -# define true (bool) 1 -# define false (bool) 0 -# endif -#endif - -#ifndef HAVE_VPRINTF -# ifdef HAVE_DOPRNT -# define vfprintf(stream, message, args) _doprnt(message, args, stream) -# else -# error: vfprintf AND _doprnt are missing!!! - /* If we have neither, should fall back to fprintf with fixed args. */ -# endif -#endif - - -/*************************************************************/ -/************************* protos.h ************************/ -/*************************************************************/ - -typedef int pixels; -typedef int32_t subpixels; -typedef int32_t dviunits; - -#define MM_TO_PXL(x) (int)(((x)*resolution*10)/254) -#define PT_TO_PXL(x) (int)((int32_t)((x)*resolution*100l)/7224) -#define PT_TO_DVI(x) (int32_t)((x)*65536l) - -/*#define PIXROUND(x,c) ((((double)x+(double)(c>>1))/(double)c)+0.5)*/ -/*#define PIXROUND(x,c) (((x)+c)/(c))*/ -/*#define PIXROUND(x,c) ((x+c-1)/(c))*/ -/*#define PIXROUND(x,c) ((x)/(c))*/ -/* integer round to the nearest number, not towards zero */ -#define PIXROUND(num,den) ((num)>0 ? ((num)+(den)/2)/(den) : -(((den)/2-(num))/(den))) - - -/********************************************************/ -/*********************** dvi.h ************************/ -/********************************************************/ - -#define DVI_TYPE 0 -struct dvi_data { /* dvi entry */ - int type; /* This is a DVI */ - struct dvi_data *next; - uint32_t num, den, mag; /* PRE command parameters */ - int32_t conv; /* computed from num and den */ - /* divide dvi units (sp) with conv to get mf device resolution */ - /* divide further with shrinkfactor to get true resolution */ - char * name; /* full name of DVI file */ - char * outname; /* output filename (basename) */ - FILE * filep; /* file pointer */ - time_t mtime; /* modification time */ - struct font_num *fontnump; /* DVI font numbering */ - struct page_list *pagelistp; /* DVI page list */ -#define DVI_PREVIEW_LATEX_TIGHTPAGE 1 -#define DVI_PREVIEW_BOP_HOOK (1<<1) - uint32_t flags; /* Preview-latex flags */ -}; - -#define PAGE_POST INT32_MAX -#define PAGE_LASTPAGE INT32_MAX-1 -#define PAGE_MAXPAGE INT32_MAX-2 /* assume no pages out of this range */ -#define PAGE_FIRSTPAGE INT32_MIN -#define PAGE_MINPAGE INT32_MIN+1 /* assume no pages out of this range */ - -struct dvi_color { - int red,green,blue; -}; - -struct page_list { - struct page_list* next; - int offset; /* file offset to BOP */ - int32_t count[11]; /* 10 dvi counters + absolute pagenum in file */ - int csp; /* color stack pointer at BOP */ - struct dvi_color cstack[2]; /* color stack at BOP, may be longer */ -}; - - - - -struct dvi_data* DVIOpen(char*,char*); -void DVIClose(struct dvi_data*); -bool DVIReOpen(struct dvi_data*); -struct page_list*FindPage(struct dvi_data*, int32_t, bool); -struct page_list*NextPage(struct dvi_data*, struct page_list*); -struct page_list*PrevPage(struct dvi_data*, struct page_list*); -int SeekPage(struct dvi_data*, struct page_list*); -bool DVIFollowToggle(void); -unsigned char* DVIGetCommand(struct dvi_data*); -bool DVIIsNextPSSpecial(struct dvi_data*); -uint32_t CommandLength(unsigned char*); -void ClearPSHeaders(void); - -/********************************************************/ -/********************** misc.h ************************/ -/********************************************************/ - -struct filemmap { -#ifdef WIN32 - HANDLE hFile; - HANDLE hMap; -#else /* WIN32 */ - int fd; -#endif /* WIN32 */ - char* data; - size_t size; -}; - -bool DecodeArgs(int, char *[]); -void DecodeString(char *); -bool MmapFile (char *filename,struct filemmap *fmmap); -void UnMmapFile(struct filemmap* fmmap); - -void Message(int, const char *fmt, ...); -void Warning(const char *fmt, ...); -void Fatal(const char *fmt, ...); - -int32_t SNumRead(unsigned char*, register int); -uint32_t UNumRead(unsigned char*, register int); - -bool MmapFile (char *filename,struct filemmap *fmmap); -void UnMmapFile(struct filemmap* fmmap); - - -/********************************************************/ -/*********************** font.h ***********************/ -/********************************************************/ -struct encoding { - struct encoding* next; - char* name; - char* charname[257]; -}; - -struct subfont { - struct subfont* next; - char* name; - char* infix; - int encoding; - int32_t charindex[256]; -}; - -#ifdef HAVE_FT2_OR_LIBT1 -struct psfontmap { - struct psfontmap *next; - char *line,*psfile,*tfmname,*encname,*end; - struct encoding* encoding; -#ifdef HAVE_FT2 - FT_Matrix* ft_transformp; - FT_Matrix ft_transform; - struct subfont* subfont; -#endif -#ifdef HAVE_LIBT1 - T1_TMATRIX* t1_transformp; - T1_TMATRIX t1_transform; -#endif -}; -#endif - -#define FONT_TYPE_PK 1 -#define FONT_TYPE_VF 2 -#define FONT_TYPE_FT 3 -#define FONT_TYPE_T1 4 -struct char_entry { /* PK/FT/T1 Glyph/VF Macro */ - dviunits tfmw; /* TFM width */ - unsigned char *data; /* glyph data, either pixel data - * (0=transp, 255=max ink) or VF macro */ - uint32_t length; /* Length of PK data or VF macro */ - /* Only used in pixel fonts */ - pixels w,h; /* width and height in pixels */ - subpixels xOffset, yOffset; /* x offset and y offset in subpixels */ - /* Only used in PK fonts */ - unsigned char *pkdata; /* Points to beginning of PK data */ - unsigned char flag_byte; /* PK flagbyte */ -}; - -struct font_entry { /* font entry */ - int type; /* PK/VF/Type1 ... */ - struct font_entry *next; - uint32_t c, s, d; - uint8_t a, l; - char n[STRSIZE]; /* FNT_DEF command parameters */ - int dpi; /* computed from s and d */ - char * name; /* full name of PK/VF file */ - struct filemmap fmmap; /* file memory map */ - uint32_t magnification; /* magnification read from font file */ - uint32_t designsize; /* design size read from font file */ - void * chr[NFNTCHARS]; /* character information */ -#ifdef HAVE_FT2 - FT_Face face; /* Freetype2 face */ -#endif -#ifdef HAVE_LIBT1 - int T1id; /* T1lib font id */ -#endif -#ifdef HAVE_FT2_OR_LIBT1 - struct psfontmap* psfontmap; /* Font transformation */ -#endif - struct font_num *vffontnump; /* VF local font numbering */ - int32_t defaultfont; /* VF default font number */ -}; - -struct font_num { /* Font number. Different for VF/DVI, and several - font_num can point to one font_entry */ - struct font_num *next; - int32_t k; - struct font_entry *fontp; -}; - -void CheckChecksum(uint32_t, uint32_t, const char*); -void InitPK (struct font_entry *newfontp); -void DonePK(struct font_entry *oldfontp); -void InitVF (struct font_entry *newfontp); -void DoneVF(struct font_entry *oldfontp); - -void FontDef(unsigned char*, void* /* dvi/vf */); -void ClearFonts(void); -void SetFntNum(int32_t, void* /* dvi/vf */); -void FreeFontNumP(struct font_num *hfontnump); - -#ifdef HAVE_FT2_OR_LIBT1 -char* copyword(char* orig); -struct psfontmap *NewPSFont(struct psfontmap* copyfrom); -void InitPSFontMap(void); -void ClearPSFontMap(void); -struct psfontmap* FindPSFontMap(char*); -struct encoding* FindEncoding(char*); -void ClearEncoding(void); -bool ReadTFM(struct font_entry *, char*); -#endif - -#ifdef HAVE_FT2 -bool InitFT(struct font_entry *); -void DoneFT(struct font_entry *tfontp); -void LoadFT(int32_t, struct char_entry *); -struct psfontmap* FindSubFont(struct psfontmap* entry, char* fontname); -void ClearSubfont(void); -#endif - -#ifdef HAVE_LIBT1 -bool InitT1(struct font_entry *); -void DoneT1(struct font_entry *tfontp); -void LoadT1(int32_t, struct char_entry *); -#endif - -/********************************************************/ -/********************* ppagelist.h ********************/ -/********************************************************/ - -bool ParsePages(const char*); -void FirstPage(int32_t,bool); -void LastPage(int32_t,bool); -void ClearPpList(void); -void Reverse(bool); -struct page_list* NextPPage(void* /* dvi */, struct page_list*); - - - - -#ifdef MAIN -#define EXTERN -#define INIT(x) =x -#else -#define EXTERN extern -#define INIT(x) -#endif - -/********************************************************/ -/********************** draw.h ************************/ -/********************************************************/ -#include "commands.h" - -void CreateImage(pixels width, pixels height); -void DestroyImage(void); -void DrawCommand(unsigned char*, void* /* dvi/vf */); -void DrawPages(void); -void WriteImage(char*, int); -void LoadPK(int32_t, register struct char_entry *); -int32_t SetChar(int32_t); -dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv); -void Gamma(double gamma); -int32_t SetVF(struct char_entry *ptr); -int32_t SetRule(int32_t, int32_t, int32_t, int32_t); -void SetSpecial(char *, int32_t, int32_t); -void BeginVFMacro(struct font_entry*); -void EndVFMacro(void); - -/**************************************************/ -void handlepapersize(const char*,int32_t*,int32_t*); - -void stringrgb(const char* colorstring,int *r,int *g,int *b); -void background(const char *); -void initcolor(void); -void popcolor(void); -void pushcolor(const char *); -void resetcolorstack(const char *); -void StoreColorStack(struct page_list *tpagep); -void ReadColorStack(struct page_list *tpagep); -void StoreBackgroundColor(struct page_list *tpagep); -void ClearColorNames(void); -void InitXColorPrologue(const char* prologuename); - -/**********************************************************************/ -/************************* Global Variables *************************/ -/**********************************************************************/ - -#ifdef MAKETEXPK -#ifdef HAVE_LIBKPATHSEA -EXTERN bool makeTexPK INIT(MAKE_TEX_PK_BY_DEFAULT); -#else -EXTERN bool makeTexPK INIT(_TRUE); -#endif -#endif - -EXTERN uint32_t usermag INIT(0); /* user specified magstep */ -EXTERN struct font_entry *hfontptr INIT(NULL); /* font list pointer */ - -EXTERN struct internal_state { - struct font_entry* currentfont; -} current_state; - -#define BE_NONQUIET 1 -#define BE_VERBOSE (1<<1) -#define PARSE_STDIN (1<<2) -#define EXPAND_BBOX (1<<3) -#define TIGHT_BBOX (1<<4) -#define FORCE_TRUECOLOR (1<<5) -#define USE_FREETYPE (1<<6) -#define USE_LIBT1 (1<<7) -#define REPORT_HEIGHT (1<<8) -#define REPORT_DEPTH (1<<9) -#define REPORT_WIDTH (1<<10) -#define DVI_PAGENUM (1<<11) -#define MODE_PICKY (1<<12) -#define GIF_OUTPUT (1<<13) -#define MODE_STRICT (1<<14) -#define NO_GHOSTSCRIPT (1<<15) -#define NO_GSSAFER (1<<16) -#define BG_TRANSPARENT (1<<17) -#define BG_TRANSPARENT_ALPHA (1<<18) -#define FORCE_PALETTE (1<<19) -EXTERN uint32_t option_flags INIT(BE_NONQUIET | USE_FREETYPE | USE_LIBT1); - -#define PAGE_GAVE_WARN 1 -#define PAGE_PREVIEW_BOP (1<<1) -#define PAGE_TRUECOLOR (1<<2) -EXTERN uint32_t page_flags INIT(0); - - -#ifdef DEBUG -EXTERN unsigned int debug INIT(0); -#define DEBUG_PRINT(a,b) if (debug & a) { printf b; fflush(stdout); } -#define DEBUG_DVI 1 -#define DEBUG_VF (1<<1) -#define DEBUG_PK (1<<2) -#define DEBUG_TFM (1<<3) -#define DEBUG_GLYPH (1<<4) -#define DEBUG_FT (1<<5) -#define DEBUG_ENC (1<<6) -#define DEBUG_COLOR (1<<7) -#define DEBUG_GS (1<<8) -#define DEBUG_T1 (1<<9) -#define LASTDEBUG DEBUG_T1 -#define DEBUG_DEFAULT DEBUG_DVI -#else -#define DEBUG_PRINT(a,b) -#endif - -/************************timing stuff*********************/ -#ifdef TIMING -# ifdef TIME_WITH_SYS_TIME -# include -# include -# else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -# endif -EXTERN double timer INIT(0); -EXTERN double my_tic,my_toc INIT(0); -EXTERN int ndone INIT(0); /* number of pages converted */ -# ifdef HAVE_GETTIMEOFDAY -EXTERN struct timeval Tp; -# define TIC { gettimeofday(&Tp, NULL); \ - my_tic= Tp.tv_sec + Tp.tv_usec/1000000.0;} -# define TOC { gettimeofday(&Tp, NULL); \ - my_toc += Tp.tv_sec + Tp.tv_usec/1000000.0 - my_tic;} -# else -# ifdef HAVE_FTIME -EXTERN struct timeb timebuffer; -# define TIC() { ftime(&timebuffer); \ - my_tic= timebuffer.time + timebuffer.millitm/1000.0; -# define TOC() { ftime(&timebuffer); \ - my_toc += timebuffer.time + timebuffer.millitm/1000.0 - my_tic;} -# else -# define TIC() -# define TOC() -# endif -# endif -#endif /* TIMING */ - -EXTERN char* user_mfmode INIT(NULL); -EXTERN int user_bdpi INIT(0); -EXTERN int dpi INIT(100); - -#ifdef HAVE_GDIMAGEPNGEX -EXTERN int compression INIT(1); -#endif -#undef min -#undef max -# define max(x,y) if ((y)>(x)) x = y -# define min(x,y) if ((y)<(x)) x = y - -/* These are in pixels*/ -EXTERN int x_min INIT(0); -EXTERN int y_min INIT(0); -EXTERN int x_max INIT(0); -EXTERN int y_max INIT(0); - -/* Page size: default set by -T */ -EXTERN int x_width_def INIT(0); -EXTERN int y_width_def INIT(0); - -/* Offset: default set by -O and -T bbox */ -EXTERN int x_offset_def INIT(0); -EXTERN int y_offset_def INIT(0); - -/* Preview-latex's tightpage */ -EXTERN int x_width_tightpage INIT(0); -EXTERN int y_width_tightpage INIT(0); -EXTERN int x_offset_tightpage INIT(0); -EXTERN int y_offset_tightpage INIT(0); - -/* Paper size: set by -t, for cropmark purposes only */ -/* This has yet to be written */ -EXTERN int x_pwidth INIT(0); -EXTERN int y_pwidth INIT(0); - -/* The transparent border preview-latex desires */ -EXTERN int borderwidth INIT(0); - -/* fallback color for transparent background */ -EXTERN bool userbordercolor INIT(FALSE); /* if true, use user-supplied color */ -EXTERN struct dvi_color bordercolor; - - -EXTERN gdImagePtr page_imagep INIT(NULL); -EXTERN int32_t shrinkfactor INIT(4); - -EXTERN struct dvi_color cstack[STACK_SIZE]; -EXTERN int csp INIT(1); - -EXTERN struct font_entry* currentfont; -EXTERN struct dvi_data* dvi INIT(NULL); - -#ifdef HAVE_FT2 -EXTERN FT_Library libfreetype INIT(NULL); -#endif - -#ifdef HAVE_LIBT1 -EXTERN void* libt1 INIT(NULL); -#endif - -#define EXIT_FATAL EXIT_FAILURE+1 -EXTERN int exitcode INIT(EXIT_SUCCESS); - -#endif /* DVIPNG_H */ diff --git a/Build/source/texk/dvipng/dvipng-1.13/enc.c b/Build/source/texk/dvipng/dvipng-1.13/enc.c deleted file mode 100644 index 3a17d2a82fa..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/enc.c +++ /dev/null @@ -1,128 +0,0 @@ -/* enc.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2008 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -struct encoding* encodingp=NULL; - -static struct encoding* InitEncoding(char* encoding) -{ - char *pos,*max,*buf,*enc_file; - int i; - struct encoding* encp=NULL; - struct filemmap fmmap; - boolean mmapfailed; - -#ifdef HAVE_KPSE_ENC_FORMATS - enc_file=kpse_find_file(encoding,kpse_enc_format,false); -#else - enc_file=kpse_find_file(encoding,kpse_tex_ps_header_format,false); -#endif - if (enc_file == NULL) { - Warning("encoding file %s could not be found",encoding); - return(NULL); - } - DEBUG_PRINT((DEBUG_FT|DEBUG_ENC),("\n OPEN ENCODING:\t'%s'", enc_file)); - mmapfailed = MmapFile(enc_file,&fmmap); - free(enc_file); - if (mmapfailed) - return(NULL); - if ((encp = calloc(sizeof(struct encoding)+strlen(encoding)+1 - +fmmap.size,1))==NULL) { - Warning("cannot alloc space for encoding",encoding); - UnMmapFile(&fmmap); - return(NULL); - } - encp->name=(char*)encp+sizeof(struct encoding); - strcpy(encp->name,encoding); - pos=fmmap.data; - max=fmmap.data+fmmap.size; - buf=encp->name+strlen(encoding)+1; -#define SKIPCOMMENT(x) if (*x=='%') while (xcharname[256]=buf; - while(poscharname[256])); - while (pos < max && *pos!='[') { - SKIPCOMMENT(pos); - pos++; - } - while(poscharname[i++]=buf; - while(poscharname[i-1])); - while(posname)!=0) - temp=temp->next; - if (temp==NULL) { - temp=InitEncoding(encoding); - if (temp!=NULL) { - temp->next=encodingp; - encodingp=temp; - } - } - return(temp); -} - -void ClearEncoding(void) -{ - struct encoding *temp=encodingp; - - while(temp!=NULL) { - encodingp=encodingp->next; - free(temp); - temp=encodingp; - } -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/font.c b/Build/source/texk/dvipng/dvipng-1.13/font.c deleted file mode 100644 index 2a8b59b9723..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/font.c +++ /dev/null @@ -1,356 +0,0 @@ -/* font.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -void CheckChecksum(uint32_t c1, uint32_t c2, const char* name) -{ - /* Report a warning if both checksums are nonzero, they don't match, - and the user hasn't turned it off. */ - if (c1 && c2 && c1 != c2 -#ifdef HAVE_LIBKPATHSEA - && !kpse_tex_hush ("checksum") -#endif - ) { - Warning ("checksum mismatch in %s", name) ; - } -} - - -static double ActualFactor(uint32_t unmodsize) -/* compute the actual size factor given the approximation */ -/* actually factor * 1000 */ -{ - double realsize; /* the actual magnification factor */ - realsize = (double)unmodsize / 1000.0; - if (abs((int)(unmodsize - 1095l))<2) - realsize = 1.095445115; /*stephalf*/ - else if (abs((int)(unmodsize - 1315l))<2) - realsize = 1.31453414; /*stepihalf*/ - else if (abs((int)(unmodsize - 1577l))<2) - realsize = 1.57744097; /*stepiihalf*/ - else if (abs((int)(unmodsize - 1893l))<2) - realsize = 1.89292916; /*stepiiihalf*/ - else if (abs((int)(unmodsize - 2074l))<2) - realsize = 2.0736; /*stepiv*/ - else if (abs((int)(unmodsize - 2488l))<2) - realsize = 2.48832; /*stepv*/ - else if (abs((int)(unmodsize - 2986l))<2) - realsize = 2.985984; /*stepvi*/ - /* the remaining magnification steps are represented with sufficient - accuracy already */ - return(realsize); -} - - -void FontDef(unsigned char* command, void* parent) -{ - int32_t k; - uint32_t c, s, d; - uint8_t a, l; - unsigned char* current; - struct font_entry *tfontptr; /* temporary font_entry pointer */ - struct font_num *tfontnump = NULL; /* temporary font_num pointer */ - unsigned short i; - - current = command + 1; - k = UNumRead(current, (int)*command - FNT_DEF1 + 1); - current += (int)*command - FNT_DEF1 + 1; - c = UNumRead(current, 4); /* checksum */ - s = UNumRead(current+4, 4); /* space size */ - d = UNumRead(current+8, 4); /* design size */ - a = UNumRead(current+12, 1); /* length for font name */ - l = UNumRead(current+13, 1); /* device length */ - if (((struct font_entry*)parent)->type==FONT_TYPE_VF) { - DEBUG_PRINT(DEBUG_VF,(" %d %d %d",k,c,s)); - /* Rescale. s is relative to the actual scale /(1<<20) */ - s = (uint32_t)((uint64_t) s * (((struct font_entry*) parent)->s) - / (1<<20)); - DEBUG_PRINT(DEBUG_VF,(" (%d) %d",s,d)); - /* Oddly, d differs in the DVI and the VF that my system produces */ - d = (uint32_t)((uint64_t) d * ((struct font_entry*)parent)->d - / ((struct font_entry*)parent)->designsize); - DEBUG_PRINT(DEBUG_VF,(" (%d)",d)); - DEBUG_PRINT(DEBUG_VF,(" %d %d '%.*s'",a,l,a+l,current+14)); -#ifdef DEBUG - } else { - DEBUG_PRINT(DEBUG_DVI,(" %d %d %d %d %d %d '%.*s'",k,c,s,d,a,l, - a+l,current+14)); -#endif - } - if (a+l > STRSIZE-1) - Fatal("too long font name for font %ld",k); - - /* Find entry with this font number in use */ - switch (((struct font_entry*)parent)->type) { - case FONT_TYPE_VF: - tfontnump = ((struct font_entry*)parent)->vffontnump; - break; - case DVI_TYPE: - tfontnump = ((struct dvi_data*)parent)->fontnump; - } - while (tfontnump != NULL && tfontnump->k != k) { - tfontnump = tfontnump->next; - } - /* If found, return if it is correct */ - if (tfontnump!=NULL - && tfontnump->fontp->s == s - && tfontnump->fontp->d == d - && strlen(tfontnump->fontp->n) == a+l - && strncmp(tfontnump->fontp->n,(char*)current+14,a+l) == 0) { - DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tMatch found",k)); - return; - } - /* If not found, create new */ - if (tfontnump==NULL) { - if ((tfontnump=malloc(sizeof(struct font_num)))==NULL) - Fatal("cannot malloc memory for new font number"); - tfontnump->k=k; - switch (((struct font_entry*)parent)->type) { - case FONT_TYPE_VF: - tfontnump->next=((struct font_entry*)parent)->vffontnump; - ((struct font_entry*)parent)->vffontnump=tfontnump; - break; - case DVI_TYPE: - tfontnump->next=((struct dvi_data*)parent)->fontnump; - ((struct dvi_data*)parent)->fontnump=tfontnump; - } - } - - /* Search font list for possible match */ - tfontptr = hfontptr; - while (tfontptr != NULL - && (tfontptr->s != s - || tfontptr->d != d - || strlen(tfontptr->n) != a+l - || strncmp(tfontptr->n,(char*)current+14,a+l) != 0 ) ) { - tfontptr = tfontptr->next; - } - /* If found, set its number and return */ - if (tfontptr!=NULL) { - DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tMatch found, number set",k)); - tfontnump->fontp = tfontptr; - return; - } - - DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tNew entry created",k)); - /* No fitting font found, create new entry. */ - if ((tfontptr = calloc(1,sizeof(struct font_entry))) == NULL) - Fatal("cannot malloc space for font_entry"); - tfontptr->next = hfontptr; - hfontptr = tfontptr; - tfontnump->fontp = tfontptr; -#ifndef WIN32 - tfontptr->fmmap.fd = 0; -#else /* WIN32 */ - tfontptr->fmmap.hFile = INVALID_HANDLE_VALUE; -#endif - tfontptr->c = c; /* checksum */ - tfontptr->s = s; /* space size */ - tfontptr->d = d; /* design size */ - tfontptr->a = a; /* length for font name */ - tfontptr->l = l; /* device length */ - strncpy(tfontptr->n,(char*)current+14,a+l); /* full font name */ - tfontptr->n[a+l] = '\0'; - - tfontptr->name = NULL; - for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) { - tfontptr->chr[i] = NULL; - } - - tfontptr->dpi = - (uint32_t)((ActualFactor((uint32_t)(1000.0*tfontptr->s - /(double)tfontptr->d+0.5)) - * ActualFactor(dvi->mag) * dpi*shrinkfactor) + 0.5); -#ifdef HAVE_FT2_OR_LIBT1 - tfontptr->psfontmap=NULL; -#endif -} - -#ifdef HAVE_FT2_OR_LIBT1 -static char* kpse_find_t1_or_tt(char* filename) -{ - char* filepath = kpse_find_file(filename, kpse_type1_format, false); -#ifdef HAVE_FT2 - if ((option_flags & USE_FREETYPE) && filepath==NULL) - filepath = kpse_find_file(filename, kpse_truetype_format, false); -#endif - return(filepath); -} -#endif - -static void FontFind(struct font_entry * tfontptr) -{ - kpse_glyph_file_type font_ret; - - /* tfontptr->dpi = kpse_magstep_fix (tfontptr->dpi, resolution, NULL); */ - DEBUG_PRINT(DEBUG_DVI,("\n FIND FONT:\t%s %d",tfontptr->n,tfontptr->dpi)); - - tfontptr->name = kpse_find_vf (tfontptr->n); - if (tfontptr->name!=NULL) - InitVF(tfontptr); -#ifdef HAVE_FT2_OR_LIBT1 - else if (option_flags & (USE_FREETYPE | USE_LIBT1)) { - tfontptr->psfontmap = FindPSFontMap(tfontptr->n); - if (tfontptr->psfontmap!=NULL) - tfontptr->name=kpse_find_t1_or_tt(tfontptr->psfontmap->psfile); - else - tfontptr->name=kpse_find_t1_or_tt(tfontptr->n); - if (tfontptr->name!=NULL) { - char* tfmname=kpse_find_file(tfontptr->n, kpse_tfm_format, false); - if (tfmname!=NULL) { - if (!ReadTFM(tfontptr,tfmname)) { - Warning("unable to read tfm file %s", tfmname); - free(tfontptr->name); - tfontptr->name=NULL; - } else -#ifdef HAVE_FT2 - if ((option_flags & USE_FREETYPE)==0 || !InitFT(tfontptr)) { -#endif -#ifdef HAVE_LIBT1 - if ((option_flags & USE_LIBT1)==0 || !InitT1(tfontptr)) { -#endif - /* if Freetype or T1 loading fails for some reason, fall - back to PK font */ - free(tfontptr->name); - tfontptr->name=NULL; -#ifdef HAVE_LIBT1 - } -#endif -#ifdef HAVE_FT2 - } -#endif - free(tfmname); - } - } - } -#endif /* HAVE_FT2_OR_LIBT1 */ - if (tfontptr->name==NULL) { - tfontptr->name=kpse_find_pk (tfontptr->n, tfontptr->dpi, &font_ret); - if (tfontptr->name!=NULL) { - if (!FILESTRCASEEQ (tfontptr->n, font_ret.name)) { - page_flags |= PAGE_GAVE_WARN; - Warning("font %s not found, using %s at %d dpi instead", - tfontptr->n, font_ret.name, font_ret.dpi); - tfontptr->c = 0; /* no checksum warning */ - } else if (!kpse_bitmap_tolerance ((double)font_ret.dpi, - (double) tfontptr->dpi)) { - page_flags |= PAGE_GAVE_WARN; - Warning("font %s at %d dpi not found, using %d dpi instead", - tfontptr->n, tfontptr->dpi, font_ret.dpi); - } - InitPK(tfontptr); - } else { - page_flags |= PAGE_GAVE_WARN; - Warning("font %s at %d dpi not found, characters will be left blank", - tfontptr->n, tfontptr->dpi); -#ifndef WIN32 - tfontptr->fmmap.fd = 0; -#else /* WIN32 */ - tfontptr->fmmap.hFile = INVALID_HANDLE_VALUE; -#endif - tfontptr->magnification = 0; - tfontptr->designsize = 0; - } - } -} - - -static void DoneFont(struct font_entry *tfontp) -{ - switch (tfontp->type) { - case FONT_TYPE_PK: - DonePK(tfontp); - break; - case FONT_TYPE_VF: - DoneVF(tfontp); - break; -#ifdef HAVE_FT2 - case FONT_TYPE_FT: - DoneFT(tfontp); - break; -#endif -#ifdef HAVE_LIBT1 - case FONT_TYPE_T1: - DoneT1(tfontp); - break; -#endif - } -} - - -void FreeFontNumP(struct font_num *hfontnump) -{ - struct font_num *tmp; - while(hfontnump!=NULL) { - tmp=hfontnump->next; - free(hfontnump); - hfontnump=tmp; - } -} - -void ClearFonts(void) -{ - struct font_entry *tmp; - - while(hfontptr!=NULL) { - tmp=hfontptr->next; - DoneFont(hfontptr); - if (hfontptr->name != NULL) - free(hfontptr->name); - free(hfontptr); - hfontptr=tmp; - } - if (dvi!=NULL) - FreeFontNumP(dvi->fontnump); -} - -/*-->SetFntNum*/ -/**********************************************************************/ -/**************************** SetFntNum *****************************/ -/**********************************************************************/ -void SetFntNum(int32_t k, void* parent /* dvi/vf */) -/* this routine is used to specify the font to be used in printing future - characters */ -{ - struct font_num *tfontnump=NULL; /* temporary font_num pointer */ - - switch (((struct font_entry*)parent)->type) { - case FONT_TYPE_VF: - tfontnump = ((struct font_entry*)parent)->vffontnump; - break; - case DVI_TYPE: - tfontnump = ((struct dvi_data*)parent)->fontnump; - } - while (tfontnump != NULL && tfontnump->k != k) - tfontnump = tfontnump->next; - if (tfontnump == NULL) - Fatal("font %d undefined", k); - - currentfont = tfontnump->fontp; - if (currentfont->name==NULL) - FontFind(currentfont); -} - - diff --git a/Build/source/texk/dvipng/dvipng-1.13/fontmap.c b/Build/source/texk/dvipng/dvipng-1.13/fontmap.c deleted file mode 100644 index c779d6674b4..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/fontmap.c +++ /dev/null @@ -1,340 +0,0 @@ -/* fontmap.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -static struct filemmap psfont_mmap; -#ifdef HAVE_FT2 -static struct filemmap ttfont_mmap; -#endif -static struct psfontmap *psfontmap=NULL; - -static char* newword(char** buffer, char* end) -{ - char *word,*pos=*buffer; - - while(posline = copyfrom->line; - newentry->tfmname = copyword(copyfrom->tfmname); - newentry->psfile = copyword(copyfrom->psfile); - newentry->encname = copyword(copyfrom->encname); - newentry->encoding = copyfrom->encoding; -#ifdef HAVE_LIBT1 - newentry->t1_transformp = copyfrom->t1_transformp; -#endif -#ifdef HAVE_FT2 - newentry->ft_transformp = copyfrom->ft_transformp; - newentry->subfont = copyfrom->subfont; -#endif - newentry->end = copyfrom->end; - } else { - newentry->line = NULL; - newentry->tfmname = NULL; - newentry->psfile = NULL; - newentry->encname = NULL; - newentry->encoding = NULL; -#ifdef HAVE_LIBT1 - newentry->t1_transformp = NULL; -#endif -#ifdef HAVE_FT2 - newentry->ft_transformp = NULL; - newentry->subfont = NULL; -#endif - newentry->end = NULL; - } - newentry->next=psfontmap; - psfontmap=newentry; - return(newentry); -} - -static struct psfontmap *SearchPSFontMap(char* fontname, - struct filemmap* search_mmap) -{ - static char *pos=NULL,*end=NULL; - static struct filemmap* searching_mmap=NULL; - struct psfontmap *entry=NULL; - - if (pos==end && search_mmap!=searching_mmap) { - searching_mmap=search_mmap; - pos=searching_mmap->data; - end=searching_mmap->data+searching_mmap->size; - } - while(postfmname,fontname)!=0)) { - while(pos < end - && (*pos=='\n' || *pos==' ' || *pos=='\t' - || *pos=='%' || *pos=='*' || *pos==';' || *pos=='#')) { - while(pos < end && *pos!='\n') pos++; /* skip comments/empty rows */ - pos++; - } - if (pos < end) { - entry=NewPSFont(NULL); - entry->line = pos; - /* skip tfmname = newword(&pos,end); - while(pos < end && *pos!='\n') pos++; - entry->end = pos; - } - pos++; - } - if (entry!=NULL && strcmp(entry->tfmname,fontname)!=0) - entry=NULL; - return(entry); -} - -void ClearPSFontMap(void) -{ - struct psfontmap *entry; - - while(psfontmap!=NULL) { - entry=psfontmap; - psfontmap=psfontmap->next; - free(entry->tfmname); - if (entry->psfile!=NULL) - free(entry->psfile); - if (entry->encname!=NULL) - free(entry->encname); - free(entry); - } - UnMmapFile(&psfont_mmap); -#ifdef HAVE_FT2 - UnMmapFile(&ttfont_mmap); -#endif -} - -static void ReadPSFontMap(struct psfontmap *entry) -{ - char *pos,*end,*psname; - int nameno = 0; - - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\n PSFONTMAP: %s ",entry->tfmname)); - pos=entry->line; - end=entry->end; - while(pos < end) { - if (*pos=='<') { /* filename follows */ - pos++; - if (pospsfile = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<%s ",entry->psfile)); - } else if (posencname = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); - } else { /* encname=word; - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); - } else { /* psfile=word; - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<%s ",entry->psfile)); - } - } - } else if (*pos=='"') { /* PS code: reencoding/tranformation exists */ - char *word; - double cxx=1.0,cxy=0.0; - pos++; - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\"")); - while(pos < end && *pos!='"') { - word=newword((char**)&pos,end); - while(pos < end && (*pos==' ' || *pos=='\t')) pos++; - if (pos+10ft_transformp=&(entry->ft_transform); - entry->ft_transform.xx=(FT_Fixed)(cxx*0x10000); - entry->ft_transform.xy=(FT_Fixed)(cxy*0x10000); - entry->ft_transform.yx=0; - entry->ft_transform.yy=0x10000; -#endif -#ifdef HAVE_LIBT1 - entry->t1_transformp=&(entry->t1_transform); - entry->t1_transform.cxx=cxx; - entry->t1_transform.cxy=cxy; - entry->t1_transform.cyx=0.0; - entry->t1_transform.cyy=1.0; -#endif - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\" ")); - pos++; - } else { /* bare word */ - switch (++nameno) { - case 1: /* first word is tfmname and perhaps psname, NOT psfile */ - while(postfmname; - break; - case 2: /* second word is psname, NOT psfile */ - psname = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("(%s) ",psname)); - free(psname); - break; - case 3: /* third word is encoding */ - entry->encname = newword((char**)&pos,end); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); - break; - default: - while(pospsfile==NULL) { - /* No psfile-name given, use tfmname */ - entry->psfile=copyword(entry->tfmname); - DEBUG_PRINT((DEBUG_FT|DEBUG_T1),(" <%s ",entry->psfile)); - } - if (entry->encname!=NULL - && (entry->encoding=FindEncoding(entry->encname))==NULL) - Warning("unable to load font encoding '%s' for %s", - entry->encname,entry->tfmname); -} - - -struct psfontmap* FindPSFontMap(char* fontname) -{ - struct psfontmap *entry; - static struct filemmap* search_mmap_p=&psfont_mmap; - - entry=psfontmap; - while(entry!=NULL && strcmp(entry->tfmname,fontname)!=0) - entry=entry->next; - if(entry==NULL) { - entry=SearchPSFontMap(fontname,search_mmap_p); -#ifdef HAVE_FT2 - if(entry==NULL && search_mmap_p!=&ttfont_mmap) { - search_mmap_p=&ttfont_mmap; - entry=SearchPSFontMap(fontname,search_mmap_p); - } - } - if(entry==NULL) { - struct psfontmap* entry_subfont=NULL; - entry=psfontmap; - while(entry!=NULL && strcmp(entry->tfmname,fontname)!=0) { - while(entry!=NULL && strchr(entry->tfmname,'@')==NULL) - entry=entry->next; - if (entry!=NULL) { - entry_subfont=FindSubFont(entry,fontname); - if (entry_subfont!=NULL) - entry=entry_subfont; - else - entry=entry->next; - } - } -#endif - } - if (entry!=NULL && entry->psfile==NULL) - ReadPSFontMap(entry); - if (entry!=NULL && entry->encname!=NULL && entry->encoding==NULL) - /* Encoding given but it cannot be found. Unusable font */ - return(NULL); - return(entry); -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/ft.c b/Build/source/texk/dvipng/dvipng-1.13/ft.c deleted file mode 100644 index fdb8a89489c..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/ft.c +++ /dev/null @@ -1,173 +0,0 @@ -/* ft.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2009 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -void LoadFT(int32_t c, struct char_entry * ptr) -{ - FT_Bitmap bitmap; - FT_UInt glyph_i; - int i,j,k; - unsigned char* bit; - - DEBUG_PRINT(DEBUG_FT,("\n LOAD FT CHAR\t%d (%d)",c,ptr->tfmw)); - if (currentfont->psfontmap!=NULL - && currentfont->psfontmap->encoding != NULL) { - DEBUG_PRINT(DEBUG_FT,(" %s",currentfont->psfontmap->encoding->charname[c])); - glyph_i = FT_Get_Name_Index(currentfont->face, - currentfont->psfontmap->encoding->charname[c]); - } else if (currentfont->psfontmap!=NULL - && currentfont->psfontmap->subfont != NULL) { - glyph_i = FT_Get_Char_Index( currentfont->face, - currentfont->psfontmap->subfont->charindex[c] ); - DEBUG_PRINT(DEBUG_FT,(" 0x%X",currentfont->psfontmap->subfont->charindex[c])); - } else - glyph_i = FT_Get_Char_Index( currentfont->face, c ); - if (FT_Load_Glyph( currentfont->face, glyph_i, - FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT ) - /* On some configurations (with FreeType <= 2.1.7) the above - fails, while the below works */ - && FT_Load_Glyph( currentfont->face, glyph_i, - FT_LOAD_RENDER | FT_LOAD_NO_HINTING )) - Fatal("cannot load FT char %d",c); - ptr->xOffset = -currentfont->face->glyph->bitmap_left*shrinkfactor; - ptr->yOffset = (currentfont->face->glyph->bitmap_top-1)*shrinkfactor; - bitmap=currentfont->face->glyph->bitmap; - DEBUG_PRINT(DEBUG_FT,(" (%dx%d)",bitmap.width,bitmap.rows)); - - if ((ptr->data = calloc(bitmap.width*bitmap.rows,sizeof(char))) == NULL) - Fatal("unable to malloc image space for char %c", (char)c); - ptr->w = bitmap.width; - ptr->h = bitmap.rows; - -#define GREYLEVELS 16 - DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); - bit=ptr->data; - for(i=0;i0 ? k*16-1 : 0; */ - DEBUG_PRINT(DEBUG_GLYPH,("%3u ",k)); - bit[i*bitmap.width+j]=k; - } - DEBUG_PRINT(DEBUG_GLYPH,("|\n")); - } -} - -bool InitFT(struct font_entry * tfontp) -{ - int error; - - if (libfreetype==NULL) { - if (FT_Init_FreeType( &libfreetype )) { - Warning("an error occured during freetype initialisation, disabling it"); - option_flags &= ~USE_FREETYPE; - return(false); - } -# ifdef DEBUG - else { - FT_Int amajor, aminor, apatch; - - DEBUG_PRINT(DEBUG_FT,("\n COMPILED WITH FREETYPE %d.%d.%d", - FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH)); -# ifdef HAVE_FT_LIBRARY_VERSION - FT_Library_Version( libfreetype, &amajor, &aminor, &apatch ); - DEBUG_PRINT(DEBUG_FT,("\n USING LIBFT %d.%d.%d", - amajor, aminor, apatch)); -# endif - } -# endif - } - DEBUG_PRINT((DEBUG_DVI|DEBUG_FT),("\n OPEN FT FONT:\t'%s'", tfontp->name)); - error = FT_New_Face( libfreetype, tfontp->name, 0, &tfontp->face ); - if (error == FT_Err_Unknown_File_Format) { - Warning("font file %s has unknown format", tfontp->name); - return(false); - } else if (error) { - Warning("font file %s could not be opened", tfontp->name); - return(false); - } - Message(BE_VERBOSE,"<%s>", tfontp->name); - if (tfontp->psfontmap != NULL && tfontp->psfontmap->subfont != NULL) - error=FT_Select_Charmap(tfontp->face, tfontp->psfontmap->subfont->encoding); - else if (tfontp->psfontmap == NULL || tfontp->psfontmap->encoding == NULL) -#ifndef FT_ENCODING_ADOBE_CUSTOM -# define FT_ENCODING_ADOBE_CUSTOM ft_encoding_adobe_custom -# define FT_ENCODING_ADOBE_STANDARD ft_encoding_adobe_standard -#endif - error=FT_Select_Charmap(tfontp->face, FT_ENCODING_ADOBE_CUSTOM); - if (error) { - Warning("unable to set font encoding for %s", tfontp->name); - if(FT_Select_Charmap( tfontp->face, FT_ENCODING_ADOBE_STANDARD )) { - Warning("unable to set fallback font encoding for %s", tfontp->name); - return(false); - } - } - if (FT_Set_Char_Size( tfontp->face, /* handle to face object */ - 0, /* char_width in 1/64th of points */ - ((int64_t)tfontp->d*64*7200)/7227/65536, - /* char_height in 1/64th of _big_points, - not TeX points */ - tfontp->dpi/shrinkfactor, /* horizontal resolution */ - tfontp->dpi/shrinkfactor )) /* vertical resolution */ { - Warning("unable to set font size for %s", tfontp->name); - return(false); - } - if (tfontp->psfontmap!=NULL) - FT_Set_Transform(tfontp->face, tfontp->psfontmap->ft_transformp, NULL); - tfontp->type = FONT_TYPE_FT; - return(true); -} - - -static void UnLoadFT(struct char_entry *ptr) -{ - if (ptr->data!=NULL) - free(ptr->data); - ptr->data=NULL; -} - - -void DoneFT(struct font_entry *tfontp) -{ - int c=0; - - int error = FT_Done_Face( tfontp->face ); - if (error) - Warning("font file %s could not be closed", tfontp->name); - while(cchr[c]!=NULL) { - UnLoadFT((struct char_entry*)tfontp->chr[c]); - free(tfontp->chr[c]); - tfontp->chr[c]=NULL; - } - c++; - } - if (tfontp->name!=NULL) - free(tfontp->name); - tfontp->name=NULL; -} - - diff --git a/Build/source/texk/dvipng/dvipng-1.13/miktex.h b/Build/source/texk/dvipng/dvipng-1.13/miktex.h deleted file mode 100644 index c949cd1aff6..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/miktex.h +++ /dev/null @@ -1,272 +0,0 @@ -/* config.h. Edited for MiKTeX. */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2008 Jan-Åke Larsson - -************************************************************************/ - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define as 1 to get the debug (-d) option. */ -#define DEBUG 1 - -/* The environment setting for $SELFAUTODIR */ -#undef ENV_SELFAUTODIR - -/* The environment setting for $SELFAUTOLOC */ -#undef ENV_SELFAUTOLOC - -/* The environment setting for $SELFAUTOPARENT */ -#undef ENV_SELFAUTOPARENT - -/* Define as the path to GhostScript. */ -#undef GS_PATH - -/* Define to 1 if you have `alloca', as a function or macro. */ -#define HAVE_ALLOCA 1 - -/* Define to 1 if you have and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 - -/* Define to 1 if you have the header file. */ -#define HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if you have freetype2 */ -#undef HAVE_FT2 - -/* Define to 1 if you have the `ftime' function. */ -#undef HAVE_FTIME - -/* Define to 1 if you have the `FT_Library_Version' function. */ -#undef HAVE_FT_LIBRARY_VERSION - -/* Define to 1 if you have the `gdImageAlphaBlending' function. */ -#undef HAVE_GDIMAGEALPHABLENDING - -/* Define to 1 if you have the `gdImageColorResolveAlpha' function. */ -#undef HAVE_GDIMAGECOLORRESOLVEALPHA - -/* Define to 1 if you have the `gdImageCreateTrueColor' function. */ -#define HAVE_GDIMAGECREATETRUECOLOR 1 - -/* Define to 1 if you have the `gdImageGif' function. */ -#undef HAVE_GDIMAGEGIF - -/* Define to 1 if you have the `gdImagePngEx' function. */ -#define HAVE_GDIMAGEPNGEX 1 - -/* Define to 1 if you have the `gdImageTrueColorToPalette' function. */ -#define HAVE_GDIMAGETRUECOLORTOPALETTE 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_GD_H 1 - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_KPATHSEA_KPATHSEA_H 1 - -/* Define to 1 if your kpathsea has kpse_enc_format */ -#define HAVE_KPSE_ENC_FORMATS 1 - -/* Define to 1 if you have the `gd' library (-lgd). */ -#define HAVE_LIBGD 1 - -/* Define to 1 if you have the `gen' library (-lgen). */ -#undef HAVE_LIBGEN - -/* Define to 1 if you have the `kpathsea' library (-lkpathsea). */ -#define HAVE_LIBKPATHSEA 1 - -/* Define to 1 if you have the `m' library (-lm). */ -#define HAVE_LIBM 1 - -/* Define to 1 if you have the `png' library (-lpng). */ -#define HAVE_LIBPNG 1 - -/* Define to 1 if you have the `t1' library (-lt1). */ -#undef HAVE_LIBT1 - -/* Define to 1 if you have the `z' library (-lz). */ -#undef HAVE_LIBZ - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#define HAVE_MEMSET 1 - -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* Define to 1 if you have the header file. */ -#define HAVE_PNG_H 1 - -/* Define to 1 if you have the `pow' function. */ -#undef HAVE_POW - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if stdbool.h conforms to C99. */ -#undef HAVE_STDBOOL_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_T1LIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vfork' function. */ -#undef HAVE_VFORK - -/* Define to 1 if you have the header file. */ -#undef HAVE_VFORK_H - -/* Define to 1 if you have the `vprintf' function. */ -#define HAVE_VPRINTF 1 - -/* Define to 1 if `fork' works. */ -#undef HAVE_WORKING_FORK - -/* Define to 1 if `vfork' works. */ -#undef HAVE_WORKING_VFORK - -/* Define to 1 if the system has the type `_Bool'. */ -#undef HAVE__BOOL 1 - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "dvipng@nongnu.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "dvipng" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "dvipng 1.7" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "dvipng" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.7" - -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* Define as 1 to get execution time output. */ -#undef TIMING - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `long long' if does not define it. */ -#undef int64_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `int' if does not define. */ -#undef pid_t - -/* Define to `unsigned' if does not define. */ -#undef size_t - -/* Define to `unsigned long long' if does not define it. */ -#undef uint64_t - -/* Define as `fork' if `vfork' does not work. */ -#undef vfork diff --git a/Build/source/texk/dvipng/dvipng-1.13/miktex.mak b/Build/source/texk/dvipng/dvipng-1.13/miktex.mak deleted file mode 100644 index b291ba67207..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/miktex.mak +++ /dev/null @@ -1,196 +0,0 @@ -## miktex.mak: dvipng -## -## Copyright (C) 2004 Christian Schenk -## -## This file is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published -## by the Free Software Foundation; either version 2, or (at your -## option) any later version. -## -## This file is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this file; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301 USA. - -miktex_cc_no_warnings = 1 -miktex_cc_disable_optimization = 1 - -!include ..\miktex.inc - -objects = \ - $(outdir)\color.obj \ - $(outdir)\draw.obj \ - $(outdir)\dvi.obj \ - $(outdir)\dvipng.obj \ - $(outdir)\font.obj \ - $(outdir)\misc.obj \ - $(outdir)\papersiz.obj \ - $(outdir)\pk.obj \ - $(outdir)\ppagelist.obj \ - $(outdir)\set.obj \ - $(outdir)\special.obj \ - $(outdir)\vf.obj \ - $(wrapper_obj) \ - -sources = \ - color.c \ - draw.c \ - dvi.c \ - dvipng.c \ - font.c \ - misc.c \ - papersiz.c \ - pk.c \ - ppagelist.c \ - set.c \ - special.c \ - vf.c \ - -extra_cdefines = \ - -Dalloca=_alloca \ - -DUSE_MIKTEX_EXIT \ - -extra_cincludes = \ - -I$(gdlibdir) \ - -I$(kpslibdir) \ - -.c{$(outdir)\}.obj: - $(cc) $(cstandard) \ - $(extra_cdefines) \ - $(extra_cincludes) \ - $(ccopt_output_directory)$(outdir)\ $< - -binaries = $(outdir)\dvipng.exe - -all: common-all $(binaries) - -install: common-install install-binaries - -qrt: common-qrt - -# ----------------------------------------------------------------------------- -# dvipng -# ----------------------------------------------------------------------------- - -libs = \ - $(miktex_lib) \ - $(gd_lib) \ - $(kps_lib) \ - $(gnu_lib) \ - $(texmf_lib) \ - -$(outdir)\dvipng.exe: \ - $(outdir) \ - $(objects) \ - $(libs) \ - $(outdir)\dvipng.res \ - - $(link) $(lstandard) \ - -out:$@ \ - $(objects) \ - $(libs) \ - $(outdir)\dvipng.res \ - -$(outdir)\dvipng.res: \ - $(libdir)\miktex-version.h \ - $(outdir) \ - dvipng-version.h \ - dvipng.rc \ - - $(rc) $(rcstandard) $(rcopt_output_file)$@ dvipng.rc - -# ----------------------------------------------------------------------------- -# clean-up -# ----------------------------------------------------------------------------- - -mostlyclean: common-mostlyclean - -clean: common-clean mostlyclean - -distclean: common-distclean clean - -realclean: common-realclean distclean - -# ----------------------------------------------------------------------------- -# dependencies -# ----------------------------------------------------------------------------- - -!include ..\common-dependencies.inc - -depend: $(sources) - $(MAKEDEPEND1) $(extra_cincludes) $(extra_cdefines) $(sources) - -# DO NOT DELETE - -$(outdir)\color.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\color.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\color.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\color.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\color.obj: ..\lib\miktex-features.h commands.h -$(outdir)\draw.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\draw.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\draw.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\draw.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\draw.obj: ..\lib\miktex-features.h commands.h -$(outdir)\dvi.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\dvi.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\dvi.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\dvi.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\dvi.obj: ..\lib\miktex-features.h commands.h ..\libgnu\gnu-miktex.h -$(outdir)\dvipng.obj: dvipng.h config.h .\inttypes.h -$(outdir)\dvipng.obj: $(gdlibdir)\gd.h $(gdlibdir)\gd_io.h -$(outdir)\dvipng.obj: $(gdlibdir)\gdfx.h -$(outdir)\dvipng.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\dvipng.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\dvipng.obj: ..\lib\miktex-features.h commands.h -$(outdir)\font.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\font.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\font.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\font.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\font.obj: ..\lib\miktex-features.h commands.h -$(outdir)\misc.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\misc.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\misc.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\misc.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\misc.obj: ..\lib\miktex-features.h commands.h -$(outdir)\misc.obj: ..\libgnu\gnu-miktex.h -$(outdir)\papersiz.obj: dvipng.h config.h .\inttypes.h -$(outdir)\papersiz.obj: $(gdlibdir)\gd.h -$(outdir)\papersiz.obj: $(gdlibdir)\gd_io.h -$(outdir)\papersiz.obj: $(gdlibdir)\gdfx.h -$(outdir)\papersiz.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\papersiz.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\papersiz.obj: ..\lib\miktex-features.h commands.h -$(outdir)\pk.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\pk.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\pk.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\pk.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\pk.obj: ..\lib\miktex-features.h commands.h -$(outdir)\ppagelist.obj: dvipng.h config.h .\inttypes.h -$(outdir)\ppagelist.obj: $(gdlibdir)\gd.h -$(outdir)\ppagelist.obj: $(gdlibdir)\gd_io.h -$(outdir)\ppagelist.obj: $(gdlibdir)\gdfx.h -$(outdir)\ppagelist.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\ppagelist.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\ppagelist.obj: ..\lib\miktex-features.h commands.h -$(outdir)\set.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\set.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\set.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\set.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\set.obj: ..\lib\miktex-features.h commands.h -$(outdir)\special.obj: dvipng.h config.h .\inttypes.h -$(outdir)\special.obj: $(gdlibdir)\gd.h $(gdlibdir)\gd_io.h -$(outdir)\special.obj: $(gdlibdir)\gdfx.h -$(outdir)\special.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\special.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\special.obj: ..\lib\miktex-features.h commands.h -$(outdir)\vf.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h -$(outdir)\vf.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h -$(outdir)\vf.obj: $(kpslibdir)\kpathsea\kpathsea.h -$(outdir)\vf.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h -$(outdir)\vf.obj: ..\lib\miktex-features.h commands.h diff --git a/Build/source/texk/dvipng/dvipng-1.13/misc.c b/Build/source/texk/dvipng/dvipng-1.13/misc.c deleted file mode 100644 index a1d8c3d95eb..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/misc.c +++ /dev/null @@ -1,848 +0,0 @@ -/* misc.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" -#ifdef HAVE_LIBGEN_H -# include -#else -#define basename xbasename -#endif -#include /* open/close */ -#ifdef HAVE_MMAP -#include -#endif -#include - -static char *programname; - -/*-->DecodeArgs*/ -/*********************************************************************/ -/***************************** DecodeArgs ****************************/ -/*********************************************************************/ -bool DecodeArgs(int argc, char ** argv) -{ - int i; /* argument index for options */ - bool ppused=false; /* Flag when -pp is used */ - int32_t number; /* Temporary storage for numeric parameter */ - char *dviname=NULL; /* Name of dvi file */ - char *outname=NULL; /* Name of output file */ - - if (argv[0]) { -#ifdef HAVE_GDIMAGEGIF - programname=strrchr(argv[0],'/'); - if (programname!=NULL) - programname++; - else - programname=argv[0]; - if (strncmp(programname,"dvigif",6)==0) - option_flags |= GIF_OUTPUT; -#endif - programname=argv[0]; - Message(BE_NONQUIET,"This is %s",programname); - if (strcmp(basename(programname),PACKAGE_NAME)!=0) - Message(BE_NONQUIET," (%s)", PACKAGE_NAME); - Message(BE_NONQUIET," %s Copyright 2002-2010 Jan-Ake Larsson\n", - PACKAGE_VERSION); - } - - for (i=1; i'9' && *p!='-') { - if (strncmp(p,"vinum",5)==0) { - if (p[5] != '0') { - option_flags |= DVI_PAGENUM; - Message(PARSE_STDIN,"DVI page number output on\n",p); - } else { - option_flags &= ~DVI_PAGENUM; - Message(PARSE_STDIN,"DVI page number output off\n"); - } - break; - } else if (strncmp(p,"epth",4)==0) { /* Depth reporting */ - if (p[4] != '0') { - option_flags |= REPORT_DEPTH; - Message(PARSE_STDIN,"Depth reporting on\n",p); - } else { - option_flags &= ~REPORT_DEPTH; - Message(PARSE_STDIN,"Depth reporting off\n"); - } - break; - } - goto DEFAULT; - } else { -#ifdef DEBUG - if (*p == 0 && argv[i+1]) - p = argv[i+1]; - debug = atoi(p); - if (debug > 0) { - if (p == argv[i+1]) i++; - } else - debug = DEBUG_DEFAULT; - Message(PARSE_STDIN,"Debug output enabled\n"); -#ifdef HAVE_LIBKPATHSEA - kpathsea_debug = debug / LASTDEBUG / 2 ; -#endif -#else - Warning("This instance of %s was compiled without the debug (-d) option", - programname); -#endif - break; - } - case 'o': /* Output file is specified */ - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - outname=p; - /* remove .png extension */ - Message(PARSE_STDIN,"Output file: %s\n", - outname); - break; -#ifdef MAKETEXPK - case 'M': - /* -M, -M1 => don't make font; -M0 => do. */ - makeTexPK = (*p == '0'); -#ifdef HAVE_LIBKPATHSEA - kpse_set_program_enabled (kpse_pk_format, makeTexPK, kpse_src_cmdline); -#endif - if (makeTexPK) - Message(PARSE_STDIN,"MakeTeXPK enabled\n"); - else - Message(PARSE_STDIN,"MakeTeXPK disabled\n"); - break; -#endif /* MAKETEXPK */ - case 'm': - if (strcmp(p,"ode") == 0 ) { - if (argv[i+1]) - user_mfmode = argv[++i] ; - Message(PARSE_STDIN,"MetaFont mode: %s\n",user_mfmode); - break; - } - goto DEFAULT; - case 'h': - if (strcmp(p,"elp") == 0 ) { - break; - } else if (strncmp(p,"eight",5) == 0 ) { /* Height reporting */ - if (p[5] != '0') { - option_flags |= REPORT_HEIGHT; - Message(PARSE_STDIN,"Height reporting on\n",p); - } else { - option_flags &= ~REPORT_HEIGHT; - Message(PARSE_STDIN,"Height reporting off\n"); - } - break; - } - goto DEFAULT; - case 'O' : /* Offset */ - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - handlepapersize(p, &x_offset_def, &y_offset_def) ; - Message(PARSE_STDIN,"Offset: (%d,%d)\n",x_offset_def,y_offset_def); - break ; - case 'e': - if (strncmp(p,"xpand-bbox",10) == 0 ) { - if (p[10] != '0') { - option_flags |= EXPAND_BBOX; - Message(PARSE_STDIN,"BBox expansion on\n",p); - } else { - option_flags &= ~EXPAND_BBOX; - Message(PARSE_STDIN,"BBox expansion off\n"); - } - break; - } - goto DEFAULT; - case 'T' : - if (*p == 0 && argv[i+1]) - p = argv[++i]; - if (strcmp(p,"bbox")==0) { - x_width_def=0; - y_width_def=0; - Message(PARSE_STDIN,"Pagesize: (bbox)\n"); - } else if (strcmp(p,"tight")==0) { - x_width_def=-1; - y_width_def=-1; - Message(PARSE_STDIN,"Pagesize: (tight bbox)\n"); - } else { - handlepapersize(p, &x_width_def, &y_width_def) ; - Message(PARSE_STDIN,"Pagesize: (%d,%d)\n", - x_width_def,y_width_def); - } - break ; - case 't': /* specify paper format, only for cropmarks */ -#ifdef HAVE_GDIMAGECREATETRUECOLOR - /* Truecolor */ - if (strncmp(p,"ruecolor",8)==0) { - if (p[8] != '0') { - option_flags |= FORCE_TRUECOLOR; - Message(PARSE_STDIN,"Truecolor mode on\n",p); - } else { - option_flags &= ~FORCE_TRUECOLOR; - Message(PARSE_STDIN,"Truecolor mode off\n"); - } - } else -#endif -#ifdef HAVE_LIBT1 - if ( strncmp(p,"1lib",4) == 0 ) { /* -t1lib activation */ - if (p[4] != '0') { - option_flags |= USE_LIBT1; - Message(PARSE_STDIN,"t1lib rendering on\n",p); - } else { - option_flags &= ~USE_LIBT1; - Message(PARSE_STDIN,"t1lib rendering off\n"); - } - } else -#endif - - { /* cropmarks not implemented yet */ - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - if (strcmp(p,"a4")==0) { - handlepapersize("210mm,297mm",&x_pwidth,&y_pwidth); - } else if (strcmp(p,"letter")==0) { - handlepapersize("8.5in,11in",&x_pwidth,&y_pwidth); - } else if (strcmp(p,"legal")==0) { - handlepapersize("8.5in,14in",&x_pwidth,&y_pwidth); - } else if (strcmp(p,"executive")==0) { - handlepapersize("7.25in,10.5in",&x_pwidth,&y_pwidth); - } else - Fatal("papersize %s is not implemented",p); - Message(PARSE_STDIN,"Papersize: %s\n",p); - } - break; -/* case 'c': */ -/* if (strncmp(p,"acheimages",10)==0) { */ -/* if (p[10] != '0') { */ -/* option_flags |= CACHE_IMAGES; */ -/* Message(PARSE_STDIN,"Caching images\n",p); */ -/* } else { */ -/* option_flags &= ~CACHE_IMAGES; */ -/* Message(PARSE_STDIN,"Not caching images\n"); */ -/* } */ -/* break; */ -/* } */ -/* goto DEFAULT; */ - case 'b': - if ( *p == 'g' ) { /* -bg background color */ - p++; - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - if (strncmp(p,"Transparent",11) == 0 ) - option_flags |= BG_TRANSPARENT_ALPHA; - else if (strncmp(p,"transparent",11) == 0 ) - option_flags |= BG_TRANSPARENT; - else - background(p); - if (option_flags & BG_TRANSPARENT) - Message(PARSE_STDIN,"Transp. background (fallback rgb %d,%d,%d)\n", - cstack[0].red,cstack[0].green,cstack[0].blue); - else - Message(PARSE_STDIN,"Background: rgb %d,%d,%d\n", - cstack[0].red,cstack[0].green,cstack[0].blue); - break; - } else if (strcmp(p, "dpi")==0) { - p+=3; - if (*p == 0 && argv[i+1]) - p = argv[++i]; - number = atoi(p); - if (number < 10 || number > 10000) - Warning("Bad --bdpi parameter, ignored"); - else { - user_bdpi=number; - Message(PARSE_STDIN,"Bdpi: %d\n",user_bdpi); - } - break; - } else if ( *p == 'd' ) { /* -bd border width */ - int tmpi; - char* tmps; - p++; - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - tmpi = strtol(p, &tmps, 10); - if (p 1000000) - Warning("Bad magnification parameter (-x or -y), ignored"); - else { - usermag=number; - Message(PARSE_STDIN,"Magstep: %d\n",usermag); - /*overridemag = (c == 'x' ? 1 : -1) ;*/ - } - break ; - case 'g' : - if (strncmp(p,"amma",4)==0) { /* --gamma correction */ - double gamma=0.0; - - p+=4; - if (*p == 0 && argv[i+1]) - p = argv[++i]; - if (p!=NULL) - gamma=atof(p); - if (gamma==0.0) { - Warning("Bad gamma value, default is %f",DEFAULT_GAMMA); - gamma=DEFAULT_GAMMA; - } - Gamma(gamma); - Message(PARSE_STDIN,"Gamma value is %s\n", gamma); - break; -#ifdef HAVE_GDIMAGEGIF - } else if (strncmp(p,"if",2)==0) { /* --gif output */ - option_flags |= GIF_OUTPUT; - Message(PARSE_STDIN,"GIF output\n"); - break; -#endif - } - goto DEFAULT; - case 'p' : - if (*p == 'p') { /* a -pp specifier for a page list */ - ppused=true; - p++ ; - if (*p == 0 && argv[i+1]) - p = argv[++i]; - Message(PARSE_STDIN,"Page list: %s\n",p); - if (ParsePages(p)) - Fatal("bad page list specifier (-pp)"); - } else if (strncmp(p,"ng",2)==0) { /* --png output */ - option_flags &= ~GIF_OUTPUT; - Message(PARSE_STDIN,"PNG output\n"); - } else if (strncmp(p,"icky",4)==0) { - if (p[4] != '0') { - option_flags |= MODE_PICKY; - Message(PARSE_STDIN,"No images output for pages with warnings\n",p); - } else { - option_flags &= ~MODE_PICKY; - Message(PARSE_STDIN,"Images output even for pages with warnings\n"); - } - } else if (strncmp(p,"alette",6)==0) { - if (p[6] != '0') { - option_flags |= FORCE_PALETTE; - Message(PARSE_STDIN,"Forcing 256-color PNG output\n",p); - } else { - option_flags &= ~FORCE_PALETTE; - Message(PARSE_STDIN,"Allows truecolor PNG output\n"); - } - } else { /* a -p specifier for first page */ - int32_t firstpage; - bool abspage=false; - - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - if (*p == '=') { - abspage=true; - p++ ; - } - if ((*p>='0'&&*p<='9') || (*p=='-' && *(p+1)>='0' && *(p+1)<='9')) { - firstpage = atoi(p); - FirstPage(firstpage,abspage); - Message(PARSE_STDIN,"First page: %d\n",firstpage); - } else - Warning("Bad firstpage (-p) parameter, ignored"); - } - break ; - case 's' : - if (strncmp(p,"trict",5)==0) { - if (p[5] != '0') { - option_flags |= MODE_STRICT; - Message(PARSE_STDIN,"Warnings are fatal\n",p); - } else { - option_flags &= ~MODE_STRICT; - Message(PARSE_STDIN,"Warnings are not fatal\n"); - } - } else - goto DEFAULT; - break ; - case 'n' : - if (strncmp(p,"oghostscript",12)==0) { - if (p[12] != '0') { - option_flags |= NO_GHOSTSCRIPT; - Message(PARSE_STDIN,"No GhostScript calls\n",p); - } else { - option_flags &= ~NO_GHOSTSCRIPT; - Message(PARSE_STDIN,"GhostScript calls made\n"); - } - } else if (strncmp(p,"ogssafer",8)==0) { - if (p[8] != '0') { - option_flags |= NO_GSSAFER; - Message(PARSE_STDIN,"GhostScript calls does not use -dSAFER\n",p); - } else { - option_flags &= ~NO_GSSAFER; - Message(PARSE_STDIN,"GhostScript calls use -dSAFER\n"); - } - } else - goto DEFAULT; - break ; - case 'l': - { - int32_t lastpage; - bool abspage=false; - - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - if (*p == '=') { - abspage=true; - p++ ; - } - if ((*p>='0'&&*p<='9') || (*p=='-' && *(p+1)>='0' && *(p+1)<='9')) { - lastpage = atoi(p); - LastPage(lastpage,abspage); - Message(PARSE_STDIN,"Last page: %d\n",lastpage); - } else - Warning("Bad lastpage (-l) parameter, ignored"); - } - break ; - case 'q': /* quiet operation */ - if (*p != '0') - option_flags &= (~BE_NONQUIET & ~BE_VERBOSE); - else - option_flags |= BE_NONQUIET; - break; - case 'r': /* process pages in reverse order */ - if (*p != '0') { - Message(PARSE_STDIN,"Reverse order\n"); - Reverse(true); - } else { - Message(PARSE_STDIN,"Normal order\n"); - Reverse(false); - } - break; - case 'v': /* verbatim mode */ - if (strcmp(p, "ersion")==0) { - if (strcmp(basename(programname),PACKAGE_NAME)!=0) - printf("%s (%s) %s\n",basename(programname), - PACKAGE_NAME,PACKAGE_VERSION); - else - puts(PACKAGE_STRING); -#ifdef HAVE_LIBKPATHSEA - puts (KPSEVERSION); -#endif -#ifdef HAVE_FT2 - printf("Compiled with Freetype %d.%d.%d\n", - FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH); -# ifdef HAVE_FT_LIBRARY_VERSION - if (FT_Init_FreeType( &libfreetype )) - Warning("the Freetype library seems unusable"); - else { - FT_Int amajor, aminor, apatch; - - FT_Library_Version( libfreetype, &amajor, &aminor, &apatch ); - printf("Using libft %d.%d.%d\n",amajor, aminor, apatch); - FT_Done_FreeType(libfreetype); - } -# endif -#endif -#ifdef HAVE_LIBT1 - printf("Using t1lib %s\n", T1_GetLibIdent()); -#endif - puts ("Copyright (C) 2002-2010 Jan-Ake Larsson.\n\ -There is NO warranty. You may redistribute this software\n\ -under the terms of the GNU Lesser General Public License\n\ -version 3, see the COPYING file in the dvipng distribution\n\ -or ."); - exit (EXIT_SUCCESS); - } - if (*p != '0') - option_flags |= BE_NONQUIET | BE_VERBOSE; - else - option_flags &= ~BE_VERBOSE; - break; - case 'D' : - if (*p == 0 && argv[i+1]) - p = argv[++i] ; - number = atoi(p); - if (number < 10 || number > 10000) - Warning("Bad resolution (-D) parameter, ignored") ; - else { - dpi=number; - Message(PARSE_STDIN,"Dpi: %d\n",dpi); - } - break; - case 'Q': /* quality (= shrinkfactor) */ - if (*p == 0 && argv[i+1]) - p = argv[++i]; - if (*p>='0'&&*p<='9') { - shrinkfactor = atoi(p); - Message(PARSE_STDIN,"Quality: %d\n",shrinkfactor); - } else { - Warning("Non-numeric quality (-Q) value, ignored"); - } - break; - case 'w': - if (strncmp(p,"idth",4) == 0 ) { /* Width reporting */ - if (p[4] != '0') { - option_flags |= REPORT_WIDTH; - Message(PARSE_STDIN,"Width reporting on\n",p); - } else { - option_flags &= ~REPORT_WIDTH; - Message(PARSE_STDIN,"Width reporting off\n"); - } - break; - } - goto DEFAULT; -#ifdef HAVE_GDIMAGEPNGEX - case 'z': - if (*p == 0 && argv[i+1]) - p = argv[++i]; - number = atoi(p); - if (number<1 || number>9) - Warning("Bad compression (-z) value, ignored"); - else { - compression=number; - Message(PARSE_STDIN,"Compression: %d\n",shrinkfactor); - } - break; -#endif - case '\0': - option_flags |= PARSE_STDIN; - break; - DEFAULT: default: - Warning("%s is not a valid option", argv[i]); - } - } else { - dviname=argv[i]; - } - } - if (dviname != NULL) { - if (dvi != NULL && dvi->filep != NULL) - DVIClose(dvi); - dvi=DVIOpen(dviname,outname); - } - - if (dvi==NULL) { - fprintf(stdout,"\nUsage: %s [OPTION]... FILENAME[.dvi]\n", programname); - fprintf(stdout,"Options are chosen to be similar to dvips' options where possible:\n"); -#ifdef DEBUG - fprintf(stdout," -d # Debug (# is the debug bitmap, 1 if not given)\n"); -#endif - fprintf(stdout," -D # Output resolution\n"); - fprintf(stdout," -l # Last page to be output\n"); - fprintf(stdout," -o f Output file, '%%d' is pagenumber\n"); - fprintf(stdout," -O c Image offset\n"); - fprintf(stdout," -p # First page to be output\n"); - fprintf(stdout," -pp #,#.. Page list to be output\n"); - fprintf(stdout," -q* Quiet operation\n"); - fprintf(stdout," -T c Image size (also accepts '-T bbox' and '-T tight')\n"); - fprintf(stdout," -v* Verbose operation\n"); - fprintf(stdout," - Interactive query of options\n"); - fprintf(stdout,"\nThese do not correspond to dvips options:\n"); - fprintf(stdout," -bd # Transparent border width in dots\n"); - fprintf(stdout," -bd s Transparent border fallback color (TeX-style color)\n"); - fprintf(stdout," -bg s Background color (TeX-style color or 'Transparent')\n"); - fprintf(stdout," --depth* Output the image depth on stdout\n"); - fprintf(stdout," --dvinum* Use TeX page numbers in output filenames\n"); - fprintf(stdout," -fg s Foreground color (TeX-style color)\n"); - fprintf(stdout," --follow* Wait for data at end-of-file\n"); -#ifdef HAVE_FT2 - fprintf(stdout," --freetype* FreeType font rendering (default on)\n"); -#endif - fprintf(stdout," --gamma # Control color interpolation\n"); -#ifdef HAVE_GDIMAGEGIF - fprintf(stdout," --gif Output GIF images (dvigif default)\n"); -#endif - fprintf(stdout," --height* Output the image height on stdout\n"); - fprintf(stdout," --noghostscript* Don't use ghostscript for PostScript specials\n"); - fprintf(stdout," --nogssafer* Don't use -dSAFER in ghostscript calls\n"); -#ifdef HAVE_GDIMAGECREATETRUECOLOR - fprintf(stdout," --palette* Force palette output\n"); -#endif - fprintf(stdout," --picky When a warning occurs, don't output image\n"); -#ifdef HAVE_GDIMAGEGIF - fprintf(stdout," --png Output PNG images (dvipng default)\n"); -#endif - fprintf(stdout," --strict When a warning occurs, exit\n"); -#ifdef HAVE_LIBT1 - fprintf(stdout," --t1lib* T1lib font rendering (default on)\n"); -#endif -#ifdef HAVE_GDIMAGECREATETRUECOLOR - fprintf(stdout," --truecolor* Truecolor output\n"); -#endif - fprintf(stdout," -Q # Quality (T1lib and PK subsampling)\n"); -#ifdef HAVE_GDIMAGEPNGEX - fprintf(stdout," -z # PNG compression level\n"); -#endif - - fprintf(stdout,"\n # = number f = file s = string * = suffix, '0' to turn off\n"); - fprintf(stdout," c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)\n\n"); - /*#ifdef HAVE_LIBKPATHSEA - { - extern DllImport char *kpse_bug_address; - putc ('\n', stdout); - fputs (kpse_bug_address, stdout); - } - #endif*/ - if ((option_flags & PARSE_STDIN) == 0) { - exit(EXIT_SUCCESS); - } - } - if ((option_flags & PARSE_STDIN) == 0 && (!ppused)) - ParsePages("-"); - return((option_flags & PARSE_STDIN) != 0); -} - -void DecodeString(char *string) -{ -#define PARSEARGS 10 - char *strv[PARSEARGS]; - int strc=1; - strv[0]=NULL; /* No program name */ - - while (*string==' ' || *string=='\t' || *string=='\n') - string++; - while (*string!='\0') { - strv[strc++]=string; - if (*string!='\'') { - /* Normal split at whitespace */ - while (*string!=' ' && *string!='\t' && *string!='\n' && *string!='\0') - string++; - } else { - /* String delimiter found , so search for next */ - strv[strc-1]=++string; - while (*string!='\'' && *string!='\0') - string++; - } - if (*string!='\0') - *string++='\0'; - while (*string==' ' || *string=='\t' || *string=='\n') - string++; - } - if (strc>1) /* Nonempty */ - (void) DecodeArgs(strc,strv); -} - - - -uint32_t UNumRead(unsigned char* current, register int n) -{ - uint32_t x = (unsigned char) *(current)++; /* number being constructed */ - while(--n) - x = (x << 8) | *(current)++; - return(x); -} - -int32_t SNumRead(unsigned char* current, register int n) -{ - int32_t x = (signed char) *(current)++; /* number being constructed */ - while(--n) - x = (x << 8) | *(current)++; - return(x); -} - - -/**********************************************************************/ -/****************************** Fatal *******************************/ -/**********************************************************************/ -void Fatal (const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - fflush(stdout); - fprintf(stderr, "\n"); - fprintf(stderr, "%s: Fatal error, ", programname); - vfprintf(stderr, fmt, args); - - fprintf(stderr, "\n\n"); - va_end(args); - - ClearFonts(); -#ifdef HAVE_FT2 - if (libfreetype) - (void) FT_Done_FreeType(libfreetype); /* at this point, ignore error */ -#endif -#ifdef HAVE_LIBT1 - if (libt1) - (void) T1_CloseLib(); /* at this point, ignore error */ -#endif - exit(EXIT_FATAL); -} - -/*-->Warning*/ -/**********************************************************************/ -/***************************** Warning ******************************/ -/**********************************************************************/ -void Warning(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - - if ( option_flags & BE_NONQUIET ) { - fflush(stdout); - fprintf(stderr, "%s warning: ", programname); - vfprintf(stderr, fmt, args); - fprintf(stderr, " "); - } - va_end(args); -} - -/*-->Message*/ -/**********************************************************************/ -/***************************** Message ******************************/ -/**********************************************************************/ -void Message(int activeflags, const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - if ( option_flags & activeflags ) { - vfprintf(stdout, fmt, args); - } - va_end(args); -} - - -bool MmapFile (char *filename,struct filemmap *fmmap) -{ -#ifndef WIN32 - struct stat stat; -#endif - - DEBUG_PRINT(DEBUG_DVI,("\n OPEN FILE:\t'%s'", filename)); - fmmap->data=NULL; -#ifndef WIN32 - if ((fmmap->fd = open(filename,O_RDONLY)) == -1) { - Warning("cannot open file <%s>", filename); - return(true); - } - fstat(fmmap->fd,&stat); - fmmap->size=stat.st_size; -# ifdef HAVE_MMAP - fmmap->data = mmap(NULL,fmmap->size, PROT_READ, MAP_SHARED,fmmap->fd,0); - if (fmmap->data == (char*)-1) { - Warning("cannot mmap file <%s>",filename); - fmmap->data=NULL; - close(fmmap->fd); - return(true); - } -# else /* HAVE_MMAP */ - fmmap->data = malloc(fmmap->size); - if (fmmap->data == NULL) { - Warning("cannot malloc space for <%s>",filename); - close(fmmap->fd); - return(true); - } - if (read(fmmap->fd,fmmap->data,fmmap->size)size) { - Warning("too little data in <%s>",filename); - free(fmmap->data); - fmmap->data=NULL; - close(fmmap->fd); - return(true); - } - close(fmmap->fd); -# endif /* HAVE_MMAP */ -#else /* WIN32 */ - fmmap->hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, 0, - OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); - if (fmmap->hFile == INVALID_HANDLE_VALUE) { - Warning("cannot open file <%s>", filename); - return(true); - } - fmmap->size = GetFileSize(fmmap->hFile, 0); - fmmap->hMap = CreateFileMapping(fmmap->hFile, 0, PAGE_READONLY, 0, 0, 0); - if (fmmap->hMap == 0) { - CloseHandle (fmmap->hFile); - Warning("cannot CreateFileMapping() file <%s>", filename); - return(true); - } - fmmap->data = MapViewOfFile(fmmap->hMap, FILE_MAP_READ, 0, 0, 0); - if (fmmap->data == NULL) { - Warning("cannot MapViewOfFile() file <%s>", filename); - CloseHandle (fmmap->hMap); - CloseHandle (fmmap->hFile); - return(true); - } -#endif /* WIN32 */ - return(false); -} - -void UnMmapFile(struct filemmap* fmmap) -{ - if (fmmap->data!=NULL) { -#ifndef WIN32 -# ifdef HAVE_MMAP - if (munmap(fmmap->data,fmmap->size)) - Warning("cannot munmap file at 0x%X",fmmap->data); - if (close(fmmap->fd)) - Warning("cannot close file descriptor %d",fmmap->fd); -# else /* HAVE_MMAP */ - free(fmmap->data); -# endif /* HAVE_MMAP */ -#else /* WIN32 */ - UnmapViewOfFile (fmmap->data); - CloseHandle (fmmap->hMap); - CloseHandle (fmmap->hFile); -#endif /* WIN32 */ - } - fmmap->data=NULL; -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/papersiz.c b/Build/source/texk/dvipng/dvipng-1.13/papersiz.c deleted file mode 100644 index 3cf15d7a06c..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/papersiz.c +++ /dev/null @@ -1,73 +0,0 @@ -/* papersiz.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -const char *lengthnames[]={ "sp", "pt", "bp", - "dd", "mm", "pc", - "cc", "cm", "in" }; -const int32_t lengthsp[]={ 1L, 65536L, 65782L, - 70124L, 186468L, 786432L, - 841489L, 1864680L, 4736286L }; - -/* - * Convert a double[unit], e.g., "3.2cm" or "1.0in" into length in pixels. - * Advance the passed pointer as well. - */ - -static int32_t myatodim(const char ** p) -{ - double tmp; /* double accuracy is enough, I think */ - int i=0; - char *q; - - tmp = strtod(*p,&q); - while (*q == ' ') - q++; - while (i<8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1])) - i++; - if (i==8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1])) - Warning("unrecognized length unit \"%.2s\", assuming inches",q); - while (*q != ',' && *q !='\0') - q++; - tmp = tmp*lengthsp[i]*dpi/4736286L; /* sp * dots/in / (sp/in), convert sp to pixels */ - return((int32_t) tmp); -} - - -/* - * The routine where we handle the paper size special. We need to pass in - * the string after the `papersize=' specification. - */ - -void handlepapersize(const char * p, int32_t * x, int32_t * y) -{ - while (*p == ' ') - p++ ; - *x = myatodim(&p) ; - while (*p == ' ' || *p == ',') - p++ ; - *y = myatodim(&p) ; -} - diff --git a/Build/source/texk/dvipng/dvipng-1.13/pk.c b/Build/source/texk/dvipng/dvipng-1.13/pk.c deleted file mode 100644 index 446dc7ed2ee..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/pk.c +++ /dev/null @@ -1,403 +0,0 @@ -/* pk.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2009 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -#define PK_POST 245 -#define PK_PRE 247 -#define PK_ID 89 - -unsigned char dyn_f; -int repeatcount; -int poshalf; - -static unsigned char getnyb(unsigned char** pos) -{ - if (poshalf == 0) { - poshalf=1; - return(**pos / 16); - } else { - poshalf=0; - return(*(*pos)++ & 15); - } -} - -static uint32_t pk_packed_num(unsigned char** pos) -{ - register int i; - uint32_t j; - - i = (int)getnyb(pos); - if (i == 0) { - do { - j = (uint32_t)getnyb(pos); - i++; - } while (j == 0); - while (i > 0) { - j = j * 16 + (uint32_t)getnyb(pos); - i--; - }; - return (j - 15 + (13 - dyn_f) * 16 + dyn_f); - } else if (i <= (int)dyn_f) { - return ((uint32_t)i); - } else if (i < 14) { - return ((i-(uint32_t)dyn_f - 1) * 16 + (uint32_t)getnyb(pos) - + dyn_f + 1); - } else { - if (i == 14) { - repeatcount = (int)pk_packed_num(pos); - } else { - repeatcount = 1; - } - return (pk_packed_num(pos)); /* tail end recursion !! */ - } -} - -static unsigned char* skip_specials(unsigned char* pos) -{ - uint32_t i; - - while (*pos >= 240 && *pos != PK_POST) { - i=0; - switch (*pos++) { - case 243: - i = *pos++; - case 242: - i = 256 * i + *pos++; - case 241: - i = 256 * i + *pos++; - case 240: - i = 256 * i + *pos++; - DEBUG_PRINT(DEBUG_PK,("\n PK SPECIAL\t'%.*s' ",(int)i,pos)); - pos += i; - break; - case 244: -#ifdef DEBUG - { - uint32_t c; - c=UNumRead(pos,4); - DEBUG_PRINT(DEBUG_PK,("\n PK SPECIAL\t%d",c)); - } -#endif - pos += 4; - break; - case 245: - break; - case 246: - DEBUG_PRINT(DEBUG_PK,("\n PK\tNOP ")); - break; - case 247: case 248: case 249: case 250: - case 251: case 252: case 253: case 254: - case 255: - Fatal("unexpected PK flagbyte %d", (int)*pos); - } - } - return(pos); -} - - -void LoadPK(int32_t c, register struct char_entry * ptr) -{ - unsigned short shrunk_width,shrunk_height; - unsigned short width,height; - short xoffset,yoffset; - unsigned short i_offset,j_offset; - int i,j,k,n; - int count=0; - bool paint_switch; - unsigned char *pos,*buffer; - - DEBUG_PRINT(DEBUG_PK,("\n LOAD PK CHAR\t%d",c)); - pos=ptr->pkdata; - if ((ptr->flag_byte & 7) == 7) n=4; - else if ((ptr->flag_byte & 4) == 4) n=2; - else n=1; - dyn_f = ptr->flag_byte / 16; - paint_switch = ((ptr->flag_byte & 8) != 0); - /* - * Read character preamble - */ - if (n != 4) { - ptr->tfmw = UNumRead(pos, 3); - /* +n: vertical escapement not used */ - pos+=3+n; - } else { - ptr->tfmw = UNumRead(pos, 4); - /* +4: horizontal escapement not used */ - /* +n: vertical escapement not used */ - pos+=8+n; - } - DEBUG_PRINT(DEBUG_PK,(" %d",ptr->tfmw)); - ptr->tfmw = (dviunits) - ((int64_t) ptr->tfmw * currentfont->s / 0x100000 ); - DEBUG_PRINT(DEBUG_PK,(" (%d)",ptr->tfmw)); - - width = UNumRead(pos, n); - height = UNumRead(pos+=n, n); - DEBUG_PRINT(DEBUG_PK,(" %dx%d",width,height)); - - if (width > 0x7fff || height > 0x7fff) - Fatal("character %d too large in file %s", c, currentfont->name); - - /* - * Hotspot issues: Shrinking to the topleft corner rather than the - hotspot will displace glyphs a fraction of a pixel. We deal with - this in as follows: The glyph is shrunk to its hotspot by - offsetting the bitmap somewhat to put the hotspot in the lower - left corner of a "shrink square". Shrinking to the topleft corner - will then act as shrinking to the hotspot. This may enlarge the - bitmap somewhat, of course. (Also remember that the below - calculation of i/j_offset is in integer arithmetics.) - - There will still be a displacement from rounding the dvi - position, but vertically it will be equal for all glyphs on a - line, so we displace a whole line vertically by fractions of a - pixel. This is acceptible, IMHO. Sometime there will be support - for subpixel positioning, horizontally. Will do for now, I - suppose. - */ - xoffset = SNumRead(pos+=n, n); - i_offset = ( shrinkfactor - xoffset % shrinkfactor ) % shrinkfactor; - width += i_offset; - ptr->xOffset = xoffset+i_offset; - - yoffset = SNumRead(pos+=n, n); - j_offset = ( shrinkfactor - (yoffset-(shrinkfactor-1)) % shrinkfactor ) - % shrinkfactor; - height += j_offset; - ptr->yOffset = yoffset+j_offset; - - DEBUG_PRINT(DEBUG_PK,(" (%dx%d)",width,height)); - /* - Extra marginal so that we do not crop the image when shrinking. - */ - shrunk_width = (width + shrinkfactor - 1) / shrinkfactor; - shrunk_height = (height + shrinkfactor - 1) / shrinkfactor; - ptr->w = shrunk_width; - ptr->h = shrunk_height; - pos+=n; - buffer = calloc(shrunk_width*shrunk_height* - shrinkfactor*shrinkfactor,sizeof(char)); - DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); - /* Raster char */ - if (dyn_f == 14) { /* get raster by bits */ - int bitweight = 0; - for (j = j_offset; j < (int) height; j++) { /* get all rows */ - for (i = i_offset; i < (int) width; i++) { /* get one row */ - bitweight /= 2; - if (bitweight == 0) { - count = *pos++; - bitweight = 128; - } - if (count & bitweight) { - buffer[i+j*width]=1; -#ifdef DEBUG - DEBUG_PRINT(DEBUG_GLYPH,("+")); - } else { - DEBUG_PRINT(DEBUG_GLYPH,(" ")); -#endif - } - } - DEBUG_PRINT(DEBUG_GLYPH,("|\n")); - } - } else { /* get packed raster */ - poshalf=0; - repeatcount = 0; - for(i=i_offset, j=j_offset; j 0) { - if (i+count < width) { - if (paint_switch) - for(k=0;k0; repeatcount--,j++) { - for (i = i_offset; i0) { - DEBUG_PRINT(DEBUG_GLYPH,("=")); - } else { - DEBUG_PRINT(DEBUG_GLYPH,(" ")); - } -#endif - } - DEBUG_PRINT(DEBUG_GLYPH,("|\n")); - } - i=i_offset; - } - } - paint_switch = 1 - paint_switch; - } - if (i>i_offset) - Fatal("wrong number of bits stored: char. %c, font %s", - (char)c, currentfont->name); - if (j>height) - Fatal("bad PK file %s, too many bits", currentfont->name); - } - /* - Shrink raster while doing antialiasing. (See above. The - single-glyph output seems better than what xdvi at 300 dpi, - shrinkfactor 3 produces.) - */ - if ((ptr->data = calloc(shrunk_width*shrunk_height,sizeof(char))) == NULL) - Fatal("unable to malloc image space for char %c", (char)c); - for (j = 0; j < (int) height; j++) { - for (i = 0; i < (int) width; i++) { - /* if (((i % shrinkfactor) == 0) && ((j % shrinkfactor) == 0)) - ptr->data[i/shrinkfactor+j/shrinkfactor*shrunk_width] = - buffer[i+j*width]; - else */ - ptr->data[i/shrinkfactor+j/shrinkfactor*shrunk_width] += - buffer[i+j*width]; - } - } - for (j = 0; j < shrunk_height; j++) { - for (i = 0; i < shrunk_width; i++) { - ptr->data[i+j*shrunk_width] = ptr->data[i+j*shrunk_width] - *255/shrinkfactor/shrinkfactor; - DEBUG_PRINT(DEBUG_GLYPH,("%3u ",ptr->data[i+j*shrunk_width])); - } - DEBUG_PRINT(DEBUG_GLYPH,("|\n")); - } - free(buffer); -} - -void InitPK(struct font_entry * tfontp) -{ - unsigned char* position; - struct char_entry *tcharptr; /* temporary char_entry pointer */ - uint32_t hppp, vppp, packet_length; - uint32_t c; - - DEBUG_PRINT((DEBUG_DVI|DEBUG_PK),("\n OPEN FONT:\t'%s'", tfontp->name)); - Message(BE_VERBOSE,"<%s>", tfontp->name); - if (MmapFile(tfontp->name,&(tfontp->fmmap))) - Fatal("font file %s unusable", tfontp->name); - position=(unsigned char*)tfontp->fmmap.data; - if (tfontp->fmmap.size < 2 || tfontp->fmmap.size < 3+*(position+2)+16) - Fatal("PK file %s ends prematurely",tfontp->name); - if (*position++ != PK_PRE) - Fatal("unknown font format in file %s",tfontp->name); - if (*position++ != PK_ID) - Fatal( "wrong version %d of PK file %s (should be 89)", - (int)*(position-1),tfontp->name); - DEBUG_PRINT(DEBUG_PK,("\n PK_PRE:\t'%.*s'",(int)*position, position+1)); - position += *position + 1; - - tfontp->designsize = UNumRead(position, 4); - DEBUG_PRINT(DEBUG_PK,(" %d", tfontp->designsize)); - tfontp->type = FONT_TYPE_PK; - - c = UNumRead(position+4, 4); - DEBUG_PRINT(DEBUG_PK,(" %d", c)); - CheckChecksum (tfontp->c, c, tfontp->name); - - hppp = UNumRead(position+8, 4); - vppp = UNumRead(position+12, 4); - DEBUG_PRINT(DEBUG_PK,(" %d %d", hppp,vppp)); - if (hppp != vppp) - Warning("aspect ratio is %d:%d (should be 1:1)", hppp, vppp); - tfontp->magnification = (uint32_t)((uint64_t)hppp * 7227 * 5 / 65536l + 50)/100; - position+=16; - /* Read char definitions */ - position = skip_specials(position); - while (*position != PK_POST) { - DEBUG_PRINT(DEBUG_PK,("\n @%ld PK CHAR:\t%d", - (long)position - (long)tfontp->fmmap.data, *position)); - if ((tcharptr = malloc(sizeof(struct char_entry))) == NULL) - Fatal("cannot malloc space for char_entry"); - tcharptr->flag_byte = *position; - tcharptr->data = NULL; - tcharptr->tfmw = 0; - if ((*position & 7) == 7) { - packet_length = UNumRead(position+1,4); - c = UNumRead(position+5, 4); - position += 9; - } else if (*position & 4) { - packet_length = (*position & 3) * 65536l + - UNumRead(position+1, 2); - c = UNumRead(position+3, 1); - position += 4; - } else { - packet_length = (*position & 3) * 256 + - UNumRead(position+1, 1); - c = UNumRead(position+2, 1); - position += 3; - } - DEBUG_PRINT(DEBUG_PK,(" %d %d",packet_length,c)); - if (c > (LASTFNTCHAR)) - Fatal("PK font %s exceeds char numbering limit",tfontp->name); - tcharptr->length = packet_length; - tcharptr->pkdata = position; - tfontp->chr[c]=tcharptr; - position += packet_length; - position = skip_specials(position); - } -} - -static void UnLoadPK(struct char_entry *ptr) -{ - if (ptr->data!=NULL) - free(ptr->data); - ptr->data=NULL; -} - -void DonePK(struct font_entry *tfontp) -{ - int c=FIRSTFNTCHAR; - - UnMmapFile(&(tfontp->fmmap)); - while(c<=LASTFNTCHAR) { - if (tfontp->chr[c]!=NULL) { - UnLoadPK((struct char_entry*)tfontp->chr[c]); - free(tfontp->chr[c]); - } - c++; - } - if (tfontp->name!=NULL) - free(tfontp->name); - tfontp->name=NULL; -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/ppagelist.c b/Build/source/texk/dvipng/dvipng-1.13/ppagelist.c deleted file mode 100644 index b7467a98539..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/ppagelist.c +++ /dev/null @@ -1,189 +0,0 @@ -/* ppagelist.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -/* Some code at the end of this file is adapted from dvips */ - -static int32_t first=PAGE_FIRSTPAGE, last=PAGE_LASTPAGE; -static bool abspage=false, reverse=false; -bool no_ppage=true; - -/* dvips' behaviour: - * -pp outputs _all_ pages with the correct numbers, - * -p, -l outputs from the first occurrence of firstpage to the first - * occurrence of lastpage. Using '=' means absolute pagenumbers - */ - -void FirstPage(int32_t page, bool data) -{ - first=page; - abspage |= data; -} -void LastPage(int32_t page,bool data) -{ - last=page; - abspage |= data; -} -void Reverse(bool new) -{ - reverse=new; -} -/*-->NextPPage*/ -/**********************************************************************/ -/**************************** NextPPage *****************************/ -/**********************************************************************/ -/* Return the page in turn on our queue */ -/* (Implicitly, PAGE_POST is never in the pagelist) */ -bool InPageList(int32_t i); - -struct page_list* NextPPage(void* dvi, struct page_list* page) -{ - if (! reverse) { /*********** normal order */ - if (page == NULL) { /* first call: find first page */ - if (no_ppage) - return(NULL); - page=FindPage(dvi,first,abspage); - } else /* later calls: count up, except "last" page */ - page=(last==page->count[abspage ? 0 : 10]) ? NULL : NextPage(dvi,page); - /* seek for pages in pagelist */ - while (page!=NULL && ! InPageList(page->count[0])) - page=(last==page->count[abspage ? 0 : 10]) ? NULL : NextPage(dvi,page); - } else { /******************** reverse order */ - if (page == NULL) { /* first call: find "last" page */ - if (no_ppage) - return(NULL); - page=FindPage(dvi,last,abspage); - } else /* later calls: count down, except "first" page */ - page=(first==page->count[abspage ? 0 : 10]) ? NULL : PrevPage(dvi,page); - /* seek for pages in pagelist */ - while (page!=NULL && ! InPageList(page->count[0])) - page=(first==page->count[abspage ? 0 : 10]) ? NULL : PrevPage(dvi,page); - } - return(page); -} - -struct pp_list { - struct pp_list *next; /* next in a series of alternates */ - int32_t ps_low, ps_high; /* allowed range */ -} *ppages = 0; /* the list of allowed pages */ - -/*-->InPageList*/ -/**********************************************************************/ -/****************************** InPageList **************************/ -/**********************************************************************/ -/* Return true iff i is one of the desired output pages */ - -bool InPageList(int32_t i) -{ - register struct pp_list *pl = ppages; - - while (pl) { - if ( i >= pl -> ps_low && i <= pl -> ps_high) - return(true); /* success */ - pl = pl -> next; - } - return(false); -} - -static void ListPage(int32_t pslow, int32_t pshigh) -{ - register struct pp_list *pl; - - /* Some added code, we want to reuse the list */ - no_ppage=false; - pl = ppages; - while (pl != NULL && pl->ps_low <= pl->ps_high) - pl = pl->next; - if (pl == NULL) { - if ((pl = (struct pp_list *)malloc(sizeof(struct pp_list))) - ==NULL) - Fatal("cannot malloc memory for page queue"); - pl -> next = ppages; - ppages = pl; - } - pl -> ps_low = pslow; - pl -> ps_high = pshigh; -} - -/* Parse a string representing a list of pages. Return 0 iff ok. As a - side effect, the page selection(s) is (are) prepended to ppages. */ - -bool ParsePages(const char *s) -{ - const char *c; /* conversion start */ - char *t; - long int ps_low = PAGE_MINPAGE, ps_high = PAGE_MAXPAGE; - - while (*s==' ' || *s=='\t') s++; - while (*s!='\0') { - if (*s=='-' || *s==':') { /* range with no starting value */ - ps_low = PAGE_MINPAGE; - c=s+1; - ps_high = strtol(c,&t,10); - s = t; - if (c==s) ps_high=PAGE_MAXPAGE; /* no number */ - while (*s==' ' || *s=='\t') s++; - if (*s=='-' || *s==':') { /* Oh, range with negative starting value */ - ps_low = -ps_high; - c=s+1; - ps_high = strtol(c,&t,10); - s = t; - if (c==s) ps_high=PAGE_MAXPAGE; /* no number */ - } - } else { /* range with starting value, or singleton */ - c=s; - ps_low = ps_high = strtol(c,&t,10); - s = t; - if (c==s) - return(true); - if (*s=='-' || *s==':') { /* range */ - c=s+1; - ps_high = strtol(c,&t,10); - s = t; - if (c==s) ps_high=PAGE_MAXPAGE; /* no number */ - } - } - ListPage(ps_low, ps_high); - while (*s==' ' || *s=='\t' || *s==',') s++; - } - return(false); -} - -/* Addition, we want to be able to clear the pplist */ -void ClearPpList(void) -{ - register struct pp_list *pl = ppages; - - while (pl) { - ppages=ppages->next; - free(pl); - pl = ppages; - } - first=PAGE_FIRSTPAGE; - last=PAGE_LASTPAGE; - abspage = false; - no_ppage=true; -} - diff --git a/Build/source/texk/dvipng/dvipng-1.13/set.c b/Build/source/texk/dvipng/dvipng-1.13/set.c deleted file mode 100644 index af4e4ebdfaa..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/set.c +++ /dev/null @@ -1,289 +0,0 @@ -/* set.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" -#include - -#ifndef HAVE_GDIMAGECREATETRUECOLOR -#define gdImageColorAllocateAlpha(i,r,g,b,a) gdImageColorAllocate(i,r,g,b) -#define gdImageColorResolveAlpha(i,r,g,b,a) gdImageColorResolve(i,r,g,b) -#define gdImageAlpha(i,c) 0 -#define gdAlphaMax 127 -#endif -#ifndef HAVE_GDIMAGEPNGEX -#define gdImagePngEx(i,f,z) gdImagePng(i,f) -#endif - -/* Persistent color cache. Index is ink thickness, - 0=no ink, 127=total coverage */ -static int ColorCache[gdAlphaMax+1]; - -void CreateImage(pixels x_width,pixels y_width) -{ - if (page_imagep) - gdImageDestroy(page_imagep); - if (x_width <= 0) x_width=1; - if (y_width <= 0) y_width=1; -#ifdef HAVE_GDIMAGECREATETRUECOLOR - /* GIFs are 256-color */ - if ((option_flags & FORCE_TRUECOLOR - || page_flags & PAGE_TRUECOLOR) - && ~option_flags & GIF_OUTPUT - && ~option_flags & FORCE_PALETTE) - page_imagep=gdImageCreateTrueColor(x_width,y_width); - else -#endif - page_imagep=gdImageCreate(x_width,y_width); - /* Set bg color. GIFs cannot handle an alpha channel, resort to - transparent color index, set in WriteImage */ - ColorCache[0] - = gdImageColorAllocateAlpha(page_imagep, - cstack[0].red, - cstack[0].green, - cstack[0].blue, - (option_flags & BG_TRANSPARENT_ALPHA - && ~option_flags & GIF_OUTPUT) ? 127 : 0); - ColorCache[gdAlphaMax]=-1; -#ifdef HAVE_GDIMAGECREATETRUECOLOR - /* Alpha blending in libgd is only performed for truecolor images. - We need it for palette images also. Turn libgd alpha blending off - and calculate color blending where needed. We turn it back on - briefly for image inclusion. */ - gdImageAlphaBlending(page_imagep, 0); - if (option_flags & BG_TRANSPARENT_ALPHA) - gdImageSaveAlpha(page_imagep, 1); - if (page_imagep->trueColor) - /* Truecolor: there is no background color index, fill image instead. */ - gdImageFilledRectangle(page_imagep, 0, 0, - x_width-1, y_width-1, ColorCache[0]); -#endif -} - - -static void ChangeColor(gdImagePtr imagep,int x1,int y1, - int x2,int y2,int color1,int color2) -/* In the given rectangle, change color1 to color2 */ -{ - int x,y; - for( y=y1; y<=y2; y++) { - for( x=x1; x<=x2; x++) { - if (gdImageGetPixel(imagep, x, y)==color1) - gdImageSetPixel(imagep, x, y, color2); - } - } -} - -void WriteImage(char *pngname, int pagenum) -{ - char* pos, *freeme=NULL; - FILE* outfp=NULL; - - /* Set transparent background. Maybe alpha is not available or - perhaps we are producing GIFs, so test for BG_TRANSPARENT_ALPHA - too */ - if (option_flags & (BG_TRANSPARENT|BG_TRANSPARENT_ALPHA)) - gdImageColorTransparent(page_imagep,ColorCache[0]); - /* Transparent border */ - if (borderwidth>0) { - int Transparent; - pixels x_width,y_width; - - x_width=gdImageSX(page_imagep); - y_width=gdImageSY(page_imagep); - - /* Set ANOTHER bg color, transparent this time */ - /* No semi-transparency here, given the motivation for this code - * (box cursor visibility in Emacs) */ - if (userbordercolor) - Transparent = gdImageColorAllocate(page_imagep, - bordercolor.red, - bordercolor.green, - bordercolor.blue); - else - Transparent = gdImageColorAllocate(page_imagep, - gdImageRed(page_imagep,ColorCache[0]), - gdImageGreen(page_imagep,ColorCache[0]), - gdImageBlue(page_imagep,ColorCache[0])); - gdImageColorTransparent(page_imagep,Transparent); - ChangeColor(page_imagep,0,0,x_width-1,borderwidth-1, - ColorCache[0],Transparent); - ChangeColor(page_imagep,0,0,borderwidth-1,y_width-1, - ColorCache[0],Transparent); - ChangeColor(page_imagep,x_width-borderwidth,0,x_width-1,y_width-1, - ColorCache[0],Transparent); - ChangeColor(page_imagep,0,y_width-borderwidth,x_width-1,y_width-1, - ColorCache[0],Transparent); - } - - if ((pos=strchr(pngname,'%')) != NULL) { - if (strchr(++pos,'%')) - Fatal("too many %%s in output file name"); - if (*pos == 'd' - || (*pos=='0' && pos[1]>='1' && pos[1]<='9' && pos[2]=='d')) { - /* %d -> pagenumber, so add 9 string positions - since pagenumber max +-2^31 or +-2*10^9 */ - freeme = malloc(strlen(pngname)+9); - sprintf(freeme,pngname,pagenum); - pngname = freeme; - } else { - Fatal("unacceptible format spec in output file name"); - } - } -#ifdef HAVE_GDIMAGEGIF - if (option_flags & GIF_OUTPUT && (pos=strrchr(pngname,'.')) != NULL - && strcmp(pos,".png")==0) { - *(pos+1)='g'; - *(pos+2)='i'; - *(pos+3)='f'; - } -#endif - if ((outfp = fopen(pngname,"wb")) == NULL) - Fatal("cannot open output file %s",pngname); -#ifdef HAVE_GDIMAGEGIF - if (option_flags & GIF_OUTPUT) - gdImageGif(page_imagep,outfp); - else -#endif - gdImagePngEx(page_imagep,outfp,compression); - fclose(outfp); - DEBUG_PRINT(DEBUG_DVI,("\n WROTE: \t%s\n",pngname)); - if (freeme) - free(freeme); - DestroyImage(); -} - -void DestroyImage(void) -{ - gdImageDestroy(page_imagep); - page_imagep=NULL; -} - -static int gammatable[]= - {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, - 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39, - 40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59, - 60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, - 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99, - 100,101,102,103,104,105,106,107,108,109, - 110,111,112,113,114,115,116,117,118,119, - 120,121,122,123,124,125,126,127}; - -void Gamma(double gamma) -{ - int i=0; - - while (i<=gdAlphaMax) { - gammatable[i]=gdAlphaMax- - (int)(pow((gdAlphaMax-i)/((double)gdAlphaMax),gamma)*gdAlphaMax); - DEBUG_PRINT(DEBUG_GLYPH, - ("\n GAMMA GREYSCALE: %d -> %d ",i,gammatable[i])); - i++; - } -} - -dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv) -/* gdImageChar can only do monochrome glyphs */ -{ - int dst_alpha,dst_weight,tot_weight,alpha; - int x,y,pos=0; - int bgColor,pixelgrey,pixelcolor; - - hh -= ptr->xOffset/shrinkfactor; - vv -= ptr->yOffset/shrinkfactor; - /* Initialize persistent color cache. Perhaps this should be in - color.c? */ - pixelcolor=gdImageColorResolve(page_imagep, - cstack[csp].red, - cstack[csp].green, - cstack[csp].blue); - if (ColorCache[gdAlphaMax]!=pixelcolor) { - for( x=1; xh; y++) { - for( x=0; xw; x++) { - if (ptr->data[pos]>0) { - pixelgrey=gammatable[(int)ptr->data[pos]/2]; - bgColor = gdImageGetPixel(page_imagep, hh + x, vv + y); - if (ColorCache[0]!=bgColor || ColorCache[pixelgrey]==-1) { - DEBUG_PRINT(DEBUG_GLYPH,("\n GAMMA GREYSCALE: %d -> %d ", - ptr->data[pos]/2,pixelgrey)); - alpha = gdAlphaMax-pixelgrey; - dst_alpha = gdImageAlpha(page_imagep,bgColor); - dst_weight = (gdAlphaMax - dst_alpha) * alpha / gdAlphaMax; - tot_weight = pixelgrey + dst_weight; - pixelcolor = gdImageColorResolveAlpha(page_imagep, - (cstack[csp].red*pixelgrey - + gdImageRed(page_imagep,bgColor)*dst_weight)/tot_weight, - (cstack[csp].green*pixelgrey - + gdImageGreen(page_imagep,bgColor)*dst_weight)/tot_weight, - (cstack[csp].blue*pixelgrey - + gdImageBlue(page_imagep,bgColor)*dst_weight)/tot_weight, - alpha*dst_alpha/gdAlphaMax); - if (ColorCache[0]==bgColor) - ColorCache[pixelgrey]=pixelcolor; - } else - pixelcolor=ColorCache[pixelgrey]; - gdImageSetPixel(page_imagep, hh + x, vv + y, pixelcolor); - } - pos++; - } - } - return(ptr->tfmw); -} - -dviunits SetRule(dviunits a, dviunits b, subpixels hh,subpixels vv) -{ - /* This routine will draw a \rule */ - int Color; - pixels width=0, height=0; - - if ( a > 0 && b > 0 ) { - /* Calculate width and height, round up */ - width = (b+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; - height = (a+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; - } - if (page_imagep != NULL) { - if ((height>0) && (width>0)) { - /* This code produces too dark rules. But what the hell. Grey - * rules look fuzzy. */ - Color = gdImageColorResolve(page_imagep, - cstack[csp].red, - cstack[csp].green, - cstack[csp].blue); - /* +1 and -1 are because the Rectangle coords include last pixels */ - gdImageFilledRectangle(page_imagep,hh,vv-height+1,hh+width-1,vv,Color); - DEBUG_PRINT(DEBUG_DVI,("\n RULE \t%dx%d at (%d,%d)", - width, height, hh, vv)); - } - } else { - /* The +1's are because things are cut _at_that_coordinate_. */ - min(x_min,hh); - min(y_min,vv-height+1); - max(x_max,hh+width); - max(y_max,vv+1); - } - return(b); -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/sfd.c b/Build/source/texk/dvipng/dvipng-1.13/sfd.c deleted file mode 100644 index 99520b116ce..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/sfd.c +++ /dev/null @@ -1,176 +0,0 @@ -/* sfd.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2008 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" -struct subfont* subfontp=NULL; - -static struct subfont* ReadSubfont(char* sfdname, char *infix) -{ - char *pos,*max,*sfdfile=NULL; - struct subfont* sfdp=NULL; - struct filemmap fmmap; - boolean mmapfailed; - - /* OK, find subfont and look for correct infix */ -#ifdef HAVE_KPSE_ENC_FORMATS - sfdfile=kpse_find_file(sfdname,kpse_sfd_format,false); -#endif - if (sfdfile == NULL) { - Warning("subfont file %s could not be found",sfdname); - return(NULL); - } - DEBUG_PRINT((DEBUG_FT|DEBUG_ENC),("\n OPEN SUBFONT:\t'%s'", sfdfile)); - mmapfailed = MmapFile(sfdfile,&fmmap); - free(sfdfile); - if (mmapfailed) - return(NULL); - pos=fmmap.data; - max=fmmap.data+fmmap.size; - while(posname=(char*)sfdp+sizeof(struct subfont); - strcpy(sfdp->name,sfdname); - sfdp->infix=(char*)sfdp+sizeof(struct subfont)+strlen(sfdname)+1; - strcpy(sfdp->infix,infix); - sfdp->encoding=FT_ENCODING_UNICODE; - while (poscharindex[codepoint]=number; - DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); - number++; - codepoint++; - } - default: - if (codepoint<256) - sfdp->charindex[codepoint]=number; - DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); - } - while(postfmname,*sfdwant=fontname, - *sfdname,*infix,*postfix; - - while (*sfdspec!='\0' && *sfdspec==*sfdwant) { - sfdspec++; - sfdwant++; - } - /* Find delimiter */ - if (*sfdspec!='@') - return(NULL); - sfdspec++; - postfix=sfdspec; - while (*postfix!='\0' && *postfix!='@') - postfix++; - if (*postfix!='@') - return(NULL); - /* Extract subfont name */ - sfdname=malloc(postfix-sfdspec+1); - strncpy(sfdname,sfdspec,postfix-sfdspec); - sfdname[postfix-sfdspec]='\0'; - /* Check postfix */ - postfix++; - if (strcmp(sfdwant+strlen(sfdwant)-strlen(postfix),postfix)!=0) - return(NULL); - /* Extract infix */ - infix=malloc(strlen(sfdwant)-strlen(postfix)+1); - strncpy(infix,sfdwant,strlen(sfdwant)-strlen(postfix)); - infix[strlen(sfdwant)-strlen(postfix)]='\0'; - DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT %s %s %s",fontname,sfdname,infix)); - /* Find subfont */ - while(temp!=NULL - && (strcmp(sfdname,temp->name)!=0 || strcmp(infix,temp->infix)!=0)) - temp=temp->next; - if (temp==NULL) { - temp=ReadSubfont(sfdname,infix); - if (temp!=NULL) { - temp->next=subfontp; - subfontp=temp; - } - } - entry=NewPSFont(entry); - if (entry!=NULL) { - entry->tfmname=copyword(fontname); - entry->subfont=temp; - } - free(infix); - free(sfdname); - return(entry); -} - -void ClearSubfont(void) -{ - struct subfont *temp=subfontp; - - while(temp!=NULL) { - subfontp=subfontp->next; - free(temp); - temp=subfontp; - } -} - diff --git a/Build/source/texk/dvipng/dvipng-1.13/special.c b/Build/source/texk/dvipng/dvipng-1.13/special.c deleted file mode 100644 index 9a983b6df1c..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/special.c +++ /dev/null @@ -1,902 +0,0 @@ -/* special.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -#ifndef MIKTEX -#ifdef WIN32 -#include -#include -#include -#define snprintf _snprintf -#endif /* WIN32 */ -#endif - -#define SKIPSPACES(s) while(s && *s==' ' && *s!='\0') s++ - -/* PostScript can come as a string (headers and raw specials) or - a memory-mapped file (headers and included EPS figures). */ - -struct pscode { - struct pscode* next; - char* special; /* complete special */ - char* code; /* PS string, null if a file */ - char* filename; /* file name, null if a string */ - char* postcode; /* post PS string */ - struct filemmap fmmap; /* file mmap */ -}; - -struct pscode* psheaderp=NULL; /* static, DVI-specific header list */ - -static void PSCodeInit(struct pscode *entry, char *special) -{ - entry->next=NULL; - entry->special=special; - entry->code=NULL; - entry->filename=NULL; - entry->postcode=NULL; - entry->fmmap.data=NULL; - if (special==NULL) - return; - if (strncmp(special,"header=",7)==0) - entry->filename=special+7; - else if (strncmp(special,"ps:: plotfile ",14)==0) - entry->filename=special+14; - else if (special[0]=='"' || special[0]=='!') - entry->code=special+1; - else if (strncmp(special,"ps::[begin]",11)==0) - entry->code=special+11; - else if (strncmp(special,"ps::[end]",9)==0) - entry->code=special+9; - else if (strncmp(special,"ps::",4)==0) - entry->code=special+4; - else if (strncmp(special,"ps:",3)==0) - entry->code=special+3; - else - entry->code=special; -#ifdef DEBUG - if (entry->code!=NULL) - DEBUG_PRINT(DEBUG_GS,(" '%s'",entry->code)); - if (entry->filename!=NULL) - DEBUG_PRINT(DEBUG_GS,(" {%s}",entry->filename)); - if (entry->postcode!=NULL) - DEBUG_PRINT(DEBUG_GS,(" '%s'",entry->postcode)); -#endif -} - - - -void ClearPSHeaders(void) -{ - struct pscode *temp=psheaderp; - - while(temp!=NULL) { - psheaderp=psheaderp->next; - if (temp->fmmap.data!=NULL) - UnMmapFile(&(temp->fmmap)); - free(temp); - temp=psheaderp; - } -} - -static void writepscode(struct pscode* pscodep, FILE* psstream) -{ - while (pscodep!=NULL) { - if (pscodep->code!=NULL) { - fputs(pscodep->code,psstream); - putc('\n',psstream); - DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\t%s",pscodep->code)); - } - if (pscodep->filename!=NULL && pscodep->fmmap.data==NULL) { - char* filepath= - kpse_find_file(pscodep->filename,kpse_tex_ps_header_format,false); - if (filepath==NULL) { - Warning("Cannot find PostScript file %s, ignored", pscodep->filename); - page_flags |= PAGE_GAVE_WARN; - } else if (MmapFile(filepath,&(pscodep->fmmap))) { - Warning("PostScript file %s unusable, ignored", pscodep->filename); - page_flags |= PAGE_GAVE_WARN; - } - } - if (pscodep->fmmap.data!=NULL) { - unsigned char* position; - - DEBUG_PRINT(DEBUG_GS,("\n PS FILE:\t%s",pscodep->filename)); - position=(unsigned char*)pscodep->fmmap.data; - while(position - < (unsigned char*)pscodep->fmmap.data + pscodep->fmmap.size) { - putc(*position,psstream); - position++; - } - } - if (pscodep->postcode!=NULL) { - fputs(pscodep->postcode,psstream); - putc('\n',psstream); - DEBUG_PRINT(DEBUG_GS,("\n PS POST CODE:\t%s",pscodep->postcode)); - } - pscodep=pscodep->next; - } -} - - -static gdImagePtr -ps2png(struct pscode* pscodep, const char *device, int hresolution, int vresolution, - int llx, int lly, int urx, int ury, int bgred, int bggreen, int bgblue) -{ -#ifndef MIKTEX - int downpipe[2], uppipe[2]; -#ifdef WIN32 - unsigned long nexitcode = STILL_ACTIVE; - HANDLE hchild; - int savestdin, savestdout; -#else /* !WIN32 */ - pid_t pid; -#endif /* !WIN32 */ -#else /* MIKTEX */ - HANDLE hPngStream; - HANDLE hPsStream; - HANDLE hStdErr; - PROCESS_INFORMATION pi; - _TCHAR szCommandLine[2048]; - _TCHAR szGsPath[_MAX_PATH]; -#define GS_PATH szGsPath - int fd; -#endif /* MIKTEX */ - FILE *psstream=NULL, *pngstream=NULL; - char resolution[STRSIZE]; - /* char devicesize[STRSIZE]; */ - gdImagePtr psimage=NULL; -#ifndef WIN32 - static bool showpage=false; -#endif - - sprintf(resolution, "-r%dx%d",hresolution,vresolution); - /* Future extension for \rotatebox - status=sprintf(devicesize, "-g%dx%d", - //(int)((sin(atan(1.0))+1)* - (urx - llx)*hresolution/72,//), - //(int)((sin(atan(1.0))+1)* - (ury - lly)*vresolution/72);//); - */ - DEBUG_PRINT(DEBUG_GS, - ("\n GS CALL:\t%s %s %s %s %s %s %s %s %s %s %s",/* %s", */ - GS_PATH, device, resolution, /*devicesize,*/ - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", - "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", - (option_flags & NO_GSSAFER) ? "": "- ")); -#ifndef MIKTEX -#ifndef WIN32 - if (pipe(downpipe) || pipe(uppipe)) return(NULL); - /* Ready to fork */ - pid = fork (); - if (pid == 0) { /* Child process. Execute gs. */ - close(downpipe[1]); - dup2(downpipe[0], STDIN_FILENO); - close(downpipe[0]); - close(uppipe[0]); - dup2(uppipe[1], STDOUT_FILENO); - close(uppipe[1]); - execlp(GS_PATH, GS_PATH, device, resolution, /*devicesize,*/ - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", - "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", - (option_flags & NO_GSSAFER) ? NULL: "-", - NULL); - _exit (EXIT_FAILURE); -#else /* WIN32 */ - if (_pipe(downpipe, 65536, O_BINARY | _O_NOINHERIT)==-1 || - _pipe(uppipe, 65536, O_BINARY | _O_NOINHERIT)==-1) { - fprintf(stderr, "Pipe error.\n"); - return NULL; -#endif /* WIN32 */ - } - /* Parent process. */ -#ifdef WIN32 - savestdin = _dup(fileno(stdin)); - _dup2(downpipe[0], fileno(stdin)); -#endif /* WIN32 */ - close(downpipe[0]); -#ifdef WIN32 - savestdout = _dup(fileno(stdout)); - _dup2(uppipe[1], fileno(stdout)); - close(uppipe[1]); -#endif /* WIN32 */ - psstream=fdopen(downpipe[1],"wb"); - /* fclose(psstream); psstream=fopen("test.ps","wb"); */ -#ifndef WIN32 - if (psstream == NULL) - close(downpipe[1]); - close(uppipe[1]); - pngstream=fdopen(uppipe[0],"rb"); - if (pngstream == NULL) - close(uppipe[0]); -#else /* WIN32 */ - if (psstream == NULL) { - fprintf(stderr, "psstream == NULL\n"); - close(downpipe[1]); - } - pngstream=fdopen(uppipe[0],"rb"); - if (pngstream == NULL) { - fprintf(stderr, "pngstream == NULL\n"); - close(uppipe[0]); - } - hchild=(HANDLE)spawnlp(_P_NOWAIT, GS_PATH, GS_PATH, device, resolution, - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", - "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", - (option_flags & NO_GSSAFER) ? NULL : "-", NULL); - - if(hchild) { -#endif /* WIN32 */ -#else /* MIKTEX */ - if (! miktex_find_miktex_executable("mgs.exe", szGsPath)) { - Warning("Ghostscript could not be found"); - return(NULL); - } - sprintf(szCommandLine,"\"%s\" %s %s %s %s %s %s %s %s %s %s",/* %s",*/ - szGsPath, device, resolution, /*devicesize,*/ - "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", - "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", - (option_flags & NO_GSSAFER) ? "-": "-dSAFER", - (option_flags & NO_GSSAFER) ? "": "-"); - if (! miktex_start_process_3(szCommandLine, &pi, INVALID_HANDLE_VALUE, - &hPsStream, &hPngStream, &hStdErr, 0)) { - Warning("Ghostscript could not be started"); - return(NULL); - } - CloseHandle (pi.hThread); - fd = _open_osfhandle((intptr_t)hPsStream, _O_WRONLY); - if (fd >= 0) { - psstream = _tfdopen(fd, "wb"); - if (psstream == NULL) - _close (fd); - } - fd = _open_osfhandle((intptr_t)hPngStream, _O_RDONLY); - if (fd >= 0) { - pngstream = _tfdopen(fd, "rb"); - if (pngstream == NULL) - _close (fd); - } -#endif /* MIKTEX */ - if (psstream) { - writepscode(psheaderp,psstream); - DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\t<>setpagedevice", - urx - llx, ury - lly,llx,lly)); - fprintf(psstream, "<>setpagedevice\n", - urx - llx, ury - lly,llx,lly); - if ( bgred < 255 || bggreen < 255 || bgblue < 255 ) { - DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\tgsave %f %f %f setrgbcolor clippath fill grestore", - bgred/255.0, bggreen/255.0, bgblue/255.0)); - fprintf(psstream, "gsave %f %f %f setrgbcolor clippath fill grestore", - bgred/255.0, bggreen/255.0, bgblue/255.0); - } - -/* WIN32 -write the following at the top of an eps: - -%! -/DVIPNGDICT 100 dict def -DVIPNGDICT begin /showpage {} def end -DVIPNGDICT begin -*/ - -#ifdef WIN32 - fprintf(psstream, "\n%%!\n/DVIPNGDICT 100 dict def\n"); - fprintf(psstream, "DVIPNGDICT begin /showpage {} def end\n"); - fprintf(psstream, "DVIPNGDICT begin\n"); -#endif - writepscode(pscodep,psstream); - -/* WIN32 -write the following at the very end of an eps: - -end -showpage -*/ - -#ifdef WIN32 - fprintf(psstream, "\nend\nshowpage\n"); -#endif - -#ifndef WIN32 - if (showpage) { - DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\tshowpage")); - fprintf(psstream, " showpage "); - } -#endif - - fclose(psstream); - } - if (pngstream) { - psimage = gdImageCreateFromPng(pngstream); - fclose(pngstream); - } -#ifdef MIKTEX - CloseHandle(pi.hProcess); -#else /* !MIKTEX */ -#ifdef WIN32 - } - while(nexitcode == STILL_ACTIVE) - GetExitCodeProcess((HANDLE)hchild, &nexitcode); - - CloseHandle((HANDLE)hchild); - _dup2(savestdin, fileno(stdin)); - _dup2(savestdout, fileno(stdout)); - close(savestdin); - close(savestdout); - close(uppipe[0]); - close(uppipe[1]); - close(downpipe[0]); - close(downpipe[1]); -#endif /* WIN32 */ -#endif /* !MIKTEX */ - - if (psimage == NULL) { - DEBUG_PRINT(DEBUG_GS,("\n GS OUTPUT:\tNO IMAGE ")); - -/* - For WIN32 we always output showpage. -*/ - -#ifndef WIN32 - if (!showpage) { - showpage=true; - DEBUG_PRINT(DEBUG_GS,("(will try adding \"showpage\") ")); - psimage=ps2png(pscodep, - device, hresolution, vresolution, llx, lly, urx, ury, - bgred,bggreen,bgblue); - showpage=false; - } -#endif - -#ifdef DEBUG - } else { - DEBUG_PRINT(DEBUG_GS,("\n GS OUTPUT:\t%dx%d image ", - gdImageSX(psimage),gdImageSY(psimage))); -#endif - } - return psimage; -} - -static gdImagePtr -rescale(gdImagePtr psimage, int pngwidth, int pngheight) -{ - gdImagePtr scaledimage=psimage; - /* Rescale unless correct size */ - if (psimage!=NULL - && gdImageSX(psimage)!=pngwidth - && gdImageSY(psimage)!=pngheight) { - DEBUG_PRINT(DEBUG_DVI, - ("\n RESCALE INCLUDED BITMAP \t(%d,%d) -> (%d,%d)", - gdImageSX(psimage),gdImageSY(psimage), - pngwidth,pngheight)); -#ifdef HAVE_GDIMAGECREATETRUECOLOR - scaledimage=gdImageCreateTrueColor(pngwidth,pngheight); - /* Copy with overwrite, remember that this is the rescaled source - image. The real target has alpha blending on. */ - gdImageAlphaBlending(scaledimage,0); - gdImageCopyResampled(scaledimage,psimage,0,0,0,0, - pngwidth,pngheight, - gdImageSX(psimage),gdImageSY(psimage)); -#else - scaledimage=gdImageCreate(pngwidth,pngheight); - gdImageCopyResized(scaledimage,psimage,0,0,0,0, - pngwidth,pngheight, - gdImageSX(psimage),gdImageSY(psimage)); -#endif - gdImageDestroy(psimage); - } - return(scaledimage); -} - -static void newpsheader(const char* special) { - struct pscode* tmp; - char* txt; - - if (psheaderp==NULL && strcmp(special,"header=tex.pro")!=0) { - newpsheader("header=tex.pro"); - newpsheader("header=color.pro"); - newpsheader("header=special.pro"); - } - if (strcmp(special+strlen(special)-4,".xcp")==0 - && strncmp(special,"header=",7)==0) - InitXColorPrologue(special+7); - if (strncmp(special,"! /pgfH",7)==0) - newpsheader("! TeXDict begin"); - if (psheaderp==NULL) { - if ((tmp=psheaderp=malloc(sizeof(struct pscode)))==NULL) - Fatal("cannot malloc space for PostScript header struct"); - } else { - /* No duplicates. This still misses pre=..., because we still - change that. To be fixed */ - tmp=psheaderp; - if (strcmp(tmp->special,special)==0) - return; - while(tmp->next!=NULL) { - tmp=tmp->next; - if (strcmp(tmp->special,special)==0) - return; - } - if ((tmp->next=malloc(sizeof(struct pscode)))==NULL) - Fatal("cannot malloc space for PostScript header struct"); - tmp=tmp->next; - } - DEBUG_PRINT(DEBUG_GS,("\n PS HEADER ")); - if ((txt=malloc(strlen(special)+1))==NULL) - Fatal("cannot malloc space for PostScript header"); - strcpy(txt,special); - PSCodeInit(tmp,txt); -} - -/*********************************************************************/ -/**************************** SetSpecial ***************************/ -/*********************************************************************/ - -void SetSpecial(char * special, int32_t hh, int32_t vv) -/* interpret a \special command, made up of keyword=value pairs, - * or !header or ps:literal_PostScript - */ -{ - DEBUG_PRINT(DEBUG_DVI,(" '%s'",special)); - SKIPSPACES(special); - /********************** Color specials ***********************/ - if (strncmp(special,"background ",11)==0) { - background(special+11); - return; - } - if (strncmp(special,"color ",6)==0) { - special+=6; - SKIPSPACES(special); - if (strncmp(special,"push ",5)==0) { - pushcolor(special+5); - } else { - if (strcmp(special,"pop")==0) - popcolor(); - else - resetcolorstack(special); - } - return; - } - - /******************* Image inclusion ********************/ - - /* Needed tests for regression: PNG, GIF, JPEG and EPS inclusion, - * for different gd versions */ - - if (strncmp(special,"PSfile=",7)==0) { /* PSfile */ - char* psname = special+7; - int llx=0,lly=0,urx=0,ury=0,rwi=0,rhi=0; - bool clip=false; - int hresolution,vresolution; - int pngheight,pngwidth; - - /* Remove quotation marks around filename. If no quotation marks, - use first word as filename */ - if (*psname=='"') { - psname++; - special=strrchr(psname,'"'); - } else { - special=strchr(psname,' '); - } - if (special!=NULL) { - *special='\0'; - special++; - } - - /* Retrieve parameters */ - SKIPSPACES(special); - while(special && *special) { - if (strncmp(special,"llx=",4)==0) - llx = strtol(special+4,&special,10); - else if (strncmp(special,"lly=",4)==0) - lly = strtol(special+4,&special,10); - else if (strncmp(special,"urx=",4)==0) - urx = strtol(special+4,&special,10); - else if (strncmp(special,"ury=",4)==0) - ury = strtol(special+4,&special,10); - else if (strncmp(special,"rwi=",4)==0) - rwi = strtol(special+4,&special,10); - else if (strncmp(special,"rhi=",4)==0) - rhi = strtol(special+4,&special,10); - else if (strncmp(special,"clip",4)==0) - {clip = true; special=special+4;} - while (*special && *special!=' ') special++; - SKIPSPACES(special); - } - - /* Calculate resolution, and use our base resolution as a fallback. */ - /* The factor 10 is magic, the dvips graphicx driver needs this. */ - hresolution = ((dpi*rwi+urx-llx-1)/(urx - llx)+9)/10; - vresolution = ((dpi*rhi+ury-lly-1)/(ury - lly)+9)/10; - if (vresolution==0) vresolution = hresolution; - if (hresolution==0) hresolution = vresolution; - if (hresolution==0) hresolution = vresolution = dpi; - - /* Convert from postscript 72 dpi resolution to our given resolution */ - pngwidth = (dpi*rwi+719)/720; /* +719: round up */ - pngheight = (dpi*rhi+719)/720; - if (pngwidth==0) - pngwidth = ((dpi*rhi*(urx-llx)+ury-lly-1)/(ury-lly)+719)/720; - if (pngheight==0) - pngheight = ((dpi*rwi*(ury-lly)+urx-llx-1)/(urx-llx)+719)/720; - if (pngheight==0) { - pngwidth = (dpi*(urx-llx)+71)/72; - pngheight = (dpi*(ury-lly)+71)/72; - } - if (page_imagep != NULL) { /* Draw into image */ - struct pscode image; - gdImagePtr psimage=NULL; -#ifndef HAVE_GDIMAGECREATEFROMPNGPTR - FILE* psstream; -#endif - - PSCodeInit(&image, NULL); - image.filename=kpse_find_file(psname,kpse_pict_format,0); - if (MmapFile(image.filename,&(image.fmmap)) || image.fmmap.size==0) { - Warning("Image file %s unusable, image will be left blank", - image.filename); - page_flags |= PAGE_GAVE_WARN; - return; - } - Message(BE_NONQUIET," <%s",psname); - switch ((unsigned char)*image.fmmap.data) { - case 0x89: /* PNG magic: "\211PNG\r\n\032\n" */ - DEBUG_PRINT(DEBUG_DVI,("\n INCLUDE PNG \t%s",image.filename)); -#ifdef HAVE_GDIMAGECREATEFROMPNGPTR - psimage=gdImageCreateFromPngPtr(image.fmmap.size,image.fmmap.data); -#else - psstream=fopen(image.filename,"rb"); - psimage=gdImageCreateFromPng(psstream); - fclose(psstream); -#endif - psimage=rescale(psimage,pngwidth,pngheight); - break; - case 'G': /* GIF magic: "GIF87" or "GIF89" */ - DEBUG_PRINT(DEBUG_DVI,("\n INCLUDE GIF \t%s",image.filename)); -#ifdef HAVE_GDIMAGEGIF - psimage=rescale(gdImageCreateFromGifPtr(image.fmmap.size, - image.fmmap.data), - pngwidth,pngheight); -#else - DEBUG_PRINT(DEBUG_DVI,(" (NO GIF DECODER)")); -#endif - break; - case 0xff: /* JPEG magic: 0xffd8 */ - DEBUG_PRINT(DEBUG_DVI,("\n INCLUDE JPEG \t%s",image.filename)); -#ifdef HAVE_GDIMAGECREATEFROMJPEG -#ifdef HAVE_GDIMAGECREATEFROMPNGPTR - psimage=gdImageCreateFromJpegPtr(image.fmmap.size,image.fmmap.data); -#else - psstream=fopen(image.filename,"rb"); - psimage=gdImageCreateFromJpeg(psstream); - fclose(psstream); -#endif - psimage=rescale(psimage,pngwidth,pngheight); -#else - DEBUG_PRINT(DEBUG_DVI,(" (NO JPEG DECODER)")); -#endif - break; - default: /* Default, PostScript magic: "%!PS-Adobe" */ - if (option_flags & NO_GHOSTSCRIPT) { - Warning("GhostScript calls disallowed by --noghostscript" ); - page_flags |= PAGE_GAVE_WARN; - } else { - /* Use alpha blending, and render transparent postscript - images. The alpha blending works correctly only from - libgd 2.0.12 upwards */ -#ifdef HAVE_GDIMAGEPNGEX - if (page_imagep->trueColor) { - int tllx=llx,tlly=lly,turx=urx,tury=ury; - - DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), - ("\n GS RENDER \t%s -> pngalpha ",image.filename)); - if (!clip) { - /* Render across the whole image */ - tllx=llx-(hh+1)*72/hresolution; - tlly=lly-(gdImageSY(page_imagep)-vv-1)*72/vresolution; - turx=llx+(gdImageSX(page_imagep)-hh)*72/hresolution; - tury=lly+(vv+1)*72/vresolution; - DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), - ("\n EXPAND BBOX \t%d %d %d %d -> %d %d %d %d", - llx,lly,urx,ury,tllx,tlly,turx,tury)); -#ifdef DEBUG - } else { - DEBUG_PRINT((DEBUG_DVI | DEBUG_GS),(", CLIPPED TO BBOX")); -#endif - } - psimage = ps2png(&image, "-sDEVICE=pngalpha", - hresolution, vresolution, - tllx, tlly, turx, tury, - 255,255,255); - if (psimage==NULL) - Warning("No GhostScript pngalpha output, opaque image inclusion"); - } else - Warning("Palette output, opaque image inclusion"); -#endif - if (psimage==NULL) { - /* png256 gives inferior result */ - DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), - ("\n GS RENDER \t%s -> png16m", image.filename)); - psimage = ps2png(&image, "-sDEVICE=png16m", - hresolution, vresolution, - llx, lly, urx, ury, - cstack[0].red,cstack[0].green,cstack[0].blue); - clip=true; - page_flags |= PAGE_GAVE_WARN; - } - if (!clip) { - /* Rendering across the whole image */ - hh=0; - vv=gdImageSY(psimage)-1; - } - } - } - UnMmapFile(&(image.fmmap)); - if (psimage!=NULL) { - DEBUG_PRINT(DEBUG_DVI, - ("\n GRAPHIC(X|S) INCLUDE \t%s (%d,%d) res %dx%d at (%d,%d)", - psname,gdImageSX(psimage),gdImageSY(psimage), - hresolution,vresolution,hh,vv)); -#ifdef HAVE_GDIMAGECREATETRUECOLOR - if (psimage->trueColor && !page_imagep->trueColor) - gdImageTrueColorToPalette(psimage,0,256); -#endif -#ifdef HAVE_GDIMAGEPNGEX - gdImageAlphaBlending(page_imagep,1); -#else - Warning("Using libgd < 2.0.12, opaque image inclusion"); - page_flags |= PAGE_GAVE_WARN; -#endif - gdImageCopy(page_imagep, psimage, - hh, vv-gdImageSY(psimage)+1, - 0,0, - gdImageSX(psimage),gdImageSY(psimage)); -#ifdef HAVE_GDIMAGEPNGEX - gdImageAlphaBlending(page_imagep,0); -#endif - gdImageDestroy(psimage); - } else { - Warning("Unable to load %s, image will be left blank",image.filename); - page_flags |= PAGE_GAVE_WARN; - } - free(image.filename); - Message(BE_NONQUIET,">"); - } else { /* Don't draw */ - page_flags |= PAGE_TRUECOLOR; - DEBUG_PRINT(DEBUG_DVI, - ("\n GRAPHIC(X|S) INCLUDE \t%s (%d,%d) res %dx%d at (%d,%d)", - psname,pngheight,pngwidth, - hresolution,vresolution,hh,vv)); - min(x_min,hh); - min(y_min,vv-pngheight+1); - max(x_max,hh+pngwidth); - max(y_max,vv+1); - } - return; - } - - /******************* Raw PostScript ********************/ - - if (strncmp(special,"!/preview@version(",18)==0) { - int length=0; - special+=18; - while (special[length]!='\0' && special[length]!=')') - length++; - if (page_imagep==NULL) - Message(BE_NONQUIET," (preview-latex version %.*s)",length,special); - return; - } - - /* preview-latex' tightpage option */ - if (strncmp(special,"!/preview@tightpage",19)==0) { - special+=19; - SKIPSPACES(special); - if (strncmp(special,"true",4)==0) { - if (page_imagep==NULL) - Message(BE_NONQUIET," (preview-latex tightpage option detected, will use its bounding box)"); - dvi->flags |= DVI_PREVIEW_LATEX_TIGHTPAGE; - } - return; - } - if (strncmp(special,"!userdict",9)==0 - && strstr(special+10,"7{currentfile token not{stop}if 65781.76 div")!=NULL) { - if (page_imagep==NULL && ~dvi->flags & DVI_PREVIEW_LATEX_TIGHTPAGE) - Message(BE_NONQUIET," (preview-latex <= 0.9.1 tightpage option detected, will use its bounding box)"); - dvi->flags |= DVI_PREVIEW_LATEX_TIGHTPAGE; - return; - } - - /* preview-latex' dvips bop-hook redefinition */ - if (strncmp(special,"!userdict",9)==0 - && strstr(special+10,"preview-bop-")!=NULL) { - dvi->flags |= DVI_PREVIEW_BOP_HOOK; - if (page_imagep==NULL) - Message(BE_VERBOSE," (preview-latex beginning-of-page-hook detected)"); - return; - } - - if (dvi->flags & DVI_PREVIEW_BOP_HOOK && ~page_flags & PAGE_PREVIEW_BOP - && strncmp(special,"ps::",4)==0) { - /* Hokay, decode bounding box */ - dviunits adj_llx,adj_lly,adj_urx,adj_ury,ht,dp,wd; - adj_llx = strtol(special+4,&special,10); - adj_lly = strtol(special,&special,10); - adj_urx = strtol(special,&special,10); - adj_ury = strtol(special,&special,10); - ht = strtol(special,&special,10); - dp = strtol(special,&special,10); - wd = strtol(special,&special,10); - page_flags |= PAGE_PREVIEW_BOP; - if (wd>0) { - x_offset_tightpage = - (-adj_llx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; - x_width_tightpage = x_offset_tightpage - +(wd+adj_urx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; - } else { - x_offset_tightpage = - (-wd+adj_urx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; - x_width_tightpage = x_offset_tightpage - +(-adj_llx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; - } - /* y-offset = height - 1 */ - y_offset_tightpage = - (((ht>0)?ht:0)+adj_ury+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor-1; - y_width_tightpage = y_offset_tightpage+1 - +(((dp>0)?dp:0)-adj_lly+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; - return; - } - - if (special[0]=='"' || strncmp(special,"ps:",3)==0) { /* Literal PostScript */ - if (page_imagep != NULL) { /* Draw into image */ - static struct pscode *pscodep=NULL; - static bool psenvironment=false; - bool nextisps; - struct pscode *tmp; - gdImagePtr psimage=NULL; - char *txt; - const char *newspecial=NULL; /* Avoid warning from special="..." */ - - /* Some packages split their literal PostScript code into - several specials. Check for those, and concatenate them so - that they're given to one and the same invocation of gs */ - if (pscodep==NULL) { - Message(BE_NONQUIET," next != NULL) - tmp=tmp->next; - if ((tmp->next=malloc(sizeof(struct pscode)))==NULL) - Fatal("cannot malloc space for raw PostScript struct"); - tmp=tmp->next; - } - if (strncmp(special,"ps::[begin]",11)==0) - psenvironment=true; - else if (strncmp(special,"ps::[end]",9)==0) - psenvironment=false; - else if (strcmp(special,"ps:: pgfo")==0) - /* PostScript code to start page for pgf PostScript - specials. The first numbers are generally valid for the bop - instruction, and the latter code is to move the origin to - the right place. */ - newspecial="ps:: 39139632 55387786 1000 600 600 (tikzdefault.dvi) @start 1 0 bop pgfo 0 0 matrix defaultmatrix transform itransform translate"; - else if (strcmp(special,"ps:: pgfc")==0) - newspecial="ps:: pgfc eop end"; - nextisps=DVIIsNextPSSpecial(dvi); - if (psenvironment || nextisps) { - if (!nextisps) { - Warning("PostScript environment contains DVI commands"); - page_flags |= PAGE_GAVE_WARN; - } - DEBUG_PRINT(DEBUG_GS,("\n PS SPECIAL ")); - if (newspecial == NULL) - newspecial=special; - if ((txt=malloc(strlen(newspecial)+1))==NULL) - Fatal("cannot allocate space for raw PostScript special"); - strcpy(txt,newspecial); - PSCodeInit(tmp,txt); - return; - } - DEBUG_PRINT(DEBUG_DVI,("\n LAST PS SPECIAL ")); - if (newspecial != NULL) { - if ((special=malloc(strlen(newspecial)+1))==NULL) - Fatal("cannot allocate space for raw PostScript special"); - strcpy(special,newspecial); - } - PSCodeInit(tmp,special); - /* Now, render image */ - if (option_flags & NO_GHOSTSCRIPT) - Warning("GhostScript calls disallowed by --noghostscript" ); - else { - /* Use alpha blending, and render transparent postscript - images. The alpha blending works correctly only from - libgd 2.0.12 upwards */ -#ifdef HAVE_GDIMAGEPNGEX - if (page_imagep->trueColor) { - /* Render across the whole image */ - psimage = ps2png(pscodep, "-sDEVICE=pngalpha", - dpi,dpi, - -(hh+1)*72/dpi, - -(gdImageSY(page_imagep)-vv-1)*72/dpi, - (gdImageSX(page_imagep)-hh)*72/dpi, - (vv+1)*72/dpi, - 255,255,255); - if (psimage!=NULL) { - gdImageAlphaBlending(page_imagep,1); - gdImageCopy(page_imagep, psimage, - 0,0,0,0, - gdImageSX(psimage),gdImageSY(psimage)); - gdImageAlphaBlending(page_imagep,0); - gdImageDestroy(psimage); - } else - Warning("No GhostScript pngalpha output, cannot render raw PostScript"); - } else - Warning("Palette output, cannot include raw PostScript"); -#else - Warning("Using libgd < 2.0.12, unable to include raw PostScript"); -#endif - } - while(pscodep->next != NULL) { - tmp=pscodep->next; - free(pscodep->special); - free(pscodep); - pscodep=tmp; - } - free(pscodep); - pscodep=NULL; - if (newspecial != NULL) - free(special); - if (psimage==NULL) - page_flags |= PAGE_GAVE_WARN; - Message(BE_NONQUIET,">"); - } else { /* Don't draw */ - page_flags |= PAGE_TRUECOLOR; - } - return; - } - - if (strncmp(special,"papersize=",10)==0) { /* papersize spec, ignored */ - return; - } - - if (special[0]=='!' || strncmp(special,"header=",7)==0) { /* PS header */ - newpsheader(special); - return; - } - - if (strncmp(special,"src:",4)==0) { /* source special */ - if ( page_imagep != NULL ) - Message(BE_NONQUIET," at (%ld,%ld) source \\special{%s}", - hh, vv, special); - return; - } - if ( page_imagep != NULL ) { - Warning("at (%ld,%ld) unimplemented \\special{%s}", - hh, vv, special); - page_flags |= PAGE_GAVE_WARN; - } -} - diff --git a/Build/source/texk/dvipng/dvipng-1.13/t1.c b/Build/source/texk/dvipng/dvipng-1.13/t1.c deleted file mode 100644 index 4a74a8274f4..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/t1.c +++ /dev/null @@ -1,192 +0,0 @@ -/* t1.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2009 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -void LoadT1(int32_t c, struct char_entry * ptr) -{ - GLYPH *glyph; - int original_width,original_height; - int i,j,k,width,height; - unsigned short shrunk_width,shrunk_height; - short xoffset,yoffset; - unsigned short i_offset,j_offset; - - DEBUG_PRINT(DEBUG_T1,("\n LOAD T1 CHAR\t%d",c)); - if ((glyph= - T1_SetChar(currentfont->T1id, c, - (float)currentfont->dpi*currentfont->d/65536/72.27, - currentfont->psfontmap==NULL ? NULL : currentfont->psfontmap->t1_transformp)) - ==NULL) - Fatal("cannot load T1 char %d",c); - - DEBUG_PRINT(DEBUG_T1,(" (%d)",ptr->tfmw)); - - original_width = glyph->metrics.rightSideBearing - - glyph->metrics.leftSideBearing; - original_height = glyph->metrics.ascent - glyph->metrics.descent; - DEBUG_PRINT(DEBUG_T1,(" %dx%d",original_width,original_height)); - - if (original_width > 0x7fff || original_height > 0x7fff) - Fatal("character %d too large in file %s", c, currentfont->name); - - /* - * Hotspot issues: Shrinking to the topleft corner rather than the - hotspot will displace glyphs a fraction of a pixel. We deal with - this in as follows: The glyph is shrunk to its hotspot by - offsetting the bitmap somewhat to put the hotspot in the lower - left corner of a "shrink square". Shrinking to the topleft corner - will then act as shrinking to the hotspot. This may enlarge the - bitmap somewhat, of course. (Also remember that the below - calculation of i/j_offset is in integer arithmetics.) - - There will still be a displacement from rounding the dvi - position, but vertically it will be equal for all glyphs on a - line, so we displace a whole line vertically by fractions of a - pixel. This is acceptible, IMHO. Sometime there will be support - for subpixel positioning, horizontally. Will do for now, I - suppose. - */ - xoffset = -glyph->metrics.leftSideBearing; - /* printf("xoffset: %d\n",xoffset); */ - i_offset = ( shrinkfactor - xoffset % shrinkfactor ) % shrinkfactor; - width = original_width+i_offset; - ptr->xOffset = xoffset+i_offset; - - yoffset = glyph->metrics.ascent-1; - /* printf("yoffset: %d\n",yoffset); */ - j_offset = ( shrinkfactor - (yoffset-(shrinkfactor-1)) % shrinkfactor ) - % shrinkfactor; - height = original_height+j_offset; - ptr->yOffset = yoffset+j_offset; - - DEBUG_PRINT(DEBUG_T1,(" (%dx%d)",width,height)); - /* - Extra marginal so that we do not crop the image when shrinking. - */ - shrunk_width = (width + shrinkfactor - 1) / shrinkfactor; - shrunk_height = (height + shrinkfactor - 1) / shrinkfactor; - ptr->w = shrunk_width; - ptr->h = shrunk_height; - - /* printf("(%d,%d) ",ptr->w,ptr->h); */ - DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); - - /* - Shrink raster while doing antialiasing. - */ - if ((ptr->data = calloc(shrunk_width*shrunk_height,sizeof(char))) == NULL) - Fatal("unable to malloc image space for char %c", (char)c); - for (j = 0; j < original_height; j++) { - for (i = 0; i < (original_width+7)/8 ; i++) { - for (k = 0; k < 8 ; k++) { - DEBUG_PRINT(DEBUG_GLYPH, - ("%c", - (glyph->bits[i+j*((original_width+7)/8)] & (1<data[(i*8+k+i_offset)/shrinkfactor - +(j+j_offset)/shrinkfactor*shrunk_width] += - (glyph->bits[i+j*((original_width+7)/8)] & (1<data[i+j*shrunk_width] = ptr->data[i+j*shrunk_width] - *255/shrinkfactor/shrinkfactor; - DEBUG_PRINT(DEBUG_GLYPH,("%3u ",ptr->data[i+j*shrunk_width])); - } - DEBUG_PRINT(DEBUG_GLYPH,("|\n")); - } -} - -bool InitT1(struct font_entry * tfontp) -{ - if (libt1==NULL) { - if ((libt1=T1_InitLib( NO_LOGFILE | IGNORE_CONFIGFILE - | IGNORE_FONTDATABASE | T1_NO_AFM)) == NULL) { - Warning("an error occured during t1lib initialisation, disabling it"); - option_flags &= ~USE_LIBT1; - return(false); - } -# ifdef DEBUG - else - DEBUG_PRINT(DEBUG_T1,("\n T1LIB VERSION: %s", T1_GetLibIdent())); -# endif - } - - DEBUG_PRINT((DEBUG_DVI|DEBUG_T1),("\n OPEN T1 FONT:\t'%s'", tfontp->name)); - tfontp->T1id = T1_AddFont( tfontp->name ); - if (tfontp->T1id < 0) { - Warning("t1lib could not open font file %s", tfontp->name); - return(false); - } - if (T1_LoadFont(tfontp->T1id)) { - Warning("t1lib could not load font file %s", tfontp->name); - return(false); - } - Message(BE_VERBOSE,"<%s>", tfontp->name); - if (tfontp->psfontmap!=NULL && tfontp->psfontmap->encoding != NULL) { - DEBUG_PRINT(DEBUG_T1,("\n USE ENCODING:\t'%s'", tfontp->psfontmap->encoding->name)); - if (T1_ReencodeFont(tfontp->T1id,tfontp->psfontmap->encoding->charname)) { - Warning("unable to use font encoding '%s' for %s", - tfontp->psfontmap->encoding->name,tfontp->name); - return(false); - } - } - tfontp->type = FONT_TYPE_T1; - return(true); -} - - -static void UnLoadT1(struct char_entry *ptr) -{ - if (ptr->data!=NULL) - free(ptr->data); - ptr->data=NULL; -} - - -void DoneT1(struct font_entry *tfontp) -{ - int c=0; - - int error = T1_DeleteFont( tfontp->T1id ); - if (error) - Warning("font file %s could not be closed", tfontp->name); - while(cchr[c]!=NULL) { - UnLoadT1((struct char_entry*)tfontp->chr[c]); - free(tfontp->chr[c]); - tfontp->chr[c]=NULL; - } - c++; - } - if (tfontp->name!=NULL) - free(tfontp->name); - tfontp->name=NULL; -} - - diff --git a/Build/source/texk/dvipng/dvipng-1.13/test_dvipng.tex b/Build/source/texk/dvipng/dvipng-1.13/test_dvipng.tex deleted file mode 100644 index 34814776070..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/test_dvipng.tex +++ /dev/null @@ -1,48 +0,0 @@ -% test_dvipng.tex -% -% Part of the dvipng distribution -% -% This program is free software: you can redistribute it and/or modify -% it under the terms of the GNU Lesser General Public License as -% published by the Free Software Foundation, either version 3 of the -% License, or (at your option) any later version. -% -% This program is distributed in the hope that it will be useful, but -% WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -% Lesser General Public License for more details. -% -% You should have received a copy of the GNU Lesser General Public -% License along with this program. If not, see -% . -% -% Copyright (C) 2002-2010 Jan-{\AA}ke Larsson - -\documentclass{article} -%\usepackage[active,textmath]{preview} -\usepackage{color} -\pagestyle{empty} - -\begin{document} -\begin{equation} - \int dx -\end{equation} -\newpage -$\int dx$ -\newpage -$\sqrt2+1=\frac1{\sqrt2-1}$ -\newpage -\framebox{\textbackslash\ttfamily framebox} -\newpage -\( \begin{array}{|r|} \hline a \cr \hline \end{array} \) -\newpage -fig, pig, flask, efficiency, effluent -\newpage -\Huge A \LARGE A \Large A \large A \normalsize A \small A -\footnotesize A \scriptsize A \tiny A -\newpage -\color{yellow} - -\section*{Hello world} -\pagecolor{blue} -\end{document} diff --git a/Build/source/texk/dvipng/dvipng-1.13/tfm.c b/Build/source/texk/dvipng/dvipng-1.13/tfm.c deleted file mode 100644 index a8a829cc932..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/tfm.c +++ /dev/null @@ -1,75 +0,0 @@ -/* tfm.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2009 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -bool ReadTFM(struct font_entry * tfontp, char* tfmname) -{ - struct filemmap fmmap; - struct char_entry *tcharptr; - unsigned char *position; - int lh,bc,ec,nw, c; - dviunits* width; - - DEBUG_PRINT((DEBUG_DVI|DEBUG_FT|DEBUG_TFM), - ("\n OPEN METRICS:\t'%s'", tfmname)); - if (MmapFile(tfmname,&fmmap)) return(false); - position=(unsigned char*)fmmap.data; - lh = UNumRead(position+2,2); - bc = UNumRead(position+4,2); - ec = UNumRead(position+6,2); - nw = UNumRead(position+8,2); - DEBUG_PRINT(DEBUG_TFM,(" %d %d %d %d",lh,bc,ec,nw)); - width=malloc(nw*sizeof(dviunits)); - c=0; - position=position+24+(lh+ec-bc+1)*4; - while( c < nw ) { - width[c] = SNumRead(position,4); - c++; - position += 4; - } - - /* Read char widths */ - c=bc; - position=(unsigned char*)fmmap.data+24+lh*4; - while(c <= ec) { - DEBUG_PRINT(DEBUG_TFM,("\n@%ld TFM METRICS:\t", - (long)position - (long)fmmap.data)); - tcharptr=xmalloc(sizeof(struct char_entry)); - tcharptr->data=NULL; - tcharptr->tfmw=width[*position]; - DEBUG_PRINT(DEBUG_TFM,("%d [%d] %d",c,*position,tcharptr->tfmw)); - tcharptr->tfmw = (dviunits) - ((int64_t) tcharptr->tfmw * tfontp->s / (1 << 20)); - DEBUG_PRINT(DEBUG_TFM,(" (%d)",tcharptr->tfmw)); - if (c >= NFNTCHARS) /* Only positive for now */ - Fatal("tfm file %s exceeds char numbering limit",tfmname); - tfontp->chr[c] = tcharptr; - c++; - position += 4; - } - free(width); - UnMmapFile(&fmmap); - return(true); -} diff --git a/Build/source/texk/dvipng/dvipng-1.13/vf.c b/Build/source/texk/dvipng/dvipng-1.13/vf.c deleted file mode 100644 index d1d33fe6d7e..00000000000 --- a/Build/source/texk/dvipng/dvipng-1.13/vf.c +++ /dev/null @@ -1,144 +0,0 @@ -/* vf.c */ - -/************************************************************************ - - Part of the dvipng distribution - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this program. If not, see - . - - Copyright (C) 2002-2010 Jan-Åke Larsson - -************************************************************************/ - -#include "dvipng.h" - -#define VF_ID 202 -#define LONG_CHAR 242 - -int32_t SetVF(struct char_entry* ptr) -{ - struct font_entry* currentvf; - unsigned char *command,*end; - - currentvf=currentfont; - BeginVFMacro(currentvf); - command = ptr->data; - end = command + ptr->length; - while (command < end) { - DEBUG_PRINT(DEBUG_DVI,("\n VF MACRO:\t%s ", dvi_commands[*command])); - DrawCommand(command,currentvf); - command += CommandLength(command); - } - EndVFMacro(); - currentfont=currentvf; - return(ptr->tfmw); -} - - - -void InitVF(struct font_entry * tfontp) -{ - unsigned char* position; - int length; - struct char_entry *tcharptr; - uint32_t c=0; - struct font_num *tfontnump; /* temporary font_num pointer */ - - DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n OPEN FONT:\t'%s'", tfontp->name)); - Message(BE_VERBOSE,"<%s>", tfontp->name); - if (MmapFile(tfontp->name,&(tfontp->fmmap))) - Fatal("font file %s unusable", tfontp->name); - position=(unsigned char*)tfontp->fmmap.data; - if (*(position) != PRE) - Fatal("unknown font format in file %s",tfontp->name); - if (*(position+1) != VF_ID) - Fatal( "wrong version %d of vf file %s (should be 202)", - (int)*(position+1),tfontp->name); - DEBUG_PRINT(DEBUG_VF,("\n VF_PRE:\t'%.*s'", - (int)*(position+2), position+3)); - position = position+3 + *(position+2); - c=UNumRead(position, 4); - DEBUG_PRINT(DEBUG_VF,(" %d", c)); - CheckChecksum (tfontp->c, c, tfontp->name); - tfontp->designsize = UNumRead(position+4,4); - DEBUG_PRINT(DEBUG_VF,(" %d", tfontp->designsize)); - tfontp->type = FONT_TYPE_VF; - tfontp->vffontnump=NULL; - /* Read font definitions */ - position += 8; - while(*position >= FNT_DEF1 && *position <= FNT_DEF4) { - DEBUG_PRINT(DEBUG_VF,("\n @%ld VF:\t%s", - (long)position - (long)tfontp->fmmap.data, - dvi_commands[*position])); - FontDef(position,tfontp); - length = dvi_commandlength[*position]; - position += length + *(position + length-1) + *(position+length-2); - } - /* Default font is the first defined */ - tfontnump = tfontp->vffontnump; - while (tfontnump->next != NULL) { - tfontnump = tfontnump->next; - } - tfontp->defaultfont=tfontnump->k; - - /* Read char definitions */ - while(*position < FNT_DEF1) { - DEBUG_PRINT(DEBUG_VF,("\n@%ld VF CHAR:\t", - (long)position - (long)tfontp->fmmap.data)); - tcharptr=xmalloc(sizeof(struct char_entry)); - switch (*position) { - case LONG_CHAR: - tcharptr->length = UNumRead(position+1,4); - c = UNumRead(position+5,4); - tcharptr->tfmw = UNumRead(position+9,4); - position += 13; - break; - default: - tcharptr->length = UNumRead(position,1); - c = UNumRead(position+1,1); - tcharptr->tfmw = UNumRead(position+2,3); - position += 5; - } - DEBUG_PRINT(DEBUG_VF,("%d %d %d",tcharptr->length,c,tcharptr->tfmw)); - tcharptr->tfmw = (int32_t) - ((int64_t) tcharptr->tfmw * tfontp->s / (1 << 20)); - DEBUG_PRINT(DEBUG_VF,(" (%d)",tcharptr->tfmw)); - if (c >= NFNTCHARS) /* Only positive for now */ - Fatal("VF font %s exceeds char numbering limit",tfontp->name); - tfontp->chr[c] = tcharptr; - tcharptr->data=position; - position += tcharptr->length; - } -} - - -void DoneVF(struct font_entry *tfontp) -{ - int c=FIRSTFNTCHAR; - - UnMmapFile(&(tfontp->fmmap)); - while(c<=LASTFNTCHAR) { - if (tfontp->chr[c]!=NULL) { - free(tfontp->chr[c]); - tfontp->chr[c]=NULL; - } - c++; - } - FreeFontNumP(tfontp->vffontnump); - tfontp->vffontnump=NULL; - if (tfontp->name!=NULL) - free(tfontp->name); - tfontp->name=NULL; -} diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog new file mode 100644 index 00000000000..1ddd1a09a6f --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog @@ -0,0 +1,71 @@ +2010-12-15 Peter Breitenlohner + + * Imported release 1.14 from savannah.nongnu.org. + * patch-[2]?-* (removed): Included in 1.14. + + * patch-01-gd-copyright (new): Include full gd copyright notice + into dvipng.texi; seems the safe thing to do. + patch-02-const (new): Avoid compiler warnings. + +2010-10-02 Peter Breitenlohner + + * patch-22-win32-bugfix (new): WIN32 bug fix from Akira Kakuto. + +2010-03-18 Peter Breitenlohner + + * Imported release 1.13 from savannah.nongnu.org. + * patch-[01]?-* (removed): Included in 1.13. + + * patch-20-rpl_malloc (new): Avoid implicit decl of malloc(). + * patch-21-win32 (new): Avoid unnecessary warning in WIN32 code. + +2010-03-09 Peter Breitenlohner + + * patch-12-set_program_name: Replace kpse_set_progname() by + kpse_set_program_name(). + +2010-02-24 Peter Breitenlohner + + * patch-10-mmap-for-WIN32 (new): Former MIKTEX code for mmap + from Fabrice Popineau (?) now used for all WIN32 variants. + * patch-11-win32-fork-and-pipe (new): WIN32 specific replacement + for fork and pipe, using code from Akira Kakuto. + +2010-02-21 Peter Breitenlohner + + * patch-07-always-undef (new): Always undefine min/max before + redefining them (for MinGW32). + * patch-08-HAVE_MMAP (new): #include only + #if defined(HAVE_MMAP) (for MinGW32). + * patch-09-sleep (new): Use Sleep and #include + (for WIN32/MinGW32). + +2010-01-29 Karl Berry + + * patch-06-mathptmx (new): Do not use \usepackage{mathptmx} + in test_dvipng.tex. + +2009-06-12 Peter Breitenlohner + + * patch-05-warnings (new): Avoid more compiler warnings. + +2009-06-09 Peter Breitenlohner + + * patch-04-static (new): Avoid warnings when compiling with + 'gcc --Wmissing-prototypes'. + +2009-02-22 Peter Breitenlohner + + * patch-03-have-ft2 (new): Bug fix - skip FT2 code when + compiling without FT2 library. + +2009-03-25 Peter Breitenlohner + + * patch-02-use-ifdef (new): Use #ifdef instead of #if to avoid + preprocessor warnings. + +2009-03-24 Peter Breitenlohner + + * patch-01-portability (new): Portability fix - put variable + declarations at the beginning of the block. + diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/TL-Changes b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/TL-Changes new file mode 100644 index 00000000000..2ca3f07dfc0 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/TL-Changes @@ -0,0 +1,17 @@ +Changes applied to the dvipng-1.14 tree as obtained from: + http://savannah.nongnu.org/files/?group=dvipng + +Removed: + configure + install-sh + mkinstalldirs + +Created Autoconf macro files ../m4/gs-device.m4 and ../m4/makeinfo.m4 + adapting code in aclocal.m4. + +Copied these files to ../doc/: + dvipng.texi + install.texi + macros.texi + readme.texi + diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-01-gd-copyright b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-01-gd-copyright new file mode 100644 index 00000000000..3777c5c9037 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-01-gd-copyright @@ -0,0 +1,47 @@ + Include full gd copyright notice; seems the safe thing to do. + +diff -ur dvipng-1.14.orig/dvipng.texi dvipng-1.14/dvipng.texi +--- dvipng-1.14.orig/dvipng.texi 2010-12-06 21:07:18.000000000 +0100 ++++ dvipng-1.14/dvipng.texi 2010-12-15 15:34:12.000000000 +0100 +@@ -954,6 +954,41 @@ + Smith, Jason Riedy, Wolfram Krause, Reinhard Kotucha, Takeshi Abe, and + Waldeck Schutzer. + ++Use of the @code{gd} library requires inclusion of the following ++copyright notice, which applies to the @code{gd} library: ++ ++@quotation ++Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188 by the National Institutes of Health. ++ ++Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 by Boutell.Com, Inc. ++ ++Portions relating to GD2 format copyright 1999, 2000, 2001, 2002, 2003, 2004 Philip Warner. ++ ++Portions relating to PNG copyright 1999, 2000, 2001, 2002, 2003, 2004 Greg Roelofs. ++ ++Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002, 2003, 2004 John Ellson (ellson@@graphviz.org). ++ ++Portions relating to gdft.c copyright 2001, 2002, 2003, 2004 John Ellson (ellson@@graphviz.org). ++ ++Portions relating to JPEG and to color quantization copyright 2000, 2001, 2002, 2003, 2004, Doug Becker and copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Thomas G. Lane. This software is based in part on the work of the Independent JPEG Group. See the file README-JPEG.TXT for more information. ++ ++Portions relating to GIF compression copyright 1989 by Jef Poskanzer and David Rowley, with modifications for thread safety by Thomas Boutell. ++ ++Portions relating to GIF decompression copyright 1990, 1991, 1993 by David Koblas, with modifications for thread safety by Thomas Boutell. ++ ++Portions relating to WBMP copyright 2000, 2001, 2002, 2003, 2004 Maurice Szmurlo and Johan Van den Brande. ++ ++Portions relating to GIF animations copyright 2004 Jaakko Hyv@"adtti (jaakko.hyvatti@@iki.fi) ++ ++Permission has been granted to copy, distribute and modify gd in any context without fee, including a commercial application, provided that this notice is present in user-accessible supporting documentation. ++ ++This does not affect your ownership of the derived work itself, and the intent is to assure proper credit for the authors of gd, not to interfere with your productive use of gd. If you have questions, ask. "Derived works" includes all programs that utilize the library. Credit must be given in user-accessible documentation. ++ ++This software is provided "AS IS." The copyright holders disclaim all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to this code and accompanying documentation. ++ ++Although their code does not appear in the current release, the authors also wish to thank Hutchison Avenue Software Corporation for their prior contributions. ++@end quotation ++ + @ifset man + @c man begin NOTES + The full manual is accessible in info format, on most systems by typing diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-02-const b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-02-const new file mode 100644 index 00000000000..ef9dcd0200f --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-02-const @@ -0,0 +1,15 @@ +diff -ur dvipng-1.14.orig/special.c dvipng-1.14/special.c +--- dvipng-1.14.orig/special.c 2010-12-06 11:14:22.000000000 +0100 ++++ dvipng-1.14/special.c 2010-12-15 16:01:07.000000000 +0100 +@@ -44,9 +44,9 @@ + struct pscode { + struct pscode* next; + char* special; /* complete special */ +- char* code; /* PS string, null if a file */ ++ const char* code; /* PS string, null if a file */ + char* filename; /* file name, null if a string */ +- char* postcode; /* post PS string */ ++ const char* postcode; /* post PS string */ + struct filemmap fmmap; /* file mmap */ + }; + diff --git a/Build/source/texk/dvipng/dvipng-1.14/COPYING b/Build/source/texk/dvipng/dvipng-1.14/COPYING new file mode 100644 index 00000000000..94a9ed024d3 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Build/source/texk/dvipng/dvipng-1.14/COPYING.LESSER b/Build/source/texk/dvipng/dvipng-1.14/COPYING.LESSER new file mode 100644 index 00000000000..fc8a5de7edf --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/COPYING.LESSER @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Build/source/texk/dvipng/dvipng-1.14/ChangeLog b/Build/source/texk/dvipng/dvipng-1.14/ChangeLog new file mode 100644 index 00000000000..e21a07c761c --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/ChangeLog @@ -0,0 +1,1230 @@ +2010-10-23 Jan-Åke Larsson + + * dvipng.1, RELEASE: Prepare for 1.14 + +2010-10-22 Jan-Åke Larsson + + * configure.ac: Prepare for 1.14 + + * special.c: Tidy up the three different calls to gs on different + systems. + + * dvipng.texi: Some adjustments, document handling of raw + PostScript + +2010-10-21 Jan-Åke Larsson + + * special.c: Code cleanup + +2010-10-14 Jan-Åke Larsson + + * dvipng.h (malloc): Put malloc def first + + * special.c (ps2png): Ensure one and only one showpage, and do it + in PostScript instead of in C as suggested by Akira's previous patch + +2010-10-02 Peter Breitenlohner + + * special.c (ps2png): Drop unused 'bool showpage' for WIN32. + +2010-10-01 Jan-Åke Larsson + + * special.c: Add heuristics to ignore non-rendering specials from + hyperref + +2010-09-30 Jan-Åke Larsson + + * special.c, misc.c, dvipng.h, dvipng.texi: Add option to not try + converting raw PostScript + +2010-09-29 Jan-Åke Larsson + + * special.c (ps2png): Reap zombies + + * papersiz.c: Fix bug in length decoder + +2010-09-22 Jan-Åke Larsson + + * color.c, enc.c, fontmap.c, misc.c, sfd.c: Handle CRLF correctly + +2010-09-20 Akira Kakuto + + * special.c (ps2png): fix WIN32 bug that dvipng.exe waits + infinitely for some kind of eps files. + +2010-03-17 Jan-Ake Larsson + + * Release 1.13 + + * misc.c: Correct copyright year + + * RELEASE: Prepare for 1.13 + +2010-03-17 Peter Breitenlohner + + * configure.ac: Check for kpse_set_program_name() as used in + dvipng.c instead of kpse_set_progname(). + + Support WIN32 builds (native or MinGW32). + * dvipng.h (min, max): Always undefine before defining. + * dvi.c: For WIN32 use Sleep(1000) instead of sleeep(1). + * misc.c: #include depends on HAVE_MMAP. + * dvipng.h, font.c, misc.c: For mmap code use '#ifdef WIN32' + instead of '#ifdef MIKTEX'. + * special.c: WIN32 specific replacement for fork and pipe, using + code from Akira Kakuto, (e-mail from 23 Feb 2010 23:33:58). + +2010-03-17 Jan-Ake Larsson + + * test_dvipng.tex: Don't use mathptmx + + * color.c, dvi.c, dvipng.h, fontmap.c, misc.c, papersiz.c, + ppagelist.c, special.c: Avoid compiler warnings + + * dvipng.texi, configure.ac: Prepare for 1.13 + + * draw.c, dvipng.h, set.c, vf.c: Adjust glyph-index bounds + test. Remove possible segfault from isprint(). + +2010-02-11 Jan-Ake Larsson + + * color.c, draw.c, dvi.c, enc.c, font.c, fontmap.c, ft.c, + papersiz.c, pk.c, ppagelist.c, set.c, sfd.c, special.c, t1.c: + Declare functions used only in one file as static to avoid + warnings when compiling with 'gcc --Wmissing-prototypes', + suggested by Peter Breitenlohner + +2010-01-28 Jan-Ake Larsson + + * draw.c, dvipng.h, dvipng.texi, misc.c: Add width reporting + +2009-04-14 Jan-Ake Larsson + + * fontmap.c: Make the thing build without FT2 + +2009-03-28 Jan-Ake Larsson + + * config.h.in: Remove the last remnants of alloca + +2009-03-26 Jan-Ake Larsson + + * configure.ac, dvipng.h: Remove the last remnants of alloca + + * draw.c, font.c, ft.c, pk.c, t1.c, vf.c: Make the name element of + the font struct a pointer, not an array + + * dvi.c, ppagelist.c: Change error msg to mention malloc + + * color.c, enc.c, pk.c, set.c, sfd.c, special.c, tfm.c: Don't use + alloca + +2009-03-25 Jan-Ake Larsson + + * config.h.in, configure.ac: Check for libgen.h, not libgen + + * special.c: Put declarations before code + + * color.c, dvipng.h, fontmap.c, ft.c, misc.c, pk.c, set.c, t1.c, + tfm.c: Exchange #if for #ifdef + +2009-02-23 Jan-Ake Larsson + + * Release 1.12 + + * INSTALL, README, install.texi, readme.texi, special.c: Correct + date for copyright + + * RELEASE, configure.ac, dvipng.1, dvipng.texi: Prepare for 1.12 + +2009-01-23 Jan-Ake Larsson + + * special.c: Keep transparent background in rescaled included + bitmaps + +2008-06-04 Jan-Ake Larsson + + * special.c: Add the color PostScript prologue + +2008-06-03 Jan-Ake Larsson + + * dvipng.h, special.c: Support xcolor PostScript prologue + + * color.c: Support x11nam.def, fix handling of xcolor + multiple-model color values, and xcolor PostScript prologue + +2008-06-02 Jan-Ake Larsson + + * special.c: Some (most?) literal PostScript specials seem to + depend on tex.pro and possibly special.pro, always load these + + * configure.ac: Fix gs checks + + * misc.c: Correct last mmap element + +2008-05-27 Jan-Ake Larsson + + * readme.texi: Mention new color models in xcolor + + * color.c: Adjust for new version of xcolor, mainly color prefixes + +2008-05-14 Jan-Ake Larsson + + * Release 1.11 + + * configure.ac, dvipng.1, dvipng.texi, RELEASE: Prepare for 1.11 + + * special.c: Fix PS inclusion regression + +2008-05-09 Jan-Ake Larsson + + * Release 1.10 + + * RELEASE: Prepare for 1.10 + +2008-05-08 Jan-Ake Larsson + + * special.c: Add warning about DVI code in PS environment + +2008-05-07 Jan-Ake Larsson + + * README, readme.texi: Mention gs interpreter lib in TODO + + * aclocal.m4, configure.ac: Move gs device check so that it can be + called from different points + +2008-05-05 Jan-Ake Larsson + + * draw.c, dvi.c, dvipng.h: Revert creation of dvi command struct + + * draw.c, dvi.c: Init dvi command struct + + * draw.c, dvi.c, dvipng.h: Create dvi command struct + + * special.c: Rearrange code + + * color.c, dvipng.h, enc.c, fontmap.c, misc.c, pk.c, sfd.c, + special.c, tfm.c, vf.c: Change name of fmmap struct element + +2008-04-29 Jan-Ake Larsson + + * dvipng.1: Prepare for 1.10 + + * configure.ac: Prepare for 1.10, check for gdImageCreateJpeg + + * aclocal.m4: Cosmetic changes + + * special.c: Change to HAVE_...JPEG + + * dvipng.h: Remove c++ comment + + * dvipng.texi: Prepare for 1.10. Use 'active' in the 'preview' + package, remove unused text + + * Makefile.in: + Install dvipng.1 from the tarball, mark maintainer targets + +2008-02-08 Jan-Ake Larsson + + * Makefile.in, INSTALL, README, color.c, commands.h, configure.ac, + * draw.c, dvi.c, dvipng.1, dvipng.c, dvipng.h, dvipng.texi, enc.c, + * font.c, fontmap.c, ft.c, install.texi, macros.texi, miktex.h, + * misc.c, papersiz.c, pk.c, ppagelist.c, readme.texi, set.c, sfd.c, + * special.c, t1.c, test_dvipng.tex, tfm.c, vf.c, COPYING, + * COPYING.LESSER: Change to LGPLv3 + + * install.texi: + * README: + * dvipng.texi: Add blurb about MediaWiki, and cosmetic changes + +2008-01-10 Jan-Ake Larsson + + * set.c: Correct typo + +2007-12-12 Jan-Ake Larsson + + * special.c: Correct header test, add proper ps::[start] and + ps::[end] detection, add code to make tikz/pgf dvips (~PostScript) + specials work + +2007-10-26 Jan-Ake Larsson + + * draw.c: + * dvi.c: + * special.c: Change DVIGetCommand so that the command is + zero-terminated. This simplifies string operations on specials and + makes the length argument to SetSpecial unnecessary. Handle + preview-bop-hook correctly + + * special.c: Simplify PostScript header and multi-special + handling + + * color.c: + * draw.c: + * dvi.c: + * dvipng.h: + * font.c: + * ft.c: + * misc.c: + * set.c: + * special.c: + * t1.c: Split the flags variable into page_flags, option_flags and + dvi->flags + + * dvi.c: + * dvipng.c: dvi->flags resets now when the dvi is reopened + +2007-08-06 Jan-Ake Larsson + + * ft.c: + * misc.c: + * t1.c: + * tfm.c: + * vf.c: Memory fixes + +2007-07-24 Jan-Ake Larsson + + * special.c: Fix PostScript header usage + +2007-07-22 Jan-Ake Larsson + + * misc.c: Change version info slightly + + * ft.c: Change debug info slightly + +2007-07-21 Jan-Ake Larsson + + * special.c: Rewrite to allow for raw PostScript specials, also + use PostScript headers + + * dvipng.h: + * dvi.c: Add read-ahead for PostScript specials + + * config.h.in: + * configure.ac: Add test for gd pointer->image conversion + +2007-03-19 Jan-Ake Larsson + + * draw.c: Better handling of glyph index bounds + + * set.c: Check bounds for glyph index + +2006-12-11 Jan-Ake Larsson + + * readme.texi: Fix TODO, mention MediaWiki + + * dvipng.h: Fix for alloca under AIX + + * Makefile.in: mkinstalldirs is in $(srcdir) + +2006-11-11 Jan-Ake Larsson + + * Release 1.9 + + * INSTALL: + * README: Update for 1.9 + + * Makefile.in: Make the test fail if fonts not found + + * configure.ac: Don't use "which". Add info about the selfauto + stuff. Report if CJK support present + + * test_dvipng.tex: Remove the (intentional) failing special + +2006-11-07 Jan-Ake Larsson + + * fontmap.c: Don't warn if ttfonts.map is missing, fix pointer + + * Makefile.in: Adjust manpage target so manual intervention isn't + needed anymore + + * dvipng.1: Update manpage + + * dvipng.texi: Update for 1.9 + + * COPYING, Makefile.in, color.c, commands.h, configure.ac, draw.c, + dvi.c, dvipng.c, dvipng.h, dvipng.texi, enc.c, font.c, fontmap.c, + ft.c, macros.texi, miktex.h, miktex.mak, misc.c, papersiz.c, pk.c, + ppagelist.c, set.c, sfd.c, special.c, t1.c, test_dvipng.tex, + tfm.c, vf.c: Update FSF address + + * fontmap.c: Add ttfonts.map to the searched font maps + + * RELEASE: Prepare for 1.9 + +2006-11-02 Jan-Ake Larsson + + * dvipng.texi: Nitpicking on bitmapped graphics + +2006-10-13 Jan-Ake Larsson + + * readme.texi: Add note about subfont (CJK) support + + * install.texi: Add that FreeType2 is needed for subfont (CJK) support + +2006-10-12 Jan-Ake Larsson + + * readme.texi: Fix todo + +2006-10-11 Jan-Ake Larsson + + * sfd.c: Change && to || so that multiple subfonts work + + * ft.c: Adjust debug output + + * configure.ac: Add sfd.o + +2006-10-04 Jan-Ake Larsson + + * configure.ac: Prepare for 1.9 + + * sfd.c: Only look for subfont file on recent kpathsea + + * dvipng.c, ft.c, fontmap.c, dvipng.h: Prepare for subfonts (CJK) + + * sfd.c: Added. Used for subfonts (CJK) + + * configure.ac: Change wording of gs helptext + + * ft.c: Adjust debug message, and encoding selection + + * special.c: Adjust debug messages + + * dvipng.texi: Document the --strict option + + * dvipng.c: Fix timer + + * Makefile.in: Add dist target, simplify distclean + + * fontmap.c: Remove segfault occuring for non-existent font + +2006-08-08 Jan-Ake Larsson + + * special.c: Make showpage flag static + + * special.c: + Fix bug with -dSAFER and non-. paths, and bug with pngalpha and + background color + +2006-05-17 Jan-Ake Larsson + + * fontmap.c: Rearrange, simplify, speed up + +2006-05-16 Jan-Ake Larsson + + * ft.c: FT_LOAD_TARGET_LIGHT does not work in some cases, fall + back to FT_LOAD_NO_HINTING + +2006-05-08 Jan-Ake Larsson + + * dvipng.texi: Add credit + + * Makefile.in: add www target + + * README: + * readme.texi: Update capabilities info and preview-latex link + +2006-03-30 Jan-Ake Larsson + + * Release 1.8 + + * RELEASE: Update for 1.8 + + * set.c: + * readme.texi: + * install.texi: + * ft.c: + * dvi.c: + * draw.c: + * README: + * INSTALL: Update copyright + +2006-03-29 Jan-Ake Larsson + + * dvipng.1: + * dvipng.texi: Document new switch, new PostScript inclusion, + rearrange and adjust + + * misc.c: + * INSTALL: + * README: + * install.texi: + * readme.texi: Minimal documentation adjustments + +2006-03-27 Jan-Ake Larsson + + * ft.c: Change to FT_LOAD_TARGET_LIGHT + + * draw.c: Fix segfault in debug mode + + * aclocal.m4: Make sure the kpse_enc_format test fails for the + right reason only + +2006-02-27 Jan-Ake Larsson + + * special.c: Use gs' pngalpha device, render without clipping, + adjust image position + + * set.c: Simplify code, make color cache (page-)persistent + + * draw.c: Reset new flag + + * misc.c: New switch, remove some old switches from fast-help, use + new flag name + + * dvipng.h: New flags + + * configure.ac: + * config.h.in: Simplify gd tests + + * configure.ac: + * aclocal.m4: Check gs devices + +2006-02-10 Jan-Ake Larsson + + * special.c: Use execlp for gs call + +2006-02-03 Jan-Ake Larsson + * special.c: + Revert message about file type, debug information is enough + + * special.c: Warn for nonexistent image decoder + +2006-02-01 Jan-Ake Larsson + + * special.c: Warn with file type when unable to load included image + + * special.c: Read the first byte of file to be included and + compare with magic number + +2006-01-31 Jan-Ake Larsson + + * special.c: Temporary version, just try the different image + decoders and see + + * special.c: Use correct variables + +2006-01-29 Jan-Ake Larsson + + * special.c: Add code to check image access permission + +2006-01-28 Jan-Ake Larsson + + * special.c: Simplify some code + + * papersiz.c: Fix rounding error for length calculation + +2006-01-26 Jan-Ake Larsson + + * color.c: Fix typo that gave a segfault + + * config.h.in: Remove unneeded function check + + * configure.ac: Update for 1.8, remove unneeded function check + + * dvipng.h: Switch debug numbers to coincide with the manual + + * misc.c: Remove isdigit + + * special.c: Add code to include PNG, JPEG and GIF images + +2006-01-12 Jan-Ake Larsson + + * special.c: Add a space in message + + * misc.c: Do more tests for numeric-parameter options + + * dvi.c: Outfilename: only remove .dvi extension, not others + +2005-10-11 Jan-Ake Larsson + + * Release 1.7 + + * INSTALL: Typographic changes + + * README: + * RELEASE: + * configure.ac: + * dvipng.1: + * dvipng.texi: Adjust for 1.7 + + * install.texi: Insert space + + * miktex.h: Adjust for 1.7, I am uncertain which of the new calls + are available in the MIKTeX environment + + * readme.texi: Remove reference to my old laptop + +2005-09-30 Jan-Ake Larsson + + * config.h.in, configure.ac, ft.c: + Only use FT_Library_Version if available + +2005-07-05 jalar + + * Makefile.in: Enable srcdir != builddir + +2005-07-04 jalar + + * font.c: Add length check for font name + +2005-06-28 Jan-Ake Larsson + + * special.c: Read preview-latex version + +2005-06-27 Jan-Ake Larsson + + * Release 1.6 + + * RELEASE: Report what fixes have been done + + * dvipng.texi: Document xcolor adaptations + + * misc.c: Add 'Transparent' in the quick-help + + * special.c: Cosmetics, do a _small_ message for bop-hook redef + +2005-06-16 Jan-Ake Larsson + + * dvipng.h: + * dvipng.c: + * color.c: Revamp colorname interpreter for xcolor + +2005-06-14 Jan-Ake Larsson + + * misc.c: Adjust MIKTeX stuff + +2005-06-13 Jan-Ake Larsson + + * color.c: Don't use strtok, adjust for xcolor + + * special.c: Don't use strtok + +2005-04-25 Jan-Ake Larsson + + * config.h.in: + * configure.ac: + * set.c: Don't do alpha blending in truecolor mode, write alpha + channel to file + +2005-04-20 Jan-Ake Larsson + + * dvipng.texi: Add Credits + +2005-04-19 Jan-Ake Larsson + + * dvipng.h: Fix for sys/types.h conflict in old IRIX systems + + * special.c: Adjust tightpage test + +2005-04-04 Jan-Ake Larsson + + * special.c: Make tightpage option backwards compatible + + * RELEASE: Prepare for 1.6 + + * dvipng.1: Regenerate man page + + * configure.ac: + * dvipng.texi: + * miktex.h: Update version info + + * configure.ac: + * dvipng.texi: + * README: + * readme.texi: Update mailing list address + + * configure.ac: + * config.h.in: + * special.c: Simplify string search + +2005-04-03 Jan-Ake Larsson + + * special.c: Try to detect all preview-latex versions tightpage + code + +2005-03-02 Jan-Ake Larsson + + * set.c: Remove extra debug printout + + * t1.c: Sizes are given in big points in T1lib, in TeX points in + DVI files + + * ft.c: Sizes are given in big points in FreeType, in TeX points + in DVI files + + * dvipng.h: Fix boolean type again + +2005-02-10 Jan-Ake Larsson + + * config.h.in: + * configure.ac: + * dvipng.texi: + * dvipng.h: + * misc.c: + * set.c: Add proper alpha channel + +2005-02-04 Jan-Ake Larsson + + * color.c: + * draw.c: + * dvi.c: + * dvipng.c: + * font.c: + * ft.c: + * misc.c: + * papersiz.c: + * pk.c: + * set.c: + * special.c: + * t1.c: + * tfm.c: + * vf.c: Cosmetic changes to warnings and fatals + + * Release 1.5 + + * RELEASE: Prepare for 1.5 + + * INSTALL: + * Makefile.in: + * README: + * color.c: + * commands.h: + * configure.ac: + * draw.c: + * dvi.c: + * dvipng.1: + * dvipng.c: + * dvipng.h: + * dvipng.texi: + * enc.c: + * font.c: + * fontmap.c: + * ft.c: + * install.texi: + * macros.texi: + * miktex.h: + * misc.c: + * papersiz.c: + * pk.c: + * ppagelist.c: + * readme.texi: + * set.c: + * special.c: + * t1.c: + * test_dvipng.tex: + * tfm.c: + * vf.c: Update Copyright, set version 1.5 + +2005-02-03 Jan-Ake Larsson + + * draw.c: + * dvipng.h: + * set.c: Fix bug in --picky mode + +2005-01-27 Jan-Ake Larsson + + * dvipng.c: Restore --mfmode and --bdpi functionality + +2005-01-25 Jan-Ake Larsson + + * color.c: Fix segfault when trying to find nonexisting dvipsnam + color + + * dvipng.c: Make dvipsnam colors available on command line + +2004-12-10 Jan-Ake Larsson + + * Release 1.4 + + * RELEASE: + * configure.ac: + * dvipng.1: + * dvipng.texi: Set version 1.4 + + * README: Fix formatting + + * misc.c: Use mmap test. Hopefully, it will fail on ULTRIX, mmap + only works on character special devices (and not on regular files) + +2004-12-02 Jan-Ake Larsson + + * config.h.in: + * configure.ac: + * dvipng.h: Move int64_t and uint64_t tests entirely to autoconf + + * dvi.c: Fix signedness + +2004-11-30 Jan-Ake Larsson + + * misc.c: Fix NULL dereference. + +2004-11-25 Jan-Ake Larsson + + * Release 1.3 + + * Makefile.in, README, dvipng.1, readme.texi: Fix dvigif + installation and docs + + * INSTALL: + * README: Add license + + * dvipng.c: Remove duplicate copyright + + * config.h.in: + * configure.ac: Add some tests + + * dvipng.1: + * dvipng.texi: Add some minor things + +2004-11-24 Jan-Ake Larsson + + * config.h.in: + * configure.ac: Test for 64-bit types. + + * dvipng.h: Use char* arithmetic, not void*. And enable use of + gcc -ansi -pedantic. + + * special.c: Don't use C++ comments. + + * papersiz.c: Rewrite + + * draw.c: + * dvi.c: + * font.c: + * ft.c: + * misc.c: + * pk.c: + * tfm.c: + * vf.c: Fix signedness + +2004-11-15 Reiner Steib + + * draw.c, dvipng.c, enc.c, font.c, ft.c, pk.c, special.c, t1.c: + Don't use C++ comments. + +2004-11-05 David Kastrup + + * Makefile.in (install-dvigif): Don't fail if dvigif already + exists. + +2004-11-02 Jan-Åke Larsson + + * dvipng.h: Fix boolean type + +2004-11-01 Jan-Åke Larsson + + * RELEASE: Update for 1.3 + + * dvipng.h: Load alloca.h when available + + * font.c: + * fontmap.c: Remove inline + + * Makefile.in: + * commands.h: + * config.h.in: + * configure.ac: + * install.texi: + * macros.texi: + * miktex.h: + * readme.texi: + * test_dvipng.tex: Add copyright notice + + * color.c: + * draw.c: + * dvi.c: + * dvipng.c: + * dvipng.h: + * enc.c: + * font.c: + * fontmap.c: + * ft.c: + * misc.c: + * papersiz.c: + * pk.c: + * ppagelist.c: + * set.c: + * special.c: + * t1.c: + * tfm.c: + * vf.c: Change c-in-a-circle to (C) + +2004-10-27 Jan-Åke Larsson + + * dvipng.1: + * dvipng.texi: Amend docs + + * misc.c: Amend helptext + +2004-10-26 Jan-Åke Larsson + + * set.c: + * misc.c: + * dvipng.h: Change background transparency + + * configure.ac: Bump version, add test for libz + +2004-10-07 Jan-Åke Larsson + + * dvipng.texi: document change in -o switch + +2004-10-06 Jan-Åke Larsson + + * set.c: Allow longer pagenumbers in output file (e.g., %06d) + +2004-08-18 Jan-Åke Larsson + + * Release 1.2 + + * RELEASE: Change for 1.2 + + * config.h.in: Update + + * dvipng.1: change help text + + * dvipng.texi: update mailing list text. And version. + + * README: + * readme.texi: update info and todo list + + * draw.c, misc.c, dvipng.c, dvipng.h: + Add an intermediate exit status + +2004-08-17 Jan-Åke Larsson + + * misc.c: add --gamma switch + + * special.c: Fix comment + + * set.c: + * dvipng.h: new Gamma function + + * configure.ac: libm is needed by new gamma code + + * dvipng.1: + * dvipng.texi: document new switches + + * draw.c: change name of picky flag + + * special.c: do not call ghostscript when switch given + + * misc.c: add picky and ghostscript switches + + * dvipng.h: add picky and ghostscript flags + +2004-08-06 Jan-Åke Larsson + + * dvipng.texi: Document --png, --gif, and --picky + + * .cvsignore: Add *.gif + + * Makefile.in: Install 'dvigif' if we have GIF support + + * configure.ac: Test for gdImageGif and 'ln -s' + + * config.h.in: GIF support + + * set.c: GIF writing + + * misc.c: basename fixes, --png and --gif fixes, + --no-image-on-warn changes name to --picky + + * dvi.c: basename fixes + + * dvipng.h: Portability fixes, add GIF image flag + +2004-08-02 Jan-Åke Larsson + + * draw.c: Fix behaviour of --no-image-on-warn + +2004-07-01 Jan-Åke Larsson + + * miktex.mak: New, for MIKTeX + + * dvi.c: + * dvipng.c: + * dvipng.h: + * special.c: Adjust for MIKTeX + + * color.c: + * enc.c: + * font.c: + * fontmap.c: + * misc.c: + * pk.c: + * tfm.c: + * vf.c: Move file-mmapping to misc.c, adjust it for MIKTeX + +2004-06-29 Jan-Åke Larsson + + * configure.ac: + * dvipng.h: inttypes.h not available on all platforms + + * special.c: Remove snprintf, not available on certain platforms + +2004-06-27 Jan-Åke Larsson + + * dvipng.c: Fix case of missing font libs + + * fontmap.c: Remove debug printf + + * draw.c: Fix for case of absent font lib(s), correct typo + +2004-06-24 Jan-Åke Larsson + + * fontmap.c: + * pk.c: + * vf.c: More memory fixes + +2004-06-21 Jan-Åke Larsson + + * config.h.in: + * configure.ac: Test for stdbool, munmap and strtol + + * test_dvipng.tex: Change color test + + * dvipng.h: + * misc.c: + * ppagelist.c: Fix -r switch + + * dvipng.h: + * font.c: + * misc.c: + * ppagelist.c: + * special.c: + * t1.c: + * tfm.c: Use stdbool + + * color.c: + * dvi.c: + * dvipng.c: + * dvipng.h: + * enc.c: + * font.c: + * fontmap.c: + * ppagelist.c: + * special.c: Fix memory leak(s) + + * color.c: + * draw.c: + * dvi.c: + * dvipng.h: + * misc.c: + * set.c: + * special.c: Fix color stack + + * draw.c: + * dvipng.h: + * ft.c: + * pk.c: + * set.c: + * t1.c: + * tfm.c: + * vf.c: Simplify char structs + + * color.c: + * draw.c: + * dvi.c: + * dvipng.c: + * dvipng.h: + * enc.c: + * font.c: + * fontmap.c: + * ft.c: + * misc.c: + * papersiz.c: + * pk.c: + * ppagelist.c: + * set.c: + * special.c: + * t1.c: + * tfm.c: + * vf.c: Add copyright notice + +2004-05-31 Jan-Åke Larsson + + * dvipng.1: + * configure.ac: + * RELEASE: + * INSTALL: Release 1.1 + +2004-05-26 Jan-Åke Larsson + + * special.c: Handle source specials + + * test_dvipng.tex: Add failing special and color test + + * dvipng.c: Adjust coment about SELFAUTO... + + * dvi.c: Fix possible overflow + +2004-05-24 Jan-Åke Larsson + + * misc.c: Remove -t, it is not implemented yet + + * dvipng.h: Undef malloc, if defined + +2004-05-18 Jan-Åke Larsson + + * dvipng.texi: Fix build + +2004-05-14 Jan-Åke Larsson + + * config.h.in: Use more tests + + * dvipng.1: Add documentation + + * dvipng.texi: Fix build. Revert to four-argument @node, my + makeinfo cannot handle the one-argument form (yet). + +2004-05-11 Jan-Åke Larsson + + * configure.ac: More tests + +2004-05-09 Jan-Åke Larsson + + * install.texi: T1lib docs + + * dvipng.1: + * dvipng.texi: Add documentation, and spellcheck + + * special.c: + * color.c: Make colors work again. + +2004-05-08 David Kastrup + + * Create new ChangeLog for dvipng + +2004-05-05 Jan-Åke Larsson + + * fontmap.c: Use both kpse_fontmap_format and + _dvips_header_ + + * enc.c: Use configure test + + * configure.ac: Add test for kpse_enc_format, reorder gd + and png tests + + * aclocal.m4: Add test for kpse_enc_format + + * special.c: More informative warnings + +2004-05-04 Jan-Åke Larsson + + * enc.c: + Use the new kpathsea search format kpse_enc_format if available, + otherwise use kpse_tex_ps_header_format + + * fontmap.c: + Fix new kpathsea search type kpse_fontmap_format, use + kpse_dvips_config_format if not available + + * ft.c: Fix sizing + + * draw.c: Simplify LoadT1 call + + * t1.c: Shorten call, fix sizing + + * dvipng.h: Simplify char-storing structure + +2004-05-03 Jan-Åke Larsson + + * fontmap.c, font.c, t1.c, ft.c: + Fix for ps fonts not in psfontmap + +2004-05-02 Jan-Åke Larsson + + * Makefile.in: + * config.h.in: + * configure.ac: + * draw.c: + * dvipng.c: + * dvipng.h: + * enc.c: + * font.c: + * fontmap.c: + * ft.c: + * t1.c: + * misc.c: Add t1lib support + +2004-04-05 Jan-Åke Larsson + + * dvipng.1: + * readme.texi: + * dvipng.texi: + * Makefile.in: Add man page + +2004-03-27 Jan-Åke Larsson + + * dvipng.texi: Fix debug documentations + + * dvipng.c: Dont fail on --mode without --bdpi, output a warning. + +2004-03-26 Jan-Åke Larsson + + * papersiz.c: Remove compiler warning + + * dvipng.texi: + * misc.c: Change year + +2004-03-25 Jan-Åke Larsson + + * special.c: Revert change, not only resolution but also + offset is needed when generating png from ps + + * misc.c: Change helptext + + * configure.ac: Change version number + + * README: Checkin updated README + + * pk.c: + * ft.c: Speed up color cache + + * dvipng.texi: Add info on resolution, change version number + +2004-03-24 Jan-Åke Larsson + + * special.c: Fix missing 'showpage' and a memory leak + + * font.c: Adjust error message + + * dvipng.h: + * ft.c: + * pk.c: Change ink darkness map + + * draw.c: Output page numbers more often. If the user has a + slow terminal he's to blame himself, not me. + + * tfm.c: Include alloca.h if present + +2004-03-23 Jan-Åke Larsson + + * dvipng.texi: Adjust for the new -D option + +2004-03-19 dakas + + * RELEASE: Remove spurious blanks. + +2004-03-19 Jan-Åke Larsson + + * RELEASE: Update, shorten + +2004-03-18 Jan-Åke Larsson + + * RELEASE: + * dvi.c: + * dvipng.c: + * dvipng.h: + * font.c: + * misc.c: + * papersiz.c: + * special.c: Change the behaviour of the -D switch + +2004-03-08 Jan-Åke Larsson + + * font.c: Don't retry on PK generation failure + +2004-03-02 David Kastrup + + * dvi.c (DVIOpen): Fix a buffer overrun error. diff --git a/Build/source/texk/dvipng/dvipng-1.14/ChangeLog.0 b/Build/source/texk/dvipng/dvipng-1.14/ChangeLog.0 new file mode 100644 index 00000000000..3c4689ad8c4 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/ChangeLog.0 @@ -0,0 +1,903 @@ +2004-01-16 Jan-Åke Larsson + + * font.c: fix compile without FT2 + +2004-01-12 Jan-Ake Larsson + + * RELEASE: Prepare for 0.9 + + * misc.c: Enable --expand-bbox + + * color.c: + * draw.c: + * dvipng.h: + * font.c: + * misc.c: + * special.c: Enable --no-image-on-warn + + * draw.c: + * dvi.c: + * dvipng.c: + * dvipng.h: + * readme.texi: + * special.c: Fix tightpage behaviour + +2004-01-09 Jan-Ake Larsson + + * special.c: Add preview-latex's "tightpage" code + +2004-01-08 Jan-Ake Larsson + + * dvipng.texi: + * configure.ac: Prepare for 0.9 + + * Makefile.in: clean target + +2004-01-07 Jan-Ake Larsson + + * color.c: + * draw.c: + * dvi.c: + * dvipng.c: + * dvipng.h: + * enc.c: + * font.c: + * fontmap.c: + * ft.c: + * pk.c: + * set.c: + * special.c: + * tfm.c: + * vf.c: Speedup DEBUG + + * pk.c: Fix subpixel offsets + + * dvipng.c: + * dvipng.h: + * font.c: + * misc.c: + * set.c: + * special.c: Fix flags + + * draw.c: Fix bbox + + * dvipng.h: Adjust for freetype >= 2.1.6 + +2003-12-15 Jan-Ake Larsson + + * tfm.c: + * fontmap.c: + * font.c: Fix freeeeeeeeeing + +2003-12-08 Jan-Ake Larsson + + * dvipng.texi: + * configure.ac: + * RELEASE: Prepare for 0.8 + + * ft.c: Fix debug output + + * draw.c: + * dvipng.h: + * dvipng.texi: + * misc.c: Add --height option + + * test_dvipng.tex: A nice equation is true. Behave! + +2003-12-07 Jan-Ake Larsson + + * enc.c: Encodings are _ps_header_s + +2003-12-05 Jan-Åke Larsson + + * misc.c: + * dvipng.texi: + * dvipng.h: + * draw.c: Change --baseline to --depth + +2003-12-01 Jan-Ake Larsson + + * draw.c: + * dvipng.h: + * misc.c: Change to physical pagenumbers, instead of DVI + pagenumbers. DVI pagenumbers will be indicated on STDOUT if they + differ from physical pagenumbers, but the numbering of PNG files + is physical pagenumbers. Old behaviour can be chosen with the + option -dvinum. + + * ppagelist.c: + * misc.c: + * dvipng.texi: Make negative pages render. Now -pp handles + negative pages gracefully too. Remove -pp code taken from dvips. + +2003-11-30 Jan-Ake Larsson + + * draw.c: + * dvipng.c: + * dvipng.h: + * font.c: + * ft.c: + * misc.c: + * pk.c: + * set.c: + * tfm.c: + * vf.c: Include alloca.h when necessary, start preparing + transition to subpixel rendering, do proper cleanup on exit + +2003-11-18 Jan-Åke Larsson + + * enc.c: Fix bug + + * ft.c: + * tfm.c: + * font.c: + * dvipng.h: Add fallback from FT to PK + +2003-11-14 Jan-Åke Larsson + + * Makefile.in: Use $DESTDIR + +2003-11-06 Jan-Åke Larsson + + * special.c: Fix postscript inclusion: placement and + background color + +2003-10-17 Jan-Åke Larsson + + * misc.c: + * font.c: + * dvipng.texi: + * dvipng.h: Add option for freetype activation + + * configure.ac: Add message when freetype is present + + * ft.c: Apparently FreeType hinting is a no-no. Load glyphs + with FT_LOAD_NO_HINTING. Only then output is acceptable. + +2003-10-15 Jan-Åke Larsson + + * fontmap.c: Remove erroneous match + +2003-10-13 Jan-Åke Larsson + + * font.c: Fix font searching order + + * RELEASE: Prepare for 0.7 + + * fontmap.c: + * psfontmap.c: + * configure.ac: Rename psfontmap.c to fontmap.c + +2003-10-08 Jan-Ake Larsson + + * psfontmap.c: Add third bare word: encoding + +2003-10-07 Jan-Ake Larsson + + * misc.c: + * dvipng.texi: Allow for -- on options + + * configure.ac: Prepare for 0.7 + + * Makefile.in: Adjust hint + + * configure.ac: + * config.h.in: Fix helptext in config.h.in + + * test_dvipng.tex: Add some tests for ligatures and sizes + +2003-10-03 Jan-Åke Larsson + + * readme.texi: Document new font support and switches + + * psfontmap.c: Redesign psfontmap loading to use the syntax + from dvips' docs + + * font.c: Enhance TrueType font finding + + * draw.c: Warn if setting char from null font + + * dvipng.h: + * color.c: Load and use psnames.def + +2003-09-28 Jan-Ake Larsson + + * misc.c: Warn for all bad options + +2003-09-24 Jan-Ake Larsson + + * dvipng.texi: + * install.texi: + * misc.c: Fix documentation + +2003-09-23 Jan-Ake Larsson + + * ft.c: + * enc.c: + * dvipng.h: Only load encodings once + +2003-09-18 Jan-Åke Larsson + + * draw.c: + * dvipng.h: + * misc.c: Add -baseline switch + +2003-09-17 Jan-Ake Larsson + + * font.c: Remove compiler warning + + * config.h.in: + * psfontmap.c: + * dvipng.c: + * configure.ac: Fix SELFAUTO... variables if dvipng is not + being installed in main texmf tree. This will make it find config + files and fonts anyway. + +2003-09-16 Jan-Ake Larsson + + * tfm.c: + * psfontmap.c: + * ft.c: + * enc.c: Added for postscript font handling with freetype + + * font.c: Use freetype font loading + + * dvipng.h: Add freetype-related types and declarations, + and simplify glyph rendering + + * pk.c: Simplify glyph rendering + + * dvipng.c: Init freetype + + * dvi.c: Fix strlen bugs + + * draw.c: Add FONT_TYPE_FT drawing + + * configure.ac: + * config.h.in: + * Makefile.in: Adjust for freetype things + +2003-08-29 Jan-Åke Larsson + + * special.c: fix color handling + + * dvipng.c: Increase TIMING output + + * misc.c: + * draw.c: small speedups + + * dvipng.h: + * configure.ac: + * config.h.in: + * Makefile.in: Change handling of the DEBUG and TIMING + flags + +2003-08-26 Jan-Åke Larsson + + * RELEASE, dvipng.texi, configure.ac: + prepare for 0.6 + + * Makefile.in: another install-docs fix + +2003-08-13 Jan-Åke Larsson + + * configure.ac: new test (ps inclusion speedup) + + * draw.c: simplify preprocessor processing, fix SetSpecial + call + + * special.c: speedup for ps image inclusion, fix SetSpecial + call + + * Makefile.in: fix install-docs + +2003-08-04 Jan-Åke Larsson + + * special.c: Argh!, fix compilation for non-truecolor version + + * dvipng.h: Argh!, fix image cache + + * dvipng.texi: + * configure.ac: + * RELEASE: Prepare for 0.5 + + * misc.c: + * dvipng.h: + * set.c: Add preliminary truecolor support + + * pk.c: Benchmark truecolor rendering, no real code change + + * special.c: + * misc.c: + * dvipng.h: Add preliminary image cacheing + + * draw.c: Small adjustments + +2003-07-30 Jan-Åke Larsson + + * draw.c: Fix two bugs so that bounding box again is + correct + + * configure.ac: configuration printout improved + + +2003-07-02 Jan-Åke Larsson + + * dvipng.h: Add prototypes + + * draw.c: minor change + + * RELEASE: prepare for 0.4 + +2003-07-01 Jan-Åke Larsson + + * draw.c, set.c: + Fix rules (again), this time taking maxdrift into account. + + * pk.c: Unfortunately gdImageColorResolveAlpha only works + on truecolor images. Some other day, then. I did fix the + performance of PROPER_OVERSTRIKE, though. + + * readme.texi: Add todo + +2003-06-30 Jan-Åke Larsson + + * dvipng.texi: small fixes + + * vf.c: Speedup macro start/end + + * set.c: Handle offset in draw.c only, allow choice of + compression if gd can do this + + * pk.c: Handle overstrike, either with gd alpha level, if + support exists for that, or "manually". The latter is active if + PROPER_OVERSTRIKE is #defined, currently yes, at roughly 5% + performance loss. + + * misc.c: -z option: choose compression if gd can do this + + * dvipng.h: Proper rounding, gd bells and whistles + + * draw.c: Allow drift a la dvitype, maxdrift=1, handle + offset here only, speedup vf macro start/end + + * config.h.in: + * configure.ac: New tests for gd bells and whistles + + * Makefile.in: Clean README + + * .cvsignore: More files + +2003-06-23 Jan-Åke Larsson + + * configure.ac: + * config.h.in: Added tests for newly added C code + + * Makefile.in: + * dvipng.texi: Reflect move of readme + + * README: + * readme.texi: Moved from README to readme.texi + +2003-06-19 Jan-Åke Larsson + + * special.c: Fix crash on file not found + + * set.c: Code reformatting + + * misc.c: Fix switches, and send warnings/errors to stderr. + + * vf.c: + * pk.c: + * draw.c: Include header only used in this file, here. + + * commands.h: Make draw.c compile without -DDEBUG + + * Makefile.in: Use --disable-debug, fix docs + generation/install, and add 'test' target. + + * README: Update info + + * configure.ac: Add --disable-debug + + * install.texi: Minor changes + + * dvipng.texi: Document difference between -pp and -p + -l + + * dvipng.h: Fix FreeBSD non-C99 header issue + +2003-06-12 Jan-Åke Larsson + + * Makefile.in: Fix SunOS make suffix rule wierdness + + * color.c: Change comment + + * dvi.c (DVIOpen): bugfix ".dvi" completion + + * dvipng.h (PIXROUND): Round down instead of up, SetRule + now has its own rounding mechanism + + * set.c (SetRule): Refine rule drawing, make sure rule is + inside bounding box + +2003-06-10 Jan-Åke Larsson + + * README: + * RELEASE: + * Makefile.in: + * configure.ac: + * dvipng.texi: Prepare for 0.3 + + * vf.c: + * set.c: + * pk.c: + * font.c: + * dvi.c: + * draw.c: simplify DEBUG_PRINT + + * configure.ac: Look for gs + + * special.c: Fixes to gs interaction + + * set.c: Enable -o for output file, no segfault on empty + image, reposition rule to match dvips + + * draw.c: simplify DEBUG_PRINT macro + + * dvi.c: + * misc.c: Enable -o for output file + + * dvipng.h: Enable -o for output file, simplify DEBUG_PRINT + macro + +2003-04-17 Jan-Ake Larsson + + * install.texi: + * dvipng.texi: Rewrite stuff + + * dvipng.h: New debug flag + + * configure.ac: + * config.h.in: Configure GS_PATH + + * special.c: No tempfiles anymore. Communicate with child + through two pipes. + + * configure.ac: + * Makefile.in: Make docs + +2003-04-15 Jan-Åke Larsson + + * macros.texi: Added + + * install.texi, dvipng.texi: Initial version + +2003-03-28 Jan-Åke Larsson + + * README: + * RELEASE: Release 0.2, PostScript type1 font support and + PostScript inclusion. + + * configure.ac: Added configure error message about where + to find libgd. + + * dvipng.h: + * draw.c (DrawCommand): + * special.c (SetSpecial): Postscript inclusion now works. + + * misc.c (DecodeArgs): Fix --help message + + * COPYING: + * RELEASE: + * README: Added files to repository + +2003-03-12 Jan-Åke Larsson + + * dvi.c (DVIFollowToggle): + * misc.c (DecodeArgs): + * dvipng.h: Added '-follow' switch, and code that + implements a follow mode. + +2003-02-27 Jan-Åke Larsson + + * draw.c (DrawPages): + * misc.c (Message): Speed up slightly when not in DEBUG + mode. + + * misc.c (DecodeArgs): Adjust copyright notice. + + * set.c (SetRule): Reposition rules, one dot up. + +2003-01-30 Jan-Åke Larsson + + * Makefile.in: + * configure.ac: Fix includes and linking + + * draw.c: + * font.c: + * pk.c: + * vf.c: + * dvipng.h (font_entry): remove unnamed union + + * dvipng.h: simplify includes + +2003-01-15 Jan-Ake Larsson + + * misc.c: Use autoconf's stuff, use atoi, fix warning + message + + * dvipng.c: + * dvipng.h: Localize position and spacing to draw.c. Fix + timing + + * pk.c: + * set.c: + * special.c: + * vf.c: + * draw.c: Localize position and spacing to draw.c + + * configure.ac: Require gd and kpathsea + +2002-12-03 Jan-Ake Larsson + + * draw.c: unfinished change: repairing + + * draw.c: + * font.c: + * vf.c: use void* in function call + + * dvipng.h: + * draw.c: + * color.c: + * set.c: change names of some functions + + * dvipng.h: + * draw.c: + * dvi.c: + * ppagelist.c: make dvi data more local + + * .cvsignore: + * dvipng.h: + * special.c: + * font.c: + * misc.c: + * dvipng.c: + * configure.ac: + * config.h.in: + * Makefile.in: autoconfiscate + +2002-11-07 Jan-Ake Larsson + + * dvipng.h: + * dvipng.c (main): + * dvi.c (DVIReOpen): Don't re-init, re-open + +2002-10-31 Jan-Ake Larsson + + * dvipng.h: + * dvi.c: Remove globals and Reopen DVI on change (check + mtime) + + * dvipng.c: Reopen DVI on change (check mtime) + +2002-10-30 Jan-Ake Larsson + + * pk.c: Declaration moved here from dvipng.h + + * Makefile: No io.c, no pagequeue.c but ppagelist.c + + * dvipng.h: Rearranged, some new declarations + + * dvipng.c (main): minor changes + + * draw.c (DoPages): use new page-finding mechanisms + + * dvi.c: outfilename handling fixed, page-finding + mechanisms added. + + * misc.c: Ppagelist handling improved, outfilename now + works, added functionality from io.c + + * ppagelist.c: Added. Functionality slightly different from + pagequeue.c + + * pagequeue.c: Revamped. Functionality changed and moved to + ppagelist.c + + * io.c: Removed. Functionality in misc.c + + * .cvsignore: Additions + +2002-10-24 Jan-Ake Larsson + + * dvipng.c (main): + * dvipng.h: + * misc.c (DecodeString): Improve stdin parser + +2002-10-21 Jan-Ake Larsson + + * dvipng.h: Remove globals, fix message output + + * vf.c (SetVF, InitVF), + * font.c (FontDef), + * draw.c (DrawCommand): Bugfix VF handling, fix message + output + + * pk.c (SetPK, InitPK), + * dvi.c (DVIOpen): Fix message output + + * papersiz.c: use int32_t, fix overflow + + * misc.c (DecodeArgs, Message): Fix -d option, remove + globals, fix message output + +2002-10-16 Jan-Ake Larsson + + * dvipng.h: Remove globals + + * dvipng.c (main): Remove globals, improve stdin parser + + * misc.c (DecodeArgs): remove globals, fix helptext + + * pagequeue.c (FindQdPage, QueuePage, QueueParse): + remove globals + + * dvi.c (FindPage): Remove unnecessary test + + * draw.c (DoPages): Do more normal read-ahead + +2002-10-15 Jan-Ake Larsson + + * pk.c, font.c: Minor change + + * misc.c: Simplify, remove (some) globals, fix helptext + + * pagequeue.c, dvipng.h, dvipng.c, + dvi.c, draw.c: Simplify, remove (some) globals + +2002-10-14 Jan-Ake Larsson + + * misc.c, dvipng.h, draw.c: + Added '-T tight' switch + +2002-10-11 Angus Leeming + + * draw.c: + * dvi.c: + * dvipng.[ch]: + * font.c: + * io.c: + * misc.c: + * pagequeue.c: + * papersiz.c: + * pk.c: + * set.c: + * special.c: + * vf.c: remove function prototype macros. + + * dvi.c (DVIGetCommand, CommandLength): + * set.c (SetChar): add a 'break' to the end of the switch + statements (prevents a warning with gcc 3.2). + +2002-10-11 Jan-Ake Larsson + + * special.c: Fix DEBUG, prototypes, and code pruning + + * vf.c, set.c, pk.c, io.c, + font.c, draw.c: Fix DEBUG + + * misc.c, dvi.c, pagequeue.c, + dvipng.h, dvipng.c: Fix pagelist and DEBUG + + +2002-09-20 Jan-Ake Larsson + + * dvipng.h: change font structures, add dvi struct, remove old + global variables, include relevant bits of config.h, restructure + somewhat + + * dvipng.c: remove explicit vf stack + + * special.c: use dvi struct + + * misc.c: minor changes + + * io.c: close file descriptors, not FILE pointers. + + * draw.c: simplify, remove explicit vf stack. + + * set.c: use dvi struct, remove explicit dvi stack. + + * vf.c: use mmap, remove explicit vf stack. + + * pk.c: use mmap + + * font.c: enable dvi struct, prepare for mmap (file descriptors, + not FILE pointers), explicit vf stack removed. + + * dvi.c: use dvi struct + + * Makefile: config.h removed + + * config.h, klibtool, klibtool.config: removed. + +2002-08-30 Jan-Ake Larsson + + * dvi.c: fix bug in STRSIZE zap + + * vf.c: simplify, fix debug info, zap STRSIZE limit + + * misc.c: Fix background transparency + + * dvipng.h, draw.c: Fix FormFeed bug (outfilename + wrong) + + * set.c: Fix FormFeed bug (outfilename wrong), and background + transparency + +2002-08-29 Jan-Ake Larsson + + * dvipng.h: type changes, dvi-io abstraction + + * color.c: comment changed + + * dvipng.c: dvi-io abstraction + + * font.c: type changes, STRSIZE killed + + * io.c: ReadCommand and CommandLength moved to dvi.c, preparations + for mmap + + * set.c: type changes + + * vf.c, pk.c: prepare for mmap, type changes + + * pagequeue.c: type change + + * misc.c: dvi fopen moved to dvi.c, type changes + + * Makefile: pagelist.o gone, dvi.o new + + * draw.c: SetVF moved to vf.c, type and dvi-io abstraction + changes + + * commands.h: added length and debug texts + + * dvi.c: Functionality moved from pagelist.c and misc.c to + dvi.c. Still needs work, but is initial stab at proper abstraction + of dvi-reading stuff. STRSIZE killed. + + * pagelist.c: Functionality moved to dvi.c + + * special.c: DoSpecial now takes a const char* argument, as + opposed to before. + +2002-08-19 Jan-Ake Larsson + + * misc.c: Added -mode switch + +2002-08-14 Jan-Ake Larsson + + * dvipng.h: VF additions, general cleanup + + * dvipng.c: Small adjustments connected to the VF support + + * config.h: Remove unnecessary things + + * pagelist.c: Simplifications + + * color.c: Comment changed + + * special.c, set.c: Scale always equal h/v + + * Makefile: Make vf.o + + * io.c: Start pre-conversion to mmap. Much still to be done. + + * misc.c, set.c, font.c, pk.c, draw.c: Adjust for VF support + + * vf.c: VF support added to dvipng + +2002-06-24 Jan-Ake Larsson + + * Makefile: Cleaned. Vacuumed, in fact. + +2002-06-19 Jan-Ake Larsson + + * pagelist.c: remove Debug bug (!) + +2002-06-13 Jan-Ake Larsson + + * Makefile: new object files + + * special.c, set.c, dvipng.h: cleanup + + * misc.c (ActualFactor): moved to font.c + cleanup + + * font.c (ActualFactor): moved here from misc.c + + * draw.c, dvipng.c, pagelist.c: functionality from dvipng.c spread + to these three + + * pagequeue.c, pages.c: functionality moved from pages.c to + pagequeue.c + + * commands.h: minor adjustments + +2002-06-12 Jan-Ake Larsson + + * special.c: on unimplemented \special, give pixel position + + * misc.c: Bugfix + literal response on stdin interface + + * font.c, dvipng.h: Font handling fixed + + * dvipng.c: prompt on stdin interface + +2002-06-11 Jan-Ake Larsson + + * set.c (SetChar): load chars on PASS_DRAW + -T -O bug fixed + +2002-06-11 Jan-Ake Larsson + + * set.c: Cleanup. Still buggy wrt -O, though. + + * Makefile: DEBUG on for now, postamble.? removed + + * postamble.c: Postamble is no longer read + + * pages.c: Improve page handling: now a queue, not an unordered + set + + * font.c: Improve font handling: search for fonts only when used + + * dvipng.h: Cleanup + + * dvipng.c: Major rewrite: page handling improved + + * misc.c: Fix DVI init + cleanup + +2002-05-30 Jan-Ake Larsson + + * misc.c: Transparent border: '-bd' + + * dvipng.h, set.c: Tiding up + transparent border + + * dvipng.c, font.c: Tidying up + +2002-05-29 Jan-Ake Larsson + + * color.c: Fix cmyk->rgb. + + * misc.c: Add '-fg' and '-bg'. + + * font.c: Tidy up + +2002-05-29 Jan-Ake Larsson + + * dvipng.h: Tidying up, and new global vars + + * io.c: Tidying up + + * papersiz.c: Pagesize matters, adapted from dvips + + * pages.c: Page choosing, from dvips. Not sufficient for our + purposes, but a start + + * dvipng.c, color.c, Makefile, misc.c, set.c: Changed to make + pagesize (-T), offset (-O), page choosing (-pp), and output file + (-o) work. + +2002-05-27 Jan-Ake Larsson + + * pk.c: Changed comments + + * .cvsignore, special.c, set.c, postamble.c, pk.c, misc.c, io.c, + font.c, dvipng.c, color.c, commands.h, dvipng.h: Initial version + + * config.h, Makefile: Initial version, to be replaced by + autoconf'ism + + * klibtool.config, klibtool: Included for now. To be + removed. diff --git a/Build/source/texk/dvipng/dvipng-1.14/INSTALL b/Build/source/texk/dvipng/dvipng-1.14/INSTALL new file mode 100644 index 00000000000..bef302aebd8 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/INSTALL @@ -0,0 +1,168 @@ +Installing dvipng +***************** + +Installing dvipng should be simple: merely `./configure', `make', and +`make install'. + +Prerequisites +============= + + * The GD Graphics Draw library, libgd + + The drawing library `libgd' is necessary, and is downloadable at + `http://www.boutell.com/gd', and there are binary packages for + most operating systems from their respective distributors. In any + case, the latest version of the library installs using `autoconf' + so it should not be difficult for you to install it from source, + and then proceed with installing dvipng. + + * The path-searching library kpathsea + + Kpathsea is most likely included in your LaTeX installation, but it + may happen that ./configure does not find it; see below. If you do + not have it, download it from `http://www.ctan.org' and compile it. + I have no experience with this, so I cannot help much here. + + * The font-rendering library FreeType 2 + + While not strictly necessary, a recent FreeType 2 is recommended + since dvipng currently will produce better-quality images when + this library is available. To take advantage of this, you should + have at least FreeType 2.1.9. + + FreeType 2 will enable direct support for PostScript and TrueType + fonts, so that dvipng will not need to generate bitmapped variants + on disk of the TeX fonts since modern TeX distributions include + PostScript versions of them. Then, you can render images at + different (and unusual) resolutions without cluttering the disk + with lots of bitmapped fonts. + + Finally, it will enable subfont support in dvipng. That is, if you + want to render CJK-LaTeX characters, you must have FreeType 2 + installed. + + * The font-rendering library T1lib + + An alternative to FreeType 2 is T1lib, but this will enable only + PostScript fonts in dvipng and will not include subfont support. + Also here, you can render images at different (and unusual) + resolutions without cluttering the disk with lots of bitmapped + fonts. If both FreeType 2 and T1lib are present, FreeType will be + internally preferred by dvipng but T1lib can be chosen at runtime. + + * libpng and libz + + To be able to compress and write PNG files to disk, dvipng (or + really libgd) uses libpng which in turn uses libz. These should be + available on any modern system, if not, download them and install + them. + + * The `texinfo' package + + This is needed for building the documentation. + +Configure +========= + +The first step is to configure the source code, telling it where +various files will be. To do so, run + + ./configure OPTIONS + + (Note: if you have fetched dvipng from CVS rather than a regular +release, you will have to first generate `./configure' by running +`autoconf' 2.53 or later.) + + On many machines, you will not need to specify any options, but if +`configure' cannot determine something on its own, you'll need to help +it out. For a list of the options type + + ./configure --help + + On some machines, the libraries will be installed in directories that +are not in the linker's search path. This will generate an error when +running `./configure', indicating that it cannot find libgd or +libkpathsea (most likely). You then need to specify the path to the +respective library's object files. They are typically called e.g., +`libgd.a' or `libgd.so'. If they are located in e.g., `/sw/local/lib', +do + + ./configure LDFLAGS=-L/sw/local/lib + + If the library is available as a shared object file (`.so'), the +runtime linker may also need to be told where to find the library, then +use + + ./configure LDFLAGS='-L/sw/local/lib -R/sw/local/lib' + + When either of these is necessary, it is likely that the C header +files are also installed in directories that are not in the C +preprocessor's search path. This will also generate an error when +running `./configure', indicating that it cannot find e.g., `gd.h' or +`kpathsea.h' (most likely). You then need to specify the path to the +respective library's C header files. If they are located in e.g., +`/sw/local/include', do + + ./configure CPPFLAGS=-I/sw/local/include + + On my SUN Solaris workstation, I had to combine this into + + ./configure CPPFLAGS='-I/sw/local/include -I/sw/tex/teTeX/1.0/include'\ + LDFLAGS='-L/sw/local/lib -R/sw/local/lib -L/sw/tex/teTeX/1.0/lib/' + +where the backslash denotes a continuation of the line. + +Build/install +============= + +Once `configure' has been run, simply enter + + make + +at the prompt to compile the C code, and build the documentation files. +To install the files into the locations chosen earlier, type + + make install + +You may need special privileges to install, e.g., if you are installing +into system directories. + +Installation outside the texmf tree +=================================== + +In some cases, a dvipng binary installed outside the texmf tree will +not be able to find virtual fonts, or the PostScript font maps +(normally used by dvips). This may be because _only_ $SELFAUTOLOC, +$SELFAUTODIR, and $SELFAUTOPARENT are used in the texmf tree +configuration file `texmf.cnf'. If so, give the switch +`--enable-selfauto-set' to `./configure'. This will make dvipng adjust +these three internally so that kpathsea thinks that dvipng _is_ +installed in the texmf tree. + +Installation for non-privileged users +===================================== + +Often people without system administration privileges want to install +software for their private use. In that case you need to specify more +options to the `configure' script, usually this is done by using the +`--prefix' option to the `configure' script, and let it point to the +personal home directory. In that way, resulting binaries will be +installed under the `bin' subdirectory of your home directory, manual +pages under `man' and so on. That way, it is reasonably easy to +maintain a bunch of additional packages, since the prefix argument is +supported by most `configure' scripts. + + You'll have to add something like `/home/myself/bin' to your `PATH' +shell variable, if it isn't there already, and similarly set the +`INFOPATH' and `MANPATH' variables to be able to access the +documentation. + +Copying +======= + +This program is released under the GNU Lesser General Public License +version 3, see the COPYING file in the dvipng distribution or +`http://www.gnu.org/licenses/'. + + Copyright (C) 2002-2009 Jan-AAke Larsson + diff --git a/Build/source/texk/dvipng/dvipng-1.14/Makefile.in b/Build/source/texk/dvipng/dvipng-1.14/Makefile.in new file mode 100644 index 00000000000..5845e238353 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/Makefile.in @@ -0,0 +1,169 @@ +# Makefile is generated by 'configure' from Makefile.in + +#************************************************************************ +# +# Part of the dvipng distribution +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program. If not, see +# . +# +# Copyright (C) 2002-2008 Jan-Åke Larsson +# +#************************************************************************ + +PACKAGE_STRING="@PACKAGE_STRING@" + +CC = @CC@ +CFLAGS = @CFLAGS@ -Wall +CPPFLAGS = @CPPFLAGS@ -I. +LN_S = @LN_S@ + +LIBS = @LIBS@ +LDFLAGS = @LDFLAGS@ + +srcdir = @srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +infodir = @infodir@ +mandir = @mandir@ +DESTDIR= +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = $(srcdir)/mkinstalldirs + +MAKEINFO=@MAKEINFO@ @MAKEINFO_MACROS@ +INSTALL_INFO=@INSTALL_INFO@ +TEX=tex +TEXIDVI=texi2dvi +TEXIHTML=texi2html +DVIPS=dvips +TEXIFILES = dvipng.texi readme.texi install.texi macros.texi dvipng.help + +objects = dvipng.o color.o draw.o dvi.o font.o misc.o pk.o \ + set.o special.o papersiz.o ppagelist.o \ + vf.o @PSFONTS_O@ + +all: dvipng docs + +install: @INSTALL_BIN_TARGET@ @INSTALL_BIN_TARGET@-docs + +####################################### The program + +dvipng: $(objects) + $(CC) $(LDFLAGS) $(objects) -o dvipng $(LIBS) + +$(objects): dvipng.h commands.h config.h + +install-dvipng: dvipng + -$(MKINSTALLDIRS) $(DESTDIR)$(bindir) + $(INSTALL) dvipng $(DESTDIR)$(bindir) + +install-dvigif: install-dvipng + (cd $(DESTDIR)$(bindir) && rm -f dvigif && $(LN_S) dvipng dvigif) + +####################################### The documentation + +docs: dvipng.dvi dvipng.info + +dvipng.dvi: $(TEXIFILES) + -$(TEXIDVI) -I $(srcdir) $(srcdir)/dvipng.texi + +dvipng.ps: dvipng.dvi + $(DVIPS) -Ppdf dvipng.dvi + +dvipng.info: $(TEXIFILES) dvipng.help + -$(MAKEINFO) -I$(srcdir) $(srcdir)/dvipng.texi + +dvipng.help: dvipng + -./dvipng > dvipng.tmp + ( test -r dvipng.help && diff dvipng.tmp dvipng.help ) \ + || cp dvipng.tmp dvipng.help + rm -f dvipng.tmp + +www: $(TEXIFILES) dvipng.help + mkdir -p www + texi2html -split chapter -nosec-nav -subdir html \ + -I $(srcdir) $(srcdir)/dvipng.texi + (cd html; for i in *; do \ + sed -e "s/Jan-A/Jan-\Å\;/g" $$i > ../www/$$i; \ + done) + cp www/dvipng.html www/index.html + rm -rf html + +dvipng_mono.html: $(TEXIFILES) dvipng.help + texi2html --monolithic -nomenu -nosec_nav -o dvipng_mono.html \ + -I $(srcdir) $(srcdir)/dvipng.texi + +install-docs: docs + -$(MKINSTALLDIRS) $(DESTDIR)$(infodir) + for x in dvipng.info* ; do \ + $(INSTALL_DATA) $$x $(DESTDIR)$(infodir) ; \ + done + -$(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) dvipng.info + -$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1 + $(INSTALL_DATA) $(srcdir)/dvipng.1 $(DESTDIR)$(mandir)/man1 + +install-dvipng-docs: install-docs + +install-dvigif-docs: install-docs + (cd $(DESTDIR)$(mandir)/man1 && rm -f dvigif.1 && $(LN_S) dvipng.1 dvigif.1) + +####################################### The test + +test: test_dvipng.dvi dvipng + ./dvipng -T tight -strict test_dvipng + echo View the result e.g. with xv test_dvipng\*.png + +test_dvipng.dvi: test_dvipng.tex + latex $(srcdir)/test_dvipng.tex + +####################################### The cleaning up + +clean: + rm -f *.o dvipng *.help *.info* *dvipng.dvi *.aux *.log + rm -f *dvipng.ps *.cp *.fn *.ky *~ \#*\# \ + *.tp *.vr *.pg *.toc *.tp *.bak *.cps *.kys *.tps \ + *.fns *.vrs *.pgs *.html *.tmp + +distclean: clean + rm -f Makefile + rm -f config.status config.log config.cache c-auto.h + +####################################### Maintainer targets + +INSTALL: install.texi + -$(MAKEINFO) -D rawfile --no-headers --no-validate \ + --no-number-sections \ + -I$(srcdir) $(srcdir)/install.texi --output INSTALL + +README: readme.texi + -$(MAKEINFO) -D rawfile --no-headers --no-validate \ + --no-number-sections \ + -I$(srcdir) $(srcdir)/readme.texi --output README + +dvipng.1: dvipng.texi readme.texi + texi2pod.pl -D man $(srcdir)/dvipng.texi | \ + sed -es/@//g -es/previewlatex/preview-latex/g -es/{}//g > dvipng.pod + pod2man --center="User commands" --release=$(PACKAGE_STRING)\ + dvipng.pod > dvipng.1 + rm dvipng.pod + +dist: INSTALL README dvipng.1 distclean + +# SunOS make suffix rule wierdness +.cps.h: + diff --git a/Build/source/texk/dvipng/dvipng-1.14/README b/Build/source/texk/dvipng/dvipng-1.14/README new file mode 100644 index 00000000000..da9ba557f4c --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/README @@ -0,0 +1,128 @@ +dvipng +****** + +This program makes PNG and/or GIF graphics from DVI files as obtained +from TeX and its relatives. + + If GIF support is enabled, GIF output is chosen by using the +`dvigif' binary or with the `--gif' option. + + It is intended to produce anti-aliased screen-resolution images as +fast as is possible. The target audience is people who need to generate +and regenerate many images again and again. The primary target is the +preview-latex (X)Emacs package, a package to preview formulas from +within (X)Emacs. Yes, you get to see your formulas in the (X)Emacs +buffer, see `http://www.gnu.org/software/auctex/preview-latex.html'. + + Another example is WeBWorK, an internet-based method for delivering +homework problems to students over the internet, giving students +instant feedback as to whether or not their answers are correct, see +`http://webwork.math.rochester.edu'. + + A more recent addition to the dvipng-using applications out there is +MediaWiki, the software behind Wikipedia and many other wikis out +there. Dvipng is used to render mathematical formulae from version +1.8.0 of MediaWiki, see `http://www.mediawiki.org'. + + Other applications may also benefit, like web applications as +latex2html and WYSIWYG editors like LyX. + +Benefits of dvipng +================== + + The benefits of `dvipng'/`dvigif' include + + * Speed. It is a very fast bitmap-rendering code for DVI files, which + makes it suitable for generating large amounts of images + on-the-fly, as needed in preview-latex, WeBWorK and others. + + * It does not read the postamble, so it can be started before TeX + finishes. There is a `--follow' switch that makes dvipng wait at + end-of-file for further output, unless it finds the POST marker + that indicates the end of the DVI. + + * Interactive query of options. dvipng can read options interactively + through stdin, and all options are usable. It is even possible to + change the input file through this interface. + + * Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts + (i.e., as used in CJK-LaTeX), color specials, and inclusion of + PostScript, PNG, JPEG or GIF images. + + * and more... + + +Installation +============ + +Read `INSTALL', included in the distribution. + +Usage +===== + +To use dvipng at its simplest, simply type + + dvipng foo + +where `foo.dvi' is the output of TeX that you want to convert to PNG +format. If there are four pages in `foo.dvi', those pages will be +output as `foo1.png', `foo2.png', `foo3.png', and `foo4.png', +respectively. + + Many options are available (see the info manual). For a brief +summary of available options, just type + + dvipng --help + +Availability +============ + +The dvipng package is available at Savannah, the GNU project site. Since +dvipng is not part of the GNU project, although released under the GNU +GPL, the web address is `http://savannah.nongnu.org/projects/dvipng'. +Instructions for anonymous CVS access can be found at +`http://savannah.nongnu.org/cvs/?group=dvipng'. + +Contacts +======== + +Bug reports should be sent to . + + Questions, suggestions for new features, pleas for help, and/or +praise should go to . For more information on this +mailing list, send a message with just the word `help' as subject or +body to or look at +`http://lists.nongnu.org/mailman/listinfo/dvipng'. + + Offers to support further development will be appreciated. For +developer access, ask on . + +Copying +======= + +This program is released under the GNU Lesser General Public License +version 3, see the COPYING file in the dvipng distribution or +`http://www.gnu.org/licenses/'. + + Copyright (C) 2002-2009 Jan-AAke Larsson + +Todo +==== + + * Use gs interpreter library for speed and possibly for + functionality. + + * Add more color models for xcolor compatibility + + * Fix T1lib and PK rendering so it is on par with Freetype. + + * Enable a named pipe as DVI + + * Further speed improvements. + + * Other output specials and source specials. + + * Clean internal structures. Overhaul file handling. + + * Fix the SELFAUTO stuff at runtime rather than at build time + diff --git a/Build/source/texk/dvipng/dvipng-1.14/RELEASE b/Build/source/texk/dvipng/dvipng-1.14/RELEASE new file mode 100644 index 00000000000..60f81395aff --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/RELEASE @@ -0,0 +1,15 @@ +Release notes for version 1.14 of the dvipng package: + +This program makes PNG graphics from DVI files as obtained from TeX +and its relatives. + + +This release changes raw PostScript processing to avoid the +non-rendering PostScript specials created by hyperref. A command-line +switch to turn off raw PostScript rendering has been added. Finally, a +few bugs has been fixed, such as correct decoding of the -T switch, a +CRLF bug when reading configuration files in Windows, and a few bugs +associated to subprocesses. + + +Report any bugs you find, see README for instructions. diff --git a/Build/source/texk/dvipng/dvipng-1.14/aclocal.m4 b/Build/source/texk/dvipng/dvipng-1.14/aclocal.m4 new file mode 100644 index 00000000000..0cd4eddf92e --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/aclocal.m4 @@ -0,0 +1,237 @@ +# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- + +# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Configure paths for FreeType2 +# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor + +dnl AC_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS +dnl +AC_DEFUN(AC_CHECK_FT2, +[dnl +dnl Get the cflags and libraries from the freetype-config script +dnl +AC_ARG_WITH(ft-prefix, +[ --with-ft-prefix=PREFIX + Prefix where FreeType is installed (optional)], + ft_config_prefix="$withval", ft_config_prefix="") +AC_ARG_WITH(ft-exec-prefix, +[ --with-ft-exec-prefix=PREFIX + Exec prefix where FreeType is installed (optional)], + ft_config_exec_prefix="$withval", ft_config_exec_prefix="") +AC_ARG_ENABLE(freetypetest, +[ --disable-freetypetest Do not try to compile and run + a test FreeType program], + [], enable_fttest=yes) + +if test x$ft_config_exec_prefix != x ; then + ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config + fi +fi +if test x$ft_config_prefix != x ; then + ft_config_args="$ft_config_args --prefix=$ft_config_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_prefix/bin/freetype-config + fi +fi +AC_PATH_PROG(FT2_CONFIG, freetype-config, no) + +min_ft_version=ifelse([$1], ,6.1.0,$1) +AC_MSG_CHECKING(for FreeType - version >= $min_ft_version) +no_ft="" +if test "$FT2_CONFIG" = "no" ; then + no_ft=yes +else + FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` + FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` + ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + ft_min_major_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_min_minor_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_min_micro_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test x$enable_fttest = xyes ; then + ft_config_is_lt="" + if test $ft_config_major_version -lt $ft_min_major_version ; then + ft_config_is_lt=yes + else + if test $ft_config_major_version -eq $ft_min_major_version ; then + if test $ft_config_minor_version -lt $ft_min_minor_version ; then + ft_config_is_lt=yes + else + if test $ft_config_minor_version -eq $ft_min_minor_version ; then + if test $ft_config_micro_version -lt $ft_min_micro_version ; then + ft_config_is_lt=yes + fi + fi + fi + fi + fi + if test x$ft_config_is_lt = xyes ; then + no_ft=yes + else + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $FT2_CFLAGS" + LIBS="$FT2_LIBS $LIBS" +dnl +dnl Sanity checks for the results of freetype-config to some extent +dnl + AC_TRY_RUN([ +#include +#include FT_FREETYPE_H +#include +#include + +int +main() +{ + FT_Library library; + FT_Error error; + + error = FT_Init_FreeType(&library); + + if (error) + return 1; + else + { + FT_Done_FreeType(library); + return 0; + } +} +],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi # test $ft_config_version -lt $ft_min_version + fi # test x$enable_fttest = xyes +fi # test "$FT2_CONFIG" = "no" +if test x$no_ft = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) +else + AC_MSG_RESULT(no) + if test "$FT2_CONFIG" = "no" ; then + echo "*** The freetype-config script installed by FreeType 2 could not be found." + echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the FT2_CONFIG environment variable to the" + echo "*** full path to freetype-config." + else + if test x$ft_config_is_lt = xyes ; then + echo "*** Your installed version of the FreeType 2 library is too old." + echo "*** If you have different versions of FreeType 2, make sure that" + echo "*** correct values for --with-ft-prefix or --with-ft-exec-prefix" + echo "*** are used, or set the FT2_CONFIG environment variable to the" + echo "*** full path to freetype-config." + else + echo "*** The FreeType test program failed to run. If your system uses" + echo "*** shared libraries and they are installed outside the normal" + echo "*** system library path, make sure the variable LD_LIBRARY_PATH" + echo "*** (or whatever is appropiate for your system) is correctly set." + fi + fi + FT2_CFLAGS="" + FT2_LIBS="" + ifelse([$3], , :, [$3]) +fi +AC_SUBST(FT2_CFLAGS) +AC_SUBST(FT2_LIBS) +]) + + +dnl +dnl MAKEINFO_CHECK_MACRO( MACRO, [ACTION-IF-FOUND +dnl [, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN(MAKEINFO_CHECK_MACRO, +[if test -n "$MAKEINFO" -a "$makeinfo" != ":"; then + AC_MSG_CHECKING([for @$1{}]) + echo \\\\input texinfo > conftest.texi + echo @$1{test} >> conftest.texi + if $MAKEINFO conftest.texi > /dev/null 2> /dev/null; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + ifelse([$3], , :, [$3]) + fi + rm -f conftest.texi conftest.info +fi +]) + +dnl +dnl MAKEINFO_CHECK_MACROS( MACRO ... [, ACTION-IF-FOUND +dnl [, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN(MAKEINFO_CHECK_MACROS, +[for ac_macro in $1; do + MAKEINFO_CHECK_MACRO($ac_macro, $2, + [MAKEINFO_MACROS="-D no-$ac_macro $MAKEINFO_MACROS" + $3])dnl + done +AC_SUBST(MAKEINFO_MACROS) +]) + + +dnl +dnl Check for enc, cmap, sfd formats +dnl +AC_DEFUN(AC_HAS_KPSE_ENC_FORMATS, + [AC_MSG_CHECKING([for kpse_enc_format]) + AC_TRY_COMPILE([ + #include + #include ], + [kpse_enc_format;kpse_cmap_format;kpse_sfd_format], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_KPSE_ENC_FORMATS, 1, + [Define to 1 if your kpathsea has kpse_enc_format])], + [AC_MSG_RESULT(no)])]) + + +dnl +dnl Check devices for GS +dnl AC_GS_HAS_DEVICE(DEVICE,ACTION-IF-FAILED) +dnl +AC_DEFUN(AC_GS_HAS_DEVICE, + [AC_MSG_CHECKING([whether $GS has the $1 device]) + if $GS -h | grep $1 >/dev/null; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + $2 + fi +]) + +dnl +dnl GS_CHECK_DEVICES +dnl +AC_DEFUN(GS_CHECK_DEVICES, + [GS_WARN="" + AC_GS_HAS_DEVICE(pngalpha, + [GS_WARN="Your EPS inclusions will be cropped to the + boundingbox, and rendered on an opaque background. + Upgrade GhostScript to avoid this." + AC_GS_HAS_DEVICE(png16m, + [GS_WARN="Your EPS inclusions may not work. + Upgrade/install GhostScript to avoid this."])]) + if test -n "$GS_WARN"; then + AC_MSG_WARN([$GS_WARN]) + fi +]) diff --git a/Build/source/texk/dvipng/dvipng-1.14/color.c b/Build/source/texk/dvipng/dvipng-1.14/color.c new file mode 100644 index 00000000000..ecaf425f35e --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/color.c @@ -0,0 +1,443 @@ +/* color.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +/* + * Color. We delete and recreate the gdImage for each new page. This + * means that the stack must contain rgb value not color index. + * Besides, the current antialiasing implementation needs rgb anyway. +*/ + +struct colorname { + struct colorname *next; + char* color; + char name[1]; +} *colornamep=NULL,*xcp=NULL; + +const char *colordef[]={"xcolor.sty","dvipsnam.def", + "svgnam.def","x11nam.def",NULL}; +char *xcpname=NULL; + +void initcolor(void) +{ + csp = 1; + cstack[0].red=255; + cstack[0].green=255; + cstack[0].blue=255; + cstack[1].red=0; + cstack[1].green=0; + cstack[1].blue=0; +} + +static struct colorname * NewColor(const char* prefix, int nprefix, + char* name, int nname, + char* model, int nmodel, + char* values, int nvalues) +{ + struct colorname *tmp = + malloc(sizeof(struct colorname)+3+nprefix+nname+nmodel+nvalues); + if (tmp==NULL) + Fatal("Cannot malloc space for color name"); + tmp->color=tmp->name+nprefix+nname+1; + strncpy(tmp->name,prefix,nprefix); + strncpy(tmp->name+nprefix,name,nname); + tmp->name[nprefix+nname]='\0'; + strncpy(tmp->color,model,nmodel); + tmp->color[nmodel]=' '; + strncpy(tmp->color+nmodel+1,values,nvalues); + tmp->color[nmodel+nvalues+1]='\0'; + model=tmp->color; + while(*model!='\0') { + if (*model==',') + *model=' '; + model++; + } + DEBUG_PRINT(DEBUG_COLOR,("\n COLOR NAME:\t'%s' '%s'", + tmp->name,tmp->color)); + return(tmp); +} + +#define FINDWORD(s) while(snext=list; + list=tmp; + } else if ((pos+15next=list; + list=tmp; + FINDWORD(pos); + } + } else { + pos++; + while (posnext; + free(xcp); + xcp=next; + } + if (xcpname!=NULL) { + free(xcpname); + xcpname=NULL; + } +} + +void ClearColorNames(void) +{ + struct colorname *next; + while (colornamep) { + next=colornamep->next; + free(colornamep); + colornamep=next; + } + ClearXColorPrologue(); +} + +void InitXColorPrologue(const char* name) +{ + ClearXColorPrologue(); + xcpname=malloc(strlen(name)+1); + if (xcpname==NULL) + Fatal("cannot malloc memory for xcolor prologue name"); + strcpy(xcpname,name); +} + +static struct colorname* LoadXColorPrologue(void) +{ + struct colorname *list=NULL,*tmp=NULL; + char *filepath,*pos,*max; + const char *prefix=""; + char *name,*values,*model; + int nprefix=0,nname,nvalues,nmodel; + struct filemmap fmmap; + boolean mmapfailed; + + filepath=kpse_find_file(xcpname,kpse_program_text_format,false); + if (filepath == NULL) + return NULL; + DEBUG_PRINT(DEBUG_COLOR,("\n OPEN XCOLOR PROLOGUE:\t'%s'", filepath)); + mmapfailed = MmapFile(filepath,&fmmap); + free(filepath); + if (mmapfailed) + return NULL; + pos=fmmap.data; + max=fmmap.data+fmmap.size; + while(posnext=list; + list=tmp; + } + } + UnMmapFile(&fmmap); + return(list); +} + +#define FTO255(a) ((int) (255*a+0.5)) +#define WARN_IF_FAILED(a,b) if (a==b) { page_flags |= PAGE_GAVE_WARN; \ + Warning("missing color-specification value, treated as zero"); } + +#define SKIPSPACES(s) while(s && *s==' ' && *s!='\0') s++ +#define NEXTFLOAT255(c) FTO255(strtod(c,&end)); WARN_IF_FAILED(c,end); c=end +#define NEXTFLOAT(c) strtod(c,&end); WARN_IF_FAILED(c,end); c=end +#define NEXTINT(c) strtol(c,&end,10); WARN_IF_FAILED(c,end); c=end +#define NEXTHEX(c) strtol(c,&end,16); WARN_IF_FAILED(c,end); c=end + +void stringrgb(const char* color,int *r,int *g,int *b) +{ + char* end; + static int unloaded=1; + + DEBUG_PRINT(DEBUG_COLOR,("\n COLOR SPEC:\t'%s' (",color)); + SKIPSPACES(color); + if (strcmp(color,"Black")==0) { + *r = *g = *b = 0; + } else if (strcmp(color,"White")==0) { + *r = *g = *b = 255; + } else if (strncmp(color,"gray ",5)==0) { + color+=5; + *r = *g = *b = NEXTFLOAT255(color); + } else if (strncmp(color,"rgb ",4)==0) { + color+=4; + *r = NEXTFLOAT255(color); + *g = NEXTFLOAT255(color); + *b = NEXTFLOAT255(color); + } else if (strncmp(color,"Gray ",5)==0) { + color+=5; + *r = *g = *b = NEXTINT(color); + } else if (strncmp(color,"RGB ",4)==0) { + color+=4; + *r = NEXTINT(color); + *g = NEXTINT(color); + *b = NEXTINT(color); + } else if (strncmp(color,"HTML ",5)==0) { + color+=5; + *b = NEXTHEX(color); + *r = *b/65536; + *g = *b/256; + *b -= *g*256; + *g -= *r*256; + } else if (strncmp(color,"cmy ",4)==0 + || strncmp(color,"cmyk ",5)==0) { + int c,m,y,k; + color+=3; + k=(*color=='k'); + if (k) + color++; + c = NEXTFLOAT255(color); + m = NEXTFLOAT255(color); + y = NEXTFLOAT255(color); + if (k) + k = NEXTFLOAT255(color); + *r = c+k<255 ? 255-(c+k) : 0; + *g = m+k<255 ? 255-(m+k) : 0; + *b = y+k<255 ? 255-(y+k) : 0; + } else if (strncmp(color,"hsb ",4)==0 + || strncmp(color,"HSB ",4)==0) { + /* The hsb and HSB models really need more presicion. + Use double and convert back*/ + double hu,sa,br,f,R,G,B; + int i; + if (*color=='h') { + color+=4; + hu = NEXTFLOAT(color); + sa = NEXTFLOAT(color); + br = NEXTFLOAT(color); + } else { + color+=4; + hu = (float)NEXTINT(color); hu /= 255; + sa = (float)NEXTINT(color); sa /= 255; + br = (float)NEXTINT(color); br /= 255; + } + i=6*hu; + f=6*hu-i; + switch(i) { + case 0: + R = br*(1-sa*0); G = br*(1-sa*(1-f)); B = br*(1-sa*1); break; + case 1: + R = br*(1-sa*f); G = br*(1-sa*0); B = br*(1-sa*1); break; + case 2: + R = br*(1-sa*1); G = br*(1-sa*0); B = br*(1-sa*(1-f)); break; + case 3: + R = br*(1-sa*1); G = br*(1-sa*f); B = br*(1-sa*0); break; + case 4: + R = br*(1-sa*(1-f)); G = br*(1-sa*1); B = br*(1-sa*0); break; + case 5: + R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*f); break; + default: + R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*1); + } + *r=FTO255(R); + *g=FTO255(G); + *b=FTO255(B); + } else { + /* Model not found, probably a color name */ + struct colorname *tmp; + + if (xcp==NULL && xcpname!=NULL) + xcp=LoadXColorPrologue(); + tmp=xcp; + while(tmp!=NULL && strcmp(color,tmp->name)!=0) + tmp=tmp->next; + if (tmp==NULL) { + if (colornamep==NULL) + colornamep=LoadColornameFile(colordef[0]); + tmp=colornamep; + while((tmp->next!=NULL || colordef[unloaded]!=NULL) + && strcmp(color,tmp->name)!=0) { + if (tmp->next==NULL) + tmp->next=LoadColornameFile(colordef[unloaded++]); + tmp=tmp->next; + } + } + if (strcmp(color,tmp->name)==0) { + /* Found: one-level recursion */ + DEBUG_PRINT(DEBUG_COLOR,("\n ---RECURSION--- ")) + stringrgb(tmp->color,r,g,b); + } else { + /* Not found, warn */ + page_flags |= PAGE_GAVE_WARN; + Warning("unimplemented color specification '%s'",color); + } + } + DEBUG_PRINT(DEBUG_COLOR,("%d %d %d) ",*r,*g,*b)) +} + +void background(const char* p) +{ + stringrgb(p, &cstack[0].red, &cstack[0].green, &cstack[0].blue); + DEBUG_PRINT(DEBUG_COLOR,("\n BACKGROUND:\t(%d %d %d) ", + cstack[0].red, cstack[0].green, cstack[0].blue)); +} + +void pushcolor(const char * p) +{ + if ( ++csp == STACK_SIZE ) + Fatal("out of color stack space") ; + stringrgb(p, &cstack[csp].red, &cstack[csp].green, &cstack[csp].blue); + DEBUG_PRINT(DEBUG_COLOR,("\n COLOR PUSH:\t(%d %d %d) ", + cstack[csp].red, cstack[csp].green, cstack[csp].blue)) +} + +void popcolor(void) +{ + if (csp > 1) csp--; /* Last color is global */ + DEBUG_PRINT(DEBUG_COLOR,("\n COLOR POP\t")) +} + +void resetcolorstack(const char * p) +{ + if ( csp > 1 ) + Warning("global color change within nested colors"); + csp=0; + pushcolor(p) ; + DEBUG_PRINT(DEBUG_COLOR,("\n RESET COLOR:\tbottom of stack:")) +} + +void StoreColorStack(struct page_list *tpagep) +{ + int i=0; + + DEBUG_PRINT(DEBUG_COLOR,("\n STORE COLOR STACK:\t %d ", csp)); + tpagep->csp=csp; + while ( i <= csp ) { + DEBUG_PRINT(DEBUG_COLOR,("\n COLOR STACK:\t %d (%d %d %d) ",i, + cstack[i].red, cstack[i].green, cstack[i].blue)); + tpagep->cstack[i].red = cstack[i].red; + tpagep->cstack[i].green = cstack[i].green; + tpagep->cstack[i].blue = cstack[i].blue; + i++; + } +} + +void ReadColorStack(struct page_list *tpagep) +{ + int i=0; + + DEBUG_PRINT(DEBUG_COLOR,("\n READ COLOR STACK:\t %d ", tpagep->csp)); + csp=tpagep->csp; + while ( i <= tpagep->csp ) { + DEBUG_PRINT(DEBUG_COLOR,("\n COLOR STACK:\t %d (%d %d %d) ",i, + cstack[i].red, cstack[i].green, cstack[i].blue)); + cstack[i].red = tpagep->cstack[i].red; + cstack[i].green = tpagep->cstack[i].green; + cstack[i].blue = tpagep->cstack[i].blue; + i++; + } +} + +void StoreBackgroundColor(struct page_list *tpagep) +{ + /* Background color changes affect the _whole_ page */ + tpagep->cstack[0].red = cstack[0].red; + tpagep->cstack[0].green = cstack[0].green; + tpagep->cstack[0].blue = cstack[0].blue; +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/commands.h b/Build/source/texk/dvipng/dvipng-1.14/commands.h new file mode 100644 index 00000000000..e2a5404bb32 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/commands.h @@ -0,0 +1,196 @@ +/* commands.h */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2008 Jan-Åke Larsson + +************************************************************************/ + +/* DVI COMMANDS */ +#define DVIFORMAT 2 + +#define SETC_000 0 /* typeset character 0 and move right */ +#define SETC_127 127 /* typeset character 127 and move right */ +#define SET1 128 /* typeset a character and move right */ +#define SET2 129 /* ??? */ +#define SET3 130 /* ??? */ +#define SET4 131 /* ??? */ +#define SET_RULE 132 /* typeset a rule and move right */ +#define PUT1 133 /* typeset a character */ +#define PUT2 134 /* ??? */ +#define PUT3 135 /* ??? */ +#define PUT4 136 /* ??? */ +#define PUT_RULE 137 /* typeset a rule */ +#define NOP 138 /* no operation */ +#define BOP 139 /* beginning of page */ +#define EOP 140 /* ending of page */ +#define PUSH 141 /* save the current positions */ +#define POP 142 /* restore previous positions */ +#define RIGHT1 143 /* move right */ +#define RIGHT2 144 /* ??? */ +#define RIGHT3 145 /* ??? */ +#define RIGHT4 146 /* ??? */ +#define W0 147 /* move right by |w| */ +#define W1 148 /* move right and set |w| */ +#define W2 149 /* ??? */ +#define W3 150 /* ??? */ +#define W4 151 /* ??? */ +#define X0 152 /* move right by |x| */ +#define X1 153 /* move right and set |x| */ +#define X2 154 /* ??? */ +#define X3 155 /* ??? */ +#define X4 156 /* ??? */ +#define DOWN1 157 /* move down */ +#define DOWN2 158 /* ??? */ +#define DOWN3 159 /* ??? */ +#define DOWN4 160 /* ??? */ +#define Y0 161 /* move down by |y| */ +#define Y1 162 /* move down and set |y| */ +#define Y2 163 /* ??? */ +#define Y3 164 /* ??? */ +#define Y4 165 /* ??? */ +#define Z0 166 /* move down by |z| */ +#define Z1 167 /* move down and set |z| */ +#define Z2 168 /* ??? */ +#define Z3 169 /* ??? */ +#define Z4 170 /* ??? */ +#define FONT_00 171 /* set current font to 0 */ +#define FONT_63 234 /* set current font to 63 */ +#define FNT1 235 /* set current font */ +#define FNT2 236 /* Same as FNT1, except that arg is 2 bytes */ +#define FNT3 237 /* Same as FNT1, except that arg is 3 bytes */ +#define FNT4 238 /* Same as FNT1, except that arg is 4 bytes */ +#define XXX1 239 /* extension to \.DVI primitives */ +#define XXX2 240 /* Like XXX1, but 0<=k<65536 */ +#define XXX3 241 /* Like XXX1, but 0<=k<@t$2^{24}$@> */ +#define XXX4 242 /* potentially long extension to \.DVI + primitives */ +#define FNT_DEF1 243 /* define the meaning of a font number */ +#define FNT_DEF2 244 /* ??? */ +#define FNT_DEF3 245 /* ??? */ +#define FNT_DEF4 246 /* ??? */ +#define PRE 247 /* preamble */ +#define POST 248 /* postamble beginning */ +#define POST_POST 249 /* postamble ending */ + +/* undefined_commands 250,251,252,253,254,255 */ + +EXTERN const int8_t dvi_commandlength[256] +#ifdef MAIN +={ + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1, /* SETC_000 --- SETC_127 */ + 2,3,4,5,9, /* SET1 --- SET4, SET_RULE */ + 2,3,4,5,9, /* PUT1 --- PUT4, PUT_RULE */ + 1,45,1,1,1, /* NOP, BOP, EOP, PUSH, POP */ + 2,3,4,5, /* RIGHT1 --- RIGHT4 */ + 1,2,3,4,5, /* W0 --- W4 */ + 1,2,3,4,5, /* X0 --- X4 */ + 2,3,4,5, /* DOWN1 --- DOWN4 */ + 1,2,3,4,5, /* Y0 --- Y4 */ + 1,2,3,4,5, /* Z0 --- Z4 */ + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1, + 1,1,1,1, /* FONT_00 --- FONT_63 */ + 2,3,4,5, /* FNT1 --- FNT4 */ + 2,3,4,5, /* XXX1 --- XXX4 + special string */ + 16,17,18,19, /* FNT_DEF1 --- FNT_DEF4 + font name */ + 15, /* PRE + TeX comment */ + 29, /* POST */ + 10, /* POST_POST minimum */ + -1,-1,-1,-1,-1,-1 /* undefined */ +} +#endif +; + +EXTERN const char* dvi_commands[256] +#ifdef MAIN +={ +"SETC_000","SETC_001","SETC_002","SETC_003","SETC_004", +"SETC_005","SETC_006","SETC_007","SETC_008","SETC_009", +"SETC_010","SETC_011","SETC_012","SETC_013","SETC_014", +"SETC_015","SETC_016","SETC_017","SETC_018","SETC_019", +"SETC_020","SETC_021","SETC_022","SETC_023","SETC_024", +"SETC_025","SETC_026","SETC_027","SETC_028","SETC_029", +"SETC_030","SETC_031","SETC_032","SETC_033","SETC_034", +"SETC_035","SETC_036","SETC_037","SETC_038","SETC_039", +"SETC_040","SETC_041","SETC_042","SETC_043","SETC_044", +"SETC_045","SETC_046","SETC_047","SETC_048","SETC_049", +"SETC_050","SETC_051","SETC_052","SETC_053","SETC_054", +"SETC_055","SETC_056","SETC_057","SETC_058","SETC_059", +"SETC_060","SETC_061","SETC_062","SETC_063","SETC_064", +"SETC_065","SETC_066","SETC_067","SETC_068","SETC_069", +"SETC_070","SETC_071","SETC_072","SETC_073","SETC_074", +"SETC_075","SETC_076","SETC_077","SETC_078","SETC_079", +"SETC_080","SETC_081","SETC_082","SETC_083","SETC_084", +"SETC_085","SETC_086","SETC_087","SETC_088","SETC_089", +"SETC_090","SETC_091","SETC_092","SETC_093","SETC_094", +"SETC_095","SETC_096","SETC_097","SETC_098","SETC_099", +"SETC_100","SETC_101","SETC_102","SETC_103","SETC_104", +"SETC_105","SETC_106","SETC_107","SETC_108","SETC_109", +"SETC_110","SETC_111","SETC_112","SETC_113","SETC_114", +"SETC_115","SETC_116","SETC_117","SETC_118","SETC_119", +"SETC_120","SETC_121","SETC_122","SETC_123","SETC_124", +"SETC_125","SETC_126","SETC_127", +"SET1","SET2","SET3","SET4","SET_RULE", +"PUT1","PUT2","PUT3","PUT4","PUT_RULE", +"NOP","BOP","EOP","PUSH","POP", +"RIGHT1","RIGHT2","RIGHT3","RIGHT4", +"W0","W1","W2","W3","W4", +"X0","X1","X2","X3","X4", +"DOWN1","DOWN2","DOWN3","DOWN4", +"Y0","Y1","Y2","Y3","Y4", +"Z0","Z1","Z2","Z3","Z4", +"FONT_00","FONT_01","FONT_02","FONT_03","FONT_04", +"FONT_05","FONT_06","FONT_07","FONT_08","FONT_09", +"FONT_10","FONT_11","FONT_12","FONT_13","FONT_14", +"FONT_15","FONT_16","FONT_17","FONT_18","FONT_19", +"FONT_20","FONT_21","FONT_22","FONT_23","FONT_24", +"FONT_25","FONT_26","FONT_27","FONT_28","FONT_29", +"FONT_30","FONT_31","FONT_32","FONT_33","FONT_34", +"FONT_35","FONT_36","FONT_37","FONT_38","FONT_39", +"FONT_40","FONT_41","FONT_42","FONT_43","FONT_44", +"FONT_45","FONT_46","FONT_47","FONT_48","FONT_49", +"FONT_50","FONT_51","FONT_52","FONT_53","FONT_54", +"FONT_55","FONT_56","FONT_57","FONT_58","FONT_59", +"FONT_60","FONT_61","FONT_62","FONT_63", +"FNT1","FNT2","FNT3","FNT4", +"XXX1","XXX2","XXX3","XXX4", +"FNT_DEF1","FNT_DEF2","FNT_DEF3","FNT_DEF4", +"PRE","POST","POST_POST", +"UNDEF_250","UNDEF_251","UNDEF_252","UNDEF_253","UNDEF_254","UNDEF_255" +} +#endif +; + diff --git a/Build/source/texk/dvipng/dvipng-1.14/config.h.in b/Build/source/texk/dvipng/dvipng-1.14/config.h.in new file mode 100644 index 00000000000..9c51686b9df --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/config.h.in @@ -0,0 +1,224 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define as 1 to get the debug (-d) option. */ +#undef DEBUG + +/* The environment setting for $SELFAUTODIR */ +#undef ENV_SELFAUTODIR + +/* The environment setting for $SELFAUTOLOC */ +#undef ENV_SELFAUTOLOC + +/* The environment setting for $SELFAUTOPARENT */ +#undef ENV_SELFAUTOPARENT + +/* Define as the path to GhostScript. */ +#undef GS_PATH + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the `dup2' function. */ +#undef HAVE_DUP2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + +/* Define to 1 if you have freetype2 */ +#undef HAVE_FT2 + +/* Define to 1 if you have the `ftime' function. */ +#undef HAVE_FTIME + +/* Define to 1 if you have the `FT_Library_Version' function. */ +#undef HAVE_FT_LIBRARY_VERSION + +/* Define to 1 if you have the `gdImageCreateFromJpeg' function. */ +#undef HAVE_GDIMAGECREATEFROMJPEG + +/* Define to 1 if you have the `gdImageCreateFromPngPtr' function. */ +#undef HAVE_GDIMAGECREATEFROMPNGPTR + +/* Define to 1 if you have the `gdImageCreateTrueColor' function. */ +#undef HAVE_GDIMAGECREATETRUECOLOR + +/* Define to 1 if you have the `gdImageGif' function. */ +#undef HAVE_GDIMAGEGIF + +/* Define to 1 if you have the `gdImagePngEx' function. */ +#undef HAVE_GDIMAGEPNGEX + +/* Define to 1 if you have the header file. */ +#undef HAVE_GD_H + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_KPATHSEA_KPATHSEA_H + +/* Define to 1 if your kpathsea has kpse_enc_format */ +#undef HAVE_KPSE_ENC_FORMATS + +/* Define to 1 if you have the `gd' library (-lgd). */ +#undef HAVE_LIBGD + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H + +/* Define to 1 if you have the `kpathsea' library (-lkpathsea). */ +#undef HAVE_LIBKPATHSEA + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the `png' library (-lpng). */ +#undef HAVE_LIBPNG + +/* Define to 1 if you have the `t1' library (-lt1). */ +#undef HAVE_LIBT1 + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_PNG_H + +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_T1LIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the header file. */ +#undef HAVE_VFORK_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if `fork' works. */ +#undef HAVE_WORKING_FORK + +/* Define to 1 if `vfork' works. */ +#undef HAVE_WORKING_VFORK + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define as 1 to get execution time output. */ +#undef TIMING + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `long long' if does not define it. */ +#undef int64_t + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to `unsigned long long' if does not define it. */ +#undef uint64_t + +/* Define as `fork' if `vfork' does not work. */ +#undef vfork diff --git a/Build/source/texk/dvipng/dvipng-1.14/configure.ac b/Build/source/texk/dvipng/dvipng-1.14/configure.ac new file mode 100644 index 00000000000..0630bb136a4 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/configure.ac @@ -0,0 +1,225 @@ +# configure.ac + +#************************************************************************ +# +# Part of the dvipng distribution +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program. If not, see +# . +# +# Copyright (C) 2002-2010 Jan-Åke Larsson +# +#************************************************************************ + +# Process this file with autoconf to produce a configure script. +AC_INIT([dvipng], [1.14], [dvipng@nongnu.org]) +AC_CONFIG_SRCDIR([dvipng.c]) + +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug],[Compile without debug (-d) option]), + [ if test "$enableval" = yes ; then + AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.]) + fi ], + [ enable_debug="yes"; + AC_DEFINE(DEBUG, 1, [Define as 1 to get the debug (-d) option.])]) +AC_ARG_ENABLE(timing, + AC_HELP_STRING([--enable-timing],[Output execution time of dvipng]), + [ if test "$enableval" = yes ; then + AC_DEFINE(TIMING, 1, [Define as 1 to get execution time output.]) + fi ]) + +# Checks for programs. +AC_SET_MAKE +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_ARG_WITH(gs, + AC_HELP_STRING([--with-gs=/PATH/TO/gs],[Hard-wire the location of GhostScript]), + [if test "x$withval" != xno ; then + AC_PATH_PROG(GS,["$withval"]) + AC_DEFINE_UNQUOTED(GS_PATH, "$GS", [Define as the path to GhostScript.]) + GS_CHECK_DEVICES + fi], + [AC_CHECK_PROG(GS,gs,gs) + AC_DEFINE_UNQUOTED(GS_PATH, "gs", [Define as the path to GhostScript.]) + if test -n "$GS"; then + GS_CHECK_DEVICES + else + AC_MSG_WARN([Cannot find GhostScript in your PATH]) + fi +]) + +# Checks for libraries. +AC_CHECK_LIB(m, pow) +AC_CHECK_LIB(z, deflate) +AC_CHECK_LIB([png], [png_read_image],, + [AC_MSG_ERROR([cannot find/use libpng])]) +AC_CHECK_LIB([gd], [gdImageCreate],, + [AC_MSG_ERROR([cannot find/use libgd +This drawing library can be downloaded at http://www.boutell.com/gd])]) +AC_CHECK_LIB([kpathsea], [kpse_set_program_name],, + AC_MSG_ERROR([cannot find/use libkpathsea])) +AC_CHECK_LIB([t1], [T1_InitLib]) +PSFONTS_O="" +if test "$ac_cv_lib_t1_T1_InitLib" = yes; then + PSFONTS_O="t1.o" +fi +AC_SUBST(PSFONTS_O) + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([gd.h png.h kpathsea/kpathsea.h],, + [AC_MSG_ERROR([cannot find/use $ac_header])]) +AC_CHECK_HEADERS([t1lib.h libgen.h]) +AC_CHECK_FT2(,[CFLAGS="$FT2_CFLAGS $CFLAGS" + LIBS="$FT2_LIBS $LIBS" + PSFONTS_O="$PSFONTS_O sfd.o ft.o" + AC_DEFINE(HAVE_FT2, 1, [Define to 1 if you have freetype2]) + ac_have_freetype2="yes"], + [ac_have_freetype2="no"]) +if test -n "$PSFONTS_O"; then + PSFONTS_O="$PSFONTS_O enc.o fontmap.o tfm.o" +fi +AC_HEADER_SYS_WAIT +AC_HEADER_TIME +AC_HEADER_STDBOOL +AC_CHECK_HEADERS([fcntl.h sys/time.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_PID_T +AC_TYPE_SIZE_T +if test "$ac_cv_header_inttypes_h" = "yes"; then + # Sometimes we want to use gcc -ansi -pedantic as a portability test + # The typedef of int64_t is not in the system header file in that + # case. Then, #define int64_t as "long long", which is non-ansi, but + # is present in most modern compilers. Using a #define rather than a + # typedef can be a problem, but in dvipng int64_t is only used as + # typecast, and there are no problems. autoconf 2.13 equivalent: + # AC_CHECK_TYPE(int64_t, long long) + # AC_CHECK_TYPE(uint64_t, unsigned long long) + AC_CHECK_TYPE([int64_t],, + [AC_DEFINE_UNQUOTED([int64_t], [long long], + [Define to `long long' if + does not define it.])]) + AC_CHECK_TYPE([uint64_t],, + [AC_DEFINE_UNQUOTED([uint64_t], [unsigned long long], + [Define to `unsigned long long' if + does not define it.])]) +fi +AC_HAS_KPSE_ENC_FORMATS + + +# Checks for library functions. +AC_FUNC_FORK +AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_FUNC_STRTOD +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([dup2 memset munmap pow putenv strchr strrchr strtol strstr]) +if test "$enable_timing" = "yes"; then + AC_CHECK_FUNCS([ftime gettimeofday]) +fi +AC_CHECK_FUNCS([gdImageCreateTrueColor gdImageCreateFromJpeg gdImagePngEx gdImageCreateFromPngPtr gdImageGif FT_Library_Version]) +if test "$ac_cv_func_gdImageGif" = "yes"; then + INSTALL_BIN_TARGET="install-dvigif" +else + INSTALL_BIN_TARGET="install-dvipng" +fi +AC_SUBST(INSTALL_BIN_TARGET) + +# Documentation-related checks +AC_PATH_PROG(MAKEINFO, makeinfo, :) +MAKEINFO_CHECK_MACROS(acronym env option) +AC_PATH_PROG(INSTALL_INFO, install-info, :, $PATH /usr/sbin /sbin) + +# SELFAUTO +AC_ARG_ENABLE(selfauto-set, + AC_HELP_STRING([--enable-selfauto-set], + [This option will make the final binary explicitly set the + $SELFAUTO... variables to make it look as dvipng is installed in the + main texmf tree, even if it isn't. This is necessary when texmf.cnf + only uses $SELFAUTO... variables and dvipng is not installed in the + texmf tree. Otherwise, dvipng may not be able to find virtual + fonts, or psfonts.map. To find out, first build the binary and do + 'make test'. If the test fails, you need this switch.]), + [ if test "$enableval" = yes ; then + AC_MSG_CHECKING([for \$SELFAUTOLOC]) + SELFAUTOLOC=`kpsewhich -expand-var=\\\$SELFAUTOLOC` + AC_DEFINE_UNQUOTED(ENV_SELFAUTOLOC,["SELFAUTOLOC=$SELFAUTOLOC"], + [The environment setting for $SELFAUTOLOC]) + AC_MSG_RESULT([$SELFAUTOLOC]) + AC_MSG_CHECKING([for \$SELFAUTODIR]) + SELFAUTODIR=`kpsewhich -expand-var=\\\$SELFAUTODIR` + AC_DEFINE_UNQUOTED(ENV_SELFAUTODIR,["SELFAUTODIR=$SELFAUTODIR"], + [The environment setting for $SELFAUTODIR]) + AC_MSG_RESULT([$SELFAUTODIR]) + AC_MSG_CHECKING([for \$SELFAUTOPARENT]) + SELFAUTOPARENT=`kpsewhich -expand-var=\\\$SELFAUTOPARENT` + AC_DEFINE_UNQUOTED(ENV_SELFAUTOPARENT,["SELFAUTOPARENT=$SELFAUTOPARENT"], + [The environment setting for $SELFAUTOPARENT]) + AC_MSG_RESULT([$SELFAUTOPARENT]) + fi ], + [AC_MSG_CHECKING([for texmf.cnf]) + TEXMF_CNF=`kpsewhich texmf.cnf` + AC_MSG_RESULT([$TEXMF_CNF]) + AC_PATH_PROG(KPSEWHICH, kpsewhich) + AC_MSG_CHECKING([for psfonts.map]) + cp $KPSEWHICH . + PSFONTS_MAP=`./kpsewhich psfonts.map` + rm -f ./kpsewhich + if test -n "$PSFONTS_MAP"; then + AC_MSG_RESULT([$PSFONTS_MAP]) + else + AC_MSG_RESULT([not found from outside the texmf tree]) + AC_MSG_CHECKING([for \$SELFAUTO in texmf.cnf]) + if grep SELFAUTO "$TEXMF_CNF" > /dev/null 2> /dev/null; then + AC_MSG_RESULT([yes +*************************************************************** +texmf.cnf is using \$SELFAUTO... variables. If you are going to +install dvipng outside the texmf tree, you may need to use +--enable-selfauto-set. To find out, do 'make ; make test'. If the test +is unsuccessful, add the mentioned switch and rebuild. +***************************************************************]) + else + AC_MSG_RESULT([no]) + fi + fi]) + +AC_MSG_RESULT([ +** Configuration summary for $PACKAGE_STRING: + + The -d (debug) switch is enabled: $enable_debug + Your gd is new enough (>=2.0) to enable + the --truecolor switch, full alpha + transparency, proper rescaling of + included bitmaps, and jpeg inclusion: $ac_cv_func_gdImageCreateTrueColor + Your gd has jpeg inclusion enabled: $ac_cv_func_gdImageCreateFromJpeg + Your gd is new enough (>=2.0.12) to + enable transparent backgrounds for EPS + inclusion and the -z (compression) + switch: $ac_cv_func_gdImagePngEx + Your gd is new enough (>=2.0.21) to + allow image creation from memory $ac_cv_func_gdImageCreateFromPngPtr + Your gd is new enough (>=2.0.28) to + enable gif inclusion and output + (dvigif): $ac_cv_func_gdImageGif + FreeType font rendering available: $ac_have_freetype2 + Support for subfonts (CJK-LaTeX): $ac_have_freetype2 + T1lib font rendering available: $ac_cv_lib_t1_T1_InitLib +]) + +AC_CONFIG_HEADER([config.h]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/Build/source/texk/dvipng/dvipng-1.14/draw.c b/Build/source/texk/dvipng/dvipng-1.14/draw.c new file mode 100644 index 00000000000..a32bd9f19c2 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/draw.c @@ -0,0 +1,395 @@ +/* draw.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +#ifdef DEBUG +#include /* isprint */ +#endif + +struct stack_entry { + dviunits h, v, w, x, y, z; /* stack entry */ + subpixels hh,vv; +} stack[STACK_SIZE+1]; /* stack + space for current pos */ +struct stack_entry* dvi_stack=stack; + +#define MAXDRIFT 1 +#define CHECK_MAXDRIFT(x,xx) \ + if ( xx-PIXROUND(x,dvi->conv*shrinkfactor) < -MAXDRIFT ) { \ + DEBUG_PRINT(DEBUG_DVI,(" add 1 to")); \ + xx += 1; \ + } \ + if ( xx-PIXROUND(x,dvi->conv*shrinkfactor) > MAXDRIFT ) { \ + DEBUG_PRINT(DEBUG_DVI,(" sub 1 to")); \ + xx -= 1; \ + } \ + if (PIXROUND(dvi_stack->h,dvi->conv*shrinkfactor) != dvi_stack->hh \ + || PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor) != dvi_stack->vv)\ + DEBUG_PRINT(DEBUG_DVI, \ + (" drift (%d,%d)", \ + dvi_stack->hh-PIXROUND(dvi_stack->h,dvi->conv*shrinkfactor), \ + dvi_stack->vv-PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor))); + +#define MoveRight(x) \ + temp=x; dvi_stack->h += temp; \ + if ( currentfont==NULL \ + || temp > currentfont->s/6 || temp < -currentfont->s/6*4 ) \ + dvi_stack->hh = PIXROUND(dvi_stack->h,dvi->conv*shrinkfactor); \ + else \ + dvi_stack->hh += PIXROUND( temp,dvi->conv*shrinkfactor ); \ + CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh) + +#define MoveDown(x) \ + temp=x; dvi_stack->v += temp; \ + if ( currentfont==NULL \ + || temp > currentfont->s/6*5 || temp < currentfont->s/6*(-5) ) \ + dvi_stack->vv = PIXROUND(dvi_stack->v,dvi->conv*shrinkfactor); \ + else \ + dvi_stack->vv += PIXROUND( temp,dvi->conv*shrinkfactor ); \ + CHECK_MAXDRIFT(dvi_stack->v,dvi_stack->vv) + +#define DO_VFCONV(a) ((((struct font_entry*) parent)->type==DVI_TYPE)?a:\ + (dviunits)((int64_t) a * ((struct font_entry*) parent)->s / (1 << 20))) + + +dviunits SetChar(int32_t c) +{ + struct char_entry* ptr=NULL; + + if (currentfont==NULL) + Fatal("faulty DVI, trying to set character from null font"); + if (c<0 || c>LASTFNTCHAR) { + Warning("glyph index out of range (%d), skipping",c); + return(0); + } + ptr=currentfont->chr[c]; + if (ptr==NULL) { + Warning("unable to draw glyph %d, skipping",c); + return(0); + } +#ifdef DEBUG + switch (currentfont->type) { + case FONT_TYPE_VF: DEBUG_PRINT(DEBUG_DVI,("\n VF CHAR:\t")); break; + case FONT_TYPE_PK: DEBUG_PRINT(DEBUG_DVI,("\n PK CHAR:\t")); break; + case FONT_TYPE_T1: DEBUG_PRINT(DEBUG_DVI,("\n T1 CHAR:\t")); break; + case FONT_TYPE_FT: DEBUG_PRINT(DEBUG_DVI,("\n FT CHAR:\t")); break; + default: DEBUG_PRINT(DEBUG_DVI,("\n NO CHAR:\t")) + } + if (debug & DEBUG_DVI && c>=0 && c<=UCHAR_MAX && isprint(c)) + DEBUG_PRINT(DEBUG_DVI,("'%c' ",c)); + DEBUG_PRINT(DEBUG_DVI,("%d at (%d,%d) tfmw %d", c, + dvi_stack->hh,dvi_stack->vv,ptr?ptr->tfmw:0)); +#endif + if (currentfont->type==FONT_TYPE_VF) { + return(SetVF(ptr)); + } else { + if (ptr->data == NULL) + switch(currentfont->type) { + case FONT_TYPE_PK: LoadPK(c, ptr); break; +#ifdef HAVE_LIBT1 + case FONT_TYPE_T1: LoadT1(c, ptr); break; +#endif +#ifdef HAVE_FT2 + case FONT_TYPE_FT: LoadFT(c, ptr); break; +#endif + default: + Fatal("undefined fonttype %d",currentfont->type); + } + if (page_imagep != NULL) + return(SetGlyph(ptr, dvi_stack->hh, dvi_stack->vv)); + else { + /* Expand bounding box if necessary */ + min(x_min,dvi_stack->hh - ptr->xOffset/shrinkfactor); + min(y_min,dvi_stack->vv - ptr->yOffset/shrinkfactor); + max(x_max,dvi_stack->hh - ptr->xOffset/shrinkfactor + ptr->w); + max(y_max,dvi_stack->vv - ptr->yOffset/shrinkfactor + ptr->h); + return(ptr->tfmw); + } + } + return(0); +} + +void DrawCommand(unsigned char* command, void* parent /* dvi/vf */) + /* To be used both in plain DVI drawing and VF drawing */ +{ + dviunits temp; + + if (/*command >= SETC_000 &&*/ *command <= SETC_127) { + temp = SetChar((int32_t)*command); + dvi_stack->h += temp; + dvi_stack->hh += PIXROUND(temp,dvi->conv*shrinkfactor); + CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh); + } else if (*command >= FONT_00 && *command <= FONT_63) { + SetFntNum((int32_t)*command - FONT_00,parent); + } else switch (*command) { + case PUT1: case PUT2: case PUT3: case PUT4: + DEBUG_PRINT(DEBUG_DVI,(" %d", + UNumRead(command+1, dvi_commandlength[*command]-1))); + (void) SetChar(UNumRead(command+1, dvi_commandlength[*command]-1)); + break; + case SET1: case SET2: case SET3: case SET4: + DEBUG_PRINT(DEBUG_DVI,(" %d", + UNumRead(command+1, dvi_commandlength[*command]-1))); + { + temp = SetChar(UNumRead(command+1, dvi_commandlength[*command]-1)); + dvi_stack->h += temp; + dvi_stack->hh += PIXROUND(temp,dvi->conv*shrinkfactor); + CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh); + } + break; + case SET_RULE: + DEBUG_PRINT(DEBUG_DVI,(" %d %d", + UNumRead(command+1, 4), UNumRead(command+5, 4))); + temp = SetRule(DO_VFCONV(UNumRead(command+1, 4)), + DO_VFCONV(UNumRead(command+5, 4)), + dvi_stack->hh, dvi_stack->vv); + dvi_stack->h += temp; + dvi_stack->hh += PIXROUND(temp,dvi->conv*shrinkfactor); + CHECK_MAXDRIFT(dvi_stack->h,dvi_stack->hh); + break; + case PUT_RULE: + DEBUG_PRINT(DEBUG_DVI,(" %d %d", + UNumRead(command+1, 4), UNumRead(command+5, 4))); + (void) SetRule(DO_VFCONV(UNumRead(command+1, 4)), + DO_VFCONV(UNumRead(command+5, 4)), + dvi_stack->hh, dvi_stack->vv); + break; + case BOP: + Fatal("BOP occurs within page"); + break; + case EOP: + break; + case PUSH: + /* is next item on stack? */ + if (dvi_stack == &stack[STACK_SIZE-1]) + Fatal("DVI stack overflow"); + { + struct stack_entry *next=dvi_stack+1; + next->h = dvi_stack->h; + next->v = dvi_stack->v; + next->w = dvi_stack->w; + next->x = dvi_stack->x; + next->y = dvi_stack->y; + next->z = dvi_stack->z; + next->hh = dvi_stack->hh; + next->vv = dvi_stack->vv; + dvi_stack=next; + } + break; + case POP: + if (dvi_stack == stack) + Fatal("DVI stack underflow"); + dvi_stack--; + break; + case RIGHT1: case RIGHT2: case RIGHT3: case RIGHT4: + DEBUG_PRINT(DEBUG_DVI,(" %d", + SNumRead(command+1, dvi_commandlength[*command]-1))); + MoveRight(DO_VFCONV(SNumRead(command+1, dvi_commandlength[*command]-1))); + break; + case W1: case W2: case W3: case W4: + dvi_stack->w = SNumRead(command+1, dvi_commandlength[*command]-1); + DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->w)); + case W0: + MoveRight(DO_VFCONV(dvi_stack->w)); + break; + case X1: case X2: case X3: case X4: + dvi_stack->x = SNumRead(command+1, dvi_commandlength[*command]-1); + DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->x)); + case X0: + MoveRight(DO_VFCONV(dvi_stack->x)); + break; + case DOWN1: case DOWN2: case DOWN3: case DOWN4: + DEBUG_PRINT(DEBUG_DVI,(" %d", + SNumRead(command+1, dvi_commandlength[*command]-1))); + MoveDown(DO_VFCONV(SNumRead(command+1, dvi_commandlength[*command]-1))); + break; + case Y1: case Y2: case Y3: case Y4: + dvi_stack->y = SNumRead(command+1, dvi_commandlength[*command]-1); + DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->y)); + case Y0: + MoveDown(DO_VFCONV(dvi_stack->y)); + break; + case Z1: case Z2: case Z3: case Z4: + dvi_stack->z = SNumRead(command+1, dvi_commandlength[*command]-1); + DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_stack->z)); + case Z0: + MoveDown(DO_VFCONV(dvi_stack->z)); + break; + case FNT1: case FNT2: case FNT3: case FNT4: + DEBUG_PRINT(DEBUG_DVI,(" %d", + UNumRead(command+1, dvi_commandlength[*command]-1))); + SetFntNum(UNumRead(command+1, dvi_commandlength[*command]-1),parent); + break; + case XXX1: case XXX2: case XXX3: case XXX4: + DEBUG_PRINT(DEBUG_DVI,(" %d", + UNumRead(command+1, dvi_commandlength[*command]-1))); + SetSpecial((char*)command + dvi_commandlength[*command], + dvi_stack->hh,dvi_stack->vv); + break; + case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: + if (((struct font_entry*)parent)->type==DVI_TYPE) { + FontDef(command, parent); + } else { + Fatal("%s within VF macro from %s",dvi_commands[*command], + ((struct font_entry*)parent)->n); + } + break; + case PRE: case POST: case POST_POST: + Fatal("%s occurs within page",dvi_commands[*command]); + break; + case NOP: + break; + default: + Fatal("%s is an undefined command",dvi_commands[*command]); + break; + } +} + +void BeginVFMacro(struct font_entry* currentvf) +{ + struct stack_entry *next=dvi_stack+1; + if (dvi_stack == &stack[STACK_SIZE-1]) + Fatal("DVI stack overflow"); + next->h = dvi_stack->h; + next->v = dvi_stack->v; + next->w = next->x = next->y = next->z = 0; + next->hh = dvi_stack->hh; + next->vv = dvi_stack->vv; + dvi_stack = next; + DEBUG_PRINT(DEBUG_DVI,("\n START VF:\tPUSH, W = X = Y = Z = 0")); + SetFntNum(currentvf->defaultfont,currentvf); +} + +void EndVFMacro(void) +{ + if (dvi_stack == stack) + Fatal("DVI stack underflow"); + dvi_stack--; + DEBUG_PRINT(DEBUG_DVI,("\n END VF:\tPOP ")); +} + + +static void DrawPage(dviunits hoffset, dviunits voffset) + /* To be used after having read BOP and will exit cleanly when + * encountering EOP. + */ +{ + unsigned char* command; /* current command */ + + dvi_stack->h = hoffset; + dvi_stack->v = voffset; + dvi_stack->w = dvi_stack->x = dvi_stack->y = dvi_stack->z = 0; + dvi_stack->hh = PIXROUND( dvi_stack->h , dvi->conv*shrinkfactor ); + dvi_stack->vv = PIXROUND( dvi_stack->v , dvi->conv*shrinkfactor ); + currentfont = NULL; /* No default font */ + + command=DVIGetCommand(dvi); + DEBUG_PRINT(DEBUG_DVI,("DRAW CMD:\t%s", dvi_commands[*command])); + while (*command != EOP) { + DrawCommand(command,dvi); + command=DVIGetCommand(dvi); + DEBUG_PRINT(DEBUG_DVI,("DRAW CMD:\t%s", dvi_commands[*command])); + } +} + +void DrawPages(void) +{ + struct page_list *dvi_pos; + pixels x_width,y_width,x_offset,y_offset; + int pagecounter=(option_flags & DVI_PAGENUM)?0:10; + + dvi_pos=NextPPage(dvi,NULL); + if (dvi_pos!=NULL) { + while(dvi_pos!=NULL) { + SeekPage(dvi,dvi_pos); + Message(BE_NONQUIET,"[%d", dvi_pos->count[pagecounter]); + if (dvi_pos->count[pagecounter]!=dvi_pos->count[0]) + Message(BE_NONQUIET," (%d)", dvi_pos->count[0]); + x_max = y_max = INT32_MIN; + x_min = y_min = INT32_MAX; + DrawPage((dviunits)0,(dviunits)0); + /* Store background color. Background color of a page is given + by the color at EOP rather than the color at BOP. */ + StoreBackgroundColor(dvi_pos); + /* Store pagesize */ + if (dvi->flags & DVI_PREVIEW_LATEX_TIGHTPAGE) { + x_width_def=x_width_tightpage; + y_width_def=y_width_tightpage; + x_offset_def=x_offset_tightpage; + y_offset_def=y_offset_tightpage; + } + if (x_width_def >= 0) { /* extend BBOX */ + min(x_min,-x_offset_def); + max(x_max,x_min + x_width_def); + min(y_min,-y_offset_def); + max(y_max,y_min + y_width_def); + } + if (x_width_def <= 0 || option_flags & EXPAND_BBOX) { + x_width = x_max-x_min; + y_width = y_max-y_min; + x_offset = -x_min; /* offset by moving topleft corner */ + y_offset = -y_min; /* offset by moving topleft corner */ + } else { + x_width=x_width_def; + y_width=y_width_def; + x_offset=x_offset_def; + y_offset=y_offset_def; + } + DEBUG_PRINT(DEBUG_DVI,("\n IMAGE:\t%dx%d",x_width,y_width)); + SeekPage(dvi,dvi_pos); + CreateImage(x_width,y_width); +#ifdef DEBUG + DEBUG_PRINT(DEBUG_DVI,("\n@%d PAGE START:\tBOP",dvi_pos->offset)); + { + int i; + for (i=0;i<10;i++) + DEBUG_PRINT(DEBUG_DVI,(" %d",dvi_pos->count[i])); + DEBUG_PRINT(DEBUG_DVI,(" (%d)\n",dvi_pos->count[10])); + } +#endif + Message(REPORT_DEPTH," depth=%d", y_width-y_offset-1); + Message(REPORT_HEIGHT," height=%d", y_offset+1); + Message(REPORT_WIDTH," width=%d", x_width); + page_flags &= ~PAGE_PREVIEW_BOP; + DrawPage(x_offset*dvi->conv*shrinkfactor, + y_offset*dvi->conv*shrinkfactor); + if ( ! (option_flags & MODE_PICKY && page_flags & PAGE_GAVE_WARN )) { + WriteImage(dvi->outname,dvi_pos->count[pagecounter]); +#ifdef TIMING + ++ndone; +#endif + } else { + exitcode=EXIT_FAILURE; + Message(BE_NONQUIET,"(page not rendered)"); + DestroyImage(); + } + Message(BE_NONQUIET,"] "); + fflush(stdout); + page_flags = 0; + dvi_pos=NextPPage(dvi,dvi_pos); + } + Message(BE_NONQUIET,"\n"); + ClearPpList(); + } +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/dvi.c b/Build/source/texk/dvipng/dvipng-1.14/dvi.c new file mode 100644 index 00000000000..a20290ecfd9 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/dvi.c @@ -0,0 +1,484 @@ +/* dvi.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" +#ifdef MIKTEX +# include +# define SLEEP Sleep(1000) +#else /* MIKTEX */ +# ifdef HAVE_LIBGEN_H +# include +# else +# define basename xbasename +# endif +# ifdef WIN32 +# define SLEEP Sleep(1000) +# include +# else +# define SLEEP sleep(1) +# endif /* WIN32 */ +#endif /* MIKTEX */ +#include + +bool followmode=0; + +bool DVIFollowToggle(void) +{ + return followmode = ! followmode; +} + +static unsigned char fgetc_follow(FILE* fp) +{ + int got=fgetc(fp); + + while(followmode && got==EOF) { + SLEEP; + got=fgetc(fp); + } + if (got==EOF) + Fatal("DVI file ends prematurely"); + return (unsigned char)got; +} + +static void DVIInit(struct dvi_data* dvi) +{ + int k; + unsigned char* pre; + struct stat stat; + + fseek(dvi->filep,0,SEEK_SET); + pre=DVIGetCommand(dvi); + if (*pre != PRE) { + Fatal("PRE does not occur first - are you sure this is a DVI file?"); + } + k = UNumRead(pre+1,1); + DEBUG_PRINT(DEBUG_DVI,("DVI START:\tPRE %d",k)); + if (k != DVIFORMAT) { + Fatal("DVI format = %d, can only process DVI format %d files", + k, DVIFORMAT); + } + dvi->num = UNumRead(pre+2, 4); + dvi->den = UNumRead(pre+6, 4); + DEBUG_PRINT(DEBUG_DVI,(" %d/%d",dvi->num,dvi->den)); + dvi->mag = UNumRead(pre+10, 4); /*FIXME, see font.c*/ + DEBUG_PRINT(DEBUG_DVI,(" %d",dvi->mag)); + if ( usermag > 0 && usermag != dvi->mag ) { + Warning("DVI magnification of %d over-ridden by user (%ld)", + (long)dvi->mag, usermag ); + dvi->mag = usermag; + } + dvi->conv = (1.0/(((double)dvi->num / (double)dvi->den) * + ((double)dvi->mag / 1000.0) * + ((double)dpi*shrinkfactor/254000.0)))+0.5; + DEBUG_PRINT(DEBUG_DVI,(" (%d)",dvi->conv)); + k = UNumRead(pre+14,1); + DEBUG_PRINT(DEBUG_DVI,(" '%.*s'",k,pre+15)); + Message(BE_VERBOSE,"'%.*s' -> %s\n",k,pre+15,dvi->outname); + fstat(fileno(dvi->filep), &stat); + dvi->mtime = stat.st_mtime; + dvi->pagelistp=NULL; + dvi->flags = 0; +} + +struct dvi_data* DVIOpen(char* dviname,char* outname) +{ + char* tmpstring; + struct dvi_data* dvi; + + if ((dvi = calloc(1,sizeof(struct dvi_data)))==NULL) + Fatal("cannot malloc memory for DVI struct"); + + dvi->type = DVI_TYPE; + dvi->fontnump=NULL; + + dvi->name = malloc(strlen(dviname)+5); + if (dvi->name==NULL) + Fatal("cannot malloc space for DVI filename"); + strcpy(dvi->name, dviname); + tmpstring = strrchr(dvi->name, '.'); + if (tmpstring == NULL || strcmp(tmpstring,".dvi") != 0) + strcat(dvi->name, ".dvi"); + + if (outname==NULL) { + dvi->outname = malloc(strlen(basename(dviname))+7); + if (dvi->outname==NULL) { + free(dvi->name); + free(dvi); + Fatal("cannot malloc space for output filename"); + } + strcpy(dvi->outname,basename(dviname)); + tmpstring = strrchr(dvi->outname, '.'); + if (tmpstring != NULL && strcmp(tmpstring,".dvi") == 0) + *tmpstring = '\0'; + strcat(dvi->outname, "%d.png"); + } else { + dvi->outname = malloc(strlen(outname)+1); + if (dvi->outname==NULL) { + free(dvi->name); + free(dvi); + Fatal("cannot malloc space for output filename"); + } + strcpy(dvi->outname,outname); + } + + if ((dvi->filep = fopen(dvi->name,"rb")) == NULL) { + /* do not insist on .dvi */ + tmpstring = strrchr(dvi->name, '.'); + *tmpstring='\0'; + dvi->filep = fopen(dvi->name,"rb"); + } + while((dvi->filep == NULL) && followmode) { + SLEEP; + *tmpstring='.'; + if ((dvi->filep = fopen(dvi->name,"rb")) == NULL) { + /* do not insist on .dvi */ + *tmpstring='\0'; + dvi->filep = fopen(dvi->name,"rb"); + } + } + if (dvi->filep == NULL) { + free(dvi->name); + free(dvi->outname); + free(dvi); + perror(dviname); + exit (EXIT_FAILURE); + } + DEBUG_PRINT(DEBUG_DVI,("OPEN FILE\t%s", dvi->name)); + DVIInit(dvi); + return(dvi); +} + +unsigned char* DVIGetCommand(struct dvi_data* dvi) + /* This function reads in and stores the next dvi command. */ + /* Mmap is not appropriate here, we may want to read from + half-written files. */ +{ + static unsigned char* command=NULL; + static uint32_t commlen=0; + unsigned char *current = command; + int length; + uint32_t strlength=0; + + if (commlen==0) { + commlen=STRSIZE; + if ((current=command=malloc(commlen))==NULL) + Fatal("cannot malloc memory for DVI command"); + } + DEBUG_PRINT(DEBUG_DVI,("\n@%ld ", ftell(dvi->filep))); + *(current++) = fgetc_follow(dvi->filep); + length = dvi_commandlength[*command]; + if (length < 0) + Fatal("undefined DVI op-code %d",*command); + while(current < command+length) + *(current++) = fgetc_follow(dvi->filep); + switch (*command) { + case XXX4: + strlength = *(current - 4); + case XXX3: + strlength = strlength * 256 + *(current - 3); + case XXX2: + strlength = strlength * 256 + *(current - 2); + case XXX1: + strlength = strlength * 256 + *(current - 1); + break; + case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: + strlength = *(current - 1) + *(current - 2); + break; + case PRE: + strlength = *(current - 1); + break; + } + if (strlength > 0) { /* Read string */ + if (strlength+1 + (uint32_t)length > commlen) { + /* string + command length exceeds that of buffer */ + commlen=strlength+1 + (uint32_t)length; + if ((command=realloc(command,commlen))==NULL) + Fatal("cannot malloc memory for DVI command"); + current = command + length; + } + while(current < command+length+strlength) + *(current++) = fgetc_follow(dvi->filep); + *current='\0'; + } + return(command); +} + +bool DVIIsNextPSSpecial(struct dvi_data* dvi) + /* This function checks if the next dvi command is a raw PS + special */ + /* Mmap is not appropriate here, we may want to read from + half-written files. */ +{ + long fpos; + uint32_t strlength=0; + bool israwps=false; + + DEBUG_PRINT(DEBUG_DVI,("\n CHECKING NEXT DVI COMMAND ")); + fpos=ftell(dvi->filep); + switch (fgetc_follow(dvi->filep)) { + case XXX4: + strlength = fgetc_follow(dvi->filep); + case XXX3: + strlength = strlength * 256 + fgetc_follow(dvi->filep); + case XXX2: + strlength = strlength * 256 + fgetc_follow(dvi->filep); + case XXX1: + strlength = strlength * 256 + fgetc_follow(dvi->filep); + } + if (strlength > 0) { + switch(fgetc_follow(dvi->filep)) { + case 'p': + if (strlength > 2 + && fgetc_follow(dvi->filep)=='s' + && fgetc_follow(dvi->filep)==':') + israwps=true; + break; + case '"': + israwps=true; + } + } + fseek(dvi->filep,fpos,SEEK_SET); + return(israwps); +} + +uint32_t CommandLength(unsigned char* command) +{ + /* generally 2^32+5 bytes max, but in practice 32 bit numbers suffice */ + uint32_t length=0; + + length = dvi_commandlength[*command]; + switch (*command) { + case XXX1: case XXX2: case XXX3: case XXX4: + length += UNumRead(command + 1,length - 1); + break; + case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: + length += *(command + length - 1) + *(command + length - 2); + break; + case PRE: + length += *(command + length - 1); + break; + } + return(length); +} + +static void SkipPage(struct dvi_data* dvi) +{ + /* Skip present page */ + unsigned char* command; + + command=DVIGetCommand(dvi); + while (*command != EOP) { + switch (*command) { + case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: + DEBUG_PRINT(DEBUG_DVI,("NOSKIP CMD:\t%s", dvi_commands[*command])); + FontDef(command,dvi); + break; + case XXX1: case XXX2: case XXX3: case XXX4: + DEBUG_PRINT(DEBUG_DVI,("NOSKIP CMD:\t%s %d", dvi_commands[*command], + UNumRead(command+1, dvi_commandlength[*command]-1))); + SetSpecial((char*)command + dvi_commandlength[*command],0,0); + break; + case BOP: case PRE: case POST: case POST_POST: + Fatal("%s occurs within page", dvi_commands[*command]); + break; +#ifdef DEBUG + default: + DEBUG_PRINT(DEBUG_DVI,("SKIP CMD:\t%s", dvi_commands[*command])); +#endif + } + command=DVIGetCommand(dvi); + } /* while */ + DEBUG_PRINT(DEBUG_DVI,("SKIP CMD:\t%s", dvi_commands[*command])); +} + +static struct page_list* InitPage(struct dvi_data* dvi) +{ + /* Find page start, return pointer to page_list entry if found */ + struct page_list* tpagelistp=NULL; + unsigned char* command; + + command=DVIGetCommand(dvi); + /* Skip until page start or postamble */ + while((*command != BOP) && (*command != POST)) { + switch(*command) { + case FNT_DEF1: case FNT_DEF2: case FNT_DEF3: case FNT_DEF4: + DEBUG_PRINT(DEBUG_DVI,("NOPAGE CMD:\t%s", dvi_commands[*command])); + FontDef(command,dvi); + break; + case NOP: + DEBUG_PRINT(DEBUG_DVI,("NOPAGE CMD:\tNOP")); + break; + default: + Fatal("%s occurs outside page", dvi_commands[*command]); + } + command=DVIGetCommand(dvi); + } + if ((tpagelistp = + malloc(sizeof(struct page_list) + +(csp+1-2)*sizeof(struct dvi_color)))==NULL) + Fatal("cannot malloc memory for new page entry"); + tpagelistp->next = NULL; + if ( *command == BOP ) { /* Init page */ + int i; + DEBUG_PRINT(DEBUG_DVI,("PAGE START:\tBOP")); + StoreColorStack(tpagelistp); + tpagelistp->offset = ftell(dvi->filep)-45; + for (i = 0; i <= 9; i++) { + tpagelistp->count[i] = UNumRead(command + 1 + i*4, 4); + DEBUG_PRINT(DEBUG_DVI,(" %d",tpagelistp->count[i])); + } + if (dvi->pagelistp==NULL) + tpagelistp->count[10] = 1; + else + tpagelistp->count[10] = dvi->pagelistp->count[10]+1; + DEBUG_PRINT(DEBUG_DVI,(" (%d)", tpagelistp->count[10])); + } else { + DEBUG_PRINT(DEBUG_DVI,("DVI END:\tPOST")); + tpagelistp->offset = ftell(dvi->filep)-1; + tpagelistp->count[0] = PAGE_POST; /* POST */ + tpagelistp->count[10] = PAGE_POST; /* POST */ + } + return(tpagelistp); +} + +int SeekPage(struct dvi_data* dvi, struct page_list* page) +{ + ReadColorStack(page); + return(fseek(dvi->filep, + page->offset+((page->count[0]==PAGE_POST) ? 1L : 45L), + SEEK_SET)); +} + +struct page_list* NextPage(struct dvi_data* dvi, struct page_list* page) +{ + struct page_list* tpagelistp; + + /* if page points to POST there is no next page */ + if (page!=NULL && page->count[0]==PAGE_POST) + return(NULL); + + /* If we have read past the last page in our current list or the + * list is empty, sneak a look at the next page + */ + if (dvi->pagelistp==NULL + || dvi->pagelistp->offset+45L < ftell(dvi->filep)) { + tpagelistp=dvi->pagelistp; + dvi->pagelistp=InitPage(dvi); + dvi->pagelistp->next=tpagelistp; + } + + if (page!=dvi->pagelistp) { + /* also works if page==NULL, we'll get the first page then */ + tpagelistp=dvi->pagelistp; + while(tpagelistp!=NULL && tpagelistp->next!=page) + tpagelistp=tpagelistp->next; + } else { + /* dvi->pagelistp points to the last page we've read so far, + * the last page that we know where it is, so to speak + * So look at the next + */ + (void)SeekPage(dvi,dvi->pagelistp); + SkipPage(dvi); + tpagelistp=dvi->pagelistp; + dvi->pagelistp=InitPage(dvi); + dvi->pagelistp->next=tpagelistp; + tpagelistp=dvi->pagelistp; + } + return(tpagelistp); +} + +struct page_list* PrevPage(struct dvi_data* dvi, struct page_list* page) +{ + return(page->next); +} + + +struct page_list* FindPage(struct dvi_data* dvi, int32_t pagenum, bool abspage) + /* Find first page of certain number, + absolute number if abspage is set */ +{ + struct page_list* page=NextPage(dvi, NULL); + + if (pagenum==PAGE_LASTPAGE || pagenum==PAGE_POST) { + while(page!=NULL && page->count[0]!=PAGE_POST) + page=NextPage(dvi,page); + if (pagenum==PAGE_LASTPAGE) + page=PrevPage(dvi,page); + } else + if (pagenum!=PAGE_FIRSTPAGE) + while(page != NULL && pagenum != page->count[abspage ? 0 : 10]) + page=NextPage(dvi,page); + return(page); +} + + +static void DelPageList(struct dvi_data* dvi) +{ + struct page_list* temp; + + /* Delete the page list */ + + temp=dvi->pagelistp; + while(temp!=NULL) { + dvi->pagelistp=dvi->pagelistp->next; + free(temp); + temp=dvi->pagelistp; + } +} + +void DVIClose(struct dvi_data* dvi) +{ + if (dvi!=NULL) { + fclose(dvi->filep); + DelPageList(dvi); + ClearPSHeaders(); + free(dvi->outname); + free(dvi->name); + free(dvi); + } +} + +bool DVIReOpen(struct dvi_data* dvi) +{ + struct stat stat; + fstat(fileno(dvi->filep), &stat); + if (dvi->mtime != stat.st_mtime) { + fclose(dvi->filep); + dvi->filep=NULL; + DelPageList(dvi); + ClearPSHeaders(); + while(((dvi->filep = fopen(dvi->name,"rb")) == NULL) && followmode) { + SLEEP; + } + if (dvi->filep == NULL) { + perror(dvi->name); + exit(EXIT_FAILURE); + } + Message(PARSE_STDIN,"Reopened file\n"); + DEBUG_PRINT(DEBUG_DVI,("\nREOPEN FILE\t%s", dvi->name)); + DVIInit(dvi); + return(true); + } + return(false); +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/dvipng.1 b/Build/source/texk/dvipng/dvipng-1.14/dvipng.1 new file mode 100644 index 00000000000..44537c4e8b7 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/dvipng.1 @@ -0,0 +1,513 @@ +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "DVIPNG 1" +.TH DVIPNG 1 "2010-10-23" "dvipng 1.14" "User commands" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +dvipng \- A DVI\-to\-PNG translator +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +dvipng [options] filename +.PP +dvipng [options] [filename] \- +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +This program makes \s-1PNG\s0 and/or \s-1GIF\s0 graphics from \s-1DVI\s0 files as obtained +from TeX and its relatives. +.PP +If \s-1GIF\s0 support is enabled, \s-1GIF\s0 output is chosen by using the +\&\fBdvigif\fR binary or with the \fB\-\-gif\fR option. +.PP +The benefits of \fBdvipng\fR/\fBdvigif\fR include +.IP "\(bu" 4 +Speed. It is a very fast bitmap-rendering code for \s-1DVI\s0 files, which +makes it suitable for generating large amounts of images on-the-fly, +as needed in preview-latex, WeBWorK and others. +.IP "\(bu" 4 +It does not read the postamble, so it can be started before TeX +finishes. There is a \fB\-\-follow\fR switch that makes dvipng wait at +end-of-file for further output, unless it finds the \s-1POST\s0 marker that +indicates the end of the \s-1DVI\s0. +.IP "\(bu" 4 +Interactive query of options. dvipng can read options interactively +through stdin, and all options are usable. It is even possible to change +the input file through this interface. +.IP "\(bu" 4 +Supports \s-1PK\s0, \s-1VF\s0, PostScript Type1, and TrueType fonts, subfonts (i.e., +as used in CJK-LaTeX), color specials, and inclusion of PostScript, +\&\s-1PNG\s0, \s-1JPEG\s0 or \s-1GIF\s0 images. +.IP "\(bu" 4 +and more... +.SH "OPTIONS" +.IX Header "OPTIONS" +Many of the parameterless options listed here can be turned off by +suffixing the option with a zero (\fB0\fR); for instance, to turn off +page reversal, use \fB\-r0\fR. Such options are marked with a trailing +\&\fB*\fR. +.IP "\fB\-\fR" 4 +.IX Item "-" +Read additional options from standard input after processing the command +line. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +Print a usage message and exit. +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +Print the version number and exit. +.IP "\fB\-bd\fR \fInum\fR" 4 +.IX Item "-bd num" +.PD 0 +.IP "\fB\-bd\fR \fIcolor_spec\fR" 4 +.IX Item "-bd color_spec" +.IP "\fB\-bd '\fR\fInum\fR\fB \fR\fIcolor_spec\fR\fB'\fR" 4 +.IX Item "-bd 'num color_spec'" +.PD +Set the pixel width of the transparent border (default 0). Using this +option will make the image edges transparent, but it only affects pixels +with the background color. Giving a \fIcolor_spec\fR will set the +fallback color, to be used in viewers that cannot handle transparency +(the default is the background color). The color spec should be in +TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. Setting the +fallback color makes the default border width 1 px. +.IP "\fB\-\-bdpi\fR \fInum\fR" 4 +.IX Item "--bdpi num" +This option only has an effect when using bitmapped (\s-1PK\s0) fonts. The +option sets the base (Metafont) resolution, both horizontal and +vertical, to \fInum\fR dpi (dots per inch). This option is necessary +when manually selecting Metafont mode with the \-\-mode option (see +below). +.IP "\fB\-bg\fR \fIcolor_spec\fR" 4 +.IX Item "-bg color_spec" +Choose background color for the images. This option will be ignored if +there is a background color \especial in the \s-1DVI\s0. The color spec should +be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. You can +also specify 'Transparent' or 'transparent' which will give you a +transparent background with the normal background as a fallback color. A +capitalized 'Transparent' will give a full-alpha transparency, while an +all-lowercase 'transparent' will give a simple fully transparent +background with non-transparent antialiased pixels. The latter would be +suitable for viewers who cannot cope with a true alpha channel. \s-1GIF\s0 +images do not support full alpha transparency, so in case of \s-1GIF\s0 output, +both variants will use the latter behaviour. +.IP "\fB\-d\fR \fInum\fR" 4 +.IX Item "-d num" +Set the debug flags, showing what dvipng (thinks it) is doing. This will +work unless dvipng has been compiled without the \f(CW\*(C`DEBUG\*(C'\fR option +(not recommended). Set the flags as you need them, use \fB\-d \-1\fR as +the first option for maximum output. +.IP "\fB\-D\fR \fInum\fR" 4 +.IX Item "-D num" +Set the output resolution, both horizontal and vertical, to \fInum\fR +dpi (dots per inch). +.Sp +One may want to adjust this to fit a certain text font size (e.g., on +a web page), and for a text font height of \fIfont_px\fR pixels (in +Mozilla) the correct formula is +.Sp +.Vb 1 +\& = * 72.27 / 10 [px * TeXpt/in / TeXpt] +.Ve +.Sp +The last division by ten is due to the standard font height 10pt in +your document, if you use 12pt, divide by 12. Unfortunately, some +proprietary browsers have font height in pt (points), not pixels. You +have to rescale that to pixels, using the screen resolution (default +is usually 96 dpi) which means the formula is +.Sp +.Vb 1 +\& = * 96 / 72 [pt * px/in / (pt/in)] +.Ve +.Sp +On some high-res screens, the value is instead 120 dpi. Good luck! +.IP "\fB\-\-depth*\fR" 4 +.IX Item "--depth*" +Report the depth of the image. This only works reliably when the +LaTeX style \fIpreview.sty\fR from preview-latex is used with +the \fBactive\fR option. It reports the number of pixels from the +bottom of the image to the baseline of the image. This can be used for +vertical positioning of the image in, e.g., web documents, where one +would use (Cascading StyleSheets 1) +.Sp +.Vb 1 +\& +.Ve +.Sp +The depth is a negative offset in this case, so the minus sign is +necessary, and the unit is pixels (px). +.IP "\fB\-\-dvinum*\fR" 4 +.IX Item "--dvinum*" +Set this option to make the output page number be the TeX page +numbers rather than the physical page number. See the \fB\-o\fR switch. +.IP "\fB\-fg\fR \fIcolor_spec\fR" 4 +.IX Item "-fg color_spec" +Choose foreground color for the images. This option will be ignored if +there is a foreground color \especial in the \s-1DVI\s0. The color spec should +be in TeX color \especial syntax, e.g., 'rgb 1.0 0.0 0.0'. +.IP "\fB\-\-follow*\fR" 4 +.IX Item "--follow*" +Wait for data at end-of-file. One of the benefits of dvipng is that it +does not read the postamble, so it can be started before TeX +finishes. This switch makes dvipng wait at end-of-file for further +output, unless it finds the \s-1POST\s0 marker that indicates the end of the +\&\s-1DVI\s0. This is similar to \fBtail \-f\fR but for DVI-to-PNG conversion. +.IP "\fB\-\-freetype*\fR" 4 +.IX Item "--freetype*" +Enable/disable FreeType font rendering (default on). This option is +available if the FreeType2 font library was present at compilation time. +If this is the case, dvipng will have direct support for PostScript +Type1 and TrueType fonts internally, rather than using \fBgsftopk\fR +for rendering the fonts. If you have PostScript versions of Computer +Modern installed, there will be no need to generate bitmapped (\s-1PK\s0) +variants on disk of these. Then, you can render images at different (and +unusual) resolutions without cluttering the disk with lots of bitmapped +fonts. Note that if you have both FreeType and T1lib on your system, +FreeType will be preferred by dvipng. If you for some reason would want +to use T1lib rendering, use this option. +.IP "\fB\-\-gamma\fR \fInum\fR" 4 +.IX Item "--gamma num" +Control the interpolation of colors in the greyscale anti-aliasing +color palette. Default value is 1.0. For 0 < \fInum\fR < 1, the +fonts will be lighter (more like the background), and for \fInum\fR > +1, the fonts will be darker (more like the foreground). +.IP "\fB\-\-gif*\fR" 4 +.IX Item "--gif*" +The images are output in the \s-1GIF\s0 format, if \s-1GIF\s0 support is enabled. +This is the default for the \fBdvigif\fR binary, which only will be +available when \s-1GIF\s0 support is enabled. \s-1GIF\s0 images are palette images +(see the \fB\-\-palette\fR option) and does not support true alpha +channels (see the \fB\-\-bg\fR option). See also the \fB\-\-png\fR +option. +.IP "\fB\-\-height*\fR" 4 +.IX Item "--height*" +Report the height of the image. This only works reliably when the +LaTeX style \fIpreview.sty\fR from preview-latex is used with +the \fBactive\fR option. It reports the number of pixels from the top +of the image to the baseline of the image. The total height of the +image is obtained as the sum of the values reported from +\&\fB\-\-height\fR and \fB\-\-depth\fR. +.IP "\fB\-l [=]\fR\fInum\fR" 4 +.IX Item "-l [=]num" +The last page printed will be the first one numbered \fInum\fR. Default +is the last page in the document. If \fInum\fR is prefixed by an equals +sign, then it (and the argument to the \fB\-p\fR option, if specified) +is treated as a physical (absolute) page number, rather than a value to +compare with the TeX \fB\ecount0\fR values stored in the \s-1DVI\s0 file. +Thus, using \fB\-l =9\fR will end with the ninth page of the document, +no matter what the pages are actually numbered. +.IP "\fB\-\-mode\fR \fImode\fR" 4 +.IX Item "--mode mode" +This option only has an effect when using bitmapped (\s-1PK\s0) fonts. Use +\&\fImode\fR as the Metafont device name for the \s-1PK\s0 fonts (both for path +searching and font generation). This needs to be augmented with the base +device resolution, given with the \fB\-\-bdpi\fR option. See the file +<\fBftp://ftp.tug.org/tex/modes.mf\fR> for a list of resolutions and mode +names for most devices. +.IP "\fB\-M*\fR" 4 +.IX Item "-M*" +This option only has an effect when using bitmapped (\s-1PK\s0) fonts. It turns +off automatic \s-1PK\s0 font generation (\fImktexpk\fR). +.IP "\fB\-\-nogs*\fR" 4 +.IX Item "--nogs*" +This switch prohibits the internal call to GhostScript for displaying +PostScript specials. \fB\-\-nogs0\fR turns the call back on. +.IP "\fB\-\-nogssafer*\fR" 4 +.IX Item "--nogssafer*" +Normally, if GhostScript is used to render PostScript specials, the +GhostScript interpreter is run with the option \fB\-dSAFER\fR. The +\&\fB\-\-nogssafer\fR option runs GhostScript without \fB\-dSAFER\fR. The +\&\fB\-dSAFER\fR option in Ghostscript disables PostScript operators such +as deletefile, to prevent possibly malicious PostScript programs from +having any effect. +.IP "\fB\-\-norawps*\fR" 4 +.IX Item "--norawps*" +Some packages generate raw PostScript specials, even non-rendering such +specials. This switch turns off the internal call to GhostScript +intended to display these raw PostScript specials. \fB\-\-norawps0\fR +turns the call back on. +.IP "\fB\-o\fR \fIname\fR" 4 +.IX Item "-o name" +Send output to the file \fIname\fR. A single occurrence of \fB\f(CB%d\fB\fR or +\&\fB\f(CB%01d\fB\fR, ..., \fB\f(CB%09d\fB\fR will be exchanged for the physical +page number (this can be changed, see the \fB\-\-dvinum\fR switch). The +default output filename is \fIfile\fR\fB\f(CB%d\fB.png\fR where the input \s-1DVI\s0 +file was \fIfile\fR\fB.dvi\fR. +.IP "\fB\-O\fR \fIx\-offset\fR\fB,\fR\fIy\-offset\fR" 4 +.IX Item "-O x-offset,y-offset" +Move the origin by \fIx\-offset\fR,\fIy\-offset\fR, a comma-separated +pair of dimensions such as \fB.1in,\-.3cm\fR. +The origin of the page is shifted from the default position +(of one inch down, one inch to the right from the upper left corner of +the paper) by this amount. +.IP "\fB\-p [=]\fR\fInum\fR" 4 +.IX Item "-p [=]num" +The first page printed will be the first one numbered \fInum\fR. Default +is the first page in the document. If \fInum\fR is prefixed by an +equals sign, then it (and the argument to the \fB\-l\fR option, if +specified) is treated as a physical (absolute) page number, rather than +a value to compare with the TeX \fB\ecount0\fR values stored in the +\&\s-1DVI\s0 file. Thus, using \fB\-p =3\fR will start with the third page of +the document, no matter what the pages are actually numbered. +.IP "\fB\-\-palette*\fR" 4 +.IX Item "--palette*" +When an external image is included, \fBdvipng\fR will automatically +switch to truecolor mode, to avoid unnecessary delay and quality +reduction, and enable the \s-1EPS\s0 translator to draw on a transparent +background and outside of the boundingbox. This switch will force +palette (256\-color) output and make \fBdvipng\fR revert to opaque +clipped image inclusion. This will also override the \fB\-\-truecolor\fR +switch if present. +.IP "\fB\-\-picky*\fR" 4 +.IX Item "--picky*" +No images are output when a warning occurs. Normally, dvipng will +output an image in spite of a warning, but there may be something +missing in this image. One reason to use this option would be if you +have a more complete but slower fallback converter. Mainly, this is +useful for failed figure inclusion and unknown \especial occurrences, +but warnings will also occur for missing or unknown color specs and +missing \s-1PK\s0 fonts. +.IP "\fB\-\-png*\fR" 4 +.IX Item "--png*" +The images are output in the \s-1PNG\s0 format. This is the default for the +\&\fBdvipng\fR binary. See also the \fB\-\-gif\fR option. +.IP "\fB\-pp\fR \fIfirstpage\fR\fB\-\fR\fIlastpage\fR" 4 +.IX Item "-pp firstpage-lastpage" +Print pages \fIfirstpage\fR through \fIlastpage\fR; but not quite +equivalent to \fB\-p\fR \fIfirstpage\fR \fB\-l\fR \fIlastpage\fR. For example, +when rendering a book, there may be several instances of a page in the +\&\s-1DVI\s0 file (one in \f(CW\*(C`\efrontmatter\*(C'\fR, one in \f(CW\*(C`\emainmatter\*(C'\fR, and one +in \f(CW\*(C`\ebackmatter\*(C'\fR). In case of several pages matching, \fB\-pp\fR +\&\fIfirstpage\fR\fB\-\fR\fIlastpage\fR will render \fIall\fR pages that +matches the specified range, while \fB\-p\fR \fIfirstpage\fR \fB\-l\fR +\&\fIlastpage\fR will render the pages from the \fIfirst\fR occurrence +of \fIfirstpage\fR to the \fIfirst\fR occurrence of \fIlastpage\fR. +This is the (undocumented) behaviour of dvips. In dvipng you can give +both kinds of options, in which case you get all pages that matches the +range in \fB\-pp\fR between the pages from \fB\-p\fR to \fB\-l\fR. Also +multiple \fB\-pp\fR options accumulate, unlike \fB\-p\fR and \fB\-l\fR. +The \fB\-\fR separator can also be \fB:\fR. Note that \fB\-pp \-1\fR +will be interpreted as \*(L"all pages up to and including 1\*(R", if you want a +page numbered \-1 (only the table of contents, say) put \fB\-pp \-1\-\-1\fR, +or more readable, \fB\-pp \-1:\-1\fR. +.IP "\fB\-q*\fR" 4 +.IX Item "-q*" +Run quietly. Don't chatter about pages converted, etc. to standard +output; report no warnings (only errors) to standard error. +.IP "\fB\-Q\fR \fInum\fR" 4 +.IX Item "-Q num" +Set the quality to \fInum\fR. That is, choose the number of antialiasing +levels for bitmapped fonts (\s-1PK\s0) and fonts rendered using T1lib, to be +\&\fInum\fR*\fInum\fR+1. The default value is 4 which gives 17 levels of +antialiasing for antialiased fonts from these two. If FreeType is +available, its rendering is unaffected by this option. +.IP "\fB\-r*\fR" 4 +.IX Item "-r*" +Toggle output of pages in reverse/forward order. By default, the first +page in the \s-1DVI\s0 is output first. +.IP "\fB\-\-strict*\fR" 4 +.IX Item "--strict*" +The program exits when a warning occurs. Normally, dvipng will output +an image in spite of a warning, but there may be something missing in +this image. One reason to use this option would be if you have a more +complete but slower fallback converter. See the \fB\-\-picky\fR option +above for a list of when warnings occur. +.IP "\fB\-T\fR \fIimage_size\fR" 4 +.IX Item "-T image_size" +Set the image size to \fIimage_size\fR which can be either of +\&\fBbbox\fR, \fBtight\fR, or a comma-separated pair of dimensions +\&\fIhsize\fR,\fIvsize\fR such as \fB.1in,.3cm\fR. The default is +\&\fBbbox\fR which produces a \s-1PNG\s0 that includes all ink put on the page +and in addition the \s-1DVI\s0 origin, located 1in from the top and 1in from +the left edge of the paper. This usually gives whitespace above and to +the left in the produced image. The value \fBtight\fR will make dvipng +only include all ink put on the page, producing neat images. +.IP "\fB\-\-t1lib*\fR" 4 +.IX Item "--t1lib*" +Enable T1lib font rendering (default on). This option is available if +the T1lib font library was present at compilation time. If this is the +case, dvipng will have direct support for PostScript Type1 fonts +internally, rather than using \fBgsftopk\fR for rendering the fonts. If +you have PostScript versions of Computer Modern installed, there will be +no need to generate bitmapped variants on disk of these. Then, you can +render images at different (and unusual) resolutions without cluttering +the disk with lots of bitmapped fonts. Note that if you have both +FreeType and T1lib on your system, FreeType will be preferred by dvipng, +and if you for some reason rather want to use T1lib, give the option +\&\fB\-\-freetype0\fR (see above). +.IP "\fB\-\-truecolor*\fR" 4 +.IX Item "--truecolor*" +This will make \fBdvipng\fR generate truecolor output. Note that +truecolor output is automatic if you include an external image in your +\&\s-1DVI\s0, e.g., via a PostScript special (i.e., the \fBgraphics\fR or +\&\fBgraphicx\fR package). This switch is overridden by the +\&\fB\-\-palette\fR switch. +.IP "\fB\-v*\fR" 4 +.IX Item "-v*" +Enable verbose operation. This will currently indicate what fonts is +used, in addition to the usual output. +.IP "\fB\-\-width*\fR" 4 +.IX Item "--width*" +Report the width of the image. See also \fB\-\-height\fR and +\&\fB\-\-depth\fR. +.IP "\fB\-x\fR \fInum\fR" 4 +.IX Item "-x num" +This option is deprecated; it should not be used. It is much better to +select the output resolution directly with the \fB\-D\fR option. This +option sets the magnification ratio to \fInum\fR/1000 and +overrides the magnification specified in the \s-1DVI\s0 file. Must be between +10 and 100000. It is recommended that you use standard magstep values +(1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the +total number of \s-1PK\s0 files generated. \fInum\fR may be a real number, not +an integer, for increased precision. +.IP "\fB\-z\fR \fInum\fR" 4 +.IX Item "-z num" +Set the \s-1PNG\s0 compression level to \fInum\fR. This option is enabled if +your \fBlibgd\fR is new enough. The default compression level is 1, +which selects maximum speed at the price of slightly larger PNGs. For an +older \fBlibgd\fR, the hard-soldered value 5 is used. The include file +\&\fBpng.h\fR says +\&\*(L"Currently, valid values range from 0 \- 9, corresponding directly to +the zlib compression levels 0 \- 9 (0 \- no compression, 9 \- \*(R"maximal\*(L" +compression). Note that tests have shown that zlib compression levels +3\-6 usually perform as well as level 9 for \s-1PNG\s0 images, and do +considerably fewer calculations. In the future, these values may not +correspond directly to the zlib compression levels.\*(R" +.SH "NOTES" +.IX Header "NOTES" +The full manual is accessible in info format, on most systems by typing +.PP +.Vb 1 +\& info dvipng +.Ve +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +This program is released under the \s-1GNU\s0 Lesser General Public License +version 3, see the \s-1COPYING\s0 file in the dvipng distribution or +<\fBhttp://www.gnu.org/licenses/gpl.html\fR>. +.PP +Copyright (c) 2002\-2010 Jan-AAke Larsson diff --git a/Build/source/texk/dvipng/dvipng-1.14/dvipng.c b/Build/source/texk/dvipng/dvipng-1.14/dvipng.c new file mode 100644 index 00000000000..78b07c1a81f --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/dvipng.c @@ -0,0 +1,164 @@ +/* dvipng.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2008 Jan-Åke Larsson + +************************************************************************/ + +/* This program translates TeX's DVI-Code into Portable Network Graphics. */ + +#define MAIN +#include "dvipng.h" + +#ifdef MIKTEX +# define main __cdecl Main +#endif /* MIKTEX */ +/**********************************************************************/ +/******************************* main *******************************/ +/**********************************************************************/ +int main(int argc, char ** argv) +{ + bool parsestdin; + +#ifdef TIMING +# ifdef HAVE_GETTIMEOFDAY + gettimeofday(&Tp, NULL); + timer = Tp.tv_sec + Tp.tv_usec / 1000000.0; +# else +# ifdef HAVE_FTIME + ftime(&timebuffer); + timer = timebuffer.time + timebuffer.millitm / 1000.0; +# endif +# endif +#endif + /* setbuf(stderr, NULL); */ + +#ifdef HAVE_LIBKPATHSEA + /* Use extra paths as used by dvips */ + kpse_set_program_name(argv[0],"dvips"); + /* If dvipng is not installed in the texmf tree, and _only_ + * SELFAUTO... is used in texmf.cnf, kpathsea will not find a) + * Virtual fonts b) ps2pk.map or psfonts.map c) PostScript fonts + * + * We adjust these things here + */ + /* char selfautodir[MAXPATHLEN]; + FILE *self; + self = popen("kpsewhich -expand-var='$SELFAUTODIR'", "r"); + if (!self) + ... + if (!fgets(selfautodir, MAXPATHLEN, self)) + ... + fclose(self); */ +# ifdef ENV_SELFAUTOLOC + putenv(ENV_SELFAUTOLOC); +# endif +# ifdef ENV_SELFAUTODIR + putenv(ENV_SELFAUTODIR); +# endif +# ifdef ENV_SELFAUTOPARENT + putenv(ENV_SELFAUTOPARENT); +# endif + kpse_set_program_enabled (kpse_pk_format, makeTexPK, kpse_src_compile); +#endif + + initcolor(); + parsestdin = DecodeArgs(argc, argv); + +#ifdef HAVE_LIBKPATHSEA + if (user_mfmode) + if (user_bdpi) + kpse_init_prog("DVIPNG", user_bdpi, user_mfmode, "cmr10"); + else { + Warning("--mfmode given without --bdpi"); + /* this will give a lot of warnings but... */ + kpse_init_prog("DVIPNG", 300, user_mfmode, "cmr10"); + } + else + kpse_init_prog("DVIPNG", 300, "cx", "cmr10"); +#endif + +#ifdef HAVE_FT2_OR_LIBT1 + InitPSFontMap(); +#endif + + DrawPages(); + + if (parsestdin) { + char line[STRSIZE]; + + printf("%s> ",dvi!=NULL?dvi->name:""); + fgets(line,STRSIZE,stdin); + while(!feof(stdin)) { + DecodeString(line); + if (dvi!=NULL) { + DVIReOpen(dvi); + DrawPages(); + } + printf("%s> ",dvi!=NULL?dvi->name:""); + fgets(line,STRSIZE,stdin); + } + printf("\n"); + } + +#ifdef TIMING +# ifdef HAVE_GETTIMEOFDAY + gettimeofday(&Tp, NULL); + timer = Tp.tv_sec + Tp.tv_usec/1000000.0 - timer; +# else +# ifdef HAVE_FTIME + ftime(&timebuffer); + timer = timebuffer.time + timebuffer.millitm/1000.0 - timer; +# endif +# endif + + if (ndone > 0) + fprintf(stderr, + "Time of complete run: %.2f s, %d page(s), %.4f s/page.\n", + timer, ndone, timer / ndone); + if (my_toc >= 0.0001) + fprintf(stderr, + "Thereof in TIC/TOC region %.5f s.\n",my_toc); +#endif + + ClearFonts(); + DVIClose(dvi); + ClearColorNames(); +#ifdef HAVE_FT2_OR_LIBT1 + ClearPSFontMap(); + ClearEncoding(); +#endif +#ifdef HAVE_FT2 + ClearSubfont(); + if (libfreetype!=NULL && FT_Done_FreeType(libfreetype)) + Fatal("an error occured during freetype destruction"); + libfreetype = NULL; +#endif +#ifdef HAVE_LIBT1 + if (libt1!=NULL && T1_CloseLib()) + Fatal("an error occured during t1lib destruction"); + libt1 = NULL; +#endif + + exit(exitcode); +} + + + diff --git a/Build/source/texk/dvipng/dvipng-1.14/dvipng.h b/Build/source/texk/dvipng/dvipng-1.14/dvipng.h new file mode 100644 index 00000000000..81845a82c2d --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/dvipng.h @@ -0,0 +1,566 @@ +/* dvipng.h */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#ifndef DVIPNG_H +#define DVIPNG_H +#include "config.h" + +/* Autoconf may define malloc to rpl_malloc, if the system does not + * have a GNU Libc-compatible malloc (for which malloc(0) gives a + * valid pointer). We don't need that (yet) */ +#ifdef malloc +# undef malloc +#endif + +#define STRSIZE 255 /* stringsize for file specifications */ + +#define FIRSTFNTCHAR 0 +#define LASTFNTCHAR 255 +#define NFNTCHARS LASTFNTCHAR+1 + +#define STACK_SIZE 100 /* DVI-stack size */ + +#define DEFAULT_GAMMA 1.0 + +/* Name of the program which is called to generate missing pk files */ +#define MAKETEXPK "mktexpk" + +#ifdef HAVE_INTTYPES_H +# include +#else /* HAVE_INTTYPES_H */ +# ifndef __sgi +/* IRIX has the following types typedef'd in sys/types.h already, + * i.e., _old_ IRIX systems; newer ones have a working inttypes.h */ +typedef signed char int8_t; +typedef short int16_t; +typedef int int32_t; +#endif /* ! __sgi */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif /* HAVE_INTTYPES_H */ + +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif + +#include + +#ifdef HAVE_KPATHSEA_KPATHSEA_H +# include +#else +# error: kpathsea/kpathsea.h is missing from your system +#endif + +#ifdef HAVE_FT2 +#define HAVE_FT2_OR_LIBT1 +#include +#include FT_FREETYPE_H +#endif + +#ifdef HAVE_LIBT1 +#define HAVE_FT2_OR_LIBT1 +#include +#endif + +#ifdef HAVE_STDBOOL_H +# include +#else +# ifdef HAVE_KPATHSEA_KPATHSEA_H +/* boolean is an enum type from kpathsea/types.h loaded in + kpathsea/kpathsea.h, use it as fallback */ +# define bool boolean +# else +typedef int bool; +# define true (bool) 1 +# define false (bool) 0 +# endif +#endif + +#ifndef HAVE_VPRINTF +# ifdef HAVE_DOPRNT +# define vfprintf(stream, message, args) _doprnt(message, args, stream) +# else +# error: vfprintf AND _doprnt are missing!!! + /* If we have neither, should fall back to fprintf with fixed args. */ +# endif +#endif + +/*************************************************************/ +/************************* protos.h ************************/ +/*************************************************************/ + +typedef int pixels; +typedef int32_t subpixels; +typedef int32_t dviunits; + +#define MM_TO_PXL(x) (int)(((x)*resolution*10)/254) +#define PT_TO_PXL(x) (int)((int32_t)((x)*resolution*100l)/7224) +#define PT_TO_DVI(x) (int32_t)((x)*65536l) + +/*#define PIXROUND(x,c) ((((double)x+(double)(c>>1))/(double)c)+0.5)*/ +/*#define PIXROUND(x,c) (((x)+c)/(c))*/ +/*#define PIXROUND(x,c) ((x+c-1)/(c))*/ +/*#define PIXROUND(x,c) ((x)/(c))*/ +/* integer round to the nearest number, not towards zero */ +#define PIXROUND(num,den) ((num)>0 ? ((num)+(den)/2)/(den) : -(((den)/2-(num))/(den))) + + +/********************************************************/ +/*********************** dvi.h ************************/ +/********************************************************/ + +#define DVI_TYPE 0 +struct dvi_data { /* dvi entry */ + int type; /* This is a DVI */ + struct dvi_data *next; + uint32_t num, den, mag; /* PRE command parameters */ + int32_t conv; /* computed from num and den */ + /* divide dvi units (sp) with conv to get mf device resolution */ + /* divide further with shrinkfactor to get true resolution */ + char * name; /* full name of DVI file */ + char * outname; /* output filename (basename) */ + FILE * filep; /* file pointer */ + time_t mtime; /* modification time */ + struct font_num *fontnump; /* DVI font numbering */ + struct page_list *pagelistp; /* DVI page list */ +#define DVI_PREVIEW_LATEX_TIGHTPAGE 1 +#define DVI_PREVIEW_BOP_HOOK (1<<1) + uint32_t flags; /* Preview-latex flags */ +}; + +#define PAGE_POST INT32_MAX +#define PAGE_LASTPAGE INT32_MAX-1 +#define PAGE_MAXPAGE INT32_MAX-2 /* assume no pages out of this range */ +#define PAGE_FIRSTPAGE INT32_MIN +#define PAGE_MINPAGE INT32_MIN+1 /* assume no pages out of this range */ + +struct dvi_color { + int red,green,blue; +}; + +struct page_list { + struct page_list* next; + int offset; /* file offset to BOP */ + int32_t count[11]; /* 10 dvi counters + absolute pagenum in file */ + int csp; /* color stack pointer at BOP */ + struct dvi_color cstack[2]; /* color stack at BOP, may be longer */ +}; + + + + +struct dvi_data* DVIOpen(char*,char*); +void DVIClose(struct dvi_data*); +bool DVIReOpen(struct dvi_data*); +struct page_list*FindPage(struct dvi_data*, int32_t, bool); +struct page_list*NextPage(struct dvi_data*, struct page_list*); +struct page_list*PrevPage(struct dvi_data*, struct page_list*); +int SeekPage(struct dvi_data*, struct page_list*); +bool DVIFollowToggle(void); +unsigned char* DVIGetCommand(struct dvi_data*); +bool DVIIsNextPSSpecial(struct dvi_data*); +uint32_t CommandLength(unsigned char*); +void ClearPSHeaders(void); + +/********************************************************/ +/********************** misc.h ************************/ +/********************************************************/ + +struct filemmap { +#ifdef WIN32 + HANDLE hFile; + HANDLE hMap; +#else /* WIN32 */ + int fd; +#endif /* WIN32 */ + char* data; + size_t size; +}; + +bool DecodeArgs(int, char *[]); +void DecodeString(char *); +bool MmapFile (char *filename,struct filemmap *fmmap); +void UnMmapFile(struct filemmap* fmmap); + +void Message(int, const char *fmt, ...); +void Warning(const char *fmt, ...); +void Fatal(const char *fmt, ...); + +int32_t SNumRead(unsigned char*, register int); +uint32_t UNumRead(unsigned char*, register int); + +bool MmapFile (char *filename,struct filemmap *fmmap); +void UnMmapFile(struct filemmap* fmmap); + + +/********************************************************/ +/*********************** font.h ***********************/ +/********************************************************/ +struct encoding { + struct encoding* next; + char* name; + char* charname[257]; +}; + +struct subfont { + struct subfont* next; + char* name; + char* infix; + int encoding; + int32_t charindex[256]; +}; + +#ifdef HAVE_FT2_OR_LIBT1 +struct psfontmap { + struct psfontmap *next; + char *line,*psfile,*tfmname,*encname,*end; + struct encoding* encoding; +#ifdef HAVE_FT2 + FT_Matrix* ft_transformp; + FT_Matrix ft_transform; + struct subfont* subfont; +#endif +#ifdef HAVE_LIBT1 + T1_TMATRIX* t1_transformp; + T1_TMATRIX t1_transform; +#endif +}; +#endif + +#define FONT_TYPE_PK 1 +#define FONT_TYPE_VF 2 +#define FONT_TYPE_FT 3 +#define FONT_TYPE_T1 4 +struct char_entry { /* PK/FT/T1 Glyph/VF Macro */ + dviunits tfmw; /* TFM width */ + unsigned char *data; /* glyph data, either pixel data + * (0=transp, 255=max ink) or VF macro */ + uint32_t length; /* Length of PK data or VF macro */ + /* Only used in pixel fonts */ + pixels w,h; /* width and height in pixels */ + subpixels xOffset, yOffset; /* x offset and y offset in subpixels */ + /* Only used in PK fonts */ + unsigned char *pkdata; /* Points to beginning of PK data */ + unsigned char flag_byte; /* PK flagbyte */ +}; + +struct font_entry { /* font entry */ + int type; /* PK/VF/Type1 ... */ + struct font_entry *next; + uint32_t c, s, d; + uint8_t a, l; + char n[STRSIZE]; /* FNT_DEF command parameters */ + int dpi; /* computed from s and d */ + char * name; /* full name of PK/VF file */ + struct filemmap fmmap; /* file memory map */ + uint32_t magnification; /* magnification read from font file */ + uint32_t designsize; /* design size read from font file */ + void * chr[NFNTCHARS]; /* character information */ +#ifdef HAVE_FT2 + FT_Face face; /* Freetype2 face */ +#endif +#ifdef HAVE_LIBT1 + int T1id; /* T1lib font id */ +#endif +#ifdef HAVE_FT2_OR_LIBT1 + struct psfontmap* psfontmap; /* Font transformation */ +#endif + struct font_num *vffontnump; /* VF local font numbering */ + int32_t defaultfont; /* VF default font number */ +}; + +struct font_num { /* Font number. Different for VF/DVI, and several + font_num can point to one font_entry */ + struct font_num *next; + int32_t k; + struct font_entry *fontp; +}; + +void CheckChecksum(uint32_t, uint32_t, const char*); +void InitPK (struct font_entry *newfontp); +void DonePK(struct font_entry *oldfontp); +void InitVF (struct font_entry *newfontp); +void DoneVF(struct font_entry *oldfontp); + +void FontDef(unsigned char*, void* /* dvi/vf */); +void ClearFonts(void); +void SetFntNum(int32_t, void* /* dvi/vf */); +void FreeFontNumP(struct font_num *hfontnump); + +#ifdef HAVE_FT2_OR_LIBT1 +char* copyword(char* orig); +struct psfontmap *NewPSFont(struct psfontmap* copyfrom); +void InitPSFontMap(void); +void ClearPSFontMap(void); +struct psfontmap* FindPSFontMap(char*); +struct encoding* FindEncoding(char*); +void ClearEncoding(void); +bool ReadTFM(struct font_entry *, char*); +#endif + +#ifdef HAVE_FT2 +bool InitFT(struct font_entry *); +void DoneFT(struct font_entry *tfontp); +void LoadFT(int32_t, struct char_entry *); +struct psfontmap* FindSubFont(struct psfontmap* entry, char* fontname); +void ClearSubfont(void); +#endif + +#ifdef HAVE_LIBT1 +bool InitT1(struct font_entry *); +void DoneT1(struct font_entry *tfontp); +void LoadT1(int32_t, struct char_entry *); +#endif + +/********************************************************/ +/********************* ppagelist.h ********************/ +/********************************************************/ + +bool ParsePages(const char*); +void FirstPage(int32_t,bool); +void LastPage(int32_t,bool); +void ClearPpList(void); +void Reverse(bool); +struct page_list* NextPPage(void* /* dvi */, struct page_list*); + + + + +#ifdef MAIN +#define EXTERN +#define INIT(x) =x +#else +#define EXTERN extern +#define INIT(x) +#endif + +/********************************************************/ +/********************** draw.h ************************/ +/********************************************************/ +#include "commands.h" + +void CreateImage(pixels width, pixels height); +void DestroyImage(void); +void DrawCommand(unsigned char*, void* /* dvi/vf */); +void DrawPages(void); +void WriteImage(char*, int); +void LoadPK(int32_t, register struct char_entry *); +int32_t SetChar(int32_t); +dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv); +void Gamma(double gamma); +int32_t SetVF(struct char_entry *ptr); +int32_t SetRule(int32_t, int32_t, int32_t, int32_t); +void SetSpecial(char *, int32_t, int32_t); +void BeginVFMacro(struct font_entry*); +void EndVFMacro(void); + +/**************************************************/ +void handlepapersize(const char*,int32_t*,int32_t*); + +void stringrgb(const char* colorstring,int *r,int *g,int *b); +void background(const char *); +void initcolor(void); +void popcolor(void); +void pushcolor(const char *); +void resetcolorstack(const char *); +void StoreColorStack(struct page_list *tpagep); +void ReadColorStack(struct page_list *tpagep); +void StoreBackgroundColor(struct page_list *tpagep); +void ClearColorNames(void); +void InitXColorPrologue(const char* prologuename); + +/**********************************************************************/ +/************************* Global Variables *************************/ +/**********************************************************************/ + +#ifdef MAKETEXPK +#ifdef HAVE_LIBKPATHSEA +EXTERN bool makeTexPK INIT(MAKE_TEX_PK_BY_DEFAULT); +#else +EXTERN bool makeTexPK INIT(_TRUE); +#endif +#endif + +EXTERN uint32_t usermag INIT(0); /* user specified magstep */ +EXTERN struct font_entry *hfontptr INIT(NULL); /* font list pointer */ + +EXTERN struct internal_state { + struct font_entry* currentfont; +} current_state; + +#define BE_NONQUIET 1 +#define BE_VERBOSE (1<<1) +#define PARSE_STDIN (1<<2) +#define EXPAND_BBOX (1<<3) +#define TIGHT_BBOX (1<<4) +#define FORCE_TRUECOLOR (1<<5) +#define USE_FREETYPE (1<<6) +#define USE_LIBT1 (1<<7) +#define REPORT_HEIGHT (1<<8) +#define REPORT_DEPTH (1<<9) +#define REPORT_WIDTH (1<<10) +#define DVI_PAGENUM (1<<11) +#define MODE_PICKY (1<<12) +#define GIF_OUTPUT (1<<13) +#define MODE_STRICT (1<<14) +#define NO_GHOSTSCRIPT (1<<15) +#define NO_GSSAFER (1<<16) +#define BG_TRANSPARENT (1<<17) +#define BG_TRANSPARENT_ALPHA (1<<18) +#define FORCE_PALETTE (1<<19) +#define NO_RAW_PS (1<<20) +EXTERN uint32_t option_flags INIT(BE_NONQUIET | USE_FREETYPE | USE_LIBT1); + +#define PAGE_GAVE_WARN 1 +#define PAGE_PREVIEW_BOP (1<<1) +#define PAGE_TRUECOLOR (1<<2) +EXTERN uint32_t page_flags INIT(0); + + +#ifdef DEBUG +EXTERN unsigned int debug INIT(0); +#define DEBUG_PRINT(a,b) if (debug & a) { printf b; fflush(stdout); } +#define DEBUG_DVI 1 +#define DEBUG_VF (1<<1) +#define DEBUG_PK (1<<2) +#define DEBUG_TFM (1<<3) +#define DEBUG_GLYPH (1<<4) +#define DEBUG_FT (1<<5) +#define DEBUG_ENC (1<<6) +#define DEBUG_COLOR (1<<7) +#define DEBUG_GS (1<<8) +#define DEBUG_T1 (1<<9) +#define LASTDEBUG DEBUG_T1 +#define DEBUG_DEFAULT DEBUG_DVI +#else +#define DEBUG_PRINT(a,b) +#endif + +/************************timing stuff*********************/ +#ifdef TIMING +# ifdef TIME_WITH_SYS_TIME +# include +# include +# else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +# endif +EXTERN double timer INIT(0); +EXTERN double my_tic,my_toc INIT(0); +EXTERN int ndone INIT(0); /* number of pages converted */ +# ifdef HAVE_GETTIMEOFDAY +EXTERN struct timeval Tp; +# define TIC { gettimeofday(&Tp, NULL); \ + my_tic= Tp.tv_sec + Tp.tv_usec/1000000.0;} +# define TOC { gettimeofday(&Tp, NULL); \ + my_toc += Tp.tv_sec + Tp.tv_usec/1000000.0 - my_tic;} +# else +# ifdef HAVE_FTIME +EXTERN struct timeb timebuffer; +# define TIC() { ftime(&timebuffer); \ + my_tic= timebuffer.time + timebuffer.millitm/1000.0; +# define TOC() { ftime(&timebuffer); \ + my_toc += timebuffer.time + timebuffer.millitm/1000.0 - my_tic;} +# else +# define TIC() +# define TOC() +# endif +# endif +#endif /* TIMING */ + +EXTERN char* user_mfmode INIT(NULL); +EXTERN int user_bdpi INIT(0); +EXTERN int dpi INIT(100); + +#ifdef HAVE_GDIMAGEPNGEX +EXTERN int compression INIT(1); +#endif +#undef min +#undef max +# define max(x,y) if ((y)>(x)) x = y +# define min(x,y) if ((y)<(x)) x = y + +/* These are in pixels*/ +EXTERN int x_min INIT(0); +EXTERN int y_min INIT(0); +EXTERN int x_max INIT(0); +EXTERN int y_max INIT(0); + +/* Page size: default set by -T */ +EXTERN int x_width_def INIT(0); +EXTERN int y_width_def INIT(0); + +/* Offset: default set by -O and -T bbox */ +EXTERN int x_offset_def INIT(0); +EXTERN int y_offset_def INIT(0); + +/* Preview-latex's tightpage */ +EXTERN int x_width_tightpage INIT(0); +EXTERN int y_width_tightpage INIT(0); +EXTERN int x_offset_tightpage INIT(0); +EXTERN int y_offset_tightpage INIT(0); + +/* Paper size: set by -t, for cropmark purposes only */ +/* This has yet to be written */ +EXTERN int x_pwidth INIT(0); +EXTERN int y_pwidth INIT(0); + +/* The transparent border preview-latex desires */ +EXTERN int borderwidth INIT(0); + +/* fallback color for transparent background */ +EXTERN bool userbordercolor INIT(FALSE); /* if true, use user-supplied color */ +EXTERN struct dvi_color bordercolor; + + +EXTERN gdImagePtr page_imagep INIT(NULL); +EXTERN int32_t shrinkfactor INIT(4); + +EXTERN struct dvi_color cstack[STACK_SIZE]; +EXTERN int csp INIT(1); + +EXTERN struct font_entry* currentfont; +EXTERN struct dvi_data* dvi INIT(NULL); + +#ifdef HAVE_FT2 +EXTERN FT_Library libfreetype INIT(NULL); +#endif + +#ifdef HAVE_LIBT1 +EXTERN void* libt1 INIT(NULL); +#endif + +#define EXIT_FATAL EXIT_FAILURE+1 +EXTERN int exitcode INIT(EXIT_SUCCESS); + +#endif /* DVIPNG_H */ diff --git a/Build/source/texk/dvipng/dvipng-1.14/dvipng.texi b/Build/source/texk/dvipng/dvipng-1.14/dvipng.texi new file mode 100644 index 00000000000..0ceb68b301f --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/dvipng.texi @@ -0,0 +1,1034 @@ +\input texinfo +@setfilename dvipng.info +@settitle A DVI-to-PNG translator +@ifset man +@c man begin SYNOPSIS +dvipng [options] filename + +dvipng [options] [filename] - +@c man end +@end ifset + +@set version 1.14 +@set month-year October 2010 + +@c Put everything in one index (arbitrarily chosen to be the concept index). +@syncodeindex fn cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex vr cp + +@include macros.texi +@iftex +@tolerance 10000 @emergencystretch 3em +@end iftex + +@dircategory TeX +@direntry +* DVI-to-PNG: (dvipng). Translating TeX DVI files to Portable Network Graphics (PNG). +* dvipng: (dvipng). A DVI-to-PNG translator. +@end direntry + +@finalout +@titlepage +@title dvipng +@subtitle A DVI-to-PNG Translator +@subtitle Version @value{version} + + +@author by Jan-@AA{}ke Larsson. +@page +@vskip 0pt plus 1filll +Copyright @copyright{} 2002-2010 Jan-@AA{}ke Larsson + +Permission is granted to make and distribute verbatim copies of +this manual provided the copyright notice and this permission notice +are preserved on all copies. + +@ignore +Permission is granted to process this file through TeX and print the +results, provided the printed document carries copying permission +notice identical to this one except for the removal of this paragraph +(this paragraph not being relevant to the printed manual). +@end ignore + +Permission is granted to copy and distribute modified versions of this +manual under the conditions for verbatim copying, provided also that the +section entitled ``Copying'' is included exactly as in the original, and +provided that the entire resulting derived work is distributed under the +terms of a permission notice identical to this one. + +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions, +except that this permission notice may be stated in a translation +approved by the Free Software Foundation. +@end titlepage +@page + +@c @summarycontents +@contents + +@ifnottex +@node Top +@top dvipng + +This manual documents dvipng, a program to translate a DVI (DeVice +Independent) file into PNG (Portable Network Graphics). + +This file documents dvipng version @value{version} + +Corrections or perhaps rewrites of sections are @emph{very welcome}. + +Jan-@AA{}ke Larsson + +@end ifnottex + +@menu +* Introduction:: Introduction +* Installation:: How to compile and install dvipng +* Basic usage:: First things first +* Command-line options:: Advanced usage +* Graphics:: Including PostScript and/or bitmaps +* Color:: Using color with dvipng +* Diagnosing problems:: Problems? +* Credits:: People who have contributed +* Copying:: GNU Lesser General Public License +* Index:: General index +@end menu + + + +@node Introduction +@chapter Introduction + +@c man begin DESCRIPTION +@include readme.texi +@c man end + +@node Installation +@chapter Installation + +@cindex configuration, of dvipng +@cindex compilation +@cindex installation, of dvipng + +@include install.texi + +@node Basic usage +@chapter Basic usage of dvipng + +@cindex invoking dvipng + +To use dvipng at its simplest, simply type + +@example +dvipng foo +@end example + +@noindent +where @file{foo.dvi} is the output of @TeX{} that you want to convert to +PNG format. If there are four pages in @file{foo.dvi}, those pages will +be output as @file{foo1.png}, @file{foo2.png}, @file{foo3.png}, and +@file{foo4.png}, respectively. + +If you have enabled the PostScript font support (via FreeType or T1lib), +fonts will be rendered as they are needed. Otherwise, dvipng will use +bitmapped (PK) fonts, and if you use PK fonts that have not been used on +your system before, they may be automatically generated; this process +can take a few minutes, so progress reports appear by default. The next +time the same font is used, it will have been saved on disk, so +rendering will go much faster. (If dvipng tries to endlessly generate +the same fonts over and over again, something is wrong. @xref{Unable to +generate fonts,,, kpathsea, Kpathsea}.) + +Many options are available (see the next section). For a brief summary +of available options, just type + +@example +dvipng --help +@end example + +@node Command-line options +@chapter Command-line options + +@cindex command-line options +@cindex options, dvipng + +dvipng has a plethora of command line options. Reading through this +section will give a good idea of the capabilities of the driver. + +@menu +* Option summary:: Quick listing, from dvipng --help. +* Option details:: More information about each option. +@end menu + + +@node Option summary +@section Option summary + +@cindex options, summary +Here is a handy summary of the options; it is printed out when you run +dvipng with no arguments or with the standard @samp{--help} option. + +@example +@include dvipng.help +@end example + + +@node Option details +@section Option details + +@cindex option, details of +@c man begin OPTIONS + +Many of the parameterless options listed here can be turned off by +suffixing the option with a zero (@samp{0}); for instance, to turn off +page reversal, use @samp{-r0}. Such options are marked with a trailing +@samp{*}. + +@table @samp +@item - +@cindex options, reading from standard input +@cindex standard input, reading options from +Read additional options from standard input after processing the command +line. + +@item --help +Print a usage message and exit. + +@item --version +Print the version number and exit. + +@item -bd @var{num} +@item -bd @var{color_spec} +@item -bd '@var{num} @var{color_spec}' +@cindex transparent border width +@cindex transparent border fallback color +Set the pixel width of the transparent border (default 0). Using this +option will make the image edges transparent, but it only affects pixels +with the background color. Giving a @var{color_spec} will set the +fallback color, to be used in viewers that cannot handle transparency +(the default is the background color). The color spec should be in +@TeX{} color \special syntax, e.g., 'rgb 1.0 0.0 0.0'. Setting the +fallback color makes the default border width 1 px. @xref{Color}. + +@item --bdpi @var{num} +@cindex base resolution, setting +This option only has an effect when using bitmapped (PK) fonts. The +option sets the base (Metafont) resolution, both horizontal and +vertical, to @var{num} dpi (dots per inch). This option is necessary +when manually selecting Metafont mode with the --mode option (see +below). + +@item -bg @var{color_spec} +@cindex background color (option) +Choose background color for the images. This option will be ignored if +there is a background color \special in the DVI. The color spec should +be in @TeX{} color \special syntax, e.g., 'rgb 1.0 0.0 0.0'. You can +also specify 'Transparent' or 'transparent' which will give you a +transparent background with the normal background as a fallback color. A +capitalized 'Transparent' will give a full-alpha transparency, while an +all-lowercase 'transparent' will give a simple fully transparent +background with non-transparent antialiased pixels. The latter would be +suitable for viewers who cannot cope with a true alpha channel. GIF +images do not support full alpha transparency, so in case of GIF output, +both variants will use the latter behaviour. @xref{Color}. + +@item -d @var{num} +@cindex debugging +Set the debug flags, showing what dvipng (thinks it) is doing. This will +work unless dvipng has been compiled without the @code{DEBUG} option +(not recommended). Set the flags as you need them, use @samp{-d -1} as +the first option for maximum output. @xref{Debug options}. + +@item -D @var{num} +@cindex output resolution, setting +Set the output resolution, both horizontal and vertical, to @var{num} +dpi (dots per inch). + +One may want to adjust this to fit a certain text font size (e.g., on +a web page), and for a text font height of @var{font_px} pixels (in +Mozilla) the correct formula is +@example +@var{dpi} = @var{font_px} * 72.27 / 10 [px * @TeX{}pt/in / @TeX{}pt] +@end example +The last division by ten is due to the standard font height 10pt in +your document, if you use 12pt, divide by 12. Unfortunately, some +proprietary browsers have font height in pt (points), not pixels. You +have to rescale that to pixels, using the screen resolution (default +is usually 96 dpi) which means the formula is +@example +@var{font_px} = @var{font_pt} * 96 / 72 [pt * px/in / (pt/in)] +@end example +On some high-res screens, the value is instead 120 dpi. Good luck! + +@item --depth* +@cindex baseline reporting +@cindex depth reporting +Report the depth of the image. This only works reliably when the +@LaTeX{} style @file{preview.sty} from @previewlatex{} is used with +the @samp{active} option. It reports the number of pixels from the +bottom of the image to the baseline of the image. This can be used for +vertical positioning of the image in, e.g., web documents, where one +would use (Cascading StyleSheets 1) +@example + +@end example +The depth is a negative offset in this case, so the minus sign is +necessary, and the unit is pixels (px). + +@item --dvinum* +Set this option to make the output page number be the @TeX{} page +numbers rather than the physical page number. See the @samp{-o} switch. + +@ignore +@item -e @var{num} +@cindex maxdrift +@cindex accuracy in positioning +@cindex positioning accuracy +Maximum drift in pixels of each character from its `true' +resolution-independent position on the page. The default value of this +parameter is resolution dependent (it is the number of entries in the +list [100, 200, 300, 400, 500, 600, 800, 1000, 1200, 1600, 2000, 2400, +2800, 3200, @dots{}] that are less than or equal to the resolution in +dots per inch). Allowing individual characters to `drift' from their +correctly rounded positions by a few pixels, while regaining the true +position at the beginning of each new word, improves the spacing of +letters in words. + +@item -f* +@cindex filter, running as a +@cindex standard I/O +@cindex pipes, not readable +@vindex PRINTER@r{, avoided with @samp{-f}} +Run as a filter. Read the DVI file from standard input and write the +PostScript to standard output. The standard input must be seekable, so +it cannot be a pipe. If your input must be a pipe, write a shell script +that copies the pipe output to a temporary file and then points dvipng at +this file. This option also disables the automatic reading of the +@code{PRINTER} environment variable; use @samp{-P$PRINTER} after the +@samp{-f} to read it anyway. It also turns off the automatic sending of +control-D if it was turned on with the @samp{-F} option or in the +configuration file; use @samp{-F} after the @samp{-f} to send it anyway. + +@item -k* +@cindex cropmarks +Print crop marks. This option increases the paper size (which should be +specified, either with a paper size special or with the @samp{-T} +option) by a half inch in each dimension. It translates each page by a +quarter inch and draws cross-style crop marks. It is mostly useful with +typesetters that can set the page size automatically. This works by +downloading @file{crop.pro}. +@end ignore + +@item -fg @var{color_spec} +@cindex foreground color (option) +Choose foreground color for the images. This option will be ignored if +there is a foreground color \special in the DVI. The color spec should +be in @TeX{} color \special syntax, e.g., 'rgb 1.0 0.0 0.0'. +@xref{Color}. + +@item --follow* +@cindex follow mode +Wait for data at end-of-file. One of the benefits of dvipng is that it +does not read the postamble, so it can be started before @TeX{} +finishes. This switch makes dvipng wait at end-of-file for further +output, unless it finds the POST marker that indicates the end of the +DVI. This is similar to @samp{tail -f} but for DVI-to-PNG conversion. + +@item --freetype* +@cindex FreeType font rendering +Enable/disable FreeType font rendering (default on). This option is +available if the FreeType2 font library was present at compilation time. +If this is the case, dvipng will have direct support for PostScript +Type1 and TrueType fonts internally, rather than using @samp{gsftopk} +for rendering the fonts. If you have PostScript versions of Computer +Modern installed, there will be no need to generate bitmapped (PK) +variants on disk of these. Then, you can render images at different (and +unusual) resolutions without cluttering the disk with lots of bitmapped +fonts. Note that if you have both FreeType and T1lib on your system, +FreeType will be preferred by dvipng. If you for some reason would want +to use T1lib rendering, use this option. + +@item --gamma @var{num} +@cindex gamma +@cindex dark fonts +@cindex light fonts +@cindex fuzzy images +Control the interpolation of colors in the greyscale anti-aliasing +color palette. Default value is 1.0. For 0 < @var{num} < 1, the +fonts will be lighter (more like the background), and for @var{num} > +1, the fonts will be darker (more like the foreground). + +@item --gif* +@cindex GIF image format +The images are output in the GIF format, if GIF support is enabled. +This is the default for the @samp{dvigif} binary, which only will be +available when GIF support is enabled. GIF images are palette images +(see the @samp{--palette} option) and does not support true alpha +channels (see the @samp{--bg} option). See also the @samp{--png} +option. + +@item --height* +@cindex baseline reporting +@cindex height reporting +Report the height of the image. This only works reliably when the +@LaTeX{} style @file{preview.sty} from @previewlatex{} is used with +the @samp{active} option. It reports the number of pixels from the top +of the image to the baseline of the image. The total height of the +image is obtained as the sum of the values reported from +@samp{--height} and @samp{--depth}. + +@item -l [=]@var{num} +@cindex last page printed +@cindex page, last printed +@cindex physical page number, and @samp{-l} +@cindex absolute page number, and @samp{-l} +The last page printed will be the first one numbered @var{num}. Default +is the last page in the document. If @var{num} is prefixed by an equals +sign, then it (and the argument to the @samp{-p} option, if specified) +is treated as a physical (absolute) page number, rather than a value to +compare with the @TeX{} @samp{\count0} values stored in the DVI file. +Thus, using @samp{-l =9} will end with the ninth page of the document, +no matter what the pages are actually numbered. + +@item --mode @var{mode} +@cindex mode name, specifying +@cindex Metafont mode, specifying +This option only has an effect when using bitmapped (PK) fonts. Use +@var{mode} as the Metafont device name for the PK fonts (both for path +searching and font generation). This needs to be augmented with the base +device resolution, given with the @samp{--bdpi} option. See the file +@url{ftp://ftp.tug.org/tex/modes.mf} for a list of resolutions and mode +names for most devices. @xref{Unable to generate fonts,,, kpathsea, +Kpathsea}. + +@item -M* +@cindex font generation, avoiding +@pindex mktexpk@r{, avoiding} +@c this description repeated in kpathsea.texi +This option only has an effect when using bitmapped (PK) fonts. It turns +off automatic PK font generation (@file{mktexpk}). +@ignore +@flindex missfont.log +If @code{mktexpk}, the invocation is appended to a file +@file{missfont.log} (by default) in the current directory. You can then +execute the log file to create the missing files after fixing the +problem. +@vindex TEXMFOUTPUT +@vindex MISSFONT_LOG +If the current directory is not writable and the environment variable or +configuration file value @samp{TEXMFOUTPUT} is set, its value is used. +Otherwise, nothing is written. The name @samp{missfont.log} is +overridden by the @samp{MISSFONT_LOG} environment variable or +configuration file value. +@end ignore + +@item --nogs* +@cindex GhostScript, turning off +This switch prohibits the internal call to GhostScript for displaying +PostScript specials. @samp{--nogs0} turns the call back on. + +@item --nogssafer* +@cindex GhostScript and -dSAFER +@cindex -dSAFER +Normally, if GhostScript is used to render PostScript specials, the +GhostScript interpreter is run with the option @samp{-dSAFER}. The +@samp{--nogssafer} option runs GhostScript without @samp{-dSAFER}. The +@samp{-dSAFER} option in Ghostscript disables PostScript operators such +as deletefile, to prevent possibly malicious PostScript programs from +having any effect. + +@item --norawps* +@cindex PostScript, turning off raw PostScript specials +Some packages generate raw PostScript specials, even non-rendering such +specials. This switch turns off the internal call to GhostScript +intended to display these raw PostScript specials. @samp{--norawps0} +turns the call back on. + +@item -o @var{name} +@cindex output, redirecting +@cindex standard output, output to +Send output to the file @var{name}. A single occurrence of @samp{%d} or +@samp{%01d}, @dots{}, @samp{%09d} will be exchanged for the physical +page number (this can be changed, see the @samp{--dvinum} switch). The +default output filename is @samp{@var{file}%d.png} where the input DVI +file was @samp{@var{file}.dvi}. + +@item -O @var{x-offset},@var{y-offset} +@cindex offset pages +Move the origin by @var{x-offset},@var{y-offset}, a comma-separated +pair of dimensions such as @samp{.1in,-.3cm}. +@c (@pxref{papersize special}). +The origin of the page is shifted from the default position +(of one inch down, one inch to the right from the upper left corner of +the paper) by this amount. + +@item -p [=]@var{num} +@cindex first page printed +@cindex page, first printed +@cindex physical page number, and @samp{-p} +@cindex absolute page number, and @samp{-p} +The first page printed will be the first one numbered @var{num}. Default +is the first page in the document. If @var{num} is prefixed by an +equals sign, then it (and the argument to the @samp{-l} option, if +specified) is treated as a physical (absolute) page number, rather than +a value to compare with the @TeX{} @samp{\count0} values stored in the +DVI file. Thus, using @samp{-p =3} will start with the third page of +the document, no matter what the pages are actually numbered. + +@item --palette* +@cindex forcing palette output +When an external image is included, @samp{dvipng} will automatically +switch to truecolor mode, to avoid unnecessary delay and quality +reduction, and enable the EPS translator to draw on a transparent +background and outside of the boundingbox. This switch will force +palette (256-color) output and make @samp{dvipng} revert to opaque +clipped image inclusion. This will also override the @samp{--truecolor} +switch if present. + +@item --picky* +@cindex no erroneous images +No images are output when a warning occurs. Normally, dvipng will +output an image in spite of a warning, but there may be something +missing in this image. One reason to use this option would be if you +have a more complete but slower fallback converter. Mainly, this is +useful for failed figure inclusion and unknown \special occurrences, +but warnings will also occur for missing or unknown color specs and +missing PK fonts. + +@item --png* +@cindex PNG image format +The images are output in the PNG format. This is the default for the +@samp{dvipng} binary. See also the @samp{--gif} option. + +@item -pp @var{firstpage}-@var{lastpage} +@cindex page range +Print pages @var{firstpage} through @var{lastpage}; but not quite +equivalent to @samp{-p @var{firstpage} -l @var{lastpage}}. For example, +when rendering a book, there may be several instances of a page in the +DVI file (one in @code{\frontmatter}, one in @code{\mainmatter}, and one +in @code{\backmatter}). In case of several pages matching, @samp{-pp +@var{firstpage}-@var{lastpage}} will render @emph{all} pages that +matches the specified range, while @samp{-p @var{firstpage} -l +@var{lastpage}} will render the pages from the @emph{first} occurrence +of @var{firstpage} to the @emph{first} occurrence of @var{lastpage}. +This is the (undocumented) behaviour of dvips. In dvipng you can give +both kinds of options, in which case you get all pages that matches the +range in @samp{-pp} between the pages from @samp{-p} to @samp{-l}. Also +multiple @samp{-pp} options accumulate, unlike @samp{-p} and @samp{-l}. +The @samp{-} separator can also be @samp{:}. Note that @samp{-pp -1} +will be interpreted as "all pages up to and including 1", if you want a +page numbered -1 (only the table of contents, say) put @samp{-pp -1--1}, +or more readable, @samp{-pp -1:-1}. + +@item -q* +@cindex quiet operation +@cindex silent operation +@cindex warnings, suppressing +Run quietly. Don't chatter about pages converted, etc.@: to standard +output; report no warnings (only errors) to standard error. + +@item -Q @var{num} +@cindex antialiasing levels@r{, number of} +@cindex quality +Set the quality to @var{num}. That is, choose the number of antialiasing +levels for bitmapped fonts (PK) and fonts rendered using T1lib, to be +@var{num}*@var{num}+1. The default value is 4 which gives 17 levels of +antialiasing for antialiased fonts from these two. If FreeType is +available, its rendering is unaffected by this option. + +@item -r* +@cindex reverse pagination +Toggle output of pages in reverse/forward order. By default, the first +page in the DVI is output first. + +@ignore +@item -R +@cindex security +@cindex shell command execution, disabling +@cindex absolute filenames, disabling +@cindex pipes, disabling output to +Run securely. This disables shell command execution in @code{\special} +(via @samp{`}, @pxref{Dynamic creation of graphics}) and config files +(via the @samp{E} option, @pxref{Configuration file commands}), pipes as +output files, and opening of any absolute filenames. + +@item -t @var{papertype} +@cindex paper type +@cindex media +@cindex letter papertype +@cindex legal papertype +@cindex ledger papertype +@cindex a4 papertype +@cindex a3 papertype +@cindex landscape papertype +Set the paper type to @var{papertype}. +@c usually defined in one of the +@c configuration files, along with the appropriate PostScript code to +@c select it (@pxref{Config file paper sizes}). +You can also specify a @var{papertype} of @samp{landscape}, which +rotates a document by 90 degrees. To rotate a document whose paper type +is not the default, you can use the @samp{-t} option twice, once for the +paper type, and once for @samp{landscape}. +@end ignore + +@item --strict* +@cindex exit on erroneous images +The program exits when a warning occurs. Normally, dvipng will output +an image in spite of a warning, but there may be something missing in +this image. One reason to use this option would be if you have a more +complete but slower fallback converter. See the @samp{--picky} option +above for a list of when warnings occur. + +@item -T @var{image_size} +Set the image size to @var{image_size} which can be either of +@samp{bbox}, @samp{tight}, or a comma-separated pair of dimensions +@var{hsize},@var{vsize} such as @samp{.1in,.3cm}. The default is +@samp{bbox} which produces a PNG that includes all ink put on the page +and in addition the DVI origin, located 1in from the top and 1in from +the left edge of the paper. This usually gives whitespace above and to +the left in the produced image. The value @samp{tight} will make dvipng +only include all ink put on the page, producing neat images. +@c (@pxref{papersize special}). +@c This option overrides any papersize special in the DVI file. + +@item --t1lib* +@cindex T1lib font rendering +Enable T1lib font rendering (default on). This option is available if +the T1lib font library was present at compilation time. If this is the +case, dvipng will have direct support for PostScript Type1 fonts +internally, rather than using @samp{gsftopk} for rendering the fonts. If +you have PostScript versions of Computer Modern installed, there will be +no need to generate bitmapped variants on disk of these. Then, you can +render images at different (and unusual) resolutions without cluttering +the disk with lots of bitmapped fonts. Note that if you have both +FreeType and T1lib on your system, FreeType will be preferred by dvipng, +and if you for some reason rather want to use T1lib, give the option +@samp{--freetype0} (see above). + +@item --truecolor* +@cindex truecolor output +This will make @samp{dvipng} generate truecolor output. Note that +truecolor output is automatic if you include an external image in your +DVI, e.g., via a PostScript special (i.e., the @samp{graphics} or +@samp{graphicx} package). This switch is overridden by the +@samp{--palette} switch. + +@item -v* +Enable verbose operation. This will currently indicate what fonts is +used, in addition to the usual output. + +@item --width* +@cindex width reporting +Report the width of the image. See also @samp{--height} and +@samp{--depth}. + +@item -x @var{num} +@cindex magnification, overriding DVI +This option is deprecated; it should not be used. It is much better to +select the output resolution directly with the @samp{-D} option. This +option sets the magnification ratio to @math{@var{num}/1000} and +overrides the magnification specified in the DVI file. Must be between +10 and 100000. It is recommended that you use standard magstep values +(1095, 1200, 1440, 1728, 2074, 2488, 2986, and so on) to help reduce the +total number of PK files generated. @var{num} may be a real number, not +an integer, for increased precision. + +@item -z @var{num} +@cindex compression +Set the PNG compression level to @var{num}. This option is enabled if +your @samp{libgd} is new enough. The default compression level is 1, +which selects maximum speed at the price of slightly larger PNGs. For an +older @samp{libgd}, the hard-soldered value 5 is used. The include file +@samp{png.h} says +@ifclear man +@quotation +Currently, valid values range from 0 - 9, corresponding directly to the +zlib compression levels 0 - 9 (0 - no compression, 9 - "maximal" +compression). Note that tests have shown that zlib compression levels +3-6 usually perform as well as level 9 for PNG images, and do +considerably fewer calculations. In the future, these values may not +correspond directly to the zlib compression levels. +@end quotation +@end ifclear +@ifset man +``Currently, valid values range from 0 - 9, corresponding directly to +the zlib compression levels 0 - 9 (0 - no compression, 9 - "maximal" +compression). Note that tests have shown that zlib compression levels +3-6 usually perform as well as level 9 for PNG images, and do +considerably fewer calculations. In the future, these values may not +correspond directly to the zlib compression levels.'' +@end ifset +@end table +@c man end + +@node Graphics +@chapter Graphics + +@samp{dvipng} attempts to handle graphics as included by the +@samp{graphicx} and @samp{graphics} packages, without the need of +specifying a driver to these packages. This means that it recognizes +the encapsulated postscript inclusion meant for @samp{dvips}, but is +also able (from version 1.8) to include bitmapped graphics. It also +tries to handle some of the raw PostScript that is output from various +packages. Some of the possibilities and problems are mentioned below. + +@menu +* Encapsulated PostScript:: An internal call to GhostScript +* Bitmapped graphics:: PNG, JPEG and GIF +* Raw PostScript:: Ignore or give to GhostScript +@end menu + +@node Encapsulated PostScript +@section Encapsulated PostScript + +When an EPS file is included, a call to GhostScript is performed to +produce a bitmapped image that can be included. The default is to +produce an image with transparent background, at the same size as the +DVI page currently being converted to PNG, and include that as +foreground on the PNG. Of course, if the image is to be cropped, that +is done. The included image will be a truecolor image, so for maximum +performance the output PNG will be in truecolor mode as well. + +This conversion needs the @samp{pngalpha} output device to be present +in your copy of GhostScript. If that device is not present, or you use +the @samp{--palette} switch or request GIF output, the fallback is to +use the @samp{png16m} device to produce a cropped opaque image for +inclusion. Other relevant switches are @samp{--noghostscript} and +@samp{--nogssafer}. @xref{Option details}. + +@cindex PostScript inclusion problems +The most common problem with including graphics is an incorrect +bounding box. Complain to whoever wrote the software that generated +the file if the bounding box is indeed incorrect. An adjusted +boundingbox can be specified in the @samp{\includegraphics} call, as +in this example (using @samp{graphicx}): + +@example +\includegraphics[bb=10 20 100 200]@{imagename.eps@} +@end example + + +@node Bitmapped graphics +@section Bitmapped graphics + +dvipng can include PNG, JPEG and GIF graphics. When including such +images via @samp{\includegraphics} you need to specify the bounding +box since @TeX{} itself cannot read them from the files in question. +The bounding box size should be given as @samp{0 0 w h} in pixels, +e.g., if the file @samp{imagename.png} is 300x400 pixels, the +inclusion would read + +@example +\includegraphics[bb=0 0 300 400]@{imagename.png@} +@end example + +The default size is the image size in bp (``big points'' in TeX +nomenclature or PostScript points as other people have it, 72 per inch). +That is, default resolution will be 72 dpi for included bitmaps, which +is the default size in the few other bitmap-capable drivers that are +known to me (dvipdfm and PDFLaTeX). + +If you want 100 dpi you need to specify the width accordingly. You +just divide your image width by 100: a 135 pixel wide image at 100 dpi +will take up 1.35 inches. If you want 200 dpi you divide by 200, and +so on. Simple, eh? The example above at 200 dpi would be 1.5 inches +wide: + +@example +\includegraphics[bb=0 0 300 400,witdh=1.5in]@{imagename.png@} +@end example + +@node Raw PostScript +@section Raw PostScript + +dvipng attempts to handle raw PostScript. Rendering raw PostScript +specials is done on top of the page by including a transparent image +generated by the @samp{pngalpha} device in GhostScript (automatically +selecting @samp{truecolor} mode in dvipng). + +Included PostScript headers are respected, and if the header +@samp{tex.pro} is included, dvipng also throws in @samp{color.pro} and +@samp{special.pro}. The package @samp{xcolor} includes its own headers +with color names, and this is not only kept as a PostScript header, but +is also read and interpreted by dvipng itself. An attempt is also made +to respect the PGF header. The non-rendering specials from +@samp{hyperref} are handled via some heuristics and do not give an +error. + +Really rendering and moving things with raw PostScript specials is more +troublesome. The \rotatebox macro serves as a good example. The dvips +driver of the graphicx package surrounds DVI glyphs with PostScript code +so that after conversion by dvips, the glyphs (now themselves in +PostScript) will be rotated in the desired way. dvipng does not handle +this, at present. An attempt has been made to handle the rendering +specials output by PGF (tikz), and also PSTricks. Some things work, but +others do not. This is especially clear when mixing PostScript and DVI +rendering commands such as glyphs. dvipng cannot at present detect if +PostScript code moves @samp{currentpoint} or rotates the frame since +GhostScript does not return such information. A recommendation would be +to produce images from these packages as EPS files and include them into +your document in the standard manner. + +Another way to handle this would be to use a slower fallback (with dvips +and gs, for example). If you want to disable raw PostScript handling in +dvipng, use the switch @samp{--norawps}. This switch turns off the +internal call to GhostScript intended to display these raw PostScript +specials. Further, when dvipng encounters raw PostScript and the gs call +is turned off, it gives a warning. It is now possible to use the switch +@samp{--picky} to disable page rendering of pages with warnings, and use +the slower fallback for these pages. + +@node Color +@chapter Color + +To support color, dvipng recognizes a certain set of specials as +generated by the @samp{color} and @samp{xcolor} style files. These +specials start with the keyword @samp{color} or the keyword +@samp{background}, followed by a color specification. + +@menu +* Color specifications:: +* Color specials:: +@end menu + + +@node Color specifications +@section Color specifications + +@cindex color specifications + +The color specification supported by dvipng is by-value or by-name. The +by-value spec starts with the name of a color model (one of @samp{rgb}, +@samp{hsb}, @samp{cmy}, @samp{cmyk}, or @samp{gray}) followed by the +appropriate number of parameters. Thus, the color specification +@samp{rgb 0.3 0.4 0.5} would correspond to the color that is @samp{0.3 +0.4 0.5} in its red, blue and green values. The color model used +internally in dvipng is @samp{RGB} (discretized to 256 levels), for +details on the formulas used in conversion, see the @samp{xcolor} +documentation. + +By-name color specifications are single (case-dependent) words and are +compared with color names defined in @samp{dvipsnam.def} (from the +@samp{graphics} bundle), @samp{svgnam.def} and @samp{xcolor.sty} (from +the @samp{xcolor} bundle). See the @samp{xcolor} documentation for a +list of names and the corresponding colors. + +On the command-line, the name @samp{Transparent} can also be used as +an argument to @samp{--bg} to choose transparent background. +@xref{Option details}. + +@node Color specials +@section Color specials + +We will describe @samp{background} first, since it is the simplest. The +@samp{background} keyword must be followed by a color specification. +That color specification is used as a fill color for the background. The +last @samp{background} special on a page is the one that gets used, and +is used for the whole of the page image. (This is possible because the +prescan phase of dvipng notices all of the color specials so that the +appropriate information can be written out during the second phase.) + +The @samp{color} special itself has three forms. The first is just +@samp{color} followed by a color specification. In this case, the +current global color is set to that color; the color stack must be empty +when such a command is executed. + +The second form is @samp{color push} followed by a color specification. +This saves the current color on the color stack and sets the color to be +that given by the color specification. This is the most common way to +set a color. + +The final form of the @samp{color} special is just @samp{color pop}, +with no color specification; this says to pop the color last pushed on +the color stack from the color stack and set the current color to be +that color. + +dvipng correctly handles these color specials across pages, even when +the pages are rendered repeatedly or in reverse order. + +@node Diagnosing problems +@chapter Diagnosing problems + +@cindex problems +@cindex trouble +@cindex debugging + +You've gone through all the trouble of installing dvipng, carefully read +all the instructions in this manual, and still can't get something to +work. The following sections provide some helpful hints if you find +yourself in such a situation. + +@menu +* Contact information:: Who to ask. +* Debug options:: Getting diagnostics. +@end menu + +@node Contact information +@section Contact information + +Bug reports should be sent to +@email{dvipng@@nongnu.org}. + +Questions, suggestions for new features, pleas for help, and/or praise +should go to @email{dvipng@@nongnu.org}. For more information on this +mailing list, send a message with just the word `help' as subject or +body to @email{dvipng-request@@nongnu.org} or look at +@url{http://lists.nongnu.org/mailman/listinfo/dvipng}. + +Offers to support further development will be appreciated. For developer +access, ask on @email{dvipng@@nongnu.org}. + +For details on the @TeX{} path-searching library, and @code{mktexpk} +problems, @pxref{Common problems,,, kpathsea, Kpathsea}. + + +@node Debug options +@section Debug options + +The @samp{-d} flag to dvipng helps in tracking down certain errors. The +parameter to this flag is an integer that tells what errors are +currently being tracked. To track a certain class of debug messages, +simply provide the appropriate number given below; if you wish to track +multiple classes, sum the numbers of the classes you wish to track. To +track all classes, you can use @code{-1}. + +Some of these debugging options are actually provided by Kpathsea +(@pxref{Debugging, , , kpathsea, Kpathsea}). + +The classes are: +@table @asis +@item 1 +Normal dvi op-codes +@item 2 +Virtual fonts +@item 4 +PK fonts +@item 8 +TFM files +@item 16 +Glyph rendering +@item 32 +FreeType calls +@item 64 +Encoding loads +@item 128 +Color specials +@item 256 +GhostScript specials +@item 512 +T1lib calls +@item 1024 +Kpathsea @code{stat} calls +@item 2048 +Kpathsea hash table lookups +@item 4096 +Kpathsea path element expansion +@item 8192 +Kpathsea path searches +@ignore +@item 16384 +@end ignore + +@end table + +@node Credits +@chapter Credits + +A number of persons have contributed, if I forget to mention someone, +I apologize. First and foremost we have David Kastrup whose +@previewlatex{} project provided the incentive to write this program. +There is also a number of people who have contributed by reporting +bugs and suggesting improvements as the thing has evolved. These +include but is perhaps not limited to (in semi-random order): Thomas +Esser (te@TeX{}), Christian Schenk (MIK@TeX{}), Brian R Furry (debian +package), Angus Leeming (LyX), Thomas Boutell (libgd), John Jones +(first user report), Uwe Kern (xcolor), Karl Berry and Peter +Breitenlohner (@TeX{} Live), David Harvey (hinting in Freetype), Neal +Harmon, Alan Shutko, Reiner Stieb, Nick Alcock, Adam Buchbinder, Svend +Tollak Munkejord, James Longstreet, Bernhard Simon, Bob McElrath, +Georg Schwarz, Jason Farmer, Brian V. Smith, Samuel Hathaway, Thomas +R. Shemanske, Stephen Gibson, Christian Ridderstr@"om, Ezra Peisach, +William H Wheeler, Thomas Klausner, Harald Koenig, Adrian Bunk, Kevin +Smith, Jason Riedy, Wolfram Krause, Reinhard Kotucha, Takeshi Abe, and +Waldeck Schutzer. + +Use of the @code{gd} library requires inclusion of the following +copyright notice, which applies to the @code{gd} library: + +@quotation +Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188 by the National Institutes of Health. + +Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 by Boutell.Com, Inc. + +Portions relating to GD2 format copyright 1999, 2000, 2001, 2002, 2003, 2004 Philip Warner. + +Portions relating to PNG copyright 1999, 2000, 2001, 2002, 2003, 2004 Greg Roelofs. + +Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002, 2003, 2004 John Ellson (ellson@@graphviz.org). + +Portions relating to gdft.c copyright 2001, 2002, 2003, 2004 John Ellson (ellson@@graphviz.org). + +Portions relating to JPEG and to color quantization copyright 2000, 2001, 2002, 2003, 2004, Doug Becker and copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Thomas G. Lane. This software is based in part on the work of the Independent JPEG Group. See the file README-JPEG.TXT for more information. + +Portions relating to GIF compression copyright 1989 by Jef Poskanzer and David Rowley, with modifications for thread safety by Thomas Boutell. + +Portions relating to GIF decompression copyright 1990, 1991, 1993 by David Koblas, with modifications for thread safety by Thomas Boutell. + +Portions relating to WBMP copyright 2000, 2001, 2002, 2003, 2004 Maurice Szmurlo and Johan Van den Brande. + +Portions relating to GIF animations copyright 2004 Jaakko Hyv@"adtti (jaakko.hyvatti@@iki.fi) + +Permission has been granted to copy, distribute and modify gd in any context without fee, including a commercial application, provided that this notice is present in user-accessible supporting documentation. + +This does not affect your ownership of the derived work itself, and the intent is to assure proper credit for the authors of gd, not to interfere with your productive use of gd. If you have questions, ask. "Derived works" includes all programs that utilize the library. Credit must be given in user-accessible documentation. + +This software is provided "AS IS." The copyright holders disclaim all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to this code and accompanying documentation. + +Although their code does not appear in the current release, the authors also wish to thank Hutchison Avenue Software Corporation for their prior contributions. +@end quotation + +@ifset man +@c man begin NOTES +The full manual is accessible in info format, on most systems by typing +@example +info dvipng +@end example +@c man end +@c man begin COPYRIGHT +This program is released under the GNU Lesser General Public License +version 3, see the COPYING file in the dvipng distribution or +@url{http://www.gnu.org/licenses/gpl.html}. + +Copyright @copyright{} 2002-2010 Jan-@AA{}ke Larsson +@c man end +@end ifset + +@node Copying +@chapter Copying + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this program. If not, see +. + +@sp 2 +@noindent +Copyright @copyright{} 2002-2010 Jan-@AA{}ke Larsson + +@node Index +@unnumbered Index + +@printindex cp +@bye + diff --git a/Build/source/texk/dvipng/dvipng-1.14/enc.c b/Build/source/texk/dvipng/dvipng-1.14/enc.c new file mode 100644 index 00000000000..03224769c78 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/enc.c @@ -0,0 +1,129 @@ +/* enc.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2008 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +struct encoding* encodingp=NULL; + +static struct encoding* InitEncoding(char* encoding) +{ + char *pos,*max,*buf,*enc_file; + int i; + struct encoding* encp=NULL; + struct filemmap fmmap; + boolean mmapfailed; + +#ifdef HAVE_KPSE_ENC_FORMATS + enc_file=kpse_find_file(encoding,kpse_enc_format,false); +#else + enc_file=kpse_find_file(encoding,kpse_tex_ps_header_format,false); +#endif + if (enc_file == NULL) { + Warning("encoding file %s could not be found",encoding); + return(NULL); + } + DEBUG_PRINT((DEBUG_FT|DEBUG_ENC),("\n OPEN ENCODING:\t'%s'", enc_file)); + mmapfailed = MmapFile(enc_file,&fmmap); + free(enc_file); + if (mmapfailed) + return(NULL); + if ((encp = calloc(sizeof(struct encoding)+strlen(encoding)+1 + +fmmap.size,1))==NULL) { + Warning("cannot alloc space for encoding",encoding); + UnMmapFile(&fmmap); + return(NULL); + } + encp->name=(char*)encp+sizeof(struct encoding); + strcpy(encp->name,encoding); + pos=fmmap.data; + max=fmmap.data+fmmap.size; + buf=encp->name+strlen(encoding)+1; +#define SKIPCOMMENT(x) if (*x=='%') while (xcharname[256]=buf; + while(poscharname[256])); + while (pos < max && *pos!='[') { + SKIPCOMMENT(pos); + pos++; + } + while(poscharname[i++]=buf; + while(poscharname[i-1])); + while(posname)!=0) + temp=temp->next; + if (temp==NULL) { + temp=InitEncoding(encoding); + if (temp!=NULL) { + temp->next=encodingp; + encodingp=temp; + } + } + return(temp); +} + +void ClearEncoding(void) +{ + struct encoding *temp=encodingp; + + while(temp!=NULL) { + encodingp=encodingp->next; + free(temp); + temp=encodingp; + } +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/font.c b/Build/source/texk/dvipng/dvipng-1.14/font.c new file mode 100644 index 00000000000..2a8b59b9723 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/font.c @@ -0,0 +1,356 @@ +/* font.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +void CheckChecksum(uint32_t c1, uint32_t c2, const char* name) +{ + /* Report a warning if both checksums are nonzero, they don't match, + and the user hasn't turned it off. */ + if (c1 && c2 && c1 != c2 +#ifdef HAVE_LIBKPATHSEA + && !kpse_tex_hush ("checksum") +#endif + ) { + Warning ("checksum mismatch in %s", name) ; + } +} + + +static double ActualFactor(uint32_t unmodsize) +/* compute the actual size factor given the approximation */ +/* actually factor * 1000 */ +{ + double realsize; /* the actual magnification factor */ + realsize = (double)unmodsize / 1000.0; + if (abs((int)(unmodsize - 1095l))<2) + realsize = 1.095445115; /*stephalf*/ + else if (abs((int)(unmodsize - 1315l))<2) + realsize = 1.31453414; /*stepihalf*/ + else if (abs((int)(unmodsize - 1577l))<2) + realsize = 1.57744097; /*stepiihalf*/ + else if (abs((int)(unmodsize - 1893l))<2) + realsize = 1.89292916; /*stepiiihalf*/ + else if (abs((int)(unmodsize - 2074l))<2) + realsize = 2.0736; /*stepiv*/ + else if (abs((int)(unmodsize - 2488l))<2) + realsize = 2.48832; /*stepv*/ + else if (abs((int)(unmodsize - 2986l))<2) + realsize = 2.985984; /*stepvi*/ + /* the remaining magnification steps are represented with sufficient + accuracy already */ + return(realsize); +} + + +void FontDef(unsigned char* command, void* parent) +{ + int32_t k; + uint32_t c, s, d; + uint8_t a, l; + unsigned char* current; + struct font_entry *tfontptr; /* temporary font_entry pointer */ + struct font_num *tfontnump = NULL; /* temporary font_num pointer */ + unsigned short i; + + current = command + 1; + k = UNumRead(current, (int)*command - FNT_DEF1 + 1); + current += (int)*command - FNT_DEF1 + 1; + c = UNumRead(current, 4); /* checksum */ + s = UNumRead(current+4, 4); /* space size */ + d = UNumRead(current+8, 4); /* design size */ + a = UNumRead(current+12, 1); /* length for font name */ + l = UNumRead(current+13, 1); /* device length */ + if (((struct font_entry*)parent)->type==FONT_TYPE_VF) { + DEBUG_PRINT(DEBUG_VF,(" %d %d %d",k,c,s)); + /* Rescale. s is relative to the actual scale /(1<<20) */ + s = (uint32_t)((uint64_t) s * (((struct font_entry*) parent)->s) + / (1<<20)); + DEBUG_PRINT(DEBUG_VF,(" (%d) %d",s,d)); + /* Oddly, d differs in the DVI and the VF that my system produces */ + d = (uint32_t)((uint64_t) d * ((struct font_entry*)parent)->d + / ((struct font_entry*)parent)->designsize); + DEBUG_PRINT(DEBUG_VF,(" (%d)",d)); + DEBUG_PRINT(DEBUG_VF,(" %d %d '%.*s'",a,l,a+l,current+14)); +#ifdef DEBUG + } else { + DEBUG_PRINT(DEBUG_DVI,(" %d %d %d %d %d %d '%.*s'",k,c,s,d,a,l, + a+l,current+14)); +#endif + } + if (a+l > STRSIZE-1) + Fatal("too long font name for font %ld",k); + + /* Find entry with this font number in use */ + switch (((struct font_entry*)parent)->type) { + case FONT_TYPE_VF: + tfontnump = ((struct font_entry*)parent)->vffontnump; + break; + case DVI_TYPE: + tfontnump = ((struct dvi_data*)parent)->fontnump; + } + while (tfontnump != NULL && tfontnump->k != k) { + tfontnump = tfontnump->next; + } + /* If found, return if it is correct */ + if (tfontnump!=NULL + && tfontnump->fontp->s == s + && tfontnump->fontp->d == d + && strlen(tfontnump->fontp->n) == a+l + && strncmp(tfontnump->fontp->n,(char*)current+14,a+l) == 0) { + DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tMatch found",k)); + return; + } + /* If not found, create new */ + if (tfontnump==NULL) { + if ((tfontnump=malloc(sizeof(struct font_num)))==NULL) + Fatal("cannot malloc memory for new font number"); + tfontnump->k=k; + switch (((struct font_entry*)parent)->type) { + case FONT_TYPE_VF: + tfontnump->next=((struct font_entry*)parent)->vffontnump; + ((struct font_entry*)parent)->vffontnump=tfontnump; + break; + case DVI_TYPE: + tfontnump->next=((struct dvi_data*)parent)->fontnump; + ((struct dvi_data*)parent)->fontnump=tfontnump; + } + } + + /* Search font list for possible match */ + tfontptr = hfontptr; + while (tfontptr != NULL + && (tfontptr->s != s + || tfontptr->d != d + || strlen(tfontptr->n) != a+l + || strncmp(tfontptr->n,(char*)current+14,a+l) != 0 ) ) { + tfontptr = tfontptr->next; + } + /* If found, set its number and return */ + if (tfontptr!=NULL) { + DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tMatch found, number set",k)); + tfontnump->fontp = tfontptr; + return; + } + + DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n FONT %d:\tNew entry created",k)); + /* No fitting font found, create new entry. */ + if ((tfontptr = calloc(1,sizeof(struct font_entry))) == NULL) + Fatal("cannot malloc space for font_entry"); + tfontptr->next = hfontptr; + hfontptr = tfontptr; + tfontnump->fontp = tfontptr; +#ifndef WIN32 + tfontptr->fmmap.fd = 0; +#else /* WIN32 */ + tfontptr->fmmap.hFile = INVALID_HANDLE_VALUE; +#endif + tfontptr->c = c; /* checksum */ + tfontptr->s = s; /* space size */ + tfontptr->d = d; /* design size */ + tfontptr->a = a; /* length for font name */ + tfontptr->l = l; /* device length */ + strncpy(tfontptr->n,(char*)current+14,a+l); /* full font name */ + tfontptr->n[a+l] = '\0'; + + tfontptr->name = NULL; + for (i = FIRSTFNTCHAR; i <= LASTFNTCHAR; i++) { + tfontptr->chr[i] = NULL; + } + + tfontptr->dpi = + (uint32_t)((ActualFactor((uint32_t)(1000.0*tfontptr->s + /(double)tfontptr->d+0.5)) + * ActualFactor(dvi->mag) * dpi*shrinkfactor) + 0.5); +#ifdef HAVE_FT2_OR_LIBT1 + tfontptr->psfontmap=NULL; +#endif +} + +#ifdef HAVE_FT2_OR_LIBT1 +static char* kpse_find_t1_or_tt(char* filename) +{ + char* filepath = kpse_find_file(filename, kpse_type1_format, false); +#ifdef HAVE_FT2 + if ((option_flags & USE_FREETYPE) && filepath==NULL) + filepath = kpse_find_file(filename, kpse_truetype_format, false); +#endif + return(filepath); +} +#endif + +static void FontFind(struct font_entry * tfontptr) +{ + kpse_glyph_file_type font_ret; + + /* tfontptr->dpi = kpse_magstep_fix (tfontptr->dpi, resolution, NULL); */ + DEBUG_PRINT(DEBUG_DVI,("\n FIND FONT:\t%s %d",tfontptr->n,tfontptr->dpi)); + + tfontptr->name = kpse_find_vf (tfontptr->n); + if (tfontptr->name!=NULL) + InitVF(tfontptr); +#ifdef HAVE_FT2_OR_LIBT1 + else if (option_flags & (USE_FREETYPE | USE_LIBT1)) { + tfontptr->psfontmap = FindPSFontMap(tfontptr->n); + if (tfontptr->psfontmap!=NULL) + tfontptr->name=kpse_find_t1_or_tt(tfontptr->psfontmap->psfile); + else + tfontptr->name=kpse_find_t1_or_tt(tfontptr->n); + if (tfontptr->name!=NULL) { + char* tfmname=kpse_find_file(tfontptr->n, kpse_tfm_format, false); + if (tfmname!=NULL) { + if (!ReadTFM(tfontptr,tfmname)) { + Warning("unable to read tfm file %s", tfmname); + free(tfontptr->name); + tfontptr->name=NULL; + } else +#ifdef HAVE_FT2 + if ((option_flags & USE_FREETYPE)==0 || !InitFT(tfontptr)) { +#endif +#ifdef HAVE_LIBT1 + if ((option_flags & USE_LIBT1)==0 || !InitT1(tfontptr)) { +#endif + /* if Freetype or T1 loading fails for some reason, fall + back to PK font */ + free(tfontptr->name); + tfontptr->name=NULL; +#ifdef HAVE_LIBT1 + } +#endif +#ifdef HAVE_FT2 + } +#endif + free(tfmname); + } + } + } +#endif /* HAVE_FT2_OR_LIBT1 */ + if (tfontptr->name==NULL) { + tfontptr->name=kpse_find_pk (tfontptr->n, tfontptr->dpi, &font_ret); + if (tfontptr->name!=NULL) { + if (!FILESTRCASEEQ (tfontptr->n, font_ret.name)) { + page_flags |= PAGE_GAVE_WARN; + Warning("font %s not found, using %s at %d dpi instead", + tfontptr->n, font_ret.name, font_ret.dpi); + tfontptr->c = 0; /* no checksum warning */ + } else if (!kpse_bitmap_tolerance ((double)font_ret.dpi, + (double) tfontptr->dpi)) { + page_flags |= PAGE_GAVE_WARN; + Warning("font %s at %d dpi not found, using %d dpi instead", + tfontptr->n, tfontptr->dpi, font_ret.dpi); + } + InitPK(tfontptr); + } else { + page_flags |= PAGE_GAVE_WARN; + Warning("font %s at %d dpi not found, characters will be left blank", + tfontptr->n, tfontptr->dpi); +#ifndef WIN32 + tfontptr->fmmap.fd = 0; +#else /* WIN32 */ + tfontptr->fmmap.hFile = INVALID_HANDLE_VALUE; +#endif + tfontptr->magnification = 0; + tfontptr->designsize = 0; + } + } +} + + +static void DoneFont(struct font_entry *tfontp) +{ + switch (tfontp->type) { + case FONT_TYPE_PK: + DonePK(tfontp); + break; + case FONT_TYPE_VF: + DoneVF(tfontp); + break; +#ifdef HAVE_FT2 + case FONT_TYPE_FT: + DoneFT(tfontp); + break; +#endif +#ifdef HAVE_LIBT1 + case FONT_TYPE_T1: + DoneT1(tfontp); + break; +#endif + } +} + + +void FreeFontNumP(struct font_num *hfontnump) +{ + struct font_num *tmp; + while(hfontnump!=NULL) { + tmp=hfontnump->next; + free(hfontnump); + hfontnump=tmp; + } +} + +void ClearFonts(void) +{ + struct font_entry *tmp; + + while(hfontptr!=NULL) { + tmp=hfontptr->next; + DoneFont(hfontptr); + if (hfontptr->name != NULL) + free(hfontptr->name); + free(hfontptr); + hfontptr=tmp; + } + if (dvi!=NULL) + FreeFontNumP(dvi->fontnump); +} + +/*-->SetFntNum*/ +/**********************************************************************/ +/**************************** SetFntNum *****************************/ +/**********************************************************************/ +void SetFntNum(int32_t k, void* parent /* dvi/vf */) +/* this routine is used to specify the font to be used in printing future + characters */ +{ + struct font_num *tfontnump=NULL; /* temporary font_num pointer */ + + switch (((struct font_entry*)parent)->type) { + case FONT_TYPE_VF: + tfontnump = ((struct font_entry*)parent)->vffontnump; + break; + case DVI_TYPE: + tfontnump = ((struct dvi_data*)parent)->fontnump; + } + while (tfontnump != NULL && tfontnump->k != k) + tfontnump = tfontnump->next; + if (tfontnump == NULL) + Fatal("font %d undefined", k); + + currentfont = tfontnump->fontp; + if (currentfont->name==NULL) + FontFind(currentfont); +} + + diff --git a/Build/source/texk/dvipng/dvipng-1.14/fontmap.c b/Build/source/texk/dvipng/dvipng-1.14/fontmap.c new file mode 100644 index 00000000000..df6c6e43515 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/fontmap.c @@ -0,0 +1,340 @@ +/* fontmap.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +static struct filemmap psfont_mmap; +#ifdef HAVE_FT2 +static struct filemmap ttfont_mmap; +#endif +static struct psfontmap *psfontmap=NULL; + +static char* newword(char** buffer, char* end) +{ + char *word,*pos=*buffer; + + while(posline = copyfrom->line; + newentry->tfmname = copyword(copyfrom->tfmname); + newentry->psfile = copyword(copyfrom->psfile); + newentry->encname = copyword(copyfrom->encname); + newentry->encoding = copyfrom->encoding; +#ifdef HAVE_LIBT1 + newentry->t1_transformp = copyfrom->t1_transformp; +#endif +#ifdef HAVE_FT2 + newentry->ft_transformp = copyfrom->ft_transformp; + newentry->subfont = copyfrom->subfont; +#endif + newentry->end = copyfrom->end; + } else { + newentry->line = NULL; + newentry->tfmname = NULL; + newentry->psfile = NULL; + newentry->encname = NULL; + newentry->encoding = NULL; +#ifdef HAVE_LIBT1 + newentry->t1_transformp = NULL; +#endif +#ifdef HAVE_FT2 + newentry->ft_transformp = NULL; + newentry->subfont = NULL; +#endif + newentry->end = NULL; + } + newentry->next=psfontmap; + psfontmap=newentry; + return(newentry); +} + +static struct psfontmap *SearchPSFontMap(char* fontname, + struct filemmap* search_mmap) +{ + static char *pos=NULL,*end=NULL; + static struct filemmap* searching_mmap=NULL; + struct psfontmap *entry=NULL; + + if (pos==end && search_mmap!=searching_mmap) { + searching_mmap=search_mmap; + pos=searching_mmap->data; + end=searching_mmap->data+searching_mmap->size; + } + while(postfmname,fontname)!=0)) { + while(pos < end + && (*pos=='\r' || *pos=='\n' || *pos==' ' || *pos=='\t' + || *pos=='%' || *pos=='*' || *pos==';' || *pos=='#')) { + while(pos < end && *pos!='\r' && *pos!='\n') pos++; /* skip comments/empty rows */ + pos++; + } + if (pos < end) { + entry=NewPSFont(NULL); + entry->line = pos; + /* skip tfmname = newword(&pos,end); + while(pos < end && *pos!='\r' && *pos!='\n') pos++; + entry->end = pos; + } + pos++; + } + if (entry!=NULL && strcmp(entry->tfmname,fontname)!=0) + entry=NULL; + return(entry); +} + +void ClearPSFontMap(void) +{ + struct psfontmap *entry; + + while(psfontmap!=NULL) { + entry=psfontmap; + psfontmap=psfontmap->next; + free(entry->tfmname); + if (entry->psfile!=NULL) + free(entry->psfile); + if (entry->encname!=NULL) + free(entry->encname); + free(entry); + } + UnMmapFile(&psfont_mmap); +#ifdef HAVE_FT2 + UnMmapFile(&ttfont_mmap); +#endif +} + +static void ReadPSFontMap(struct psfontmap *entry) +{ + char *pos,*end,*psname; + int nameno = 0; + + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\n PSFONTMAP: %s ",entry->tfmname)); + pos=entry->line; + end=entry->end; + while(pos < end) { + if (*pos=='<') { /* filename follows */ + pos++; + if (pospsfile = newword((char**)&pos,end); + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<%s ",entry->psfile)); + } else if (posencname = newword((char**)&pos,end); + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); + } else { /* encname=word; + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); + } else { /* psfile=word; + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<%s ",entry->psfile)); + } + } + } else if (*pos=='"') { /* PS code: reencoding/tranformation exists */ + char *word; + double cxx=1.0,cxy=0.0; + pos++; + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\"")); + while(pos < end && *pos!='"') { + word=newword((char**)&pos,end); + while(pos < end && (*pos==' ' || *pos=='\t')) pos++; + if (pos+10ft_transformp=&(entry->ft_transform); + entry->ft_transform.xx=(FT_Fixed)(cxx*0x10000); + entry->ft_transform.xy=(FT_Fixed)(cxy*0x10000); + entry->ft_transform.yx=0; + entry->ft_transform.yy=0x10000; +#endif +#ifdef HAVE_LIBT1 + entry->t1_transformp=&(entry->t1_transform); + entry->t1_transform.cxx=cxx; + entry->t1_transform.cxy=cxy; + entry->t1_transform.cyx=0.0; + entry->t1_transform.cyy=1.0; +#endif + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("\" ")); + pos++; + } else { /* bare word */ + switch (++nameno) { + case 1: /* first word is tfmname and perhaps psname, NOT psfile */ + while(postfmname; + break; + case 2: /* second word is psname, NOT psfile */ + psname = newword((char**)&pos,end); + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("(%s) ",psname)); + free(psname); + break; + case 3: /* third word is encoding */ + entry->encname = newword((char**)&pos,end); + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),("<[%s ",entry->encname)); + break; + default: + while(pospsfile==NULL) { + /* No psfile-name given, use tfmname */ + entry->psfile=copyword(entry->tfmname); + DEBUG_PRINT((DEBUG_FT|DEBUG_T1),(" <%s ",entry->psfile)); + } + if (entry->encname!=NULL + && (entry->encoding=FindEncoding(entry->encname))==NULL) + Warning("unable to load font encoding '%s' for %s", + entry->encname,entry->tfmname); +} + + +struct psfontmap* FindPSFontMap(char* fontname) +{ + struct psfontmap *entry; + static struct filemmap* search_mmap_p=&psfont_mmap; + + entry=psfontmap; + while(entry!=NULL && strcmp(entry->tfmname,fontname)!=0) + entry=entry->next; + if(entry==NULL) { + entry=SearchPSFontMap(fontname,search_mmap_p); +#ifdef HAVE_FT2 + if(entry==NULL && search_mmap_p!=&ttfont_mmap) { + search_mmap_p=&ttfont_mmap; + entry=SearchPSFontMap(fontname,search_mmap_p); + } + } + if(entry==NULL) { + struct psfontmap* entry_subfont=NULL; + entry=psfontmap; + while(entry!=NULL && strcmp(entry->tfmname,fontname)!=0) { + while(entry!=NULL && strchr(entry->tfmname,'@')==NULL) + entry=entry->next; + if (entry!=NULL) { + entry_subfont=FindSubFont(entry,fontname); + if (entry_subfont!=NULL) + entry=entry_subfont; + else + entry=entry->next; + } + } +#endif + } + if (entry!=NULL && entry->psfile==NULL) + ReadPSFontMap(entry); + if (entry!=NULL && entry->encname!=NULL && entry->encoding==NULL) + /* Encoding given but it cannot be found. Unusable font */ + return(NULL); + return(entry); +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/ft.c b/Build/source/texk/dvipng/dvipng-1.14/ft.c new file mode 100644 index 00000000000..fdb8a89489c --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/ft.c @@ -0,0 +1,173 @@ +/* ft.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2009 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +void LoadFT(int32_t c, struct char_entry * ptr) +{ + FT_Bitmap bitmap; + FT_UInt glyph_i; + int i,j,k; + unsigned char* bit; + + DEBUG_PRINT(DEBUG_FT,("\n LOAD FT CHAR\t%d (%d)",c,ptr->tfmw)); + if (currentfont->psfontmap!=NULL + && currentfont->psfontmap->encoding != NULL) { + DEBUG_PRINT(DEBUG_FT,(" %s",currentfont->psfontmap->encoding->charname[c])); + glyph_i = FT_Get_Name_Index(currentfont->face, + currentfont->psfontmap->encoding->charname[c]); + } else if (currentfont->psfontmap!=NULL + && currentfont->psfontmap->subfont != NULL) { + glyph_i = FT_Get_Char_Index( currentfont->face, + currentfont->psfontmap->subfont->charindex[c] ); + DEBUG_PRINT(DEBUG_FT,(" 0x%X",currentfont->psfontmap->subfont->charindex[c])); + } else + glyph_i = FT_Get_Char_Index( currentfont->face, c ); + if (FT_Load_Glyph( currentfont->face, glyph_i, + FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT ) + /* On some configurations (with FreeType <= 2.1.7) the above + fails, while the below works */ + && FT_Load_Glyph( currentfont->face, glyph_i, + FT_LOAD_RENDER | FT_LOAD_NO_HINTING )) + Fatal("cannot load FT char %d",c); + ptr->xOffset = -currentfont->face->glyph->bitmap_left*shrinkfactor; + ptr->yOffset = (currentfont->face->glyph->bitmap_top-1)*shrinkfactor; + bitmap=currentfont->face->glyph->bitmap; + DEBUG_PRINT(DEBUG_FT,(" (%dx%d)",bitmap.width,bitmap.rows)); + + if ((ptr->data = calloc(bitmap.width*bitmap.rows,sizeof(char))) == NULL) + Fatal("unable to malloc image space for char %c", (char)c); + ptr->w = bitmap.width; + ptr->h = bitmap.rows; + +#define GREYLEVELS 16 + DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); + bit=ptr->data; + for(i=0;i0 ? k*16-1 : 0; */ + DEBUG_PRINT(DEBUG_GLYPH,("%3u ",k)); + bit[i*bitmap.width+j]=k; + } + DEBUG_PRINT(DEBUG_GLYPH,("|\n")); + } +} + +bool InitFT(struct font_entry * tfontp) +{ + int error; + + if (libfreetype==NULL) { + if (FT_Init_FreeType( &libfreetype )) { + Warning("an error occured during freetype initialisation, disabling it"); + option_flags &= ~USE_FREETYPE; + return(false); + } +# ifdef DEBUG + else { + FT_Int amajor, aminor, apatch; + + DEBUG_PRINT(DEBUG_FT,("\n COMPILED WITH FREETYPE %d.%d.%d", + FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH)); +# ifdef HAVE_FT_LIBRARY_VERSION + FT_Library_Version( libfreetype, &amajor, &aminor, &apatch ); + DEBUG_PRINT(DEBUG_FT,("\n USING LIBFT %d.%d.%d", + amajor, aminor, apatch)); +# endif + } +# endif + } + DEBUG_PRINT((DEBUG_DVI|DEBUG_FT),("\n OPEN FT FONT:\t'%s'", tfontp->name)); + error = FT_New_Face( libfreetype, tfontp->name, 0, &tfontp->face ); + if (error == FT_Err_Unknown_File_Format) { + Warning("font file %s has unknown format", tfontp->name); + return(false); + } else if (error) { + Warning("font file %s could not be opened", tfontp->name); + return(false); + } + Message(BE_VERBOSE,"<%s>", tfontp->name); + if (tfontp->psfontmap != NULL && tfontp->psfontmap->subfont != NULL) + error=FT_Select_Charmap(tfontp->face, tfontp->psfontmap->subfont->encoding); + else if (tfontp->psfontmap == NULL || tfontp->psfontmap->encoding == NULL) +#ifndef FT_ENCODING_ADOBE_CUSTOM +# define FT_ENCODING_ADOBE_CUSTOM ft_encoding_adobe_custom +# define FT_ENCODING_ADOBE_STANDARD ft_encoding_adobe_standard +#endif + error=FT_Select_Charmap(tfontp->face, FT_ENCODING_ADOBE_CUSTOM); + if (error) { + Warning("unable to set font encoding for %s", tfontp->name); + if(FT_Select_Charmap( tfontp->face, FT_ENCODING_ADOBE_STANDARD )) { + Warning("unable to set fallback font encoding for %s", tfontp->name); + return(false); + } + } + if (FT_Set_Char_Size( tfontp->face, /* handle to face object */ + 0, /* char_width in 1/64th of points */ + ((int64_t)tfontp->d*64*7200)/7227/65536, + /* char_height in 1/64th of _big_points, + not TeX points */ + tfontp->dpi/shrinkfactor, /* horizontal resolution */ + tfontp->dpi/shrinkfactor )) /* vertical resolution */ { + Warning("unable to set font size for %s", tfontp->name); + return(false); + } + if (tfontp->psfontmap!=NULL) + FT_Set_Transform(tfontp->face, tfontp->psfontmap->ft_transformp, NULL); + tfontp->type = FONT_TYPE_FT; + return(true); +} + + +static void UnLoadFT(struct char_entry *ptr) +{ + if (ptr->data!=NULL) + free(ptr->data); + ptr->data=NULL; +} + + +void DoneFT(struct font_entry *tfontp) +{ + int c=0; + + int error = FT_Done_Face( tfontp->face ); + if (error) + Warning("font file %s could not be closed", tfontp->name); + while(cchr[c]!=NULL) { + UnLoadFT((struct char_entry*)tfontp->chr[c]); + free(tfontp->chr[c]); + tfontp->chr[c]=NULL; + } + c++; + } + if (tfontp->name!=NULL) + free(tfontp->name); + tfontp->name=NULL; +} + + diff --git a/Build/source/texk/dvipng/dvipng-1.14/install.texi b/Build/source/texk/dvipng/dvipng-1.14/install.texi new file mode 100644 index 00000000000..c58f9af6013 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/install.texi @@ -0,0 +1,203 @@ +@c install.texi +@c +@c Part of the dvipng distribution + +@include macros.texi +@ifset rawfile +@chapter Installing dvipng + +@end ifset +@c ----------------------- +Installing dvipng should be simple: merely @code{./configure}, +@code{make}, and @code{make install}. + +@ifclear rawfile +@menu +* Prerequisites:: +* Configure:: +* Build/install:: +* Installation outside the texmf tree:: +* Advice for non-privileged users:: +@end menu +@end ifclear + +@node Prerequisites +@section Prerequisites + +@itemize @bullet +@item The GD Graphics Draw library, libgd + +The drawing library @samp{libgd} is necessary, and is downloadable at +@uref{http://www.boutell.com/gd}, and there are binary packages for +most operating systems from their respective distributors. In any +case, the latest version of the library installs using @samp{autoconf} +so it should not be difficult for you to install it from source, and +then proceed with installing dvipng. + +@item The path-searching library kpathsea + +Kpathsea is most likely included in your @LaTeX{} installation, but it +may happen that ./configure does not find it; see below. If you do not +have it, download it from @uref{http://www.ctan.org} and compile it. +I have no experience with this, so I cannot help much here. + +@item The font-rendering library FreeType 2 + +While not strictly necessary, a recent FreeType 2 is recommended since +dvipng currently will produce better-quality images when this library is +available. To take advantage of this, you should have at least FreeType +2.1.9. + +FreeType 2 will enable direct support for PostScript and TrueType fonts, +so that dvipng will not need to generate bitmapped variants on disk of +the @TeX{} fonts since modern @TeX{} distributions include PostScript +versions of them. Then, you can render images at different (and unusual) +resolutions without cluttering the disk with lots of bitmapped fonts. + +Finally, it will enable subfont support in dvipng. That is, if you want +to render CJK-@LaTeX{} characters, you must have FreeType 2 installed. + +@item The font-rendering library T1lib + +An alternative to FreeType 2 is T1lib, but this will enable only +PostScript fonts in dvipng and will not include subfont support. Also +here, you can render images at different (and unusual) resolutions +without cluttering the disk with lots of bitmapped fonts. If both +FreeType 2 and T1lib are present, FreeType will be internally +preferred by dvipng but T1lib can be chosen at runtime. + +@item libpng and libz + +To be able to compress and write PNG files to disk, dvipng (or really +libgd) uses libpng which in turn uses libz. These should be available on +any modern system, if not, download them and install them. + +@item The @code{texinfo} package + +This is needed for building the documentation. +@end itemize + +@node Configure +@section Configure + +The first step is to configure the source code, telling it where +various files will be. To do so, run + +@example +./configure @var{options} +@end example + +(Note: if you have fetched dvipng from CVS rather than a regular +release, you will have to first generate @file{./configure} by running +@code{autoconf} 2.53 or later.) + +On many machines, you will not need to specify any options, but if +@code{configure} cannot determine something on its own, you'll need to +help it out. For a list of the options type + +@example +./configure --help +@end example + +On some machines, the libraries will be installed in directories that +are not in the linker's search path. This will generate an error when +running @file{./configure}, indicating that it cannot find libgd or +libkpathsea (most likely). You then need to specify the path to the +respective library's object files. They are typically called e.g., +@file{libgd.a} or @file{libgd.so}. If they are located in e.g., +@file{/sw/local/lib}, do + +@example +./configure LDFLAGS=-L/sw/local/lib +@end example + +If the library is available as a shared object file (@file{.so}), the +runtime linker may also need to be told where to find the library, +then use + +@example +./configure LDFLAGS='-L/sw/local/lib -R/sw/local/lib' +@end example + +When either of these is necessary, it is likely that the C header +files are also installed in directories that are not in the C +preprocessor's search path. This will also generate an error when +running @file{./configure}, indicating that it cannot find e.g., +@file{gd.h} or @file{kpathsea.h} (most likely). You then need to +specify the path to the respective library's C header files. If they +are located in e.g., @file{/sw/local/include}, do + +@example +./configure CPPFLAGS=-I/sw/local/include +@end example + +On my SUN Solaris workstation, I had to combine this into + +@example +./configure CPPFLAGS='-I/sw/local/include -I/sw/tex/teTeX/1.0/include'\ + LDFLAGS='-L/sw/local/lib -R/sw/local/lib -L/sw/tex/teTeX/1.0/lib/' +@end example + +@noindent +where the backslash denotes a continuation of the line. + +@node Build/install +@section Build/install + +Once @file{configure} has been run, simply enter + +@example +make +@end example + +@noindent +at the prompt to compile the C code, and build the documentation files. +To install the files into the locations chosen earlier, type + +@example +make install +@end example + +@noindent +You may need special privileges to install, e.g., if you are installing +into system directories. + +@node Installation outside the texmf tree +@section Installation outside the texmf tree + +In some cases, a dvipng binary installed outside the texmf tree will +not be able to find virtual fonts, or the PostScript font maps +(normally used by dvips). This may be because @emph{only} +$SELFAUTOLOC, $SELFAUTODIR, and $SELFAUTOPARENT are used in the texmf +tree configuration file @samp{texmf.cnf}. If so, give the switch +@samp{--enable-selfauto-set} to @samp{./configure}. This will make +dvipng adjust these three internally so that kpathsea thinks that +dvipng @emph{is} installed in the texmf tree. + +@node Advice for non-privileged users +@section Installation for non-privileged users + +Often people without system administration privileges want to install +software for their private use. In that case you need to specify more +options to the @file{configure} script, usually this is done by using +the @samp{--prefix} option to the @file{configure} script, and let it +point to the personal home directory. In that way, resulting binaries +will be installed under the @file{bin} subdirectory of your home +directory, manual pages under @file{man} and so on. That way, it is +reasonably easy to maintain a bunch of additional packages, since the +prefix argument is supported by most @file{configure} scripts. + +You'll have to add something like @file{/home/myself/bin} to your +@code{PATH} shell variable, if it isn't there already, and similarly +set the @code{INFOPATH} and @code{MANPATH} variables to be able to +access the documentation. + +@ifset rawfile +@section Copying + +This program is released under the GNU Lesser General Public License +version 3, see the COPYING file in the dvipng distribution or +@url{http://www.gnu.org/licenses/}. + +Copyright @copyright{} 2002-2009 Jan-@AA{}ke Larsson +@end ifset diff --git a/Build/source/texk/dvipng/dvipng-1.14/macros.texi b/Build/source/texk/dvipng/dvipng-1.14/macros.texi new file mode 100644 index 00000000000..3c90a59eb15 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/macros.texi @@ -0,0 +1,61 @@ +@ignore +macros.texi + +Part of the dvipng distribution + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this program. If not, see +. + +Copyright @copyright{} 2002-2008 Jan-@AA{}ke Larsson +@end ignore + +@ifclear macros +@set macros +@macro AUCTeX {} +AUC@TeX{} +@end macro +@ifnottex +@macro LaTeX {} +La@TeX{} +@end macro +@macro previewlatex {} +preview-latex +@end macro +@ifset no-acronym +@clear no-acronym +@macro acronym {text} +@sc{\text\} +@end macro +@end ifset +@ifset no-env +@clear no-env +@macro env {text} +@code{\text\} +@end macro +@end ifset +@ifset no-option +@clear no-option +@macro option {text} +@samp{\text\} +@end macro +@end ifset +@end ifnottex +@tex +\gdef\LaTeX{L\kern-.36em\raise.3ex\hbox{\sc{a}}\kern-.15em\TeX} +\gdef\previewlatex{Preview-\LaTeX} +\ifx\acronym\undefined \gdef\acronym#1{{\smallcaps \lowercase{#1}}} \fi +\ifx\env\undefined \global\let\env=\code \fi +\ifx\option\undefined \global\let\option=\samp \fi +@end tex +@end ifclear diff --git a/Build/source/texk/dvipng/dvipng-1.14/miktex.h b/Build/source/texk/dvipng/dvipng-1.14/miktex.h new file mode 100644 index 00000000000..c949cd1aff6 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/miktex.h @@ -0,0 +1,272 @@ +/* config.h. Edited for MiKTeX. */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2008 Jan-Åke Larsson + +************************************************************************/ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define as 1 to get the debug (-d) option. */ +#define DEBUG 1 + +/* The environment setting for $SELFAUTODIR */ +#undef ENV_SELFAUTODIR + +/* The environment setting for $SELFAUTOLOC */ +#undef ENV_SELFAUTOLOC + +/* The environment setting for $SELFAUTOPARENT */ +#undef ENV_SELFAUTOPARENT + +/* Define as the path to GhostScript. */ +#undef GS_PATH + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the `dup2' function. */ +#undef HAVE_DUP2 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + +/* Define to 1 if you have freetype2 */ +#undef HAVE_FT2 + +/* Define to 1 if you have the `ftime' function. */ +#undef HAVE_FTIME + +/* Define to 1 if you have the `FT_Library_Version' function. */ +#undef HAVE_FT_LIBRARY_VERSION + +/* Define to 1 if you have the `gdImageAlphaBlending' function. */ +#undef HAVE_GDIMAGEALPHABLENDING + +/* Define to 1 if you have the `gdImageColorResolveAlpha' function. */ +#undef HAVE_GDIMAGECOLORRESOLVEALPHA + +/* Define to 1 if you have the `gdImageCreateTrueColor' function. */ +#define HAVE_GDIMAGECREATETRUECOLOR 1 + +/* Define to 1 if you have the `gdImageGif' function. */ +#undef HAVE_GDIMAGEGIF + +/* Define to 1 if you have the `gdImagePngEx' function. */ +#define HAVE_GDIMAGEPNGEX 1 + +/* Define to 1 if you have the `gdImageTrueColorToPalette' function. */ +#define HAVE_GDIMAGETRUECOLORTOPALETTE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GD_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_KPATHSEA_KPATHSEA_H 1 + +/* Define to 1 if your kpathsea has kpse_enc_format */ +#define HAVE_KPSE_ENC_FORMATS 1 + +/* Define to 1 if you have the `gd' library (-lgd). */ +#define HAVE_LIBGD 1 + +/* Define to 1 if you have the `gen' library (-lgen). */ +#undef HAVE_LIBGEN + +/* Define to 1 if you have the `kpathsea' library (-lkpathsea). */ +#define HAVE_LIBKPATHSEA 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the `png' library (-lpng). */ +#define HAVE_LIBPNG 1 + +/* Define to 1 if you have the `t1' library (-lt1). */ +#undef HAVE_LIBT1 + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the `munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the header file. */ +#define HAVE_PNG_H 1 + +/* Define to 1 if you have the `pow' function. */ +#undef HAVE_POW + +/* Define to 1 if you have the `putenv' function. */ +#undef HAVE_PUTENV + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_T1LIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the header file. */ +#undef HAVE_VFORK_H + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if `fork' works. */ +#undef HAVE_WORKING_FORK + +/* Define to 1 if `vfork' works. */ +#undef HAVE_WORKING_VFORK + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "dvipng@nongnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "dvipng" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "dvipng 1.7" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "dvipng" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.7" + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define as 1 to get execution time output. */ +#undef TIMING + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `long long' if does not define it. */ +#undef int64_t + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned' if does not define. */ +#undef size_t + +/* Define to `unsigned long long' if does not define it. */ +#undef uint64_t + +/* Define as `fork' if `vfork' does not work. */ +#undef vfork diff --git a/Build/source/texk/dvipng/dvipng-1.14/miktex.mak b/Build/source/texk/dvipng/dvipng-1.14/miktex.mak new file mode 100644 index 00000000000..b291ba67207 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/miktex.mak @@ -0,0 +1,196 @@ +## miktex.mak: dvipng +## +## Copyright (C) 2004 Christian Schenk +## +## This file is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published +## by the Free Software Foundation; either version 2, or (at your +## option) any later version. +## +## This file is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this file; if not, write to the Free Software +## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +## 02110-1301 USA. + +miktex_cc_no_warnings = 1 +miktex_cc_disable_optimization = 1 + +!include ..\miktex.inc + +objects = \ + $(outdir)\color.obj \ + $(outdir)\draw.obj \ + $(outdir)\dvi.obj \ + $(outdir)\dvipng.obj \ + $(outdir)\font.obj \ + $(outdir)\misc.obj \ + $(outdir)\papersiz.obj \ + $(outdir)\pk.obj \ + $(outdir)\ppagelist.obj \ + $(outdir)\set.obj \ + $(outdir)\special.obj \ + $(outdir)\vf.obj \ + $(wrapper_obj) \ + +sources = \ + color.c \ + draw.c \ + dvi.c \ + dvipng.c \ + font.c \ + misc.c \ + papersiz.c \ + pk.c \ + ppagelist.c \ + set.c \ + special.c \ + vf.c \ + +extra_cdefines = \ + -Dalloca=_alloca \ + -DUSE_MIKTEX_EXIT \ + +extra_cincludes = \ + -I$(gdlibdir) \ + -I$(kpslibdir) \ + +.c{$(outdir)\}.obj: + $(cc) $(cstandard) \ + $(extra_cdefines) \ + $(extra_cincludes) \ + $(ccopt_output_directory)$(outdir)\ $< + +binaries = $(outdir)\dvipng.exe + +all: common-all $(binaries) + +install: common-install install-binaries + +qrt: common-qrt + +# ----------------------------------------------------------------------------- +# dvipng +# ----------------------------------------------------------------------------- + +libs = \ + $(miktex_lib) \ + $(gd_lib) \ + $(kps_lib) \ + $(gnu_lib) \ + $(texmf_lib) \ + +$(outdir)\dvipng.exe: \ + $(outdir) \ + $(objects) \ + $(libs) \ + $(outdir)\dvipng.res \ + + $(link) $(lstandard) \ + -out:$@ \ + $(objects) \ + $(libs) \ + $(outdir)\dvipng.res \ + +$(outdir)\dvipng.res: \ + $(libdir)\miktex-version.h \ + $(outdir) \ + dvipng-version.h \ + dvipng.rc \ + + $(rc) $(rcstandard) $(rcopt_output_file)$@ dvipng.rc + +# ----------------------------------------------------------------------------- +# clean-up +# ----------------------------------------------------------------------------- + +mostlyclean: common-mostlyclean + +clean: common-clean mostlyclean + +distclean: common-distclean clean + +realclean: common-realclean distclean + +# ----------------------------------------------------------------------------- +# dependencies +# ----------------------------------------------------------------------------- + +!include ..\common-dependencies.inc + +depend: $(sources) + $(MAKEDEPEND1) $(extra_cincludes) $(extra_cdefines) $(sources) + +# DO NOT DELETE + +$(outdir)\color.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\color.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\color.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\color.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\color.obj: ..\lib\miktex-features.h commands.h +$(outdir)\draw.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\draw.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\draw.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\draw.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\draw.obj: ..\lib\miktex-features.h commands.h +$(outdir)\dvi.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\dvi.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\dvi.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\dvi.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\dvi.obj: ..\lib\miktex-features.h commands.h ..\libgnu\gnu-miktex.h +$(outdir)\dvipng.obj: dvipng.h config.h .\inttypes.h +$(outdir)\dvipng.obj: $(gdlibdir)\gd.h $(gdlibdir)\gd_io.h +$(outdir)\dvipng.obj: $(gdlibdir)\gdfx.h +$(outdir)\dvipng.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\dvipng.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\dvipng.obj: ..\lib\miktex-features.h commands.h +$(outdir)\font.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\font.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\font.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\font.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\font.obj: ..\lib\miktex-features.h commands.h +$(outdir)\misc.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\misc.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\misc.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\misc.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\misc.obj: ..\lib\miktex-features.h commands.h +$(outdir)\misc.obj: ..\libgnu\gnu-miktex.h +$(outdir)\papersiz.obj: dvipng.h config.h .\inttypes.h +$(outdir)\papersiz.obj: $(gdlibdir)\gd.h +$(outdir)\papersiz.obj: $(gdlibdir)\gd_io.h +$(outdir)\papersiz.obj: $(gdlibdir)\gdfx.h +$(outdir)\papersiz.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\papersiz.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\papersiz.obj: ..\lib\miktex-features.h commands.h +$(outdir)\pk.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\pk.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\pk.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\pk.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\pk.obj: ..\lib\miktex-features.h commands.h +$(outdir)\ppagelist.obj: dvipng.h config.h .\inttypes.h +$(outdir)\ppagelist.obj: $(gdlibdir)\gd.h +$(outdir)\ppagelist.obj: $(gdlibdir)\gd_io.h +$(outdir)\ppagelist.obj: $(gdlibdir)\gdfx.h +$(outdir)\ppagelist.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\ppagelist.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\ppagelist.obj: ..\lib\miktex-features.h commands.h +$(outdir)\set.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\set.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\set.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\set.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\set.obj: ..\lib\miktex-features.h commands.h +$(outdir)\special.obj: dvipng.h config.h .\inttypes.h +$(outdir)\special.obj: $(gdlibdir)\gd.h $(gdlibdir)\gd_io.h +$(outdir)\special.obj: $(gdlibdir)\gdfx.h +$(outdir)\special.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\special.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\special.obj: ..\lib\miktex-features.h commands.h +$(outdir)\vf.obj: dvipng.h config.h .\inttypes.h $(gdlibdir)\gd.h +$(outdir)\vf.obj: $(gdlibdir)\gd_io.h $(gdlibdir)\gdfx.h +$(outdir)\vf.obj: $(kpslibdir)\kpathsea\kpathsea.h +$(outdir)\vf.obj: $(kpslibdir)\web2c-miktex.h ..\lib\miktex.h +$(outdir)\vf.obj: ..\lib\miktex-features.h commands.h diff --git a/Build/source/texk/dvipng/dvipng-1.14/misc.c b/Build/source/texk/dvipng/dvipng-1.14/misc.c new file mode 100644 index 00000000000..aaf5f20f823 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/misc.c @@ -0,0 +1,867 @@ +/* misc.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" +#ifdef HAVE_LIBGEN_H +# include +#else +#define basename xbasename +#endif +#include /* open/close */ +#ifdef HAVE_MMAP +#include +#endif +#include + +static char *programname; + +/*-->DecodeArgs*/ +/*********************************************************************/ +/***************************** DecodeArgs ****************************/ +/*********************************************************************/ +bool DecodeArgs(int argc, char ** argv) +{ + int i; /* argument index for options */ + bool ppused=false; /* Flag when -pp is used */ + int32_t number; /* Temporary storage for numeric parameter */ + char *dviname=NULL; /* Name of dvi file */ + char *outname=NULL; /* Name of output file */ + + if (argv[0]) { +#ifdef HAVE_GDIMAGEGIF + programname=strrchr(argv[0],'/'); + if (programname!=NULL) + programname++; + else + programname=argv[0]; + if (strncmp(programname,"dvigif",6)==0) + option_flags |= GIF_OUTPUT; +#endif + programname=argv[0]; + Message(BE_NONQUIET,"This is %s",programname); + if (strcmp(basename(programname),PACKAGE_NAME)!=0) + Message(BE_NONQUIET," (%s)", PACKAGE_NAME); + Message(BE_NONQUIET," %s Copyright 2002-2010 Jan-Ake Larsson\n", + PACKAGE_VERSION); + } + + for (i=1; i'9' && *p!='-') { + if (strncmp(p,"vinum",5)==0) { + if (p[5] != '0') { + option_flags |= DVI_PAGENUM; + Message(PARSE_STDIN,"DVI page number output on\n",p); + } else { + option_flags &= ~DVI_PAGENUM; + Message(PARSE_STDIN,"DVI page number output off\n"); + } + break; + } else if (strncmp(p,"epth",4)==0) { /* Depth reporting */ + if (p[4] != '0') { + option_flags |= REPORT_DEPTH; + Message(PARSE_STDIN,"Depth reporting on\n",p); + } else { + option_flags &= ~REPORT_DEPTH; + Message(PARSE_STDIN,"Depth reporting off\n"); + } + break; + } + goto DEFAULT; + } else { +#ifdef DEBUG + if (*p == 0 && argv[i+1]) + p = argv[i+1]; + debug = atoi(p); + if (debug > 0) { + if (p == argv[i+1]) i++; + } else + debug = DEBUG_DEFAULT; + Message(PARSE_STDIN,"Debug output enabled\n"); +#ifdef HAVE_LIBKPATHSEA + kpathsea_debug = debug / LASTDEBUG / 2 ; +#endif +#else + Warning("This instance of %s was compiled without the debug (-d) option", + programname); +#endif + break; + } + case 'o': /* Output file is specified */ + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + outname=p; + /* remove .png extension */ + Message(PARSE_STDIN,"Output file: %s\n", + outname); + break; +#ifdef MAKETEXPK + case 'M': + /* -M, -M1 => don't make font; -M0 => do. */ + makeTexPK = (*p == '0'); +#ifdef HAVE_LIBKPATHSEA + kpse_set_program_enabled (kpse_pk_format, makeTexPK, kpse_src_cmdline); +#endif + if (makeTexPK) + Message(PARSE_STDIN,"MakeTeXPK enabled\n"); + else + Message(PARSE_STDIN,"MakeTeXPK disabled\n"); + break; +#endif /* MAKETEXPK */ + case 'm': + if (strcmp(p,"ode") == 0 ) { + if (argv[i+1]) + user_mfmode = argv[++i] ; + Message(PARSE_STDIN,"MetaFont mode: %s\n",user_mfmode); + break; + } + goto DEFAULT; + case 'h': + if (strcmp(p,"elp") == 0 ) { + break; + } else if (strncmp(p,"eight",5) == 0 ) { /* Height reporting */ + if (p[5] != '0') { + option_flags |= REPORT_HEIGHT; + Message(PARSE_STDIN,"Height reporting on\n",p); + } else { + option_flags &= ~REPORT_HEIGHT; + Message(PARSE_STDIN,"Height reporting off\n"); + } + break; + } + goto DEFAULT; + case 'O' : /* Offset */ + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + handlepapersize(p, &x_offset_def, &y_offset_def) ; + Message(PARSE_STDIN,"Offset: (%d,%d)\n",x_offset_def,y_offset_def); + break ; + case 'e': + if (strncmp(p,"xpand-bbox",10) == 0 ) { + if (p[10] != '0') { + option_flags |= EXPAND_BBOX; + Message(PARSE_STDIN,"BBox expansion on\n",p); + } else { + option_flags &= ~EXPAND_BBOX; + Message(PARSE_STDIN,"BBox expansion off\n"); + } + break; + } + goto DEFAULT; + case 'T' : + if (*p == 0 && argv[i+1]) + p = argv[++i]; + if (strcmp(p,"bbox")==0) { + x_width_def=0; + y_width_def=0; + Message(PARSE_STDIN,"Pagesize: (bbox)\n"); + } else if (strcmp(p,"tight")==0) { + x_width_def=-1; + y_width_def=-1; + Message(PARSE_STDIN,"Pagesize: (tight bbox)\n"); + } else { + handlepapersize(p, &x_width_def, &y_width_def) ; + Message(PARSE_STDIN,"Pagesize: (%d,%d)\n", + x_width_def,y_width_def); + } + break ; + case 't': /* specify paper format, only for cropmarks */ +#ifdef HAVE_GDIMAGECREATETRUECOLOR + /* Truecolor */ + if (strncmp(p,"ruecolor",8)==0) { + if (p[8] != '0') { + option_flags |= FORCE_TRUECOLOR; + Message(PARSE_STDIN,"Truecolor mode on\n",p); + } else { + option_flags &= ~FORCE_TRUECOLOR; + Message(PARSE_STDIN,"Truecolor mode off\n"); + } + } else +#endif +#ifdef HAVE_LIBT1 + if ( strncmp(p,"1lib",4) == 0 ) { /* -t1lib activation */ + if (p[4] != '0') { + option_flags |= USE_LIBT1; + Message(PARSE_STDIN,"t1lib rendering on\n",p); + } else { + option_flags &= ~USE_LIBT1; + Message(PARSE_STDIN,"t1lib rendering off\n"); + } + } else +#endif + + { /* cropmarks not implemented yet */ + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + if (strcmp(p,"a4")==0) { + handlepapersize("210mm,297mm",&x_pwidth,&y_pwidth); + } else if (strcmp(p,"letter")==0) { + handlepapersize("8.5in,11in",&x_pwidth,&y_pwidth); + } else if (strcmp(p,"legal")==0) { + handlepapersize("8.5in,14in",&x_pwidth,&y_pwidth); + } else if (strcmp(p,"executive")==0) { + handlepapersize("7.25in,10.5in",&x_pwidth,&y_pwidth); + } else + Fatal("papersize %s is not implemented",p); + Message(PARSE_STDIN,"Papersize: %s\n",p); + } + break; +/* case 'c': */ +/* if (strncmp(p,"acheimages",10)==0) { */ +/* if (p[10] != '0') { */ +/* option_flags |= CACHE_IMAGES; */ +/* Message(PARSE_STDIN,"Caching images\n",p); */ +/* } else { */ +/* option_flags &= ~CACHE_IMAGES; */ +/* Message(PARSE_STDIN,"Not caching images\n"); */ +/* } */ +/* break; */ +/* } */ +/* goto DEFAULT; */ + case 'b': + if ( *p == 'g' ) { /* -bg background color */ + p++; + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + if (strncmp(p,"Transparent",11) == 0 ) + option_flags |= BG_TRANSPARENT_ALPHA; + else if (strncmp(p,"transparent",11) == 0 ) + option_flags |= BG_TRANSPARENT; + else + background(p); + if (option_flags & BG_TRANSPARENT) + Message(PARSE_STDIN,"Transp. background (fallback rgb %d,%d,%d)\n", + cstack[0].red,cstack[0].green,cstack[0].blue); + else + Message(PARSE_STDIN,"Background: rgb %d,%d,%d\n", + cstack[0].red,cstack[0].green,cstack[0].blue); + break; + } else if (strcmp(p, "dpi")==0) { + p+=3; + if (*p == 0 && argv[i+1]) + p = argv[++i]; + number = atoi(p); + if (number < 10 || number > 10000) + Warning("Bad --bdpi parameter, ignored"); + else { + user_bdpi=number; + Message(PARSE_STDIN,"Bdpi: %d\n",user_bdpi); + } + break; + } else if ( *p == 'd' ) { /* -bd border width */ + int tmpi; + char* tmps; + p++; + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + tmpi = strtol(p, &tmps, 10); + if (p 1000000) + Warning("Bad magnification parameter (-x or -y), ignored"); + else { + usermag=number; + Message(PARSE_STDIN,"Magstep: %d\n",usermag); + /*overridemag = (c == 'x' ? 1 : -1) ;*/ + } + break ; + case 'g' : + if (strncmp(p,"amma",4)==0) { /* --gamma correction */ + double gamma=0.0; + + p+=4; + if (*p == 0 && argv[i+1]) + p = argv[++i]; + if (p!=NULL) + gamma=atof(p); + if (gamma==0.0) { + Warning("Bad gamma value, default is %f",DEFAULT_GAMMA); + gamma=DEFAULT_GAMMA; + } + Gamma(gamma); + Message(PARSE_STDIN,"Gamma value is %s\n", gamma); + break; +#ifdef HAVE_GDIMAGEGIF + } else if (strncmp(p,"if",2)==0) { /* --gif output */ + option_flags |= GIF_OUTPUT; + Message(PARSE_STDIN,"GIF output\n"); + break; +#endif + } + goto DEFAULT; + case 'p' : + if (*p == 'p') { /* a -pp specifier for a page list */ + ppused=true; + p++ ; + if (*p == 0 && argv[i+1]) + p = argv[++i]; + Message(PARSE_STDIN,"Page list: %s\n",p); + if (ParsePages(p)) + Fatal("bad page list specifier (-pp)"); + } else if (strncmp(p,"ng",2)==0) { /* --png output */ + option_flags &= ~GIF_OUTPUT; + Message(PARSE_STDIN,"PNG output\n"); + } else if (strncmp(p,"icky",4)==0) { + if (p[4] != '0') { + option_flags |= MODE_PICKY; + Message(PARSE_STDIN,"No images output for pages with warnings\n",p); + } else { + option_flags &= ~MODE_PICKY; + Message(PARSE_STDIN,"Images output even for pages with warnings\n"); + } + } else if (strncmp(p,"alette",6)==0) { + if (p[6] != '0') { + option_flags |= FORCE_PALETTE; + Message(PARSE_STDIN,"Forcing 256-color PNG output\n",p); + } else { + option_flags &= ~FORCE_PALETTE; + Message(PARSE_STDIN,"Allows truecolor PNG output\n"); + } + } else { /* a -p specifier for first page */ + int32_t firstpage; + bool abspage=false; + + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + if (*p == '=') { + abspage=true; + p++ ; + } + if ((*p>='0'&&*p<='9') || (*p=='-' && *(p+1)>='0' && *(p+1)<='9')) { + firstpage = atoi(p); + FirstPage(firstpage,abspage); + Message(PARSE_STDIN,"First page: %d\n",firstpage); + } else + Warning("Bad firstpage (-p) parameter, ignored"); + } + break ; + case 's' : + if (strncmp(p,"trict",5)==0) { + if (p[5] != '0') { + option_flags |= MODE_STRICT; + Message(PARSE_STDIN,"Warnings are fatal\n",p); + } else { + option_flags &= ~MODE_STRICT; + Message(PARSE_STDIN,"Warnings are not fatal\n"); + } + } else + goto DEFAULT; + break ; + case 'n' : + if (strncmp(p,"oghostscript",12)==0) { + if (p[12] != '0') { + option_flags |= NO_GHOSTSCRIPT; + Message(PARSE_STDIN,"No GhostScript calls\n",p); + } else { + option_flags &= ~NO_GHOSTSCRIPT; + Message(PARSE_STDIN,"GhostScript calls made\n"); + } + } else if (strncmp(p,"ogssafer",8)==0) { + if (p[8] != '0') { + option_flags |= NO_GSSAFER; + Message(PARSE_STDIN,"GhostScript calls does not use -dSAFER\n",p); + } else { + option_flags &= ~NO_GSSAFER; + Message(PARSE_STDIN,"GhostScript calls use -dSAFER\n"); + } + } else if (strncmp(p,"ogs",3)==0) { + if (p[3] != '0') { + option_flags |= NO_GHOSTSCRIPT; + Message(PARSE_STDIN,"No GhostScript calls\n",p); + } else { + option_flags &= ~NO_GHOSTSCRIPT; + Message(PARSE_STDIN,"GhostScript calls made\n"); + } + } else if (strncmp(p,"orawps",6)==0) { + if (p[6] != '0') { + option_flags |= NO_RAW_PS; + Message(PARSE_STDIN,"Conversion of raw PostScript will not be attempted\n",p); + } else { + option_flags &= ~NO_RAW_PS; + Message(PARSE_STDIN,"Conversion of raw PostScript will be attempted\n",p); + } + } else + goto DEFAULT; + break ; + case 'l': + { + int32_t lastpage; + bool abspage=false; + + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + if (*p == '=') { + abspage=true; + p++ ; + } + if ((*p>='0'&&*p<='9') || (*p=='-' && *(p+1)>='0' && *(p+1)<='9')) { + lastpage = atoi(p); + LastPage(lastpage,abspage); + Message(PARSE_STDIN,"Last page: %d\n",lastpage); + } else + Warning("Bad lastpage (-l) parameter, ignored"); + } + break ; + case 'q': /* quiet operation */ + if (*p != '0') + option_flags &= (~BE_NONQUIET & ~BE_VERBOSE); + else + option_flags |= BE_NONQUIET; + break; + case 'r': /* process pages in reverse order */ + if (*p != '0') { + Message(PARSE_STDIN,"Reverse order\n"); + Reverse(true); + } else { + Message(PARSE_STDIN,"Normal order\n"); + Reverse(false); + } + break; + case 'v': /* verbatim mode */ + if (strcmp(p, "ersion")==0) { + if (strcmp(basename(programname),PACKAGE_NAME)!=0) + printf("%s (%s) %s\n",basename(programname), + PACKAGE_NAME,PACKAGE_VERSION); + else + puts(PACKAGE_STRING); +#ifdef HAVE_LIBKPATHSEA + puts (KPSEVERSION); +#endif +#ifdef HAVE_FT2 + printf("Compiled with Freetype %d.%d.%d\n", + FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH); +# ifdef HAVE_FT_LIBRARY_VERSION + if (FT_Init_FreeType( &libfreetype )) + Warning("the Freetype library seems unusable"); + else { + FT_Int amajor, aminor, apatch; + + FT_Library_Version( libfreetype, &amajor, &aminor, &apatch ); + printf("Using libft %d.%d.%d\n",amajor, aminor, apatch); + FT_Done_FreeType(libfreetype); + } +# endif +#endif +#ifdef HAVE_LIBT1 + printf("Using t1lib %s\n", T1_GetLibIdent()); +#endif + puts ("Copyright (C) 2002-2010 Jan-Ake Larsson.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU Lesser General Public License\n\ +version 3, see the COPYING file in the dvipng distribution\n\ +or ."); + exit (EXIT_SUCCESS); + } + if (*p != '0') + option_flags |= BE_NONQUIET | BE_VERBOSE; + else + option_flags &= ~BE_VERBOSE; + break; + case 'D' : + if (*p == 0 && argv[i+1]) + p = argv[++i] ; + number = atoi(p); + if (number < 10 || number > 10000) + Warning("Bad resolution (-D) parameter, ignored") ; + else { + dpi=number; + Message(PARSE_STDIN,"Dpi: %d\n",dpi); + } + break; + case 'Q': /* quality (= shrinkfactor) */ + if (*p == 0 && argv[i+1]) + p = argv[++i]; + if (*p>='0'&&*p<='9') { + shrinkfactor = atoi(p); + Message(PARSE_STDIN,"Quality: %d\n",shrinkfactor); + } else { + Warning("Non-numeric quality (-Q) value, ignored"); + } + break; + case 'w': + if (strncmp(p,"idth",4) == 0 ) { /* Width reporting */ + if (p[4] != '0') { + option_flags |= REPORT_WIDTH; + Message(PARSE_STDIN,"Width reporting on\n",p); + } else { + option_flags &= ~REPORT_WIDTH; + Message(PARSE_STDIN,"Width reporting off\n"); + } + break; + } + goto DEFAULT; +#ifdef HAVE_GDIMAGEPNGEX + case 'z': + if (*p == 0 && argv[i+1]) + p = argv[++i]; + number = atoi(p); + if (number<1 || number>9) + Warning("Bad compression (-z) value, ignored"); + else { + compression=number; + Message(PARSE_STDIN,"Compression: %d\n",shrinkfactor); + } + break; +#endif + case '\0': + option_flags |= PARSE_STDIN; + break; + DEFAULT: default: + Warning("%s is not a valid option", argv[i]); + } + } else { + dviname=argv[i]; + } + } + if (dviname != NULL) { + if (dvi != NULL && dvi->filep != NULL) + DVIClose(dvi); + dvi=DVIOpen(dviname,outname); + } + + if (dvi==NULL) { + fprintf(stdout,"\nUsage: %s [OPTION]... FILENAME[.dvi]\n", programname); + fprintf(stdout,"Options are chosen to be similar to dvips' options where possible:\n"); +#ifdef DEBUG + fprintf(stdout," -d # Debug (# is the debug bitmap, 1 if not given)\n"); +#endif + fprintf(stdout," -D # Output resolution\n"); + fprintf(stdout," -l # Last page to be output\n"); + fprintf(stdout," -o f Output file, '%%d' is pagenumber\n"); + fprintf(stdout," -O c Image offset\n"); + fprintf(stdout," -p # First page to be output\n"); + fprintf(stdout," -pp #,#.. Page list to be output\n"); + fprintf(stdout," -q* Quiet operation\n"); + fprintf(stdout," -T c Image size (also accepts '-T bbox' and '-T tight')\n"); + fprintf(stdout," -v* Verbose operation\n"); + fprintf(stdout," - Interactive query of options\n"); + fprintf(stdout,"\nThese do not correspond to dvips options:\n"); + fprintf(stdout," -bd # Transparent border width in dots\n"); + fprintf(stdout," -bd s Transparent border fallback color (TeX-style color)\n"); + fprintf(stdout," -bg s Background color (TeX-style color or 'Transparent')\n"); + fprintf(stdout," --depth* Output the image depth on stdout\n"); + fprintf(stdout," --dvinum* Use TeX page numbers in output filenames\n"); + fprintf(stdout," -fg s Foreground color (TeX-style color)\n"); + fprintf(stdout," --follow* Wait for data at end-of-file\n"); +#ifdef HAVE_FT2 + fprintf(stdout," --freetype* FreeType font rendering (preferred, default on)\n"); +#endif + fprintf(stdout," --gamma # Control color interpolation\n"); +#ifdef HAVE_GDIMAGEGIF + fprintf(stdout," --gif Output GIF images (dvigif default)\n"); +#endif + fprintf(stdout," --height* Output the image height on stdout\n"); + fprintf(stdout," --nogs* Don't use ghostscript for PostScript specials\n"); + fprintf(stdout," --nogssafer* Don't use -dSAFER in ghostscript calls\n"); + fprintf(stdout," --norawps* Don't convert raw PostScript specials\n"); +#ifdef HAVE_GDIMAGECREATETRUECOLOR + fprintf(stdout," --palette* Force palette output\n"); +#endif + fprintf(stdout," --picky When a warning occurs, don't output image\n"); +#ifdef HAVE_GDIMAGEGIF + fprintf(stdout," --png Output PNG images (dvipng default)\n"); +#endif + fprintf(stdout," --strict When a warning occurs, exit\n"); +#ifdef HAVE_LIBT1 + fprintf(stdout," --t1lib* T1lib font rendering (default on)\n"); +#endif +#ifdef HAVE_GDIMAGECREATETRUECOLOR + fprintf(stdout," --truecolor* Truecolor output\n"); +#endif + fprintf(stdout," -Q # Quality (T1lib and PK subsampling)\n"); + fprintf(stdout," --width* Output the image width on stdout\n"); +#ifdef HAVE_GDIMAGEPNGEX + fprintf(stdout," -z # PNG compression level\n"); +#endif + + fprintf(stdout,"\n # = number f = file s = string * = suffix, '0' to turn off\n"); + fprintf(stdout," c = comma-separated dimension pair (e.g., 3.2in,-32.1cm)\n\n"); + /*#ifdef HAVE_LIBKPATHSEA + { + extern DllImport char *kpse_bug_address; + putc ('\n', stdout); + fputs (kpse_bug_address, stdout); + } + #endif*/ + if ((option_flags & PARSE_STDIN) == 0) { + exit(EXIT_SUCCESS); + } + } + if ((option_flags & PARSE_STDIN) == 0 && (!ppused)) + ParsePages("-"); + return((option_flags & PARSE_STDIN) != 0); +} + +void DecodeString(char *string) +{ +#define PARSEARGS 10 + char *strv[PARSEARGS]; + int strc=1; + strv[0]=NULL; /* No program name */ + + while (*string==' ' || *string=='\t' || *string=='\r' || *string=='\n') + string++; + while (*string!='\0') { + strv[strc++]=string; + if (*string!='\'') { + /* Normal split at whitespace */ + while (*string!=' ' && *string!='\t' \ + && *string!='\n' && *string!='\r' && *string!='\0') + string++; + } else { + /* String delimiter found , so search for next */ + strv[strc-1]=++string; + while (*string!='\'' && *string!='\0') + string++; + } + if (*string!='\0') + *string++='\0'; + while (*string==' ' || *string=='\t' || *string=='\r' || *string=='\n') + string++; + } + if (strc>1) /* Nonempty */ + (void) DecodeArgs(strc,strv); +} + + + +uint32_t UNumRead(unsigned char* current, register int n) +{ + uint32_t x = (unsigned char) *(current)++; /* number being constructed */ + while(--n) + x = (x << 8) | *(current)++; + return(x); +} + +int32_t SNumRead(unsigned char* current, register int n) +{ + int32_t x = (signed char) *(current)++; /* number being constructed */ + while(--n) + x = (x << 8) | *(current)++; + return(x); +} + + +/**********************************************************************/ +/****************************** Fatal *******************************/ +/**********************************************************************/ +void Fatal (const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + fflush(stdout); + fprintf(stderr, "\n"); + fprintf(stderr, "%s: Fatal error, ", programname); + vfprintf(stderr, fmt, args); + + fprintf(stderr, "\n\n"); + va_end(args); + + ClearFonts(); +#ifdef HAVE_FT2 + if (libfreetype) + (void) FT_Done_FreeType(libfreetype); /* at this point, ignore error */ +#endif +#ifdef HAVE_LIBT1 + if (libt1) + (void) T1_CloseLib(); /* at this point, ignore error */ +#endif + exit(EXIT_FATAL); +} + +/*-->Warning*/ +/**********************************************************************/ +/***************************** Warning ******************************/ +/**********************************************************************/ +void Warning(const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + + if ( option_flags & BE_NONQUIET ) { + fflush(stdout); + fprintf(stderr, "%s warning: ", programname); + vfprintf(stderr, fmt, args); + fprintf(stderr, " "); + } + va_end(args); +} + +/*-->Message*/ +/**********************************************************************/ +/***************************** Message ******************************/ +/**********************************************************************/ +void Message(int activeflags, const char *fmt, ...) +{ + va_list args; + + va_start(args, fmt); + if ( option_flags & activeflags ) { + vfprintf(stdout, fmt, args); + } + va_end(args); +} + + +bool MmapFile (char *filename,struct filemmap *fmmap) +{ +#ifndef WIN32 + struct stat stat; +#endif + + DEBUG_PRINT(DEBUG_DVI,("\n OPEN FILE:\t'%s'", filename)); + fmmap->data=NULL; +#ifndef WIN32 + if ((fmmap->fd = open(filename,O_RDONLY)) == -1) { + Warning("cannot open file <%s>", filename); + return(true); + } + fstat(fmmap->fd,&stat); + fmmap->size=stat.st_size; +# ifdef HAVE_MMAP + fmmap->data = mmap(NULL,fmmap->size, PROT_READ, MAP_SHARED,fmmap->fd,0); + if (fmmap->data == (char*)-1) { + Warning("cannot mmap file <%s>",filename); + fmmap->data=NULL; + close(fmmap->fd); + return(true); + } +# else /* HAVE_MMAP */ + fmmap->data = malloc(fmmap->size); + if (fmmap->data == NULL) { + Warning("cannot malloc space for <%s>",filename); + close(fmmap->fd); + return(true); + } + if (read(fmmap->fd,fmmap->data,fmmap->size)size) { + Warning("too little data in <%s>",filename); + free(fmmap->data); + fmmap->data=NULL; + close(fmmap->fd); + return(true); + } + close(fmmap->fd); +# endif /* HAVE_MMAP */ +#else /* WIN32 */ + fmmap->hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, 0, + OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); + if (fmmap->hFile == INVALID_HANDLE_VALUE) { + Warning("cannot open file <%s>", filename); + return(true); + } + fmmap->size = GetFileSize(fmmap->hFile, 0); + fmmap->hMap = CreateFileMapping(fmmap->hFile, 0, PAGE_READONLY, 0, 0, 0); + if (fmmap->hMap == 0) { + CloseHandle (fmmap->hFile); + Warning("cannot CreateFileMapping() file <%s>", filename); + return(true); + } + fmmap->data = MapViewOfFile(fmmap->hMap, FILE_MAP_READ, 0, 0, 0); + if (fmmap->data == NULL) { + Warning("cannot MapViewOfFile() file <%s>", filename); + CloseHandle (fmmap->hMap); + CloseHandle (fmmap->hFile); + return(true); + } +#endif /* WIN32 */ + return(false); +} + +void UnMmapFile(struct filemmap* fmmap) +{ + if (fmmap->data!=NULL) { +#ifndef WIN32 +# ifdef HAVE_MMAP + if (munmap(fmmap->data,fmmap->size)) + Warning("cannot munmap file at 0x%X",fmmap->data); + if (close(fmmap->fd)) + Warning("cannot close file descriptor %d",fmmap->fd); +# else /* HAVE_MMAP */ + free(fmmap->data); +# endif /* HAVE_MMAP */ +#else /* WIN32 */ + UnmapViewOfFile (fmmap->data); + CloseHandle (fmmap->hMap); + CloseHandle (fmmap->hFile); +#endif /* WIN32 */ + } + fmmap->data=NULL; +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/papersiz.c b/Build/source/texk/dvipng/dvipng-1.14/papersiz.c new file mode 100644 index 00000000000..6f5e99794d2 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/papersiz.c @@ -0,0 +1,74 @@ +/* papersiz.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +const char *lengthnames[]={ "sp", "pt", "bp", + "dd", "mm", "pc", + "cc", "cm", "in" }; +const int32_t lengthsp[]={ 1L, 65536L, 65782L, + 70124L, 186468L, 786432L, + 841489L, 1864680L, 4736286L }; + +/* + * Convert a double[unit], e.g., "3.2cm" or "1.0in" into length in pixels. + * Advance the passed pointer as well. + */ + +static int32_t myatodim(const char ** p) +{ + double tmp; /* double accuracy is enough, I think */ + int i=0; + char *q; + + tmp = strtod(*p,&q); + while (*q == ' ') + q++; + while (i<8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1])) + i++; + if (i==8 && (q[0]!=lengthnames[i][0] || q[1]!=lengthnames[i][1])) + Warning("unrecognized length unit \"%.2s\", assuming inches",q); + while (*q != ',' && *q !='\0') + q++; + tmp = tmp*lengthsp[i]*dpi/4736286L; /* sp * dots/in / (sp/in), convert sp to pixels */ + *p=q; + return((int32_t) tmp); +} + + +/* + * The routine where we handle the paper size special. We need to pass in + * the string after the `papersize=' specification. + */ + +void handlepapersize(const char * p, int32_t * x, int32_t * y) +{ + while (*p == ' ') + p++ ; + *x = myatodim(&p) ; + while (*p == ' ' || *p == ',') + p++ ; + *y = myatodim(&p) ; +} + diff --git a/Build/source/texk/dvipng/dvipng-1.14/pk.c b/Build/source/texk/dvipng/dvipng-1.14/pk.c new file mode 100644 index 00000000000..446dc7ed2ee --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/pk.c @@ -0,0 +1,403 @@ +/* pk.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2009 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +#define PK_POST 245 +#define PK_PRE 247 +#define PK_ID 89 + +unsigned char dyn_f; +int repeatcount; +int poshalf; + +static unsigned char getnyb(unsigned char** pos) +{ + if (poshalf == 0) { + poshalf=1; + return(**pos / 16); + } else { + poshalf=0; + return(*(*pos)++ & 15); + } +} + +static uint32_t pk_packed_num(unsigned char** pos) +{ + register int i; + uint32_t j; + + i = (int)getnyb(pos); + if (i == 0) { + do { + j = (uint32_t)getnyb(pos); + i++; + } while (j == 0); + while (i > 0) { + j = j * 16 + (uint32_t)getnyb(pos); + i--; + }; + return (j - 15 + (13 - dyn_f) * 16 + dyn_f); + } else if (i <= (int)dyn_f) { + return ((uint32_t)i); + } else if (i < 14) { + return ((i-(uint32_t)dyn_f - 1) * 16 + (uint32_t)getnyb(pos) + + dyn_f + 1); + } else { + if (i == 14) { + repeatcount = (int)pk_packed_num(pos); + } else { + repeatcount = 1; + } + return (pk_packed_num(pos)); /* tail end recursion !! */ + } +} + +static unsigned char* skip_specials(unsigned char* pos) +{ + uint32_t i; + + while (*pos >= 240 && *pos != PK_POST) { + i=0; + switch (*pos++) { + case 243: + i = *pos++; + case 242: + i = 256 * i + *pos++; + case 241: + i = 256 * i + *pos++; + case 240: + i = 256 * i + *pos++; + DEBUG_PRINT(DEBUG_PK,("\n PK SPECIAL\t'%.*s' ",(int)i,pos)); + pos += i; + break; + case 244: +#ifdef DEBUG + { + uint32_t c; + c=UNumRead(pos,4); + DEBUG_PRINT(DEBUG_PK,("\n PK SPECIAL\t%d",c)); + } +#endif + pos += 4; + break; + case 245: + break; + case 246: + DEBUG_PRINT(DEBUG_PK,("\n PK\tNOP ")); + break; + case 247: case 248: case 249: case 250: + case 251: case 252: case 253: case 254: + case 255: + Fatal("unexpected PK flagbyte %d", (int)*pos); + } + } + return(pos); +} + + +void LoadPK(int32_t c, register struct char_entry * ptr) +{ + unsigned short shrunk_width,shrunk_height; + unsigned short width,height; + short xoffset,yoffset; + unsigned short i_offset,j_offset; + int i,j,k,n; + int count=0; + bool paint_switch; + unsigned char *pos,*buffer; + + DEBUG_PRINT(DEBUG_PK,("\n LOAD PK CHAR\t%d",c)); + pos=ptr->pkdata; + if ((ptr->flag_byte & 7) == 7) n=4; + else if ((ptr->flag_byte & 4) == 4) n=2; + else n=1; + dyn_f = ptr->flag_byte / 16; + paint_switch = ((ptr->flag_byte & 8) != 0); + /* + * Read character preamble + */ + if (n != 4) { + ptr->tfmw = UNumRead(pos, 3); + /* +n: vertical escapement not used */ + pos+=3+n; + } else { + ptr->tfmw = UNumRead(pos, 4); + /* +4: horizontal escapement not used */ + /* +n: vertical escapement not used */ + pos+=8+n; + } + DEBUG_PRINT(DEBUG_PK,(" %d",ptr->tfmw)); + ptr->tfmw = (dviunits) + ((int64_t) ptr->tfmw * currentfont->s / 0x100000 ); + DEBUG_PRINT(DEBUG_PK,(" (%d)",ptr->tfmw)); + + width = UNumRead(pos, n); + height = UNumRead(pos+=n, n); + DEBUG_PRINT(DEBUG_PK,(" %dx%d",width,height)); + + if (width > 0x7fff || height > 0x7fff) + Fatal("character %d too large in file %s", c, currentfont->name); + + /* + * Hotspot issues: Shrinking to the topleft corner rather than the + hotspot will displace glyphs a fraction of a pixel. We deal with + this in as follows: The glyph is shrunk to its hotspot by + offsetting the bitmap somewhat to put the hotspot in the lower + left corner of a "shrink square". Shrinking to the topleft corner + will then act as shrinking to the hotspot. This may enlarge the + bitmap somewhat, of course. (Also remember that the below + calculation of i/j_offset is in integer arithmetics.) + + There will still be a displacement from rounding the dvi + position, but vertically it will be equal for all glyphs on a + line, so we displace a whole line vertically by fractions of a + pixel. This is acceptible, IMHO. Sometime there will be support + for subpixel positioning, horizontally. Will do for now, I + suppose. + */ + xoffset = SNumRead(pos+=n, n); + i_offset = ( shrinkfactor - xoffset % shrinkfactor ) % shrinkfactor; + width += i_offset; + ptr->xOffset = xoffset+i_offset; + + yoffset = SNumRead(pos+=n, n); + j_offset = ( shrinkfactor - (yoffset-(shrinkfactor-1)) % shrinkfactor ) + % shrinkfactor; + height += j_offset; + ptr->yOffset = yoffset+j_offset; + + DEBUG_PRINT(DEBUG_PK,(" (%dx%d)",width,height)); + /* + Extra marginal so that we do not crop the image when shrinking. + */ + shrunk_width = (width + shrinkfactor - 1) / shrinkfactor; + shrunk_height = (height + shrinkfactor - 1) / shrinkfactor; + ptr->w = shrunk_width; + ptr->h = shrunk_height; + pos+=n; + buffer = calloc(shrunk_width*shrunk_height* + shrinkfactor*shrinkfactor,sizeof(char)); + DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); + /* Raster char */ + if (dyn_f == 14) { /* get raster by bits */ + int bitweight = 0; + for (j = j_offset; j < (int) height; j++) { /* get all rows */ + for (i = i_offset; i < (int) width; i++) { /* get one row */ + bitweight /= 2; + if (bitweight == 0) { + count = *pos++; + bitweight = 128; + } + if (count & bitweight) { + buffer[i+j*width]=1; +#ifdef DEBUG + DEBUG_PRINT(DEBUG_GLYPH,("+")); + } else { + DEBUG_PRINT(DEBUG_GLYPH,(" ")); +#endif + } + } + DEBUG_PRINT(DEBUG_GLYPH,("|\n")); + } + } else { /* get packed raster */ + poshalf=0; + repeatcount = 0; + for(i=i_offset, j=j_offset; j 0) { + if (i+count < width) { + if (paint_switch) + for(k=0;k0; repeatcount--,j++) { + for (i = i_offset; i0) { + DEBUG_PRINT(DEBUG_GLYPH,("=")); + } else { + DEBUG_PRINT(DEBUG_GLYPH,(" ")); + } +#endif + } + DEBUG_PRINT(DEBUG_GLYPH,("|\n")); + } + i=i_offset; + } + } + paint_switch = 1 - paint_switch; + } + if (i>i_offset) + Fatal("wrong number of bits stored: char. %c, font %s", + (char)c, currentfont->name); + if (j>height) + Fatal("bad PK file %s, too many bits", currentfont->name); + } + /* + Shrink raster while doing antialiasing. (See above. The + single-glyph output seems better than what xdvi at 300 dpi, + shrinkfactor 3 produces.) + */ + if ((ptr->data = calloc(shrunk_width*shrunk_height,sizeof(char))) == NULL) + Fatal("unable to malloc image space for char %c", (char)c); + for (j = 0; j < (int) height; j++) { + for (i = 0; i < (int) width; i++) { + /* if (((i % shrinkfactor) == 0) && ((j % shrinkfactor) == 0)) + ptr->data[i/shrinkfactor+j/shrinkfactor*shrunk_width] = + buffer[i+j*width]; + else */ + ptr->data[i/shrinkfactor+j/shrinkfactor*shrunk_width] += + buffer[i+j*width]; + } + } + for (j = 0; j < shrunk_height; j++) { + for (i = 0; i < shrunk_width; i++) { + ptr->data[i+j*shrunk_width] = ptr->data[i+j*shrunk_width] + *255/shrinkfactor/shrinkfactor; + DEBUG_PRINT(DEBUG_GLYPH,("%3u ",ptr->data[i+j*shrunk_width])); + } + DEBUG_PRINT(DEBUG_GLYPH,("|\n")); + } + free(buffer); +} + +void InitPK(struct font_entry * tfontp) +{ + unsigned char* position; + struct char_entry *tcharptr; /* temporary char_entry pointer */ + uint32_t hppp, vppp, packet_length; + uint32_t c; + + DEBUG_PRINT((DEBUG_DVI|DEBUG_PK),("\n OPEN FONT:\t'%s'", tfontp->name)); + Message(BE_VERBOSE,"<%s>", tfontp->name); + if (MmapFile(tfontp->name,&(tfontp->fmmap))) + Fatal("font file %s unusable", tfontp->name); + position=(unsigned char*)tfontp->fmmap.data; + if (tfontp->fmmap.size < 2 || tfontp->fmmap.size < 3+*(position+2)+16) + Fatal("PK file %s ends prematurely",tfontp->name); + if (*position++ != PK_PRE) + Fatal("unknown font format in file %s",tfontp->name); + if (*position++ != PK_ID) + Fatal( "wrong version %d of PK file %s (should be 89)", + (int)*(position-1),tfontp->name); + DEBUG_PRINT(DEBUG_PK,("\n PK_PRE:\t'%.*s'",(int)*position, position+1)); + position += *position + 1; + + tfontp->designsize = UNumRead(position, 4); + DEBUG_PRINT(DEBUG_PK,(" %d", tfontp->designsize)); + tfontp->type = FONT_TYPE_PK; + + c = UNumRead(position+4, 4); + DEBUG_PRINT(DEBUG_PK,(" %d", c)); + CheckChecksum (tfontp->c, c, tfontp->name); + + hppp = UNumRead(position+8, 4); + vppp = UNumRead(position+12, 4); + DEBUG_PRINT(DEBUG_PK,(" %d %d", hppp,vppp)); + if (hppp != vppp) + Warning("aspect ratio is %d:%d (should be 1:1)", hppp, vppp); + tfontp->magnification = (uint32_t)((uint64_t)hppp * 7227 * 5 / 65536l + 50)/100; + position+=16; + /* Read char definitions */ + position = skip_specials(position); + while (*position != PK_POST) { + DEBUG_PRINT(DEBUG_PK,("\n @%ld PK CHAR:\t%d", + (long)position - (long)tfontp->fmmap.data, *position)); + if ((tcharptr = malloc(sizeof(struct char_entry))) == NULL) + Fatal("cannot malloc space for char_entry"); + tcharptr->flag_byte = *position; + tcharptr->data = NULL; + tcharptr->tfmw = 0; + if ((*position & 7) == 7) { + packet_length = UNumRead(position+1,4); + c = UNumRead(position+5, 4); + position += 9; + } else if (*position & 4) { + packet_length = (*position & 3) * 65536l + + UNumRead(position+1, 2); + c = UNumRead(position+3, 1); + position += 4; + } else { + packet_length = (*position & 3) * 256 + + UNumRead(position+1, 1); + c = UNumRead(position+2, 1); + position += 3; + } + DEBUG_PRINT(DEBUG_PK,(" %d %d",packet_length,c)); + if (c > (LASTFNTCHAR)) + Fatal("PK font %s exceeds char numbering limit",tfontp->name); + tcharptr->length = packet_length; + tcharptr->pkdata = position; + tfontp->chr[c]=tcharptr; + position += packet_length; + position = skip_specials(position); + } +} + +static void UnLoadPK(struct char_entry *ptr) +{ + if (ptr->data!=NULL) + free(ptr->data); + ptr->data=NULL; +} + +void DonePK(struct font_entry *tfontp) +{ + int c=FIRSTFNTCHAR; + + UnMmapFile(&(tfontp->fmmap)); + while(c<=LASTFNTCHAR) { + if (tfontp->chr[c]!=NULL) { + UnLoadPK((struct char_entry*)tfontp->chr[c]); + free(tfontp->chr[c]); + } + c++; + } + if (tfontp->name!=NULL) + free(tfontp->name); + tfontp->name=NULL; +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/ppagelist.c b/Build/source/texk/dvipng/dvipng-1.14/ppagelist.c new file mode 100644 index 00000000000..b7467a98539 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/ppagelist.c @@ -0,0 +1,189 @@ +/* ppagelist.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +/* Some code at the end of this file is adapted from dvips */ + +static int32_t first=PAGE_FIRSTPAGE, last=PAGE_LASTPAGE; +static bool abspage=false, reverse=false; +bool no_ppage=true; + +/* dvips' behaviour: + * -pp outputs _all_ pages with the correct numbers, + * -p, -l outputs from the first occurrence of firstpage to the first + * occurrence of lastpage. Using '=' means absolute pagenumbers + */ + +void FirstPage(int32_t page, bool data) +{ + first=page; + abspage |= data; +} +void LastPage(int32_t page,bool data) +{ + last=page; + abspage |= data; +} +void Reverse(bool new) +{ + reverse=new; +} +/*-->NextPPage*/ +/**********************************************************************/ +/**************************** NextPPage *****************************/ +/**********************************************************************/ +/* Return the page in turn on our queue */ +/* (Implicitly, PAGE_POST is never in the pagelist) */ +bool InPageList(int32_t i); + +struct page_list* NextPPage(void* dvi, struct page_list* page) +{ + if (! reverse) { /*********** normal order */ + if (page == NULL) { /* first call: find first page */ + if (no_ppage) + return(NULL); + page=FindPage(dvi,first,abspage); + } else /* later calls: count up, except "last" page */ + page=(last==page->count[abspage ? 0 : 10]) ? NULL : NextPage(dvi,page); + /* seek for pages in pagelist */ + while (page!=NULL && ! InPageList(page->count[0])) + page=(last==page->count[abspage ? 0 : 10]) ? NULL : NextPage(dvi,page); + } else { /******************** reverse order */ + if (page == NULL) { /* first call: find "last" page */ + if (no_ppage) + return(NULL); + page=FindPage(dvi,last,abspage); + } else /* later calls: count down, except "first" page */ + page=(first==page->count[abspage ? 0 : 10]) ? NULL : PrevPage(dvi,page); + /* seek for pages in pagelist */ + while (page!=NULL && ! InPageList(page->count[0])) + page=(first==page->count[abspage ? 0 : 10]) ? NULL : PrevPage(dvi,page); + } + return(page); +} + +struct pp_list { + struct pp_list *next; /* next in a series of alternates */ + int32_t ps_low, ps_high; /* allowed range */ +} *ppages = 0; /* the list of allowed pages */ + +/*-->InPageList*/ +/**********************************************************************/ +/****************************** InPageList **************************/ +/**********************************************************************/ +/* Return true iff i is one of the desired output pages */ + +bool InPageList(int32_t i) +{ + register struct pp_list *pl = ppages; + + while (pl) { + if ( i >= pl -> ps_low && i <= pl -> ps_high) + return(true); /* success */ + pl = pl -> next; + } + return(false); +} + +static void ListPage(int32_t pslow, int32_t pshigh) +{ + register struct pp_list *pl; + + /* Some added code, we want to reuse the list */ + no_ppage=false; + pl = ppages; + while (pl != NULL && pl->ps_low <= pl->ps_high) + pl = pl->next; + if (pl == NULL) { + if ((pl = (struct pp_list *)malloc(sizeof(struct pp_list))) + ==NULL) + Fatal("cannot malloc memory for page queue"); + pl -> next = ppages; + ppages = pl; + } + pl -> ps_low = pslow; + pl -> ps_high = pshigh; +} + +/* Parse a string representing a list of pages. Return 0 iff ok. As a + side effect, the page selection(s) is (are) prepended to ppages. */ + +bool ParsePages(const char *s) +{ + const char *c; /* conversion start */ + char *t; + long int ps_low = PAGE_MINPAGE, ps_high = PAGE_MAXPAGE; + + while (*s==' ' || *s=='\t') s++; + while (*s!='\0') { + if (*s=='-' || *s==':') { /* range with no starting value */ + ps_low = PAGE_MINPAGE; + c=s+1; + ps_high = strtol(c,&t,10); + s = t; + if (c==s) ps_high=PAGE_MAXPAGE; /* no number */ + while (*s==' ' || *s=='\t') s++; + if (*s=='-' || *s==':') { /* Oh, range with negative starting value */ + ps_low = -ps_high; + c=s+1; + ps_high = strtol(c,&t,10); + s = t; + if (c==s) ps_high=PAGE_MAXPAGE; /* no number */ + } + } else { /* range with starting value, or singleton */ + c=s; + ps_low = ps_high = strtol(c,&t,10); + s = t; + if (c==s) + return(true); + if (*s=='-' || *s==':') { /* range */ + c=s+1; + ps_high = strtol(c,&t,10); + s = t; + if (c==s) ps_high=PAGE_MAXPAGE; /* no number */ + } + } + ListPage(ps_low, ps_high); + while (*s==' ' || *s=='\t' || *s==',') s++; + } + return(false); +} + +/* Addition, we want to be able to clear the pplist */ +void ClearPpList(void) +{ + register struct pp_list *pl = ppages; + + while (pl) { + ppages=ppages->next; + free(pl); + pl = ppages; + } + first=PAGE_FIRSTPAGE; + last=PAGE_LASTPAGE; + abspage = false; + no_ppage=true; +} + diff --git a/Build/source/texk/dvipng/dvipng-1.14/readme.texi b/Build/source/texk/dvipng/dvipng-1.14/readme.texi new file mode 100644 index 00000000000..378333376ae --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/readme.texi @@ -0,0 +1,161 @@ +@c readme.texi +@c +@c Part of the dvipng distribution + +@ifclear man +@include macros.texi +@ifset rawfile +@chapter dvipng + +@end ifset +@end ifclear +@c ----------------------- + +This program makes PNG and/or GIF graphics from DVI files as obtained +from @TeX{} and its relatives. + +If GIF support is enabled, GIF output is chosen by using the +@samp{dvigif} binary or with the @samp{--gif} option. + +@ifclear man + +It is intended to produce anti-aliased screen-resolution images as fast +as is possible. The target audience is people who need to generate and +regenerate many images again and again. The primary target is the +@previewlatex{} (X)Emacs package, a package to preview formulas from +within (X)Emacs. Yes, you get to see your formulas in the (X)Emacs +buffer, see @url{http://www.gnu.org/software/auctex/preview-latex.html}. + +Another example is WeBWorK, an internet-based method for delivering +homework problems to students over the internet, giving students +instant feedback as to whether or not their answers are correct, see +@url{http://webwork.math.rochester.edu}. + +A more recent addition to the dvipng-using applications out there is +MediaWiki, the software behind Wikipedia and many other wikis out +there. Dvipng is used to render mathematical formulae from version +1.8.0 of MediaWiki, see @url{http://www.mediawiki.org}. + +Other applications may also benefit, like web applications as latex2html +and WYSIWYG editors like LyX. + +@ifset rawfile +@section Benefits of dvipng +@end ifset +@end ifclear + +The benefits of @samp{dvipng}/@samp{dvigif} include + +@itemize @bullet +@item +Speed. It is a very fast bitmap-rendering code for DVI files, which +makes it suitable for generating large amounts of images on-the-fly, +as needed in @previewlatex{}, WeBWorK and others. + +@item +It does not read the postamble, so it can be started before @TeX{} +finishes. There is a @samp{--follow} switch that makes dvipng wait at +end-of-file for further output, unless it finds the POST marker that +indicates the end of the DVI. + +@item +Interactive query of options. dvipng can read options interactively +through stdin, and all options are usable. It is even possible to change +the input file through this interface. + +@item +Supports PK, VF, PostScript Type1, and TrueType fonts, subfonts (i.e., +as used in CJK-@LaTeX{}), color specials, and inclusion of PostScript, +PNG, JPEG or GIF images. + +@item +and more... + +@end itemize + +@ifset rawfile +@section Installation + +Read @file{INSTALL}, included in the distribution. + +@section Usage + +To use dvipng at its simplest, simply type + +@example +dvipng foo +@end example + +@noindent +where @file{foo.dvi} is the output of @TeX{} that you want to convert to +PNG format. If there are four pages in @file{foo.dvi}, those pages will +be output as @file{foo1.png}, @file{foo2.png}, @file{foo3.png}, and +@file{foo4.png}, respectively. + +Many options are available (see the info manual). For a brief summary +of available options, just type + +@example +dvipng --help +@end example + +@section Availability + +The dvipng package is available at Savannah, the GNU project site. Since +dvipng is not part of the GNU project, although released under the GNU +GPL, the web address is +@url{http://savannah.nongnu.org/projects/dvipng}. Instructions for +anonymous CVS access can be found at +@url{http://savannah.nongnu.org/cvs/?group=dvipng}. + +@section Contacts + +Bug reports should be sent to @email{dvipng@@nongnu.org}. + +Questions, suggestions for new features, pleas for help, and/or praise +should go to @email{dvipng@@nongnu.org}. For more information on this +mailing list, send a message with just the word `help' as subject or +body to @email{dvipng-request@@nongnu.org} or look at +@url{http://lists.nongnu.org/mailman/listinfo/dvipng}. + +Offers to support further development will be appreciated. For developer +access, ask on @email{dvipng@@nongnu.org}. + +@section Copying + +This program is released under the GNU Lesser General Public License +version 3, see the COPYING file in the dvipng distribution or +@url{http://www.gnu.org/licenses/}. + +Copyright @copyright{} 2002-2009 Jan-@AA{}ke Larsson + +@section Todo + +@itemize @bullet +@item +Use gs interpreter library for speed and possibly for functionality. + +@item +Add more color models for xcolor compatibility + +@item +Fix T1lib and PK rendering so it is on par with Freetype. + +@item +Enable a named pipe as DVI + +@item +Further speed improvements. + +@item +Other output specials and source specials. + +@item +Clean internal structures. Overhaul file handling. + +@item +Fix the SELFAUTO stuff at runtime rather than at build time +@end itemize + + +@end ifset diff --git a/Build/source/texk/dvipng/dvipng-1.14/set.c b/Build/source/texk/dvipng/dvipng-1.14/set.c new file mode 100644 index 00000000000..af4e4ebdfaa --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/set.c @@ -0,0 +1,289 @@ +/* set.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" +#include + +#ifndef HAVE_GDIMAGECREATETRUECOLOR +#define gdImageColorAllocateAlpha(i,r,g,b,a) gdImageColorAllocate(i,r,g,b) +#define gdImageColorResolveAlpha(i,r,g,b,a) gdImageColorResolve(i,r,g,b) +#define gdImageAlpha(i,c) 0 +#define gdAlphaMax 127 +#endif +#ifndef HAVE_GDIMAGEPNGEX +#define gdImagePngEx(i,f,z) gdImagePng(i,f) +#endif + +/* Persistent color cache. Index is ink thickness, + 0=no ink, 127=total coverage */ +static int ColorCache[gdAlphaMax+1]; + +void CreateImage(pixels x_width,pixels y_width) +{ + if (page_imagep) + gdImageDestroy(page_imagep); + if (x_width <= 0) x_width=1; + if (y_width <= 0) y_width=1; +#ifdef HAVE_GDIMAGECREATETRUECOLOR + /* GIFs are 256-color */ + if ((option_flags & FORCE_TRUECOLOR + || page_flags & PAGE_TRUECOLOR) + && ~option_flags & GIF_OUTPUT + && ~option_flags & FORCE_PALETTE) + page_imagep=gdImageCreateTrueColor(x_width,y_width); + else +#endif + page_imagep=gdImageCreate(x_width,y_width); + /* Set bg color. GIFs cannot handle an alpha channel, resort to + transparent color index, set in WriteImage */ + ColorCache[0] + = gdImageColorAllocateAlpha(page_imagep, + cstack[0].red, + cstack[0].green, + cstack[0].blue, + (option_flags & BG_TRANSPARENT_ALPHA + && ~option_flags & GIF_OUTPUT) ? 127 : 0); + ColorCache[gdAlphaMax]=-1; +#ifdef HAVE_GDIMAGECREATETRUECOLOR + /* Alpha blending in libgd is only performed for truecolor images. + We need it for palette images also. Turn libgd alpha blending off + and calculate color blending where needed. We turn it back on + briefly for image inclusion. */ + gdImageAlphaBlending(page_imagep, 0); + if (option_flags & BG_TRANSPARENT_ALPHA) + gdImageSaveAlpha(page_imagep, 1); + if (page_imagep->trueColor) + /* Truecolor: there is no background color index, fill image instead. */ + gdImageFilledRectangle(page_imagep, 0, 0, + x_width-1, y_width-1, ColorCache[0]); +#endif +} + + +static void ChangeColor(gdImagePtr imagep,int x1,int y1, + int x2,int y2,int color1,int color2) +/* In the given rectangle, change color1 to color2 */ +{ + int x,y; + for( y=y1; y<=y2; y++) { + for( x=x1; x<=x2; x++) { + if (gdImageGetPixel(imagep, x, y)==color1) + gdImageSetPixel(imagep, x, y, color2); + } + } +} + +void WriteImage(char *pngname, int pagenum) +{ + char* pos, *freeme=NULL; + FILE* outfp=NULL; + + /* Set transparent background. Maybe alpha is not available or + perhaps we are producing GIFs, so test for BG_TRANSPARENT_ALPHA + too */ + if (option_flags & (BG_TRANSPARENT|BG_TRANSPARENT_ALPHA)) + gdImageColorTransparent(page_imagep,ColorCache[0]); + /* Transparent border */ + if (borderwidth>0) { + int Transparent; + pixels x_width,y_width; + + x_width=gdImageSX(page_imagep); + y_width=gdImageSY(page_imagep); + + /* Set ANOTHER bg color, transparent this time */ + /* No semi-transparency here, given the motivation for this code + * (box cursor visibility in Emacs) */ + if (userbordercolor) + Transparent = gdImageColorAllocate(page_imagep, + bordercolor.red, + bordercolor.green, + bordercolor.blue); + else + Transparent = gdImageColorAllocate(page_imagep, + gdImageRed(page_imagep,ColorCache[0]), + gdImageGreen(page_imagep,ColorCache[0]), + gdImageBlue(page_imagep,ColorCache[0])); + gdImageColorTransparent(page_imagep,Transparent); + ChangeColor(page_imagep,0,0,x_width-1,borderwidth-1, + ColorCache[0],Transparent); + ChangeColor(page_imagep,0,0,borderwidth-1,y_width-1, + ColorCache[0],Transparent); + ChangeColor(page_imagep,x_width-borderwidth,0,x_width-1,y_width-1, + ColorCache[0],Transparent); + ChangeColor(page_imagep,0,y_width-borderwidth,x_width-1,y_width-1, + ColorCache[0],Transparent); + } + + if ((pos=strchr(pngname,'%')) != NULL) { + if (strchr(++pos,'%')) + Fatal("too many %%s in output file name"); + if (*pos == 'd' + || (*pos=='0' && pos[1]>='1' && pos[1]<='9' && pos[2]=='d')) { + /* %d -> pagenumber, so add 9 string positions + since pagenumber max +-2^31 or +-2*10^9 */ + freeme = malloc(strlen(pngname)+9); + sprintf(freeme,pngname,pagenum); + pngname = freeme; + } else { + Fatal("unacceptible format spec in output file name"); + } + } +#ifdef HAVE_GDIMAGEGIF + if (option_flags & GIF_OUTPUT && (pos=strrchr(pngname,'.')) != NULL + && strcmp(pos,".png")==0) { + *(pos+1)='g'; + *(pos+2)='i'; + *(pos+3)='f'; + } +#endif + if ((outfp = fopen(pngname,"wb")) == NULL) + Fatal("cannot open output file %s",pngname); +#ifdef HAVE_GDIMAGEGIF + if (option_flags & GIF_OUTPUT) + gdImageGif(page_imagep,outfp); + else +#endif + gdImagePngEx(page_imagep,outfp,compression); + fclose(outfp); + DEBUG_PRINT(DEBUG_DVI,("\n WROTE: \t%s\n",pngname)); + if (freeme) + free(freeme); + DestroyImage(); +} + +void DestroyImage(void) +{ + gdImageDestroy(page_imagep); + page_imagep=NULL; +} + +static int gammatable[]= + {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19, + 20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39, + 40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59, + 60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, + 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99, + 100,101,102,103,104,105,106,107,108,109, + 110,111,112,113,114,115,116,117,118,119, + 120,121,122,123,124,125,126,127}; + +void Gamma(double gamma) +{ + int i=0; + + while (i<=gdAlphaMax) { + gammatable[i]=gdAlphaMax- + (int)(pow((gdAlphaMax-i)/((double)gdAlphaMax),gamma)*gdAlphaMax); + DEBUG_PRINT(DEBUG_GLYPH, + ("\n GAMMA GREYSCALE: %d -> %d ",i,gammatable[i])); + i++; + } +} + +dviunits SetGlyph(struct char_entry *ptr, int32_t hh,int32_t vv) +/* gdImageChar can only do monochrome glyphs */ +{ + int dst_alpha,dst_weight,tot_weight,alpha; + int x,y,pos=0; + int bgColor,pixelgrey,pixelcolor; + + hh -= ptr->xOffset/shrinkfactor; + vv -= ptr->yOffset/shrinkfactor; + /* Initialize persistent color cache. Perhaps this should be in + color.c? */ + pixelcolor=gdImageColorResolve(page_imagep, + cstack[csp].red, + cstack[csp].green, + cstack[csp].blue); + if (ColorCache[gdAlphaMax]!=pixelcolor) { + for( x=1; xh; y++) { + for( x=0; xw; x++) { + if (ptr->data[pos]>0) { + pixelgrey=gammatable[(int)ptr->data[pos]/2]; + bgColor = gdImageGetPixel(page_imagep, hh + x, vv + y); + if (ColorCache[0]!=bgColor || ColorCache[pixelgrey]==-1) { + DEBUG_PRINT(DEBUG_GLYPH,("\n GAMMA GREYSCALE: %d -> %d ", + ptr->data[pos]/2,pixelgrey)); + alpha = gdAlphaMax-pixelgrey; + dst_alpha = gdImageAlpha(page_imagep,bgColor); + dst_weight = (gdAlphaMax - dst_alpha) * alpha / gdAlphaMax; + tot_weight = pixelgrey + dst_weight; + pixelcolor = gdImageColorResolveAlpha(page_imagep, + (cstack[csp].red*pixelgrey + + gdImageRed(page_imagep,bgColor)*dst_weight)/tot_weight, + (cstack[csp].green*pixelgrey + + gdImageGreen(page_imagep,bgColor)*dst_weight)/tot_weight, + (cstack[csp].blue*pixelgrey + + gdImageBlue(page_imagep,bgColor)*dst_weight)/tot_weight, + alpha*dst_alpha/gdAlphaMax); + if (ColorCache[0]==bgColor) + ColorCache[pixelgrey]=pixelcolor; + } else + pixelcolor=ColorCache[pixelgrey]; + gdImageSetPixel(page_imagep, hh + x, vv + y, pixelcolor); + } + pos++; + } + } + return(ptr->tfmw); +} + +dviunits SetRule(dviunits a, dviunits b, subpixels hh,subpixels vv) +{ + /* This routine will draw a \rule */ + int Color; + pixels width=0, height=0; + + if ( a > 0 && b > 0 ) { + /* Calculate width and height, round up */ + width = (b+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + height = (a+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + } + if (page_imagep != NULL) { + if ((height>0) && (width>0)) { + /* This code produces too dark rules. But what the hell. Grey + * rules look fuzzy. */ + Color = gdImageColorResolve(page_imagep, + cstack[csp].red, + cstack[csp].green, + cstack[csp].blue); + /* +1 and -1 are because the Rectangle coords include last pixels */ + gdImageFilledRectangle(page_imagep,hh,vv-height+1,hh+width-1,vv,Color); + DEBUG_PRINT(DEBUG_DVI,("\n RULE \t%dx%d at (%d,%d)", + width, height, hh, vv)); + } + } else { + /* The +1's are because things are cut _at_that_coordinate_. */ + min(x_min,hh); + min(y_min,vv-height+1); + max(x_max,hh+width); + max(y_max,vv+1); + } + return(b); +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/sfd.c b/Build/source/texk/dvipng/dvipng-1.14/sfd.c new file mode 100644 index 00000000000..92fae01d960 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/sfd.c @@ -0,0 +1,179 @@ +/* sfd.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2008 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" +struct subfont* subfontp=NULL; + +static struct subfont* ReadSubfont(char* sfdname, char *infix) +{ + char *pos,*max,*sfdfile=NULL; + struct subfont* sfdp=NULL; + struct filemmap fmmap; + boolean mmapfailed; + + /* OK, find subfont and look for correct infix */ +#ifdef HAVE_KPSE_ENC_FORMATS + sfdfile=kpse_find_file(sfdname,kpse_sfd_format,false); +#endif + if (sfdfile == NULL) { + Warning("subfont file %s could not be found",sfdname); + return(NULL); + } + DEBUG_PRINT((DEBUG_FT|DEBUG_ENC),("\n OPEN SUBFONT:\t'%s'", sfdfile)); + mmapfailed = MmapFile(sfdfile,&fmmap); + free(sfdfile); + if (mmapfailed) + return(NULL); + pos=fmmap.data; + max=fmmap.data+fmmap.size; + while(posname=(char*)sfdp+sizeof(struct subfont); + strcpy(sfdp->name,sfdname); + sfdp->infix=(char*)sfdp+sizeof(struct subfont)+strlen(sfdname)+1; + strcpy(sfdp->infix,infix); + sfdp->encoding=FT_ENCODING_UNICODE; + while (poscharindex[codepoint]=number; + DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); + number++; + codepoint++; + } + default: + if (codepoint<256) + sfdp->charindex[codepoint]=number; + DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT MAP %d %d",codepoint,number)); + } + while(postfmname,*sfdwant=fontname, + *sfdname,*infix,*postfix; + + while (*sfdspec!='\0' && *sfdspec==*sfdwant) { + sfdspec++; + sfdwant++; + } + /* Find delimiter */ + if (*sfdspec!='@') + return(NULL); + sfdspec++; + postfix=sfdspec; + while (*postfix!='\0' && *postfix!='@') + postfix++; + if (*postfix!='@') + return(NULL); + /* Extract subfont name */ + sfdname=malloc(postfix-sfdspec+1); + strncpy(sfdname,sfdspec,postfix-sfdspec); + sfdname[postfix-sfdspec]='\0'; + /* Check postfix */ + postfix++; + if (strcmp(sfdwant+strlen(sfdwant)-strlen(postfix),postfix)!=0) + return(NULL); + /* Extract infix */ + infix=malloc(strlen(sfdwant)-strlen(postfix)+1); + strncpy(infix,sfdwant,strlen(sfdwant)-strlen(postfix)); + infix[strlen(sfdwant)-strlen(postfix)]='\0'; + DEBUG_PRINT(DEBUG_ENC,("\n SUBFONT %s %s %s",fontname,sfdname,infix)); + /* Find subfont */ + while(temp!=NULL + && (strcmp(sfdname,temp->name)!=0 || strcmp(infix,temp->infix)!=0)) + temp=temp->next; + if (temp==NULL) { + temp=ReadSubfont(sfdname,infix); + if (temp!=NULL) { + temp->next=subfontp; + subfontp=temp; + } + } + entry=NewPSFont(entry); + if (entry!=NULL) { + entry->tfmname=copyword(fontname); + entry->subfont=temp; + } + free(infix); + free(sfdname); + return(entry); +} + +void ClearSubfont(void) +{ + struct subfont *temp=subfontp; + + while(temp!=NULL) { + subfontp=subfontp->next; + free(temp); + temp=subfontp; + } +} + diff --git a/Build/source/texk/dvipng/dvipng-1.14/special.c b/Build/source/texk/dvipng/dvipng-1.14/special.c new file mode 100644 index 00000000000..fdc92e3eb8b --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/special.c @@ -0,0 +1,850 @@ +/* special.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +#ifndef MIKTEX +#ifndef WIN32 +#include +#else /* WIN32 */ +#include +#include +#include +#define pipe(p) _pipe(p, 65536, O_BINARY | _O_NOINHERIT) +#define snprintf _snprintf +#endif /* WIN32 */ +#endif + +#define SKIPSPACES(s) while(s && *s==' ' && *s!='\0') s++ + +/* PostScript can come as a string (headers and raw specials) or + a memory-mapped file (headers and included EPS figures). */ + +struct pscode { + struct pscode* next; + char* special; /* complete special */ + const char* code; /* PS string, null if a file */ + char* filename; /* file name, null if a string */ + const char* postcode; /* post PS string */ + struct filemmap fmmap; /* file mmap */ +}; + +struct pscode* psheaderp=NULL; /* static, DVI-specific header list */ + +static void PSCodeInit(struct pscode *entry, char *special) +{ + entry->next=NULL; + entry->special=special; + entry->code=NULL; + entry->filename=NULL; + entry->postcode=NULL; + entry->fmmap.data=NULL; + if (special==NULL) + return; + if (strncmp(special,"header=",7)==0) + entry->filename=special+7; + else if (strncmp(special,"ps:: plotfile ",14)==0) + entry->filename=special+14; + else if (special[0]=='"' || special[0]=='!') + entry->code=special+1; + else if (strncmp(special,"ps::[begin]",11)==0) + entry->code=special+11; + else if (strncmp(special,"ps::[end]",9)==0) + entry->code=special+9; + else if (strncmp(special,"ps::",4)==0) + entry->code=special+4; + else if (strncmp(special,"ps:",3)==0) + entry->code=special+3; + else + entry->code=special; +#ifdef DEBUG + if (entry->code!=NULL) + DEBUG_PRINT(DEBUG_GS,(" '%s'",entry->code)); + if (entry->filename!=NULL) + DEBUG_PRINT(DEBUG_GS,(" {%s}",entry->filename)); + if (entry->postcode!=NULL) + DEBUG_PRINT(DEBUG_GS,(" '%s'",entry->postcode)); +#endif +} + + + +void ClearPSHeaders(void) +{ + struct pscode *temp=psheaderp; + + while(temp!=NULL) { + psheaderp=psheaderp->next; + if (temp->fmmap.data!=NULL) + UnMmapFile(&(temp->fmmap)); + free(temp); + temp=psheaderp; + } +} + +static void writepscode(FILE* psstream,struct pscode* pscodep) +{ + while (pscodep!=NULL) { + if (pscodep->code!=NULL) { + fputs(pscodep->code,psstream); + putc('\n',psstream); + DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\t%s",pscodep->code)); + } + if (pscodep->filename!=NULL && pscodep->fmmap.data==NULL) { + char* filepath= + kpse_find_file(pscodep->filename,kpse_tex_ps_header_format,false); + if (filepath==NULL) { + Warning("Cannot find PostScript file %s, ignored", pscodep->filename); + page_flags |= PAGE_GAVE_WARN; + } else if (MmapFile(filepath,&(pscodep->fmmap))) { + Warning("PostScript file %s unusable, ignored", pscodep->filename); + page_flags |= PAGE_GAVE_WARN; + } + } + if (pscodep->fmmap.data!=NULL) { + unsigned char* position; + + DEBUG_PRINT(DEBUG_GS,("\n PS FILE:\t%s",pscodep->filename)); + position=(unsigned char*)pscodep->fmmap.data; + while(position + < (unsigned char*)pscodep->fmmap.data + pscodep->fmmap.size) { + putc(*position,psstream); + position++; + } + } + if (pscodep->postcode!=NULL) { + fputs(pscodep->postcode,psstream); + putc('\n',psstream); + DEBUG_PRINT(DEBUG_GS,("\n PS POST CODE:\t%s",pscodep->postcode)); + } + pscodep=pscodep->next; + } +} + + +static gdImagePtr +ps2png(struct pscode* pscodep, const char *device, int hresolution, int vresolution, + int llx, int lly, int urx, int ury, int bgred, int bggreen, int bgblue) +{ + int pspipe[2], pngpipe[2]; +#define READ_END 0 +#define WRITE_END 1 + FILE *psstream=NULL, *pngstream=NULL; + char resolution[STRSIZE]; + /* char devicesize[STRSIZE]; */ + gdImagePtr psimage=NULL; +#ifndef MIKTEX +#ifndef WIN32 + pid_t pid; +#else /* WIN32 */ + unsigned long nexitcode = STILL_ACTIVE; + HANDLE hchild; + int savestdin, savestdout; +#endif /* WIN32 */ +#else /* MIKTEX */ + HANDLE hPngStream; + HANDLE hPsStream; + HANDLE hStdErr; + PROCESS_INFORMATION pi; + _TCHAR szCommandLine[2048]; + _TCHAR szGsPath[_MAX_PATH]; +#define GS_PATH szGsPath +#define fdopen _tfdopen +#define close _close +#endif /* MIKTEX */ + + snprintf(resolution,STRSIZE,"-r%dx%d",hresolution,vresolution); + /* Future extension for \rotatebox + status=sprintf(devicesize, "-g%dx%d", + //(int)((sin(atan(1.0))+1)* + (urx - llx)*hresolution/72,//), + //(int)((sin(atan(1.0))+1)* + (ury - lly)*vresolution/72);//); + */ + DEBUG_PRINT(DEBUG_GS, + ("\n GS CALL:\t%s %s %s %s %s %s %s %s %s %s %s",/* %s", */ + GS_PATH, device, resolution, /*devicesize,*/ + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? "": "- ")); +#ifndef MIKTEX + if (pipe(pspipe) || pipe(pngpipe)) return(NULL); +#ifndef WIN32 + /* We have fork: execute gs in child */ + pid = fork(); + if (pid == 0) { /* Child, execute gs. */ + close(pspipe[WRITE_END]); + dup2(pspipe[READ_END], STDIN_FILENO); + close(pspipe[READ_END]); + close(pngpipe[READ_END]); + dup2(pngpipe[WRITE_END], STDOUT_FILENO); + close(pngpipe[WRITE_END]); + execlp(GS_PATH, GS_PATH, device, resolution, /*devicesize,*/ + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? NULL: "-", + NULL); + _exit (EXIT_FAILURE); + } +#else /* WIN32 */ + /* No fork but spawn: execute gs in present process environment. + Save fileno's, attach pipes to this process' stdin and stdout. */ + savestdin = _dup(fileno(stdin)); + _dup2(pspipe[READ_END], fileno(stdin)); + savestdout = _dup(fileno(stdout)); + _dup2(pngpipe[WRITE_END], fileno(stdout)); + if ((hchild= + (HANDLE)spawnlp(_P_NOWAIT, GS_PATH, GS_PATH, device, resolution, + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? NULL : "-", NULL))==0) + return NULL; +#endif /* WIN32 */ + close(pspipe[READ_END]); + close(pngpipe[WRITE_END]); +#else /* MIKTEX */ + /* No fork but miktex_start_process3: execute gs using that. + Attach file descriptors to that process' stdin and stdout. */ + if (! miktex_find_miktex_executable("mgs.exe", szGsPath)) { + Warning("Ghostscript could not be found"); + return(NULL); + } + snprintf(szCommandLine,2048,"\"%s\" %s %s %s %s %s %s %s %s %s %s",/* %s",*/ + szGsPath, device, resolution, /*devicesize,*/ + "-dBATCH", "-dNOPAUSE", "-q", "-sOutputFile=-", + "-dTextAlphaBits=4", "-dGraphicsAlphaBits=4", + (option_flags & NO_GSSAFER) ? "-": "-dSAFER", + (option_flags & NO_GSSAFER) ? "": "-"); + if (! miktex_start_process_3(szCommandLine, &pi, INVALID_HANDLE_VALUE, + &hPsStream, &hPngStream, &hStdErr, 0)) { + Warning("Ghostscript could not be started"); + return(NULL); + } + CloseHandle (pi.hThread); + pspipe[WRITE_END] = _open_osfhandle((intptr_t)hPsStream, _O_WRONLY); + pngpipe[READ_END] = _open_osfhandle((intptr_t)hPngStream, _O_RDONLY); +#endif /* MIKTEX */ + if (pspipe[WRITE_END] >= 0) { + if ((psstream=fdopen(pspipe[WRITE_END],"wb")) == NULL) + close(pspipe[WRITE_END]); + else { + writepscode(psstream,psheaderp); + /* Page size */ + DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\t<>setpagedevice", + urx - llx, ury - lly,llx,lly)); + fprintf(psstream, "<>setpagedevice\n", + urx - llx, ury - lly,llx,lly); + /* Background color */ + if ( bgred < 255 || bggreen < 255 || bgblue < 255 ) { + DEBUG_PRINT(DEBUG_GS,("\n PS CODE:\tgsave %f %f %f setrgbcolor clippath fill grestore", + bgred/255.0, bggreen/255.0, bgblue/255.0)); + fprintf(psstream, "gsave %f %f %f setrgbcolor clippath fill grestore\n", + bgred/255.0, bggreen/255.0, bgblue/255.0); + } + writepscode(psstream,pscodep); + fclose(psstream); + } + } + if (pngpipe[READ_END] >= 0) { + if((pngstream=fdopen(pngpipe[READ_END],"rb")) == NULL) + close(pngpipe[READ_END]); + else { + psimage = gdImageCreateFromPng(pngstream); + fclose(pngstream); + } + } +#ifndef MIKTEX +#ifndef WIN32 + /* Wait for child */ + waitpid(pid,NULL,0); +#else + /* Wait for spawned process, restore stdin and stdout */ + while(nexitcode == STILL_ACTIVE) + GetExitCodeProcess((HANDLE)hchild, &nexitcode); + CloseHandle((HANDLE)hchild); + _dup2(savestdin, fileno(stdin)); + _dup2(savestdout, fileno(stdout)); + close(savestdin); + close(savestdout); +#endif /* WIN32 */ +#else /* MIKTEX */ + /* Close miktex process */ + CloseHandle(pi.hProcess); +#endif /* MIKTEX */ +#ifdef DEBUG + if (psimage == NULL) { + DEBUG_PRINT(DEBUG_GS,("\n GS OUTPUT:\tNO IMAGE ")); + } else { + DEBUG_PRINT(DEBUG_GS,("\n GS OUTPUT:\t%dx%d image ", + gdImageSX(psimage),gdImageSY(psimage))); + } +#endif + return psimage; +} + +static gdImagePtr +rescale(gdImagePtr psimage, int pngwidth, int pngheight) +{ + gdImagePtr scaledimage=psimage; + /* Rescale unless correct size */ + if (psimage!=NULL + && gdImageSX(psimage)!=pngwidth + && gdImageSY(psimage)!=pngheight) { + DEBUG_PRINT(DEBUG_DVI, + ("\n RESCALE INCLUDED BITMAP \t(%d,%d) -> (%d,%d)", + gdImageSX(psimage),gdImageSY(psimage), + pngwidth,pngheight)); +#ifdef HAVE_GDIMAGECREATETRUECOLOR + scaledimage=gdImageCreateTrueColor(pngwidth,pngheight); + /* Copy with overwrite, remember that this is the rescaled source + image. The real target has alpha blending on. */ + gdImageAlphaBlending(scaledimage,0); + gdImageCopyResampled(scaledimage,psimage,0,0,0,0, + pngwidth,pngheight, + gdImageSX(psimage),gdImageSY(psimage)); +#else + scaledimage=gdImageCreate(pngwidth,pngheight); + gdImageCopyResized(scaledimage,psimage,0,0,0,0, + pngwidth,pngheight, + gdImageSX(psimage),gdImageSY(psimage)); +#endif + gdImageDestroy(psimage); + } + return(scaledimage); +} + +static void newpsheader(const char* special) { + struct pscode* tmp; + char* txt; + + if (psheaderp==NULL && strcmp(special,"header=tex.pro")!=0) { + newpsheader("header=tex.pro"); + newpsheader("header=color.pro"); + newpsheader("header=special.pro"); + } + if (strcmp(special+strlen(special)-4,".xcp")==0 + && strncmp(special,"header=",7)==0) + InitXColorPrologue(special+7); + if (strncmp(special,"! /pgfH",7)==0) + newpsheader("! TeXDict begin"); + if (psheaderp==NULL) { + if ((tmp=psheaderp=malloc(sizeof(struct pscode)))==NULL) + Fatal("cannot malloc space for PostScript header struct"); + } else { + /* No duplicates. This still misses pre=..., because we still + change that. To be fixed */ + tmp=psheaderp; + if (strcmp(tmp->special,special)==0) + return; + while(tmp->next!=NULL) { + tmp=tmp->next; + if (strcmp(tmp->special,special)==0) + return; + } + if ((tmp->next=malloc(sizeof(struct pscode)))==NULL) + Fatal("cannot malloc space for PostScript header struct"); + tmp=tmp->next; + } + DEBUG_PRINT(DEBUG_GS,("\n PS HEADER ")); + if ((txt=malloc(strlen(special)+1))==NULL) + Fatal("cannot malloc space for PostScript header"); + strcpy(txt,special); + PSCodeInit(tmp,txt); +} + +/*********************************************************************/ +/**************************** SetSpecial ***************************/ +/*********************************************************************/ + +void SetSpecial(char * special, int32_t hh, int32_t vv) +/* interpret a \special command, made up of keyword=value pairs, + * or !header or ps:raw_PostScript + */ +{ + DEBUG_PRINT(DEBUG_DVI,(" '%s'",special)); + SKIPSPACES(special); + /********************** Color specials ***********************/ + if (strncmp(special,"background ",11)==0) { + background(special+11); + return; + } + if (strncmp(special,"color ",6)==0) { + special+=6; + SKIPSPACES(special); + if (strncmp(special,"push ",5)==0) { + pushcolor(special+5); + } else { + if (strcmp(special,"pop")==0) + popcolor(); + else + resetcolorstack(special); + } + return; + } + + /******************* Image inclusion ********************/ + + /* Needed tests for regression: PNG, GIF, JPEG and EPS inclusion, + * for different gd versions */ + + if (strncmp(special,"PSfile=",7)==0) { /* PSfile */ + char* psname = special+7; + int llx=0,lly=0,urx=0,ury=0,rwi=0,rhi=0; + bool clip=false; + int hresolution,vresolution; + int pngheight,pngwidth; + + /* Remove quotation marks around filename. If no quotation marks, + use first word as filename */ + if (*psname=='"') { + psname++; + special=strrchr(psname,'"'); + } else { + special=strchr(psname,' '); + } + if (special!=NULL) { + *special='\0'; + special++; + } + + /* Retrieve parameters */ + SKIPSPACES(special); + while(special && *special) { + if (strncmp(special,"llx=",4)==0) + llx = strtol(special+4,&special,10); + else if (strncmp(special,"lly=",4)==0) + lly = strtol(special+4,&special,10); + else if (strncmp(special,"urx=",4)==0) + urx = strtol(special+4,&special,10); + else if (strncmp(special,"ury=",4)==0) + ury = strtol(special+4,&special,10); + else if (strncmp(special,"rwi=",4)==0) + rwi = strtol(special+4,&special,10); + else if (strncmp(special,"rhi=",4)==0) + rhi = strtol(special+4,&special,10); + else if (strncmp(special,"clip",4)==0) + {clip = true; special=special+4;} + while (*special && *special!=' ') special++; + SKIPSPACES(special); + } + + /* Calculate resolution, and use our base resolution as a fallback. */ + /* The factor 10 is magic, the dvips graphicx driver needs this. */ + hresolution = ((dpi*rwi+urx-llx-1)/(urx - llx)+9)/10; + vresolution = ((dpi*rhi+ury-lly-1)/(ury - lly)+9)/10; + if (vresolution==0) vresolution = hresolution; + if (hresolution==0) hresolution = vresolution; + if (hresolution==0) hresolution = vresolution = dpi; + + /* Convert from postscript 72 dpi resolution to our given resolution */ + pngwidth = (dpi*rwi+719)/720; /* +719: round up */ + pngheight = (dpi*rhi+719)/720; + if (pngwidth==0) + pngwidth = ((dpi*rhi*(urx-llx)+ury-lly-1)/(ury-lly)+719)/720; + if (pngheight==0) + pngheight = ((dpi*rwi*(ury-lly)+urx-llx-1)/(urx-llx)+719)/720; + if (pngheight==0) { + pngwidth = (dpi*(urx-llx)+71)/72; + pngheight = (dpi*(ury-lly)+71)/72; + } + if (page_imagep != NULL) { /* Draw into image */ + struct pscode image; + gdImagePtr psimage=NULL; +#ifndef HAVE_GDIMAGECREATEFROMPNGPTR + FILE* psstream; +#endif + + PSCodeInit(&image, NULL); + image.filename=kpse_find_file(psname,kpse_pict_format,0); + if (MmapFile(image.filename,&(image.fmmap)) || image.fmmap.size==0) { + Warning("Image file %s unusable, image will be left blank", + image.filename); + page_flags |= PAGE_GAVE_WARN; + return; + } + Message(BE_NONQUIET," <%s",psname); + switch ((unsigned char)*image.fmmap.data) { + case 0x89: /* PNG magic: "\211PNG\r\n\032\n" */ + DEBUG_PRINT(DEBUG_DVI,("\n INCLUDE PNG \t%s",image.filename)); +#ifdef HAVE_GDIMAGECREATEFROMPNGPTR + psimage=gdImageCreateFromPngPtr(image.fmmap.size,image.fmmap.data); +#else + psstream=fopen(image.filename,"rb"); + psimage=gdImageCreateFromPng(psstream); + fclose(psstream); +#endif + psimage=rescale(psimage,pngwidth,pngheight); + break; + case 'G': /* GIF magic: "GIF87" or "GIF89" */ + DEBUG_PRINT(DEBUG_DVI,("\n INCLUDE GIF \t%s",image.filename)); +#ifdef HAVE_GDIMAGEGIF + psimage=rescale(gdImageCreateFromGifPtr(image.fmmap.size, + image.fmmap.data), + pngwidth,pngheight); +#else + DEBUG_PRINT(DEBUG_DVI,(" (NO GIF DECODER)")); +#endif + break; + case 0xff: /* JPEG magic: 0xffd8 */ + DEBUG_PRINT(DEBUG_DVI,("\n INCLUDE JPEG \t%s",image.filename)); +#ifdef HAVE_GDIMAGECREATEFROMJPEG +#ifdef HAVE_GDIMAGECREATEFROMPNGPTR + psimage=gdImageCreateFromJpegPtr(image.fmmap.size,image.fmmap.data); +#else + psstream=fopen(image.filename,"rb"); + psimage=gdImageCreateFromJpeg(psstream); + fclose(psstream); +#endif + psimage=rescale(psimage,pngwidth,pngheight); +#else + DEBUG_PRINT(DEBUG_DVI,(" (NO JPEG DECODER)")); +#endif + break; + default: /* Default, PostScript magic: "%!PS-Adobe" */ + if (option_flags & NO_GHOSTSCRIPT) { + Warning("GhostScript calls disallowed by --nogs" ); + page_flags |= PAGE_GAVE_WARN; + } else { + /* Ensure one (and only one) showpage */ + image.code=" /DVIPNGDICT 100 dict def DVIPNGDICT begin /showpage {} def "; + image.postcode=" end showpage\n"; + /* Use alpha blending, and render transparent postscript + images. The alpha blending works correctly only from + libgd 2.0.12 upwards */ +#ifdef HAVE_GDIMAGEPNGEX + if (page_imagep->trueColor) { + int tllx=llx,tlly=lly,turx=urx,tury=ury; + + DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), + ("\n GS RENDER \t%s -> pngalpha ",image.filename)); + if (!clip) { + /* Render across the whole image */ + tllx=llx-(hh+1)*72/hresolution; + tlly=lly-(gdImageSY(page_imagep)-vv-1)*72/vresolution; + turx=llx+(gdImageSX(page_imagep)-hh)*72/hresolution; + tury=lly+(vv+1)*72/vresolution; + DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), + ("\n EXPAND BBOX \t%d %d %d %d -> %d %d %d %d", + llx,lly,urx,ury,tllx,tlly,turx,tury)); +#ifdef DEBUG + } else { + DEBUG_PRINT((DEBUG_DVI | DEBUG_GS),(", CLIPPED TO BBOX")); +#endif + } + psimage = ps2png(&image, "-sDEVICE=pngalpha", + hresolution, vresolution, + tllx, tlly, turx, tury, + 255,255,255); + if (psimage==NULL) + Warning("No GhostScript pngalpha output, opaque image inclusion"); + } else + Warning("Palette output, opaque image inclusion"); +#endif + if (psimage==NULL) { + /* png256 gives inferior result */ + DEBUG_PRINT((DEBUG_DVI | DEBUG_GS), + ("\n GS RENDER \t%s -> png16m", image.filename)); + psimage = ps2png(&image, "-sDEVICE=png16m", + hresolution, vresolution, + llx, lly, urx, ury, + cstack[0].red,cstack[0].green,cstack[0].blue); + clip=true; + page_flags |= PAGE_GAVE_WARN; + } + if (!clip) { + /* Rendering across the whole image */ + hh=0; + vv=gdImageSY(psimage)-1; + } + } + } + UnMmapFile(&(image.fmmap)); + if (psimage!=NULL) { + DEBUG_PRINT(DEBUG_DVI, + ("\n GRAPHIC(X|S) INCLUDE \t%s (%d,%d) res %dx%d at (%d,%d)", + psname,gdImageSX(psimage),gdImageSY(psimage), + hresolution,vresolution,hh,vv)); +#ifdef HAVE_GDIMAGECREATETRUECOLOR + if (psimage->trueColor && !page_imagep->trueColor) + gdImageTrueColorToPalette(psimage,0,256); +#endif +#ifdef HAVE_GDIMAGEPNGEX + gdImageAlphaBlending(page_imagep,1); +#else + Warning("Using libgd < 2.0.12, opaque image inclusion"); + page_flags |= PAGE_GAVE_WARN; +#endif + gdImageCopy(page_imagep, psimage, + hh, vv-gdImageSY(psimage)+1, + 0,0, + gdImageSX(psimage),gdImageSY(psimage)); +#ifdef HAVE_GDIMAGEPNGEX + gdImageAlphaBlending(page_imagep,0); +#endif + gdImageDestroy(psimage); + } else { + Warning("Unable to load %s, image will be left blank",image.filename); + page_flags |= PAGE_GAVE_WARN; + } + free(image.filename); + Message(BE_NONQUIET,">"); + } else { /* Don't draw */ + page_flags |= PAGE_TRUECOLOR; + DEBUG_PRINT(DEBUG_DVI, + ("\n GRAPHIC(X|S) INCLUDE \t%s (%d,%d) res %dx%d at (%d,%d)", + psname,pngheight,pngwidth, + hresolution,vresolution,hh,vv)); + min(x_min,hh); + min(y_min,vv-pngheight+1); + max(x_max,hh+pngwidth); + max(y_max,vv+1); + } + return; + } + + /******************* Raw PostScript ********************/ + + if (strncmp(special,"!/preview@version(",18)==0) { + int length=0; + special+=18; + while (special[length]!='\0' && special[length]!=')') + length++; + if (page_imagep==NULL) + Message(BE_NONQUIET," (preview-latex version %.*s)",length,special); + return; + } + + /* preview-latex' tightpage option */ + if (strncmp(special,"!/preview@tightpage",19)==0) { + special+=19; + SKIPSPACES(special); + if (strncmp(special,"true",4)==0) { + if (page_imagep==NULL) + Message(BE_NONQUIET," (preview-latex tightpage option detected, will use its bounding box)"); + dvi->flags |= DVI_PREVIEW_LATEX_TIGHTPAGE; + } + return; + } + if (strncmp(special,"!userdict",9)==0 + && strstr(special+10,"7{currentfile token not{stop}if 65781.76 div")!=NULL) { + if (page_imagep==NULL && ~dvi->flags & DVI_PREVIEW_LATEX_TIGHTPAGE) + Message(BE_NONQUIET," (preview-latex <= 0.9.1 tightpage option detected, will use its bounding box)"); + dvi->flags |= DVI_PREVIEW_LATEX_TIGHTPAGE; + return; + } + + /* preview-latex' dvips bop-hook redefinition */ + if (strncmp(special,"!userdict",9)==0 + && strstr(special+10,"preview-bop-")!=NULL) { + dvi->flags |= DVI_PREVIEW_BOP_HOOK; + if (page_imagep==NULL) + Message(BE_VERBOSE," (preview-latex beginning-of-page-hook detected)"); + return; + } + + if (dvi->flags & DVI_PREVIEW_BOP_HOOK && ~page_flags & PAGE_PREVIEW_BOP + && strncmp(special,"ps::",4)==0) { + /* Hokay, decode bounding box */ + dviunits adj_llx,adj_lly,adj_urx,adj_ury,ht,dp,wd; + adj_llx = strtol(special+4,&special,10); + adj_lly = strtol(special,&special,10); + adj_urx = strtol(special,&special,10); + adj_ury = strtol(special,&special,10); + ht = strtol(special,&special,10); + dp = strtol(special,&special,10); + wd = strtol(special,&special,10); + page_flags |= PAGE_PREVIEW_BOP; + if (wd>0) { + x_offset_tightpage = + (-adj_llx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + x_width_tightpage = x_offset_tightpage + +(wd+adj_urx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + } else { + x_offset_tightpage = + (-wd+adj_urx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + x_width_tightpage = x_offset_tightpage + +(-adj_llx+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + } + /* y-offset = height - 1 */ + y_offset_tightpage = + (((ht>0)?ht:0)+adj_ury+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor-1; + y_width_tightpage = y_offset_tightpage+1 + +(((dp>0)?dp:0)-adj_lly+dvi->conv*shrinkfactor-1)/dvi->conv/shrinkfactor; + return; + } + + if (special[0]=='"' || strncmp(special,"ps:",3)==0) { /* Raw PostScript */ + if (option_flags & NO_RAW_PS) { + Warning("Raw PostScript rendering disallowed by --norawps" ); + page_flags |= PAGE_GAVE_WARN; + return; + } + if (page_imagep != NULL) { /* Draw into image */ + static struct pscode *pscodep=NULL; + static bool psenvironment=false; + bool nextisps; + struct pscode *tmp; + gdImagePtr psimage=NULL; + char *txt; + const char *specialend=special+strlen(special); + const char *newspecial=NULL; + + /* hyperref non-rendering PostScript specials. */ + if (strcmp(specialend-11,"pdfmark end")==0 + || strcmp(specialend-7,"H.A end")==0 + || strcmp(specialend-7,"H.B end")==0 + || strcmp(specialend-7,"H.L end")==0 + || strcmp(specialend-7,"H.R end")==0 + || strcmp(specialend-7,"H.S end")==0 + || strcmp(specialend-7,"H.V end")==0 + || strncmp(special,"ps:SDict begin /product",23)==0) + if (pscodep==NULL) + return; + else + newspecial=""; + /* pgf PostScript specials. */ + else if (strcmp(special,"ps:: pgfo")==0) + /* pgf page start. The first numbers are generally valid for + the bop instruction, and the latter code is to move the + origin to the right place. */ + newspecial="ps:: 39139632 55387786 1000 600 600 (tikzdefault.dvi) @start 1 0 bop pgfo 0 0 matrix defaultmatrix transform itransform translate"; + else if (strcmp(special,"ps:: pgfc")==0) + newspecial="ps:: pgfc eop end"; + /* Some packages split their raw PostScript code into + several specials. Check for those, and concatenate them so + that they're given to one and the same invocation of gs */ + else if (strncmp(special,"ps::[begin]",11)==0) + psenvironment=true; + else if (strncmp(special,"ps::[end]",9)==0) + psenvironment=false; + if (pscodep==NULL) { + Message(BE_NONQUIET," next != NULL) + tmp=tmp->next; + if ((tmp->next=malloc(sizeof(struct pscode)))==NULL) + Fatal("cannot malloc space for raw PostScript struct"); + tmp=tmp->next; + } + nextisps=DVIIsNextPSSpecial(dvi); + if (psenvironment || nextisps) { + if (!nextisps) { + Warning("PostScript environment contains DVI commands"); + page_flags |= PAGE_GAVE_WARN; + } + DEBUG_PRINT(DEBUG_GS,("\n PS SPECIAL ")); + if (newspecial == NULL) + newspecial=special; + if ((txt=malloc(strlen(newspecial)+1))==NULL) + Fatal("cannot allocate space for raw PostScript special"); + strcpy(txt,newspecial); + PSCodeInit(tmp,txt); + return; + } + DEBUG_PRINT(DEBUG_DVI,("\n LAST PS SPECIAL ")); + if (newspecial != NULL) { + if ((special=malloc(strlen(newspecial)+1))==NULL) + Fatal("cannot allocate space for raw PostScript special"); + strcpy(special,newspecial); + } + PSCodeInit(tmp,special); + /* Now, render image */ + if (option_flags & NO_GHOSTSCRIPT) + Warning("GhostScript calls disallowed by --nogs" ); + else { + /* Use alpha blending, and render transparent postscript + images. The alpha blending works correctly only from + libgd 2.0.12 upwards */ +#ifdef HAVE_GDIMAGEPNGEX + if (page_imagep->trueColor) { + /* Render across the whole image */ + psimage = ps2png(pscodep, "-sDEVICE=pngalpha", + dpi,dpi, + -(hh+1)*72/dpi, + -(gdImageSY(page_imagep)-vv-1)*72/dpi, + (gdImageSX(page_imagep)-hh)*72/dpi, + (vv+1)*72/dpi, + 255,255,255); + if (psimage!=NULL) { + gdImageAlphaBlending(page_imagep,1); + gdImageCopy(page_imagep, psimage, + 0,0,0,0, + gdImageSX(psimage),gdImageSY(psimage)); + gdImageAlphaBlending(page_imagep,0); + gdImageDestroy(psimage); + } else + Warning("No image output from inclusion of raw PostScript"); + } else + Warning("Palette output, cannot include raw PostScript"); +#else + Warning("Using libgd < 2.0.12, unable to include raw PostScript"); +#endif + } + while(pscodep->next != NULL) { + tmp=pscodep->next; + free(pscodep->special); + free(pscodep); + pscodep=tmp; + } + free(pscodep); + pscodep=NULL; + if (newspecial != NULL) + free(special); + if (psimage==NULL) + page_flags |= PAGE_GAVE_WARN; + Message(BE_NONQUIET,">"); + } else { /* Don't draw */ + page_flags |= PAGE_TRUECOLOR; + } + return; + } + + if (strncmp(special,"papersize=",10)==0) { /* papersize spec, ignored */ + return; + } + + if (special[0]=='!' || strncmp(special,"header=",7)==0) { /* PS header */ + newpsheader(special); + return; + } + + if (strncmp(special,"src:",4)==0) { /* source special */ + if ( page_imagep != NULL ) + Message(BE_NONQUIET," at (%ld,%ld) source \\special{%s}", + hh, vv, special); + return; + } + if ( page_imagep != NULL ) { + Warning("at (%ld,%ld) unimplemented \\special{%s}", + hh, vv, special); + page_flags |= PAGE_GAVE_WARN; + } +} + diff --git a/Build/source/texk/dvipng/dvipng-1.14/t1.c b/Build/source/texk/dvipng/dvipng-1.14/t1.c new file mode 100644 index 00000000000..4a74a8274f4 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/t1.c @@ -0,0 +1,192 @@ +/* t1.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2009 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +void LoadT1(int32_t c, struct char_entry * ptr) +{ + GLYPH *glyph; + int original_width,original_height; + int i,j,k,width,height; + unsigned short shrunk_width,shrunk_height; + short xoffset,yoffset; + unsigned short i_offset,j_offset; + + DEBUG_PRINT(DEBUG_T1,("\n LOAD T1 CHAR\t%d",c)); + if ((glyph= + T1_SetChar(currentfont->T1id, c, + (float)currentfont->dpi*currentfont->d/65536/72.27, + currentfont->psfontmap==NULL ? NULL : currentfont->psfontmap->t1_transformp)) + ==NULL) + Fatal("cannot load T1 char %d",c); + + DEBUG_PRINT(DEBUG_T1,(" (%d)",ptr->tfmw)); + + original_width = glyph->metrics.rightSideBearing + - glyph->metrics.leftSideBearing; + original_height = glyph->metrics.ascent - glyph->metrics.descent; + DEBUG_PRINT(DEBUG_T1,(" %dx%d",original_width,original_height)); + + if (original_width > 0x7fff || original_height > 0x7fff) + Fatal("character %d too large in file %s", c, currentfont->name); + + /* + * Hotspot issues: Shrinking to the topleft corner rather than the + hotspot will displace glyphs a fraction of a pixel. We deal with + this in as follows: The glyph is shrunk to its hotspot by + offsetting the bitmap somewhat to put the hotspot in the lower + left corner of a "shrink square". Shrinking to the topleft corner + will then act as shrinking to the hotspot. This may enlarge the + bitmap somewhat, of course. (Also remember that the below + calculation of i/j_offset is in integer arithmetics.) + + There will still be a displacement from rounding the dvi + position, but vertically it will be equal for all glyphs on a + line, so we displace a whole line vertically by fractions of a + pixel. This is acceptible, IMHO. Sometime there will be support + for subpixel positioning, horizontally. Will do for now, I + suppose. + */ + xoffset = -glyph->metrics.leftSideBearing; + /* printf("xoffset: %d\n",xoffset); */ + i_offset = ( shrinkfactor - xoffset % shrinkfactor ) % shrinkfactor; + width = original_width+i_offset; + ptr->xOffset = xoffset+i_offset; + + yoffset = glyph->metrics.ascent-1; + /* printf("yoffset: %d\n",yoffset); */ + j_offset = ( shrinkfactor - (yoffset-(shrinkfactor-1)) % shrinkfactor ) + % shrinkfactor; + height = original_height+j_offset; + ptr->yOffset = yoffset+j_offset; + + DEBUG_PRINT(DEBUG_T1,(" (%dx%d)",width,height)); + /* + Extra marginal so that we do not crop the image when shrinking. + */ + shrunk_width = (width + shrinkfactor - 1) / shrinkfactor; + shrunk_height = (height + shrinkfactor - 1) / shrinkfactor; + ptr->w = shrunk_width; + ptr->h = shrunk_height; + + /* printf("(%d,%d) ",ptr->w,ptr->h); */ + DEBUG_PRINT(DEBUG_GLYPH,("\nDRAW GLYPH %d\n", (int)c)); + + /* + Shrink raster while doing antialiasing. + */ + if ((ptr->data = calloc(shrunk_width*shrunk_height,sizeof(char))) == NULL) + Fatal("unable to malloc image space for char %c", (char)c); + for (j = 0; j < original_height; j++) { + for (i = 0; i < (original_width+7)/8 ; i++) { + for (k = 0; k < 8 ; k++) { + DEBUG_PRINT(DEBUG_GLYPH, + ("%c", + (glyph->bits[i+j*((original_width+7)/8)] & (1<data[(i*8+k+i_offset)/shrinkfactor + +(j+j_offset)/shrinkfactor*shrunk_width] += + (glyph->bits[i+j*((original_width+7)/8)] & (1<data[i+j*shrunk_width] = ptr->data[i+j*shrunk_width] + *255/shrinkfactor/shrinkfactor; + DEBUG_PRINT(DEBUG_GLYPH,("%3u ",ptr->data[i+j*shrunk_width])); + } + DEBUG_PRINT(DEBUG_GLYPH,("|\n")); + } +} + +bool InitT1(struct font_entry * tfontp) +{ + if (libt1==NULL) { + if ((libt1=T1_InitLib( NO_LOGFILE | IGNORE_CONFIGFILE + | IGNORE_FONTDATABASE | T1_NO_AFM)) == NULL) { + Warning("an error occured during t1lib initialisation, disabling it"); + option_flags &= ~USE_LIBT1; + return(false); + } +# ifdef DEBUG + else + DEBUG_PRINT(DEBUG_T1,("\n T1LIB VERSION: %s", T1_GetLibIdent())); +# endif + } + + DEBUG_PRINT((DEBUG_DVI|DEBUG_T1),("\n OPEN T1 FONT:\t'%s'", tfontp->name)); + tfontp->T1id = T1_AddFont( tfontp->name ); + if (tfontp->T1id < 0) { + Warning("t1lib could not open font file %s", tfontp->name); + return(false); + } + if (T1_LoadFont(tfontp->T1id)) { + Warning("t1lib could not load font file %s", tfontp->name); + return(false); + } + Message(BE_VERBOSE,"<%s>", tfontp->name); + if (tfontp->psfontmap!=NULL && tfontp->psfontmap->encoding != NULL) { + DEBUG_PRINT(DEBUG_T1,("\n USE ENCODING:\t'%s'", tfontp->psfontmap->encoding->name)); + if (T1_ReencodeFont(tfontp->T1id,tfontp->psfontmap->encoding->charname)) { + Warning("unable to use font encoding '%s' for %s", + tfontp->psfontmap->encoding->name,tfontp->name); + return(false); + } + } + tfontp->type = FONT_TYPE_T1; + return(true); +} + + +static void UnLoadT1(struct char_entry *ptr) +{ + if (ptr->data!=NULL) + free(ptr->data); + ptr->data=NULL; +} + + +void DoneT1(struct font_entry *tfontp) +{ + int c=0; + + int error = T1_DeleteFont( tfontp->T1id ); + if (error) + Warning("font file %s could not be closed", tfontp->name); + while(cchr[c]!=NULL) { + UnLoadT1((struct char_entry*)tfontp->chr[c]); + free(tfontp->chr[c]); + tfontp->chr[c]=NULL; + } + c++; + } + if (tfontp->name!=NULL) + free(tfontp->name); + tfontp->name=NULL; +} + + diff --git a/Build/source/texk/dvipng/dvipng-1.14/test_dvipng.tex b/Build/source/texk/dvipng/dvipng-1.14/test_dvipng.tex new file mode 100644 index 00000000000..34814776070 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/test_dvipng.tex @@ -0,0 +1,48 @@ +% test_dvipng.tex +% +% Part of the dvipng distribution +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU Lesser General Public License as +% published by the Free Software Foundation, either version 3 of the +% License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, but +% WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% Lesser General Public License for more details. +% +% You should have received a copy of the GNU Lesser General Public +% License along with this program. If not, see +% . +% +% Copyright (C) 2002-2010 Jan-{\AA}ke Larsson + +\documentclass{article} +%\usepackage[active,textmath]{preview} +\usepackage{color} +\pagestyle{empty} + +\begin{document} +\begin{equation} + \int dx +\end{equation} +\newpage +$\int dx$ +\newpage +$\sqrt2+1=\frac1{\sqrt2-1}$ +\newpage +\framebox{\textbackslash\ttfamily framebox} +\newpage +\( \begin{array}{|r|} \hline a \cr \hline \end{array} \) +\newpage +fig, pig, flask, efficiency, effluent +\newpage +\Huge A \LARGE A \Large A \large A \normalsize A \small A +\footnotesize A \scriptsize A \tiny A +\newpage +\color{yellow} + +\section*{Hello world} +\pagecolor{blue} +\end{document} diff --git a/Build/source/texk/dvipng/dvipng-1.14/tfm.c b/Build/source/texk/dvipng/dvipng-1.14/tfm.c new file mode 100644 index 00000000000..a8a829cc932 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/tfm.c @@ -0,0 +1,75 @@ +/* tfm.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2009 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +bool ReadTFM(struct font_entry * tfontp, char* tfmname) +{ + struct filemmap fmmap; + struct char_entry *tcharptr; + unsigned char *position; + int lh,bc,ec,nw, c; + dviunits* width; + + DEBUG_PRINT((DEBUG_DVI|DEBUG_FT|DEBUG_TFM), + ("\n OPEN METRICS:\t'%s'", tfmname)); + if (MmapFile(tfmname,&fmmap)) return(false); + position=(unsigned char*)fmmap.data; + lh = UNumRead(position+2,2); + bc = UNumRead(position+4,2); + ec = UNumRead(position+6,2); + nw = UNumRead(position+8,2); + DEBUG_PRINT(DEBUG_TFM,(" %d %d %d %d",lh,bc,ec,nw)); + width=malloc(nw*sizeof(dviunits)); + c=0; + position=position+24+(lh+ec-bc+1)*4; + while( c < nw ) { + width[c] = SNumRead(position,4); + c++; + position += 4; + } + + /* Read char widths */ + c=bc; + position=(unsigned char*)fmmap.data+24+lh*4; + while(c <= ec) { + DEBUG_PRINT(DEBUG_TFM,("\n@%ld TFM METRICS:\t", + (long)position - (long)fmmap.data)); + tcharptr=xmalloc(sizeof(struct char_entry)); + tcharptr->data=NULL; + tcharptr->tfmw=width[*position]; + DEBUG_PRINT(DEBUG_TFM,("%d [%d] %d",c,*position,tcharptr->tfmw)); + tcharptr->tfmw = (dviunits) + ((int64_t) tcharptr->tfmw * tfontp->s / (1 << 20)); + DEBUG_PRINT(DEBUG_TFM,(" (%d)",tcharptr->tfmw)); + if (c >= NFNTCHARS) /* Only positive for now */ + Fatal("tfm file %s exceeds char numbering limit",tfmname); + tfontp->chr[c] = tcharptr; + c++; + position += 4; + } + free(width); + UnMmapFile(&fmmap); + return(true); +} diff --git a/Build/source/texk/dvipng/dvipng-1.14/vf.c b/Build/source/texk/dvipng/dvipng-1.14/vf.c new file mode 100644 index 00000000000..d1d33fe6d7e --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14/vf.c @@ -0,0 +1,144 @@ +/* vf.c */ + +/************************************************************************ + + Part of the dvipng distribution + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program. If not, see + . + + Copyright (C) 2002-2010 Jan-Åke Larsson + +************************************************************************/ + +#include "dvipng.h" + +#define VF_ID 202 +#define LONG_CHAR 242 + +int32_t SetVF(struct char_entry* ptr) +{ + struct font_entry* currentvf; + unsigned char *command,*end; + + currentvf=currentfont; + BeginVFMacro(currentvf); + command = ptr->data; + end = command + ptr->length; + while (command < end) { + DEBUG_PRINT(DEBUG_DVI,("\n VF MACRO:\t%s ", dvi_commands[*command])); + DrawCommand(command,currentvf); + command += CommandLength(command); + } + EndVFMacro(); + currentfont=currentvf; + return(ptr->tfmw); +} + + + +void InitVF(struct font_entry * tfontp) +{ + unsigned char* position; + int length; + struct char_entry *tcharptr; + uint32_t c=0; + struct font_num *tfontnump; /* temporary font_num pointer */ + + DEBUG_PRINT((DEBUG_DVI|DEBUG_VF),("\n OPEN FONT:\t'%s'", tfontp->name)); + Message(BE_VERBOSE,"<%s>", tfontp->name); + if (MmapFile(tfontp->name,&(tfontp->fmmap))) + Fatal("font file %s unusable", tfontp->name); + position=(unsigned char*)tfontp->fmmap.data; + if (*(position) != PRE) + Fatal("unknown font format in file %s",tfontp->name); + if (*(position+1) != VF_ID) + Fatal( "wrong version %d of vf file %s (should be 202)", + (int)*(position+1),tfontp->name); + DEBUG_PRINT(DEBUG_VF,("\n VF_PRE:\t'%.*s'", + (int)*(position+2), position+3)); + position = position+3 + *(position+2); + c=UNumRead(position, 4); + DEBUG_PRINT(DEBUG_VF,(" %d", c)); + CheckChecksum (tfontp->c, c, tfontp->name); + tfontp->designsize = UNumRead(position+4,4); + DEBUG_PRINT(DEBUG_VF,(" %d", tfontp->designsize)); + tfontp->type = FONT_TYPE_VF; + tfontp->vffontnump=NULL; + /* Read font definitions */ + position += 8; + while(*position >= FNT_DEF1 && *position <= FNT_DEF4) { + DEBUG_PRINT(DEBUG_VF,("\n @%ld VF:\t%s", + (long)position - (long)tfontp->fmmap.data, + dvi_commands[*position])); + FontDef(position,tfontp); + length = dvi_commandlength[*position]; + position += length + *(position + length-1) + *(position+length-2); + } + /* Default font is the first defined */ + tfontnump = tfontp->vffontnump; + while (tfontnump->next != NULL) { + tfontnump = tfontnump->next; + } + tfontp->defaultfont=tfontnump->k; + + /* Read char definitions */ + while(*position < FNT_DEF1) { + DEBUG_PRINT(DEBUG_VF,("\n@%ld VF CHAR:\t", + (long)position - (long)tfontp->fmmap.data)); + tcharptr=xmalloc(sizeof(struct char_entry)); + switch (*position) { + case LONG_CHAR: + tcharptr->length = UNumRead(position+1,4); + c = UNumRead(position+5,4); + tcharptr->tfmw = UNumRead(position+9,4); + position += 13; + break; + default: + tcharptr->length = UNumRead(position,1); + c = UNumRead(position+1,1); + tcharptr->tfmw = UNumRead(position+2,3); + position += 5; + } + DEBUG_PRINT(DEBUG_VF,("%d %d %d",tcharptr->length,c,tcharptr->tfmw)); + tcharptr->tfmw = (int32_t) + ((int64_t) tcharptr->tfmw * tfontp->s / (1 << 20)); + DEBUG_PRINT(DEBUG_VF,(" (%d)",tcharptr->tfmw)); + if (c >= NFNTCHARS) /* Only positive for now */ + Fatal("VF font %s exceeds char numbering limit",tfontp->name); + tfontp->chr[c] = tcharptr; + tcharptr->data=position; + position += tcharptr->length; + } +} + + +void DoneVF(struct font_entry *tfontp) +{ + int c=FIRSTFNTCHAR; + + UnMmapFile(&(tfontp->fmmap)); + while(c<=LASTFNTCHAR) { + if (tfontp->chr[c]!=NULL) { + free(tfontp->chr[c]); + tfontp->chr[c]=NULL; + } + c++; + } + FreeFontNumP(tfontp->vffontnump); + tfontp->vffontnump=NULL; + if (tfontp->name!=NULL) + free(tfontp->name); + tfontp->name=NULL; +} -- cgit v1.2.3