From dc88afec77f198ebb8774f9c87146f2985e8f156 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 24 Feb 2022 03:00:45 +0000 Subject: CTAN sync 202202240300 --- dviware/dvisvgm/ChangeLog | 28 ++++++++++++++++++++++++++ dviware/dvisvgm/NEWS | 3 +++ dviware/dvisvgm/configure | 22 ++++++++++---------- dviware/dvisvgm/configure.ac | 4 ++-- dviware/dvisvgm/doc/dvisvgm.1 | 4 ++-- dviware/dvisvgm/src/BoundingBox.cpp | 2 +- dviware/dvisvgm/src/BoundingBox.hpp | 2 +- dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp | 2 +- dviware/dvisvgm/src/PSPattern.cpp | 2 +- dviware/dvisvgm/src/PsSpecialHandler.cpp | 21 +++++++++++-------- dviware/dvisvgm/src/SVGTree.cpp | 2 +- dviware/dvisvgm/tests/BoundingBoxTest.cpp | 2 +- dviware/dvisvgm/tests/DvisvgmSpecialTest.cpp | 4 ++-- dviware/dvisvgm/tests/EmSpecialTest.cpp | 2 +- dviware/dvisvgm/tests/PapersizeSpecialTest.cpp | 2 +- 15 files changed, 69 insertions(+), 33 deletions(-) (limited to 'dviware') diff --git a/dviware/dvisvgm/ChangeLog b/dviware/dvisvgm/ChangeLog index 388fcf2acd..69220afffe 100644 --- a/dviware/dvisvgm/ChangeLog +++ b/dviware/dvisvgm/ChangeLog @@ -1,3 +1,28 @@ +2022-02-22 Martin Gieseking + + * .appveyor.yml, configure.ac, doc/dvisvgm.1, src/Doxyfile, + src/version.hpp: + set version to 2.13.2 + + * NEWS: + updated NEWS + +2022-02-21 Martin Gieseking + + * src/PsSpecialHandler.cpp: + removed redundant space is PS code + + * src/BoundingBox.cpp, src/BoundingBox.hpp, src/DvisvgmSpecialHandler.cpp, + src/PSPattern.cpp, src/PsSpecialHandler.cpp, src/SVGTree.cpp, + tests/BoundingBoxTest.cpp, tests/DvisvgmSpecialTest.cpp, + tests/EmSpecialTest.cpp, tests/PapersizeSpecialTest.cpp: + renamed BoundingBox::toSVGViewBox to BoundingBox::svgViewBoxString + +2022-02-18 Martin Gieseking + + * src/PsSpecialHandler.cpp: + use overflow='hidden' to clip included EPS/PDF graphics + 2022-01-26 Martin Gieseking * .appveyor.yml, configure.ac, doc/dvisvgm.1, src/Doxyfile, @@ -7,6 +32,9 @@ * NEWS: updated NEWS + * README.md: + added Copr status badge to README + 2022-01-25 Martin Gieseking * src/PSPattern.cpp: diff --git a/dviware/dvisvgm/NEWS b/dviware/dvisvgm/NEWS index d525c62948..cd62713981 100644 --- a/dviware/dvisvgm/NEWS +++ b/dviware/dvisvgm/NEWS @@ -1,3 +1,6 @@ +dvisvgm-2.13.2 (2022-02-23) +- improved clipping of embedded EPS/PDF graphics (GH issue #176) + dvisvgm-2.13.1 (2022-01-26) - added evaluation of expression {?(...)} to special dvisvgm:rawdef - fixed regression regarding positioning of PDF graphics (GH issue #174) diff --git a/dviware/dvisvgm/configure b/dviware/dvisvgm/configure index 2974ef7caf..fe7f75869e 100755 --- a/dviware/dvisvgm/configure +++ b/dviware/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 2.13.1. +# Generated by GNU Autoconf 2.69 for dvisvgm 2.13.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvisvgm' PACKAGE_TARNAME='dvisvgm' -PACKAGE_VERSION='2.13.1' -PACKAGE_STRING='dvisvgm 2.13.1' +PACKAGE_VERSION='2.13.2' +PACKAGE_STRING='dvisvgm 2.13.2' PACKAGE_BUGREPORT='martin.gieseking@uos.de' PACKAGE_URL='' @@ -1417,7 +1417,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 2.13.1 to adapt to many kinds of systems. +\`configure' configures dvisvgm 2.13.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1489,7 +1489,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvisvgm 2.13.1:";; + short | recursive ) echo "Configuration of dvisvgm 2.13.2:";; esac cat <<\_ACEOF @@ -1637,7 +1637,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvisvgm configure 2.13.1 +dvisvgm configure 2.13.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2181,7 +2181,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 $as_me 2.13.1, which was +It was created by dvisvgm $as_me 2.13.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2539,7 +2539,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -DATE="January 2022" +DATE="February 2022" ac_config_headers="$ac_config_headers config.h" @@ -3169,7 +3169,7 @@ fi # Define the identity of the package. PACKAGE='dvisvgm' - VERSION='2.13.1' + VERSION='2.13.2' cat >>confdefs.h <<_ACEOF @@ -20459,7 +20459,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 $as_me 2.13.1, which was +This file was extended by dvisvgm $as_me 2.13.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20525,7 +20525,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 config.status 2.13.1 +dvisvgm config.status 2.13.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/dviware/dvisvgm/configure.ac b/dviware/dvisvgm/configure.ac index 8eabe7972e..0e1a95f704 100644 --- a/dviware/dvisvgm/configure.ac +++ b/dviware/dvisvgm/configure.ac @@ -4,8 +4,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([dvisvgm],[2.13.1],[martin.gieseking@uos.de]) -DATE="January 2022" +AC_INIT([dvisvgm],[2.13.2],[martin.gieseking@uos.de]) +DATE="February 2022" AC_CONFIG_SRCDIR(src) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/dviware/dvisvgm/doc/dvisvgm.1 b/dviware/dvisvgm/doc/dvisvgm.1 index 19bfa9eb62..8d9274bfd7 100644 --- a/dviware/dvisvgm/doc/dvisvgm.1 +++ b/dviware/dvisvgm/doc/dvisvgm.1 @@ -4,10 +4,10 @@ .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 2022-01-18 .\" Manual: dvisvgm Manual -.\" Source: dvisvgm 2.13.1 +.\" Source: dvisvgm 2.13.2 .\" Language: English .\" -.TH "DVISVGM" "1" "2022\-01\-18" "dvisvgm 2\&.13\&.1" "dvisvgm Manual" +.TH "DVISVGM" "1" "2022\-01\-18" "dvisvgm 2\&.13\&.2" "dvisvgm Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/dviware/dvisvgm/src/BoundingBox.cpp b/dviware/dvisvgm/src/BoundingBox.cpp index 7276d717da..d79848f8f9 100644 --- a/dviware/dvisvgm/src/BoundingBox.cpp +++ b/dviware/dvisvgm/src/BoundingBox.cpp @@ -246,7 +246,7 @@ void BoundingBox::transform (const Matrix &tm) { } -string BoundingBox::toSVGViewBox () const { +string BoundingBox::svgViewBoxString () const { ostringstream oss; oss << XMLString(_ulx) << ' ' << XMLString(_uly) << ' ' << XMLString(width()) << ' ' << XMLString(height()); return oss.str(); diff --git a/dviware/dvisvgm/src/BoundingBox.hpp b/dviware/dvisvgm/src/BoundingBox.hpp index 339bc7eb41..e9ffe2c946 100644 --- a/dviware/dvisvgm/src/BoundingBox.hpp +++ b/dviware/dvisvgm/src/BoundingBox.hpp @@ -76,7 +76,7 @@ class BoundingBox { bool operator != (const BoundingBox &bbox) const {return !(*this == bbox);} void scale (double sx, double sy); void transform (const Matrix &tm); - std::string toSVGViewBox () const; + std::string svgViewBoxString () const; std::ostream& write (std::ostream &os) const; std::unique_ptr createSVGRect () const; diff --git a/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp b/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp index 9a38ef9b3b..077e030776 100644 --- a/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp +++ b/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp @@ -162,7 +162,7 @@ static void expand_constants (string &str, SpecialActions &actions) { ++endpos; if (str[endpos] == '}') { BoundingBox &box=actions.bbox(str.substr(pos+7, endpos-pos-7)); - str.replace(pos, endpos-pos+1, box.toSVGViewBox()); + str.replace(pos, endpos-pos+1, box.svgViewBoxString()); } else repl_bbox = false; diff --git a/dviware/dvisvgm/src/PSPattern.cpp b/dviware/dvisvgm/src/PSPattern.cpp index 3232c88bbe..cbb4f10807 100644 --- a/dviware/dvisvgm/src/PSPattern.cpp +++ b/dviware/dvisvgm/src/PSPattern.cpp @@ -71,7 +71,7 @@ unique_ptr PSTilingPattern::createPatternNode () const { pattern->addAttribute("y", box.minY()); pattern->addAttribute("width", box.width()); pattern->addAttribute("height", box.height()); - pattern->addAttribute("viewBox", box.toSVGViewBox()); + pattern->addAttribute("viewBox", box.svgViewBoxString()); pattern->addAttribute("patternUnits", "userSpaceOnUse"); if (!_matrix.isIdentity()) pattern->addAttribute("patternTransform", _matrix.toSVG()); diff --git a/dviware/dvisvgm/src/PsSpecialHandler.cpp b/dviware/dvisvgm/src/PsSpecialHandler.cpp index 66514d1b08..ff853c72ee 100644 --- a/dviware/dvisvgm/src/PsSpecialHandler.cpp +++ b/dviware/dvisvgm/src/PsSpecialHandler.cpp @@ -422,12 +422,18 @@ unique_ptr PsSpecialHandler::createImageNode (FileType type, const s node->addAttribute("xlink:href", href); } else { // PostScript or PDF - // clip image to its bounding box if flag 'clip' is given - string rectclip; - if (clip) - rectclip = to_string(bbox.minX())+" "+to_string(bbox.minY())+" "+to_string(bbox.width())+" "+to_string(bbox.height())+" rectclip"; - - node = util::make_unique("g"); // put SVG nodes created from the EPS/PDF file in this group + if (!clip) + node = util::make_unique("g"); + else { + // clip image to its bounding box if flag 'clip' is given + node = util::make_unique("svg"); + node->addAttribute("overflow", "hidden"); + node->addAttribute("x", bbox.minX()); + node->addAttribute("y", bbox.minY()); + node->addAttribute("width", bbox.width()); + node->addAttribute("height", bbox.height()); + node->addAttribute("viewBox", bbox.svgViewBoxString()); + } _xmlnode = node.get(); _psi.execute( "\n@beginspecial @setspecial" // enter special environment @@ -435,8 +441,7 @@ unique_ptr PsSpecialHandler::createImageNode (FileType type, const s "/@imgbase("+image_base_path(*_actions)+")store " // path and basename of image files "matrix setmatrix" // don't apply outer PS transformations "/FirstPage "+to_string(pageno)+" def" // set number of first page to convert (PDF only) - "/LastPage "+to_string(pageno)+" def " // set number of last page to convert (PDF only) - +rectclip+ // clip to bounding box (if requexted by attribute 'clip') + "/LastPage "+to_string(pageno)+" def" // set number of last page to convert (PDF only) "(" + pathstr + ")run " // execute file content "@endspecial\n" // leave special environment ); diff --git a/dviware/dvisvgm/src/SVGTree.cpp b/dviware/dvisvgm/src/SVGTree.cpp index 8463ef08f1..f4cd9a85ef 100644 --- a/dviware/dvisvgm/src/SVGTree.cpp +++ b/dviware/dvisvgm/src/SVGTree.cpp @@ -72,7 +72,7 @@ void SVGTree::setBBox (const BoundingBox &bbox) { _root->addAttribute("width", XMLString(bbox.width()*ZOOM_FACTOR)+"pt"); _root->addAttribute("height", XMLString(bbox.height()*ZOOM_FACTOR)+"pt"); } - _root->addAttribute("viewBox", bbox.toSVGViewBox()); + _root->addAttribute("viewBox", bbox.svgViewBoxString()); } diff --git a/dviware/dvisvgm/tests/BoundingBoxTest.cpp b/dviware/dvisvgm/tests/BoundingBoxTest.cpp index 3d882679cf..3810983958 100644 --- a/dviware/dvisvgm/tests/BoundingBoxTest.cpp +++ b/dviware/dvisvgm/tests/BoundingBoxTest.cpp @@ -182,7 +182,7 @@ TEST(BoundingBoxTest, transform) { TEST(BoundingBoxTest, svgViewBox) { BoundingBox bbox(4, 5, 6, 7); ostringstream oss; - oss << bbox.toSVGViewBox(); + oss << bbox.svgViewBoxString(); EXPECT_EQ(oss.str(), "4 5 2 2"); } diff --git a/dviware/dvisvgm/tests/DvisvgmSpecialTest.cpp b/dviware/dvisvgm/tests/DvisvgmSpecialTest.cpp index ba3c1fe739..ebd2020b82 100644 --- a/dviware/dvisvgm/tests/DvisvgmSpecialTest.cpp +++ b/dviware/dvisvgm/tests/DvisvgmSpecialTest.cpp @@ -47,8 +47,8 @@ class DvisvgmSpecialTest : public ::testing::Test { double getY () const override {return 14;} bool defsEquals (const string &str) const {return defsString() == str;} bool pageEquals (const string &str) const {return pageString() == str;} - bool bboxEquals (const string &str) const {return bbox.toSVGViewBox() == str;} - string bboxString () const {return bbox.toSVGViewBox();} + bool bboxEquals (const string &str) const {return bbox.svgViewBoxString() == str;} + string bboxString () const {return bbox.svgViewBoxString();} string defsString () const {return toString(svgTree().defsNode());} string pageString () const {return toString(svgTree().pageNode());} diff --git a/dviware/dvisvgm/tests/EmSpecialTest.cpp b/dviware/dvisvgm/tests/EmSpecialTest.cpp index 57ed593ce8..60aef9ba2a 100644 --- a/dviware/dvisvgm/tests/EmSpecialTest.cpp +++ b/dviware/dvisvgm/tests/EmSpecialTest.cpp @@ -52,7 +52,7 @@ class EmSpecialTest : public ::testing::Test { /* void write (ostream &os) const { os << "page: " << page << '\n' - << "bbox: " << bbox.toSVGViewBox() << '\n'; + << "bbox: " << bbox.svgViewBoxString() << '\n'; } */ private: diff --git a/dviware/dvisvgm/tests/PapersizeSpecialTest.cpp b/dviware/dvisvgm/tests/PapersizeSpecialTest.cpp index fae2cfcc5e..536f6ff0a8 100644 --- a/dviware/dvisvgm/tests/PapersizeSpecialTest.cpp +++ b/dviware/dvisvgm/tests/PapersizeSpecialTest.cpp @@ -53,7 +53,7 @@ class PapersizeSpecialTest : public ::testing::Test { } string bboxString () { - return actions.bbox().toSVGViewBox(); + return actions.bbox().svgViewBoxString(); } void preprocess (const string &str) { -- cgit v1.2.3