diff options
24 files changed, 305 insertions, 401 deletions
diff --git a/Build/source/texk/README b/Build/source/texk/README index d2dcaecef5f..2d7e574e829 100644 --- a/Build/source/texk/README +++ b/Build/source/texk/README @@ -59,7 +59,7 @@ dvipos - ? dvipsk - maintained here, by us -dvisvgm 1.13 - checked 9dec15 +dvisvgm 1.14 - checked 28dec15 http://dvisvgm.bplaced.net/Downloads gregorio 4.0.0 - checked 9dec15 diff --git a/Build/source/texk/dvisvgm/ChangeLog b/Build/source/texk/dvisvgm/ChangeLog index a78dde5b199..2951dfbe020 100644 --- a/Build/source/texk/dvisvgm/ChangeLog +++ b/Build/source/texk/dvisvgm/ChangeLog @@ -1,3 +1,8 @@ +2015-12-28 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * Imported release 1.14. + * version.ac: Adapted. + 2015-12-09 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * Imported release 1.13. diff --git a/Build/source/texk/dvisvgm/configure b/Build/source/texk/dvisvgm/configure index c48fdc37523..a0bb9200e9c 100755 --- a/Build/source/texk/dvisvgm/configure +++ b/Build/source/texk/dvisvgm/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 1.13. +# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 1.14. # # Report bugs to <tex-k@tug.org>. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvisvgm (TeX Live)' PACKAGE_TARNAME='dvisvgm--tex-live-' -PACKAGE_VERSION='1.13' -PACKAGE_STRING='dvisvgm (TeX Live) 1.13' +PACKAGE_VERSION='1.14' +PACKAGE_STRING='dvisvgm (TeX Live) 1.14' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1372,7 +1372,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 dvisvgm (TeX Live) 1.13 to adapt to many kinds of systems. +\`configure' configures dvisvgm (TeX Live) 1.14 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1443,7 +1443,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvisvgm (TeX Live) 1.13:";; + short | recursive ) echo "Configuration of dvisvgm (TeX Live) 1.14:";; esac cat <<\_ACEOF @@ -1583,7 +1583,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvisvgm (TeX Live) configure 1.13 +dvisvgm (TeX Live) configure 1.14 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2451,7 +2451,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 dvisvgm (TeX Live) $as_me 1.13, which was +It was created by dvisvgm (TeX Live) $as_me 1.14, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8137,7 +8137,7 @@ fi # Define the identity of the package. PACKAGE='dvisvgm--tex-live-' - VERSION='1.13' + VERSION='1.14' cat >>confdefs.h <<_ACEOF @@ -18321,7 +18321,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -dvisvgm (TeX Live) config.lt 1.13 +dvisvgm (TeX Live) config.lt 1.14 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -20684,7 +20684,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 dvisvgm (TeX Live) $as_me 1.13, which was +This file was extended by dvisvgm (TeX Live) $as_me 1.14, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20750,7 +20750,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="\\ -dvisvgm (TeX Live) config.status 1.13 +dvisvgm (TeX Live) config.status 1.14 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/ChangeLog b/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/ChangeLog index 0fd128aa0b9..6fadfe407e1 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/ChangeLog +++ b/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/ChangeLog @@ -1,3 +1,7 @@ +2015-12-28 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * Import release 1.14. + 2015-12-09 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * Import release 1.13. diff --git a/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/TL-Changes b/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/TL-Changes index 49db94bcd99..4741da71362 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/TL-Changes +++ b/Build/source/texk/dvisvgm/dvisvgm-src-PATCHES/TL-Changes @@ -1,4 +1,4 @@ -Changes applied to the dvisvgm-1.13 tree as obtained from: +Changes applied to the dvisvgm-1.14 tree as obtained from: http://dvisvgm.bplaced.net/Downloads Removed: @@ -14,7 +14,3 @@ Removed: test-driver tests/ */Makefile.in - -Converted Dos/Win line ends to native: - clipper/clipper.cpp - clipper/clipper.hpp diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog b/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog index ac9aeaaa2d0..2542d92a08e 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog +++ b/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog @@ -1,5 +1,47 @@ +2015-12-28 Martin Gieseking <martin.gieseking@uos.de> + + * NEWS: + updated NEWS + + * .travis.yml, configure.ac, src/Doxyfile: + set version to 1.14 + +2015-12-27 Martin Gieseking <martin.gieseking@uos.de> + + * src/PsSpecialHandler.cpp: + added evaluation of PSTricks specials 'pst:' and 'PST:' + +2015-12-26 Martin Gieseking <martin.gieseking@uos.de> + + * src/GraphicsPath.h, tests/GraphicsPathTest.cpp: + fixed memory issue in class GraphicsPath<T> + + * src/FileFinder.cpp: + lookup files in the current working directory before searching the texmf + tree + +2015-12-17 Martin Gieseking <martin.gieseking@uos.de> + + * doc/dvisvgm.txt.in, src/DVIToSVG.cpp, src/DVIToSVG.h, + src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, src/EPSToSVG.h, + src/PSPreviewFilter.cpp, src/PSPreviewFilter.h, src/PsSpecialHandler.cpp, + src/SpecialActions.h, src/dvisvgm.cpp: + added option --bbox=preview; adapt preview data if --bbox=min + +2015-12-09 Martin Gieseking <martin.gieseking@uos.de> + + * tests/GhostscriptTest.cpp: + prevent opening a graphics window when running GhostscriptTest + + * src/FileFinder.cpp: + return entire kpathsea version string if it doesn't start with + 'kpathsea' + 2015-12-08 Martin Gieseking <martin.gieseking@uos.de> + * clipper/clipper.cpp, clipper/clipper.hpp: + replaced DOS line endings of the Clipper sources to Unix ones + * NEWS: updated NEWS @@ -104,11 +146,6 @@ * src/Process.cpp, src/Process.h: fixed invalid access to freed string memory -2015-10-06 Martin Gieseking <martin.gieseking@uos.de> - - * doc/dvisvgm.txt.in: - minor improvements of the manual page - 2015-09-21 Martin Gieseking <martin.gieseking@uos.de> * NEWS, README, README.md: @@ -373,9 +410,9 @@ * doc/dvisvgm.txt.in: minor additions and formatting changes of the manpage - * doc/dvisvgm.txt.in, src/SVGOutput.cpp, src/SVGOutput.h, - tests/Makefile.am, tests/SVGOutputTest.cpp, tests/create-makefile: - added width specifiers and exression evaluation to --output patterns + * src/DVIToSVG.cpp, src/EPSToSVG.cpp, src/Makefile.am, src/SVGOutput.cpp, + src/SVGOutput.h, src/SVGOutputBase.h, src/dvisvgm.cpp: + moved class SVGOutput to separate compilation unit 2015-02-19 Martin Gieseking <martin.gieseking@uos.de> @@ -401,11 +438,6 @@ * src/TpicSpecialHandler.cpp: use constant M_PI rather than computing PI locally -2015-02-17 Martin Gieseking <martin.gieseking@uos.de> - - * README, README.md: - updated README and README.md - 2015-01-21 Martin Gieseking <martin.gieseking@uos.de> * src/TensorProductPatch.cpp, src/TriangularPatch.cpp: @@ -721,10 +753,8 @@ Breaks standard things * src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h: removed unused emit() methods from XML classes -2014-08-06 Martin Gieseking <martin.gieseking@uos.de> - - * README.md: - minor fixes to README.md + * src/dvisvgm.cpp: + removed old code that moved cache files to new location 2014-07-31 Martin Gieseking <martin.gieseking@uos.de> @@ -1366,10 +1396,10 @@ Breaks standard things replaced local std::map tables used in Font classes with new class CharMap -2013-08-22 Martin Gieseking <martin.gieseking@uos.de> +2013-08-23 Martin Gieseking <martin.gieseking@uos.de> - * src/XMLString.cpp: - replace very small floating point numbers by 0 + * src/SVGTree.cpp: + appended px unit to font-size attributes in style section 2013-08-20 Martin Gieseking <martin.gieseking@uos.de> @@ -1672,8 +1702,9 @@ Breaks standard things src/VFReader.cpp: added missing member initializations to some classes - * src/DVIToSVG.cpp, src/EPSToSVG.cpp, src/dvisvgm.cpp: - avoid output of empty parentheses if TARGET_SYSTEM is not set + * doc/dvisvgm.txt.in, src/CmdLineParserBase.cpp, src/CommandLine.cpp, + src/options.dtd, src/options.xml: + added information about 'dvisvgm -E' to usage line 2013-04-20 Martin Gieseking <martin.gieseking@uos.de> @@ -1766,11 +1797,21 @@ Breaks standard things added methods to lookup attribute values and selected descendant XML nodes + * src/XMLNode.cpp, src/XMLNode.h: + added virtual constructor XMLNode::clone() + 2013-02-19 Martin Gieseking <martin.gieseking@uos.de> * src/FilePath.cpp: adapt path separators on Windows systems to get the correct output path + * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h, + src/DVIToSVG.cpp, src/DVIToSVG.h, src/EPSFile.cpp, src/EPSFile.h, + src/EPSToSVG.cpp, src/EPSToSVG.h, src/Makefile.am, + src/PsSpecialHandler.cpp, src/SVGOutputBase.h, src/dvisvgm.cpp, + src/options.xml: + add option to directly convert EPS files to SVG + * src/PSInterpreter.cpp, src/PSInterpreter.h: added PSInterpreter::limit() to limit the number of bytes to be processed @@ -1787,15 +1828,6 @@ Breaks standard things src/CommandLine.cpp, src/CommandLine.h, src/dvisvgm.cpp, src/options.xml: added optional parameter to option --help to specify output format -2013-02-06 Martin Gieseking <martin.gieseking@uos.de> - - * doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/CommandLine.cpp, - src/CommandLine.h, src/EmSpecialHandler.cpp, src/GraphicPath.h, - src/Matrix.cpp, src/PsSpecialHandler.cpp, src/TpicSpecialHandler.cpp, - src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/options.xml: - added option --precision to set the number of decimal places applied to - attribute values - 2013-01-30 Martin Gieseking <martin.gieseking@uos.de> * src/CommandLine.cpp: @@ -2032,11 +2064,6 @@ Breaks standard things tests/StreamInputBufferTest.cpp: some refactorings of class InputReader; added InputReader::find() -2012-10-24 Martin Gieseking <martin.gieseking@uos.de> - - * src/DVIToSVG.cpp, src/DVIToSVG.h, src/dvisvgm.cpp: - don't show warning about disabled PS support in list of special handlers - 2012-09-27 Martin Gieseking <martin.gieseking@uos.de> * doc/Makefile.am: @@ -2053,19 +2080,21 @@ Breaks standard things * src/PsSpecialHandler.cpp, src/PsSpecialHandler.h: removed Ghostscript info from ps entry in list of special handlers - * src/DVIToSVG.cpp: - show warning if processing of PS specials is disabled +2012-09-19 Martin Gieseking <martin.gieseking@uos.de> + + * src/psdefs.ps, src/psdefs.psc: + ignore dvips bop operators that might be present in PS specials + +2012-09-17 Martin Gieseking <martin.gieseking@uos.de> + + * src/StreamReader.cpp: + fixed reading invalid number of string characters 2012-06-06 Martin Gieseking <martin.gieseking@uos.de> * src/gfprint.mak: fixed bugs in gfprint, and added gfprint.mak for easier builds -2012-04-17 Martin Gieseking <martin.gieseking@uos.de> - - * doc/Makefile.am: - keep manpage when calling 'make clean' or 'make distclean' - 2012-04-04 Martin Gieseking <martin.gieseking@uos.de> * src/DVIToSVGActions.cpp, src/SVGTree.cpp, src/SVGTree.h, @@ -2120,15 +2149,6 @@ Breaks standard things * README: updated information about bug reporting -2012-01-26 Martin Gieseking <martin.gieseking@uos.de> - - * src/CmdLineParserBase.h, src/DVIActions.h, src/DVIReader.h, - src/DVIToSVGActions.h, src/FontEngine.h, src/FontManager.h, - src/MetafontWrapper.h, src/SVGTree.h, src/SpecialActions.h, - src/SpecialHandler.h, src/SpecialManager.h, src/TFM.h, src/VFReader.h: - adapt forward declarations of classes and structs to their corresponding - definition (SF bug #3480013) - 2012-01-09 Martin Gieseking <martin.gieseking@uos.de> * src/TpicSpecialHandler.cpp: @@ -2978,6 +2998,10 @@ Breaks standard things src/SVGFontEmitter.cpp, src/SVGFontEmitter.h: removed class Glyph and incorporated its functionality into Font class + * src/Font.h, src/FontEncoding.cpp, src/FontEncoding.h, + src/FontManager.cpp, src/FontManager.h, src/SVGFontEmitter.cpp: + moved method encoding() from class FontManager to class FontEncoding + 2010-02-05 Martin Gieseking <martin.gieseking@uos.de> * src/DVIToSVG.cpp: @@ -3205,10 +3229,10 @@ Breaks standard things * src/GraphicPath.h, src/PsSpecialHandler.cpp: PS handler: replace zero-length paths by dots -2009-10-29 Martin Gieseking <martin.gieseking@uos.de> +2009-10-25 Martin Gieseking <martin.gieseking@uos.de> - * src/DVIToSVGActions.cpp, src/Font.cpp, src/Font.h: - fixed positioning of italic characters + * src/DvisvgmSpecialHandler.cpp: + added macro {?nl} to dvisvgm:raw evaluator 2009-10-18 Martin Gieseking <martin.gieseking@uos.de> @@ -3373,25 +3397,25 @@ Breaks standard things * NEWS, src/PsSpecialHandler.cpp: fixed another positioning bug reported by John Bowman - * src/PsSpecialHandler.cpp: - convert PS path coordinated to TeX point units - 2009-10-04 Martin Gieseking <martin.gieseking@uos.de> + * src/Makefile.old, src/Makefile.orig: + renamed the old original Makefile + * src/GraphicPath.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h: corrected positioning bug introduced with previous PS positioning fix + * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVGActions.cpp, + src/DVIToSVGActions.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, + src/SpecialActions.h, src/psdefs.ps, src/psdefs.psc: + fixed positioning bug reported by John Bowman + 2009-10-02 Martin Gieseking <martin.gieseking@uos.de> * doc/Makefile.am, doc/dvisvgm.txt.in: generate pdf manpage directly with groff; adapted manpage source to work with latest asciidoc -2009-10-01 Martin Gieseking <martin.gieseking@uos.de> - - * doc/Makefile.am, doc/dvisvgm.txt.in: - replaced backticks in manpage by apostrophes; updated date on homepage - 2009-09-30 Martin Gieseking <martin.gieseking@uos.de> * Makefile.am, configure.ac, fedora/dvisvgm.spec, src/Doxyfile: @@ -3403,13 +3427,17 @@ Breaks standard things * doc/dvisvgm.txt.in: added dvisvgm:raw example to man page + * src/DvisvgmSpecialHandler.cpp: + added optional depth parameter to special dvisvgm:raw + 2009-09-17 Martin Gieseking <martin.gieseking@uos.de> * doc/dvisvgm.txt.in: minor changes of the documentation - * fedora/dvisvgm.spec: - updated spec file and fixed typo on website + * doc/dvisvgm.txt.in: + corrected info about --verbosity in manual page (reported by John + Bowman) * src/PsSpecialHandler.h: increased the default linewidth to 0.5 @@ -3506,14 +3534,21 @@ Breaks standard things src/SpecialManager.cpp, src/SpecialManager.h: PS prologue files referenced in first page are now always loaded + * fedora/dvisvgm-0.8.1-potrace.patch, fedora/dvisvgm-gs.patch, + fedora/dvisvgm-potrace.patch, fedora/dvisvgm.spec: + updated Fedora files + * configure.ac, fedora/dvisvgm.spec, src/Ghostscript.cpp, src/Ghostscript.h, src/Makefile.am: improved Ghostscript and potrace linking checks to simplify usage of external devel files - * fedora/dvisvgm-0.8.1-potrace.patch, fedora/dvisvgm-gs.patch, - fedora/dvisvgm-potrace.patch, fedora/dvisvgm.spec: - updated Fedora files +2009-08-25 Martin Gieseking <martin.gieseking@uos.de> + + * configure.ac, src/DVIToSVGActions.cpp, src/Ghostscript.cpp, + src/Ghostscript.h: + added configuration method to directly bind the Ghostscript shared + library 2009-08-24 Martin Gieseking <martin.gieseking@uos.de> @@ -3898,10 +3933,10 @@ Breaks standard things 2009-02-25 Martin Gieseking <martin.gieseking@uos.de> - * src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, - src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp, - src/SpecialActions.h, src/TpicSpecialHandler.cpp: - renamed appendInPage() to appendToPage + * configure.ac, doc/Makefile.am, doc/caution.png, doc/dvisvgm.1.in, + doc/dvisvgm.txt, doc/note.png: + replaced manually written dvisvgm.1.in by an asciidoc file + (dvisvgm.txt.in) 2009-02-24 Martin Gieseking <martin.gieseking@uos.de> @@ -3961,9 +3996,14 @@ Breaks standard things 2009-02-17 Martin Gieseking <martin.gieseking@uos.de> - * src/DVIReader.cpp: - made DVICommand local to executeCommand, removed unnecessary if - statement + * src/BoundingBox.cpp, src/ColorSpecialHandler.cpp, + src/ColorSpecialHandler.h, src/DVIToSVGActions.cpp, src/FontGlyph.cpp, + src/InputBuffer.cpp, src/InputBuffer.h, src/Makefile.am, src/Pair.h, + src/SpecialActions.h, src/SpecialColorHandler.cpp, + src/SpecialColorHandler.h, src/SpecialEmHandler.cpp, + src/SpecialEmHandler.h, src/TransformationMatrix.cpp, + src/tests/ColorSpecialTest.h: + added skeleton of em special handler; doesn't work yet 2009-02-15 Martin Gieseking <martin.gieseking@uos.de> diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS index 66d025a2b22..f7d4d808ece 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS +++ b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS @@ -1,5 +1,14 @@ +dvisvgm-1.14 (2015-12-28) +- added evaluation of PSTricks specials 'pst:' and 'PST:' +- the bounding box data created by the preview package is now adapted to create a tight box by default +- added option --bbox=preview to apply the unmodified bounding box data created by the preview package +- improved lookup of files located in the current working directory +- fixed a memory issue related to graphics paths +- improved extraction of kapathsea version number +- minor code and test improvements + dvisvgm-1.13 (2015-12-08) -- added evaluation of PS operators 'ashow', 'awidthshow', and widthshow (GH bug #49) +- added evaluation of PS operators 'ashow', 'awidthshow', and 'widthshow' (GH bug #49) - improved conversion of fonts referenced by PS code to graphics paths - redundant 'moveto' commands are now removed from paths - fixed issue concerning evaluation of PS operator 'setcolor' diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac index 03307b31bc3..6846b5f761e 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac +++ b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac @@ -4,7 +4,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([dvisvgm],[1.13],[martin.gieseking@uos.de]) +AC_INIT([dvisvgm],[1.14],[martin.gieseking@uos.de]) DATE="December 2015" AC_CONFIG_SRCDIR(src) AC_CONFIG_HEADER(config.h) diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 index fd1b0d3dd99..71be72f1971 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 +++ b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 @@ -2,12 +2,12 @@ .\" Title: dvisvgm .\" Author: Martin Gieseking <martin.gieseking@uos.de> .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 12/08/2015 +.\" Date: 12/28/2015 .\" Manual: dvisvgm Manual -.\" Source: dvisvgm 1.13 +.\" Source: dvisvgm 1.14 .\" Language: English .\" -.TH "DVISVGM" "1" "12/08/2015" "dvisvgm 1\&.13" "dvisvgm Manual" +.TH "DVISVGM" "1" "12/28/2015" "dvisvgm 1\&.14" "dvisvgm Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -112,6 +112,7 @@ invoice, executive, legal, letter, ledger tab(:); lt lt lt lt +lt lt lt lt. T{ \fBdvi\fR @@ -128,6 +129,11 @@ T{ T}:T{ no bounding box is assigned T} +T{ +\fBpreview\fR +T}:T{ +bounding box data computed by the preview package (if present in the dvi file) +T} .TE .sp 1 .RE @@ -1021,7 +1027,10 @@ is present\&. The PostScript handler also recognizes and evaluates bounding box data generated by the preview package (\m[blue]http://www.ctan.org/pkg/preview\m[]) with option -\fItightpage\fR\&. If such data is present in the DVI file, dvisvgm adapts the bounding box of the generated SVG file accordingly, and prints a message showing the width, height, and depth of the box in TeX point units\&. Especially, the depth value can be used to vertically align the SVG graphics with the baseline of surrounding text in HTML or XSL\-FO documents, for example\&. +\fItightpage\fR\&. If such data is present in the DVI file and if dvisvgm is called with option +\fB\-\-bbox=preview\fR, dvisvgm adapts the bounding box of the generated SVG file accordingly, and prints a message showing the width, height, and depth of the box in TeX point units\&. Especially, the depth value can be used to vertically align the SVG graphics with the baseline of surrounding text in HTML or XSL\-FO documents, for example\&. If you call dvisvgm with option +\fB\-\-bbox=min\fR +(the default), the tight bounding box computed while processing the page is applied and not the one provided by the preview package\&. Thus, the height, depth and width values written to the console are adapted accordingly\&. .RE .PP \fBtpic\fR diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in index 5bf8921fcd7..8a8ba2504d2 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in +++ b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in @@ -112,6 +112,7 @@ Additionally, dvisvgm also supports the following format specifiers: *dvi*::: page size stored in the DVI file *min*::: computes the minimal/tightest bounding box *none*::: no bounding box is assigned + *preview*::: bounding box data computed by the preview package (if present in the dvi file) // *Page orientation*;; The default page orientation for DIN/ISO and American paper sizes is 'portrait', @@ -668,10 +669,13 @@ dvisvgm disables the processing of PostScript specials and prints a warning mess Use option *--list-specials* to check whether PostScript support is available, i.e. entry 'ps' is present. + The PostScript handler also recognizes and evaluates bounding box data generated by the -http://www.ctan.org/pkg/preview[preview package] with option 'tightpage'. If such data is present in the DVI file, -dvisvgm adapts the bounding box of the generated SVG file accordingly, and prints a message showing the width, height, -and depth of the box in TeX point units. Especially, the depth value can be used to vertically align the SVG graphics -with the baseline of surrounding text in HTML or XSL-FO documents, for example. +http://www.ctan.org/pkg/preview[preview package] with option 'tightpage'. If such data is present in the DVI file +and if dvisvgm is called with option *--bbox=preview*, dvisvgm adapts the bounding box of the generated SVG file +accordingly, and prints a message showing the width, height, and depth of the box in TeX point units. Especially, +the depth value can be used to vertically align the SVG graphics with the baseline of surrounding text in HTML or +XSL-FO documents, for example. If you call dvisvgm with option *--bbox=min* (the default), the tight bounding box +computed while processing the page is applied and not the one provided by the preview package. Thus, the height, +depth and width values written to the console are adapted accordingly. *tpic*:: The TPIC special set defines instructions for drawing simple geometric objects. Some LaTeX packages, like diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/m4/ax_code_coverage.m4 b/Build/source/texk/dvisvgm/dvisvgm-src/m4/ax_code_coverage.m4 deleted file mode 100644 index 2751459c1d1..00000000000 --- a/Build/source/texk/dvisvgm/dvisvgm-src/m4/ax_code_coverage.m4 +++ /dev/null @@ -1,229 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CODE_COVERAGE() -# -# DESCRIPTION -# -# Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be -# included in the CFLAGS and LIBS/LDFLAGS variables of every build target -# (program or library) which should be built with code coverage support. -# Also defines CODE_COVERAGE_RULES which should be substituted in your -# Makefile; and $enable_code_coverage which can be used in subsequent -# configure output. CODE_COVERAGE_ENABLED is defined and substituted, and -# corresponds to the value of the --enable-code-coverage option, which -# defaults to being disabled. -# -# Test also for gcov program and create GCOV variable that could be -# substituted. -# -# Note that all optimisation flags in CFLAGS must be disabled when code -# coverage is enabled. -# -# Usage example: -# -# configure.ac: -# -# AX_CODE_COVERAGE -# -# Makefile.am: -# -# @CODE_COVERAGE_RULES@ -# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ... -# my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... -# -# This results in a "check-code-coverage" rule being added to any -# Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module -# has been configured with --enable-code-coverage). Running `make -# check-code-coverage` in that directory will run the module's test suite -# (`make check`) and build a code coverage report detailing the code which -# was touched, then print the URI for the report. -# -# This code was derived from Makefile.decl in GLib, originally licenced -# under LGPLv2.1+. -# -# LICENSE -# -# Copyright (c) 2012 Philip Withnall -# Copyright (c) 2012 Xan Lopez -# Copyright (c) 2012 Christian Persch -# Copyright (c) 2012 Paolo Borelli -# Copyright (c) 2012 Dan Winship -# Copyright (c) 2015 Bastien ROUCARIES -# -# This library 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 2.1 of the License, or (at -# your option) any later version. -# -# This library 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 <http://www.gnu.org/licenses/>. - -#serial 5 - -AC_DEFUN([AX_CODE_COVERAGE],[ - dnl Check for --enable-code-coverage - AC_REQUIRE([AC_PROG_SED]) - - # allow to override gcov location - AC_ARG_WITH([gcov], - [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], - [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) - - AC_MSG_CHECKING([whether to build with code coverage support]) - AC_ARG_ENABLE([code-coverage], - AS_HELP_STRING([--enable-code-coverage], - [Whether to enable code coverage support]),, - enable_code_coverage=no) - - AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) - AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) - AC_MSG_RESULT($enable_code_coverage) - - AS_IF([ test "$enable_code_coverage" = "yes" ], [ - # check for gcov - AC_CHECK_TOOL([GCOV], - [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], - [:]) - AS_IF([test "X$GCOV" = "X:"], - [AC_MSG_ERROR([gcov is needed to do coverage])]) - AC_SUBST([GCOV]) - - dnl Check if gcc is being used - AS_IF([ test "$GCC" = "no" ], [ - AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) - ]) - - # List of supported lcov versions. - lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11" - - AC_CHECK_PROG([LCOV], [lcov], [lcov]) - AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) - - AS_IF([ test "$LCOV" ], [ - AC_CACHE_CHECK([for lcov version], ax_cv_lcov_version, [ - ax_cv_lcov_version=invalid - lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` - for lcov_check_version in $lcov_version_list; do - if test "$lcov_version" = "$lcov_check_version"; then - ax_cv_lcov_version="$lcov_check_version (ok)" - fi - done - ]) - ], [ - lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" - AC_MSG_ERROR([$lcov_msg]) - ]) - - case $ax_cv_lcov_version in - ""|invalid[)] - lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." - AC_MSG_ERROR([$lcov_msg]) - LCOV="exit 0;" - ;; - esac - - AS_IF([ test -z "$GENHTML" ], [ - AC_MSG_ERROR([Could not find genhtml from the lcov package]) - ]) - - dnl Build the code coverage flags - CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LDFLAGS="-lgcov" - - AC_SUBST([CODE_COVERAGE_CFLAGS]) - AC_SUBST([CODE_COVERAGE_LDFLAGS]) - ]) - -CODE_COVERAGE_RULES=' -# Code coverage -# -# Optional: -# - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. -# (Default: $(top_builddir)) -# - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated -# by lcov for code coverage. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) -# - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage -# reports to be created. (Default: -# $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) -# - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov -# - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the lcov instance. -# (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -# - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the lcov instance. -# (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -# - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml -# instance. (Default: empty) -# - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore -# -# The generated report will be titled using the $(PACKAGE_NAME) and -# $(PACKAGE_VERSION). In order to add the current git hash to the title, -# use the git-version-gen script, available online. - -# Optional variables -CODE_COVERAGE_DIRECTORY ?= $(top_builddir) -CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info -CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage -CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" -CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) -CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) -CODE_COVERAGE_GENHTML_OPTIONS ?= -CODE_COVERAGE_IGNORE_PATTERN ?= - -code_coverage_quiet = $(code_coverage_quiet_$(V)) -code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) -code_coverage_quiet_0 = --quiet - -# Use recursive makes in order to ignore errors during check -check-code-coverage: -ifeq ($(CODE_COVERAGE_ENABLED),yes) - -$(MAKE) $(AM_MAKEFLAGS) -k check - $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -else - @echo "Need to reconfigure with --enable-code-coverage" -endif - -# Capture code coverage data -code-coverage-capture: code-coverage-capture-hook -ifeq ($(CODE_COVERAGE_ENABLED),yes) - $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS) - $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -else - @echo "Need to reconfigure with --enable-code-coverage" -endif - -# Hook rule executed before code-coverage-capture, overridable by the user -code-coverage-capture-hook: - -ifeq ($(CODE_COVERAGE_ENABLED),yes) -clean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . -name "*.gcda" -o -name "*.gcov" -delete -endif - -GITIGNOREFILES ?= -GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -DISTCHECK_CONFIGURE_FLAGS ?= -DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage - -.PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean -' - - AC_SUBST([CODE_COVERAGE_RULES]) - m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) -]) diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp index 00becb10aeb..8ade555ad06 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp @@ -167,15 +167,21 @@ void DVIToSVG::endPage (unsigned pageno) { Matrix matrix; getPageTransformation(matrix); static_cast<DVIToSVGActions*>(getActions())->setPageMatrix(matrix); - if (_bboxString == "min") + if (_bboxFormatString == "min" || _bboxFormatString == "preview") bbox.transform(matrix); - if (string("dvi none min").find(_bboxString) == string::npos) { - istringstream iss(_bboxString); + else if (_bboxFormatString == "dvi") { + // center page content + double dx = (getPageWidth()-bbox.width())/2; + double dy = (getPageHeight()-bbox.height())/2; + bbox += BoundingBox(-dx, -dy, dx, dy); + } + else if (_bboxFormatString != "none") { + istringstream iss(_bboxFormatString); StreamInputReader ir(iss); ir.skipSpace(); if (isalpha(ir.peek())) { // set explicitly given page format - PageSize size(_bboxString); + PageSize size(_bboxFormatString); if (size.valid()) { // convention: DVI position (0,0) equals (1in, 1in) relative // to the upper left vertex of the page (see DVI specification) @@ -185,33 +191,25 @@ void DVIToSVG::endPage (unsigned pageno) { } else { // set/modify bounding box by explicitly given values try { - bbox.set(_bboxString); + bbox.set(_bboxFormatString); } catch (const MessageException &e) { } } } - else if (_bboxString == "dvi") { - // center page content - double dx = (getPageWidth()-bbox.width())/2; - double dy = (getPageHeight()-bbox.height())/2; - bbox += BoundingBox(-dx, -dy, dx, dy); - } - if (_bboxString != "none") { - if (bbox.width() == 0) - Message::wstream(false) << "\npage is empty\n"; - else { - _svg.setBBox(bbox); - - const double bp2pt = 72.27/72; - const double bp2mm = 25.4/72; - Message::mstream(false) << '\n'; - Message::mstream(false, Message::MC_PAGE_SIZE) << "page size: " << XMLString(bbox.width()*bp2pt) << "pt" - " x " << XMLString(bbox.height()*bp2pt) << "pt" - " (" << XMLString(bbox.width()*bp2mm) << "mm" - " x " << XMLString(bbox.height()*bp2mm) << "mm)"; - Message::mstream(false) << '\n'; - } + if (bbox.width() == 0) + Message::wstream(false) << "\npage is empty\n"; + if (_bboxFormatString != "none") { + _svg.setBBox(bbox); + + const double bp2pt = 72.27/72; + const double bp2mm = 25.4/72; + Message::mstream(false) << '\n'; + Message::mstream(false, Message::MC_PAGE_SIZE) << "page size: " << XMLString(bbox.width()*bp2pt) << "pt" + " x " << XMLString(bbox.height()*bp2pt) << "pt" + " (" << XMLString(bbox.width()*bp2mm) << "mm" + " x " << XMLString(bbox.height()*bp2mm) << "mm)"; + Message::mstream(false) << '\n'; } } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h index 9e3f5d659ca..9e6019acfc7 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h @@ -37,10 +37,11 @@ class DVIToSVG : public DVIReader DVIToSVG (std::istream &is, SVGOutputBase &out); ~DVIToSVG (); void convert (const std::string &range, std::pair<int,int> *pageinfo=0); - void setPageSize (const std::string &name) {_bboxString = name;} + void setPageSize (const std::string &format) {_bboxFormatString = format;} void setPageTransformation (const std::string &cmds) {_transCmds = cmds;} void getPageTransformation (Matrix &matrix) const; std::string getSVGFilename (unsigned pageno) const; + std::string getUserBBoxString () const {return _bboxFormatString;} static void setProcessSpecials (const char *ignorelist=0, bool pswarning=false); public: @@ -56,8 +57,8 @@ class DVIToSVG : public DVIReader private: SVGTree _svg; SVGOutputBase &_out; - std::string _bboxString; - std::string _transCmds; + std::string _bboxFormatString; ///< bounding box size/format set by the user + std::string _transCmds; ///< page transformation commands set by the user }; #endif diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp index 911ff62eb6c..a709a52a8bd 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp @@ -84,6 +84,13 @@ string DVIToSVGActions::getSVGFilename (unsigned pageno) const { } +string DVIToSVGActions::getBBoxFormatString () const { + if (DVIToSVG *dvi2svg = dynamic_cast<DVIToSVG*>(_dvireader)) + return dvi2svg->getUserBBoxString(); + return ""; +} + + /** This method is called when a "set char" command was found in the DVI file. * It draws a character of the current font. * @param[in] x horizontal position of left bounding box edge diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.h index 0ed9c2ce54d..2c0712e61e7 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.h @@ -84,6 +84,7 @@ class DVIToSVGActions : public DVIActions, public SpecialActions void embed (const BoundingBox &bbox); void embed (const DPair &p, double r=0); std::string getSVGFilename (unsigned pageno) const; + std::string getBBoxFormatString () const; private: SVGTree &_svg; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.h index 841ffe5d0a9..f6f69c1823e 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.h @@ -60,6 +60,7 @@ class EPSToSVG : protected SpecialActions BoundingBox& bbox () {return _bbox;} BoundingBox& bbox (const std::string &name, bool reset=false) {return _bbox;} std::string getSVGFilename (unsigned pageno) const; + std::string getBBoxFormatString () const {return "";} private: std::string _fname; ///< name of EPS file diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp index 2418c8fb786..0c3ea270add 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp @@ -115,7 +115,9 @@ std::string FileFinder::version () { } #else if (const char *v = strrchr(KPSEVERSION, ' ')) - return v+1; + return (std::string(KPSEVERSION).substr(0, 9) == "kpathsea ") ? v+1 : KPSEVERSION; + if (strlen(KPSEVERSION) > 0) + return KPSEVERSION; #endif return "unknown"; } @@ -130,6 +132,12 @@ static const char* find_file (const std::string &fname, const char *ftype) { if (!_initialized || fname.empty()) return 0; + static std::string buf; + // try to lookup the file in the current working directory + buf = FileSystem::getcwd()+"/"+fname; + if (FileSystem::exists(buf.c_str())) + return buf.c_str(); + std::string ext; if (ftype) ext = ftype; @@ -140,7 +148,6 @@ static const char* find_file (const std::string &fname, const char *ftype) { ext = fname.substr(pos+1); } - static std::string buf; #ifdef MIKTEX if (ext == "dll" || ext == "exe") { // lookup dll and exe files in the MiKTeX bin directory first diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.h index 59b91ae6f3b..fa30a512673 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/GraphicsPath.h @@ -191,22 +191,23 @@ class GraphicsPath } - /** Removes redundant path commands commands. Currently, it only removes movetos. */ - void removeRedundantCommands () { - // remove trailing moveto commands - while (_commands.back().type == Command::MOVETO) - _commands.pop_back(); - // resolve intermediate sequences of moveto commands - Iterator it=_commands.begin(); - if (it == _commands.end()) - return; - Iterator prev = it; - for (++it; it != _commands.end(); ++it) { - if (prev->type == Command::MOVETO && it->type == Command::MOVETO) + /** Removes redundant path commands commands. Currently, it only removes movetos. */ + void removeRedundantCommands () { + // remove trailing moveto commands + while (!_commands.empty() && _commands.back().type == Command::MOVETO) + _commands.pop_back(); + // resolve intermediate sequences of moveto commands + Iterator it=_commands.begin(); + if (it == _commands.end()) + return; + Iterator prev = it++; + while (it != _commands.end()) { + if (prev->type == Command::MOVETO && it->type == Command::MOVETO) _commands.erase(prev); - prev = it; - } - } + else + prev = it++; + } + } /** Writes the path data as SVG path drawing command to a given output stream. diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.cpp index 5029874c681..9994520e723 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.cpp @@ -64,6 +64,9 @@ void PSPreviewFilter::execute (const char *code, size_t len) { if (!_tightpage) psInterpreter().execute(code, len); else { + // Read bounding box information pushed on the operand stack by the preview package. + // It consists of 7 values in DVI units: + // llx, lly, urx, ury, height, depth, width CharInputBuffer ib(code, len); BufferInputReader ir(ib); ir.skipSpace(); @@ -87,7 +90,7 @@ bool PSPreviewFilter::getBoundingBox (BoundingBox &bbox) const { } -/** Gets the 4 border values set by the preview package. +/** Gets the 4 border position values set by the preview package (in bp units). * @return true if the border data is available */ bool PSPreviewFilter::getBorders (double &left, double &right, double &top, double &bottom) const { if (_boxExtents.size() < 4) diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.h index 3e9f9ad2052..fdc4a48b9e9 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/PSPreviewFilter.h @@ -50,7 +50,7 @@ class PSPreviewFilter : public PSFilter bool _active; ///< true if filter is active bool _tightpage; ///< true if tightpage option was given double _dvi2bp; ///< factor to convert dvi units to PS points - std::vector<int> _boxExtents; + std::vector<int> _boxExtents; ///< bounding box data set by the preview package (in DVI units) }; #endif diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp index 175a7b065b6..a712603dc89 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp @@ -199,7 +199,7 @@ bool PsSpecialHandler::process (const char *prefix, istream &is, SpecialActions if (_psSection != PS_BODY) enterBodySection(); - if (*prefix == '"') { + if (*prefix == '"' || strcmp(prefix, "pst:") == 0) { // read and execute literal PostScript code (isolated by a wrapping save/restore pair) moveToDVIPos(); _psi.execute("\n@beginspecial @setspecial "); @@ -242,7 +242,7 @@ bool PsSpecialHandler::process (const char *prefix, istream &is, SpecialActions executeAndSync(is, true); } } - else { // ps: ... + else { // ps: ... or PST: ... if (_actions) _actions->finishLine(); moveToDVIPos(); @@ -383,29 +383,74 @@ static bool transform_box_extents (const Matrix &matrix, double &w, double &h, d void PsSpecialHandler::dviEndPage (unsigned) { BoundingBox bbox; - if (_previewFilter.getBoundingBox(bbox)) { - double w = _previewFilter.width(); - double h = _previewFilter.height(); - double d = _previewFilter.depth(); - bool horiz_baseline = true; - if (_actions) { - _actions->bbox() = bbox; + if (_previewFilter.getBoundingBox(bbox)) { // is there any data written by preview package? + double w = max(0.0, _previewFilter.width()); + double h = max(0.0, _previewFilter.height()); + double d = max(0.0, _previewFilter.depth()); + bool isBaselineHorizontal = true; + if (_actions && (_actions->getBBoxFormatString() == "preview" || _actions->getBBoxFormatString() == "min")) { + if (_actions->getBBoxFormatString() == "preview") { + _actions->bbox() = bbox; + Message::mstream() << "\napplying bounding box set by"; + } + else { + // compute height, depth and width depending on the + // tight bounding box derived from the objects on the page + double y0 = bbox.maxY()-h; // y coordinate of the baseline + h = _actions->bbox().maxY()-y0; + if (h < 0) { + h = 0; + d = _actions->bbox().height(); + } + else { + d = y0-_actions->bbox().minY(); + if (d < 0) { + h = _actions->bbox().height(); + d = 0; + } + } + w = _actions->bbox().width(); + Message::mstream() << "\ncomputing extents based on data set by"; + } + Message::mstream() << " preview package (version " << _previewFilter.version() << ")\n"; + // apply page transformations to box extents Matrix pagetrans; _actions->getPageTransform(pagetrans); - horiz_baseline = transform_box_extents(pagetrans, w, h, d); + isBaselineHorizontal = transform_box_extents(pagetrans, w, h, d); _actions->bbox().lock(); + + if (isBaselineHorizontal) { + const double bp2pt = 72.27/72.0; + Message::mstream() << + "width=" << XMLString(w*bp2pt) << "pt, " + "height=" << XMLString(h*bp2pt) << "pt, " + "depth=" << XMLString(d*bp2pt) << "pt\n"; + } + else + Message::mstream() << "can't determine height, width, and depth due to non-horizontal baseline\n"; } - Message::mstream() << "\napplying bounding box set by preview package (version " << _previewFilter.version() << ")\n"; - if (horiz_baseline) { - const double bp2pt = 72.27/72.0; - Message::mstream() << - "width=" << XMLString(w*bp2pt) << "pt, " - "height=" << XMLString(h*bp2pt) << "pt, " - "depth=" << XMLString(d*bp2pt) << "pt\n"; +#if 0 + XMLElementNode *rect = new XMLElementNode("rect"); + rect->addAttribute("x", _actions->bbox().minX()); + rect->addAttribute("y", _actions->bbox().minY()); + rect->addAttribute("width", w); + rect->addAttribute("height", h+d); + rect->addAttribute("fill", "none"); + rect->addAttribute("stroke", "red"); + rect->addAttribute("stroke-width", "0.5"); + _actions->appendToPage(rect); + if (d > 0) { + XMLElementNode *line = new XMLElementNode("line"); + line->addAttribute("x1", _actions->bbox().minX()); + line->addAttribute("y1", _actions->bbox().minY()+h); + line->addAttribute("x2", _actions->bbox().maxX()); + line->addAttribute("y2", _actions->bbox().minY()+h); + line->addAttribute("stroke", "blue"); + line->addAttribute("stroke-width", "0.5"); + _actions->appendToPage(line); } - else - Message::mstream() << "can't determine height, width, and depth due to non-horizontal baseline\n"; +#endif } // close dictionary TeXDict and execute end-hook if defined if (_psSection == PS_BODY) { @@ -1189,6 +1234,6 @@ void PsSpecialHandler::ClippingStack::dup (int saveID) { const char** PsSpecialHandler::prefixes () const { - static const char *pfx[] = {"header=", "psfile=", "PSfile=", "ps:", "ps::", "!", "\"", 0}; + static const char *pfx[] = {"header=", "psfile=", "PSfile=", "ps:", "ps::", "!", "\"", "pst:", "PST:", 0}; return pfx; } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialActions.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialActions.h index e0f35c78738..81faba9a6fc 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialActions.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialActions.h @@ -55,6 +55,7 @@ struct SpecialActions virtual void embed (const DPair &p, double r=0) =0; virtual unsigned getCurrentPageNumber () const =0; virtual std::string getSVGFilename (unsigned pageno) const =0; + virtual std::string getBBoxFormatString () const =0; virtual void progress (const char *id) {} virtual int getDVIStackDepth () const {return 0;} @@ -87,6 +88,7 @@ class EmptySpecialActions : public SpecialActions void embed (const DPair &p, double r=0) {} unsigned getCurrentPageNumber() const {return 0;} std::string getSVGFilename (unsigned pageno) const {return "";} + std::string getBBoxFormatString () const {return "";} private: BoundingBox _bbox; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp index db0dd86fd69..8b809111f45 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp @@ -134,7 +134,7 @@ static bool set_cache_dir (const CommandLine &args) { static bool check_bbox (const string &bboxstr) { - const char *formats[] = {"none", "min", "dvi", 0}; + const char *formats[] = {"none", "min", "preview", "dvi", 0}; for (const char **p=formats; *p; ++p) if (bboxstr == *p) return true; diff --git a/Build/source/texk/dvisvgm/version.ac b/Build/source/texk/dvisvgm/version.ac index 61e0009d87d..e5ef8763b56 100644 --- a/Build/source/texk/dvisvgm/version.ac +++ b/Build/source/texk/dvisvgm/version.ac @@ -8,4 +8,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current dvisvgm version -m4_define([dvisvgm_version], [1.13]) +m4_define([dvisvgm_version], [1.14]) |