diff options
Diffstat (limited to 'Build/source/texk/dvisvgm')
36 files changed, 252 insertions, 154 deletions
diff --git a/Build/source/texk/dvisvgm/ChangeLog b/Build/source/texk/dvisvgm/ChangeLog index f0af46e4ea4..2a6f1849afd 100644 --- a/Build/source/texk/dvisvgm/ChangeLog +++ b/Build/source/texk/dvisvgm/ChangeLog @@ -1,3 +1,7 @@ +2018-02-09 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * Import 2.3.2. + 2018-01-15 Karl Berry <karl@freefriends.org> * Import 2.3.1 with Ghostscript.cpp patch from Martin. diff --git a/Build/source/texk/dvisvgm/TLpatches/ChangeLog b/Build/source/texk/dvisvgm/TLpatches/ChangeLog index 21c01cbdaba..1b2c676021f 100644 --- a/Build/source/texk/dvisvgm/TLpatches/ChangeLog +++ b/Build/source/texk/dvisvgm/TLpatches/ChangeLog @@ -1,3 +1,9 @@ +2018-02-09 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * Import 2.3.2. + * patch-08-makefiles: adapt. + * patch-16-gserrornames: Remove. + 2018-01-15 Karl Berry <karl@freefriends.org> * Import 2.3.1. diff --git a/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles b/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles index b9d0894fbdc..7c031bcf9d0 100644 --- a/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles +++ b/Build/source/texk/dvisvgm/TLpatches/patch-08-makefiles @@ -1,6 +1,6 @@ -diff -u2r dvisvgm-2.3.1/Makefile.am dvisvgm-src/Makefile.am ---- dvisvgm-2.3.1/Makefile.am 2018-01-02 01:09:10.000000000 -0800 -+++ dvisvgm-src/Makefile.am 2018-01-15 15:21:16.671504747 -0800 +diff -u2r dvisvgm-2.3.2/Makefile.am dvisvgm-src/Makefile.am +--- dvisvgm-2.3.2/Makefile.am Tue Jan 02 18:32:38 2018 ++++ dvisvgm-src/Makefile.am Fri Feb 09 13:20:34 2018 @@ -6,5 +6,5 @@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = COPYING @@ -8,9 +8,9 @@ diff -u2r dvisvgm-2.3.1/Makefile.am dvisvgm-src/Makefile.am +SUBDIRS = libs src #not for TL: tests doc ACLOCAL_AMFLAGS = -I m4 -diff -u2r dvisvgm-2.3.1/src/Makefile.am dvisvgm-src/src/Makefile.am ---- dvisvgm-2.3.1/src/Makefile.am 2018-01-02 01:09:11.000000000 -0800 -+++ dvisvgm-src/src/Makefile.am 2018-01-15 15:28:34.370204007 -0800 +diff -u2r dvisvgm-2.3.2/src/Makefile.am dvisvgm-src/src/Makefile.am +--- dvisvgm-2.3.2/src/Makefile.am Tue Jan 02 18:32:38 2018 ++++ dvisvgm-src/src/Makefile.am Fri Feb 09 13:29:22 2018 @@ -14,8 +14,5 @@ $(noinst_LIBRARIES) \ ../libs/clipper/libclipper.a \ diff --git a/Build/source/texk/dvisvgm/TLpatches/patch-16-gserrornames b/Build/source/texk/dvisvgm/TLpatches/patch-16-gserrornames deleted file mode 100644 index acdeaddddcf..00000000000 --- a/Build/source/texk/dvisvgm/TLpatches/patch-16-gserrornames +++ /dev/null @@ -1,10 +0,0 @@ -diff -u2r dvisvgm-2.3.1/src/Ghostscript.cpp dvisvgm-src/src/Ghostscript.cpp ---- dvisvgm-2.3.1/src/Ghostscript.cpp 2018-01-02 01:09:11.000000000 -0800 -+++ dvisvgm-src/src/Ghostscript.cpp 2018-01-15 15:57:09.114619987 -0800 -@@ -347,5 +347,5 @@ - return error_names[code-1]; - #else -- if (auto error_names = LOAD_SYMBOL(gs_error_names)) -+ if (auto error_names = loadSymbol<const char**>("gs_error_names")) - return error_names[code-1]; - return nullptr; diff --git a/Build/source/texk/dvisvgm/configure b/Build/source/texk/dvisvgm/configure index 4d5b6492e87..3b1b0436964 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) 2.3.1. +# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 2.3.2. # # 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='2.3.1' -PACKAGE_STRING='dvisvgm (TeX Live) 2.3.1' +PACKAGE_VERSION='2.3.2' +PACKAGE_STRING='dvisvgm (TeX Live) 2.3.2' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1375,7 +1375,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) 2.3.1 to adapt to many kinds of systems. +\`configure' configures dvisvgm (TeX Live) 2.3.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1446,7 +1446,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvisvgm (TeX Live) 2.3.1:";; + short | recursive ) echo "Configuration of dvisvgm (TeX Live) 2.3.2:";; esac cat <<\_ACEOF @@ -1581,7 +1581,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvisvgm (TeX Live) configure 2.3.1 +dvisvgm (TeX Live) configure 2.3.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2449,7 +2449,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 2.3.1, which was +It was created by dvisvgm (TeX Live) $as_me 2.3.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8188,7 +8188,7 @@ fi # Define the identity of the package. PACKAGE='dvisvgm--tex-live-' - VERSION='2.3.1' + VERSION='2.3.2' cat >>confdefs.h <<_ACEOF @@ -20189,7 +20189,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -dvisvgm (TeX Live) config.lt 2.3.1 +dvisvgm (TeX Live) config.lt 2.3.2 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -23580,7 +23580,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 2.3.1, which was +This file was extended by dvisvgm (TeX Live) $as_me 2.3.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23646,7 +23646,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 2.3.1 +dvisvgm (TeX Live) config.status 2.3.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.am b/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.am index e428c70ea9a..1aedd13864d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.am +++ b/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.am @@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = COPYING -SUBDIRS = libs src #TL: tests doc +SUBDIRS = libs src #not for TL: tests doc ACLOCAL_AMFLAGS = -I m4 if CODE_COVERAGE_ENABLED diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.in b/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.in index 7a65cd6148c..8db55229142 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.in +++ b/Build/source/texk/dvisvgm/dvisvgm-src/Makefile.in @@ -340,7 +340,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = COPYING -SUBDIRS = libs src #TL: tests doc +SUBDIRS = libs src #not for TL: tests doc ACLOCAL_AMFLAGS = -I m4 @CODE_COVERAGE_ENABLED_TRUE@lcov_dir = $(top_builddir)/lcov @CODE_COVERAGE_ENABLED_TRUE@lcov_file = $(lcov_dir)/lcov.info diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS index 8840de7f6f4..9a967bdb7cf 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS +++ b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS @@ -1,3 +1,9 @@ +dvisvgm-2.3.2 (2018-02-08) +- prevent the creation of redundant tspan elements +- added support for new JFM format (patch by Hironobu Yamashita) +- fixed build error occurred if GS development files were missing +- fixed a potential memory issue regarding option --cache + dvisvgm-2.3.1 (2018-01-12) - fixed the width of characters slanted by a mapfile entry (GH bug #82) - if ttfautohint fails for a font, dvisvgm now uses the unhinted font and diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac index 8c52510ca24..af57575779f 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac +++ b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac @@ -4,8 +4,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([dvisvgm],[2.3.1],[martin.gieseking@uos.de]) -DATE="January 2018" +AC_INIT([dvisvgm],[2.3.2],[martin.gieseking@uos.de]) +DATE="February 2018" AC_CONFIG_SRCDIR(src) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 index 875b32cf4dc..9fa5ad15a01 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 vsnapshot <http://docbook.sf.net/> -.\" Date: 01/12/2018 +.\" Date: 02/08/2018 .\" Manual: dvisvgm Manual -.\" Source: dvisvgm 2.3.1 +.\" Source: dvisvgm 2.3.2 .\" Language: English .\" -.TH "DVISVGM" "1" "01/12/2018" "dvisvgm 2\&.3\&.1" "dvisvgm Manual" +.TH "DVISVGM" "1" "02/08/2018" "dvisvgm 2\&.3\&.2" "dvisvgm Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.hpp index 86a76e9bfea..4fbceb14ed2 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.hpp @@ -97,8 +97,8 @@ class SegmentedCMap : public CMap void write (std::ostream &os) const; bool vertical () const override {return _vertical;} bool mapsToCID () const override {return _mapsToCID;} - size_t numCIDRanges () const {return _cidranges.size();} - size_t numBFRanges () const {return _bfranges.size();} + size_t numCIDRanges () const {return _cidranges.numRanges();} + size_t numBFRanges () const {return _bfranges.numRanges();} std::string getROString () const override; private: diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIActions.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIActions.hpp index 8361e7dccce..182a7c3f4c4 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIActions.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIActions.hpp @@ -27,14 +27,14 @@ class BoundingBox; class Font; -struct DVIActions{ +struct DVIActions { virtual ~DVIActions () =default; virtual void reset () {} virtual void setChar (double x, double y, unsigned c, bool vertical, const Font &f) {} virtual void setRule (double x, double y, double height, double width) {} virtual void setTextOrientation (bool vertical) {} - virtual void moveToX (double x) {} - virtual void moveToY (double y) {} + virtual void moveToX (double x, bool forceSVGMove) {} + virtual void moveToY (double y, bool forceSVGMove) {} virtual void setFont (int num, const Font &font) {} virtual void special (const std::string &s, double dvi2bp, bool preprocessing=false) {} virtual void beginPage (unsigned pageno, const std::vector<int32_t> &c) {} diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp index ff0237109f0..d3aab868cc2 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp @@ -283,7 +283,7 @@ void DVIReader::cmdSetChar0 (int c) { Font *font = FontManager::instance().getFont(_currFontNum); dviSetChar0(c, font); // template method that may trigger further actions putVFChar(font, c); // further character processing if current font is a virtual font - moveRight(font->charWidth(c)*font->scaleFactor()*_mag/1000.0); + moveRight(font->charWidth(c)*font->scaleFactor()*_mag/1000.0, MoveMode::SETCHAR); } @@ -300,7 +300,7 @@ void DVIReader::cmdSetChar (int len) { Font *font = FontManager::instance().getFont(_currFontNum); dviSetChar(c, font); // template method that may trigger further actions putVFChar(font, c); // further character processing if current font is a virtual font - moveRight(font->charWidth(c)*font->scaleFactor()*_mag/1000.0); + moveRight(font->charWidth(c)*font->scaleFactor()*_mag/1000.0, MoveMode::SETCHAR); } @@ -330,7 +330,7 @@ void DVIReader::cmdSetRule (int) { double height = _dvi2bp*readSigned(4); double width = _dvi2bp*readSigned(4); dviSetRule(height, width); - moveRight(width); + moveRight(width, MoveMode::CHANGEPOS); } @@ -347,7 +347,7 @@ void DVIReader::cmdPutRule (int) { } -void DVIReader::moveRight (double dx) { +void DVIReader::moveRight (double dx, MoveMode) { switch (_dviState.d) { case WritingMode::LR: _dviState.h += dx; break; case WritingMode::TB: _dviState.v += dx; break; @@ -356,7 +356,7 @@ void DVIReader::moveRight (double dx) { } -void DVIReader::moveDown (double dy) { +void DVIReader::moveDown (double dy, MoveMode) { switch (_dviState.d) { case WritingMode::LR: _dviState.v += dy; break; case WritingMode::TB: _dviState.h -= dy; break; @@ -367,29 +367,29 @@ void DVIReader::moveDown (double dy) { void DVIReader::cmdRight (int len) { double dx = _dvi2bp*readSigned(len); - moveRight(dx); + moveRight(dx, MoveMode::CHANGEPOS); dviRight(dx); } void DVIReader::cmdDown (int len) { double dy = _dvi2bp*readSigned(len); - moveDown(dy); + moveDown(dy, MoveMode::CHANGEPOS); dviDown(dy); } void DVIReader::cmdNop (int) {dviNop();} -void DVIReader::cmdX0 (int) {moveRight(_dviState.x); dviX0();} -void DVIReader::cmdY0 (int) {moveDown(_dviState.y); dviY0();} -void DVIReader::cmdW0 (int) {moveRight(_dviState.w); dviW0();} -void DVIReader::cmdZ0 (int) {moveDown(_dviState.z); dviZ0();} +void DVIReader::cmdX0 (int) {moveRight(_dviState.x, MoveMode::CHANGEPOS); dviX0();} +void DVIReader::cmdY0 (int) {moveDown(_dviState.y, MoveMode::CHANGEPOS); dviY0();} +void DVIReader::cmdW0 (int) {moveRight(_dviState.w, MoveMode::CHANGEPOS); dviW0();} +void DVIReader::cmdZ0 (int) {moveDown(_dviState.z, MoveMode::CHANGEPOS); dviZ0();} void DVIReader::cmdX (int len) { double dx = _dvi2bp*readSigned(len); _dviState.x = dx; - moveRight(dx); + moveRight(dx, MoveMode::CHANGEPOS); dviX(dx); } @@ -397,7 +397,7 @@ void DVIReader::cmdX (int len) { void DVIReader::cmdY (int len) { double dy = _dvi2bp*readSigned(len); _dviState.y = dy; - moveDown(dy); + moveDown(dy, MoveMode::CHANGEPOS); dviY(dy); } @@ -405,7 +405,7 @@ void DVIReader::cmdY (int len) { void DVIReader::cmdW (int len) { double dx = _dvi2bp*readSigned(len); _dviState.w = dx; - moveRight(dx); + moveRight(dx, MoveMode::CHANGEPOS); dviW(dx); } @@ -413,7 +413,7 @@ void DVIReader::cmdW (int len) { void DVIReader::cmdZ (int len) { double dy = _dvi2bp*readSigned(len); _dviState.z = dy; - moveDown(dy); + moveDown(dy, MoveMode::CHANGEPOS); dviZ(dy); } @@ -610,7 +610,7 @@ void DVIReader::cmdXGlyphArray (int) { dviXGlyphArray(dx, dy, glyphs, *font); else throw DVIException("missing setfont prior to xglypharray"); - moveRight(width); + moveRight(width, MoveMode::SETCHAR); } @@ -625,7 +625,7 @@ void DVIReader::cmdXGlyphString (int) { dviXGlyphString(dx, glyphs, *font); else throw DVIException("missing setfont prior to xglyphstring"); - moveRight(width); + moveRight(width, MoveMode::SETCHAR); } @@ -647,7 +647,7 @@ void DVIReader::cmdXTextAndGlyphs (int) { dviXTextAndGlyphs(x, y, chars, glyphs, *font); else throw DVIException("missing setfont prior to xtextandglyphs"); - moveRight(width); + moveRight(width, MoveMode::SETCHAR); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.hpp index e46748e664c..a17b98a5f2d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.hpp @@ -38,6 +38,7 @@ class DVIReader : public BasicDVIReader, public VFActions { protected: enum class WritingMode {LR=0, TB=1, BT=3}; enum class SetFontMode {SF_SHORT, SF_LONG, VF_ENTER, VF_LEAVE}; + enum class MoveMode {SETCHAR, CHANGEPOS}; struct DVIState { double h, v; ///< horizontal and vertical cursor position @@ -67,8 +68,8 @@ class DVIReader : public BasicDVIReader, public VFActions { void collectBopOffsets (); size_t numberOfPageBytes (int n) const {return _bopOffsets.size() > 1 ? _bopOffsets[n+1]-_bopOffsets[n] : 0;} void goToPostamble (); - virtual void moveRight (double dx); - virtual void moveDown (double dy); + virtual void moveRight (double dx, MoveMode mode); + virtual void moveDown (double dy, MoveMode mode); void putVFChar (Font *font, uint32_t c); double putGlyphArray (bool xonly, std::vector<double> &dx, std::vector<double> &dy, std::vector<uint16_t> &glyphs); const Font* defineFont (uint32_t fontnum, const std::string &name, uint32_t cs, double ds, double ss); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp index d527ab2553d..79744656f3a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp @@ -359,24 +359,24 @@ string DVIToSVG::getSVGFilename (unsigned pageno) const { } -void DVIToSVG::moveRight (double dx) { - DVIReader::moveRight(dx); +void DVIToSVG::moveRight (double dx, MoveMode mode) { + DVIReader::moveRight(dx, mode); if (_actions) { if (dviState().d == WritingMode::LR) - _actions->moveToX(dviState().h+_tx); + _actions->moveToX(dviState().h+_tx, mode == MoveMode::CHANGEPOS); else - _actions->moveToY(dviState().v+_ty); + _actions->moveToY(dviState().v+_ty, mode == MoveMode::CHANGEPOS); } } -void DVIToSVG::moveDown (double dy) { - DVIReader::moveDown(dy); +void DVIToSVG::moveDown (double dy, MoveMode mode) { + DVIReader::moveDown(dy, mode); if (_actions) { if (dviState().d == WritingMode::LR) - _actions->moveToY(dviState().v+_ty); + _actions->moveToY(dviState().v+_ty, mode == MoveMode::CHANGEPOS); else - _actions->moveToX(dviState().h+_tx); + _actions->moveToX(dviState().h+_tx, mode == MoveMode::CHANGEPOS); } } @@ -437,9 +437,9 @@ void DVIToSVG::dviPutRule (double height, double width) { void DVIToSVG::dviPop () { if (_actions) { if (_prevXPos != dviState().h+_tx) - _actions->moveToX(dviState().h + _tx); + _actions->moveToX(dviState().h + _tx, true); // force setting the SVG position if (_prevYPos != dviState().v+_ty) - _actions->moveToY(dviState().v + _ty); + _actions->moveToY(dviState().v + _ty, true); // force setting the SVG position if (_prevWritingMode != dviState().d) _actions->setTextOrientation(dviState().d != WritingMode::LR); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.hpp index 5385188f370..5b5c619be02 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.hpp @@ -58,8 +58,8 @@ class DVIToSVG : public DVIReader { void enterBeginPage (unsigned pageno, const std::vector<int32_t> &c); void leaveEndPage (unsigned pageno); void embedFonts (XMLElementNode *svgElement); - void moveRight (double dx) override; - void moveDown (double dy) override; + void moveRight (double dx, MoveMode mode) override; + void moveDown (double dy, MoveMode mode) override; void dviPost (uint16_t stdepth, uint16_t pages, uint32_t pw, uint32_t ph, uint32_t mag, uint32_t num, uint32_t den, uint32_t lbopofs) override; void dviBop (const std::vector<int32_t> &c, int32_t prevBopOffset) override; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp index ef377e7266b..511b6b04c1a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp @@ -49,15 +49,23 @@ void DVIToSVGActions::reset() { } -void DVIToSVGActions::moveToX (double x) { +/** Change current horizontal position. + * @param[in] x new horizontal position + * @param[in] forceSVGMove if true, creates an explicit position change in the SVG tree */ +void DVIToSVGActions::moveToX (double x, bool forceSVGMove) { SpecialManager::instance().notifyPositionChange(getX(), getY(), *this); - _svg.setX(x); + if (forceSVGMove) + _svg.setX(x); } -void DVIToSVGActions::moveToY (double y) { +/** Change current vertical position. + * @param[in] y new vertical position + * @param[in] forceSVGMove if true, creates an explicit position change in the SVG tree */ +void DVIToSVGActions::moveToY (double y, bool forceSVGMove) { SpecialManager::instance().notifyPositionChange(getX(), getY(), *this); - _svg.setY(y); + if (forceSVGMove) + _svg.setY(y); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.hpp index 0712f6cd1e0..8b3ef317759 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.hpp @@ -60,8 +60,8 @@ class DVIToSVGActions : public DVIActions, public SpecialActions { void pushContextElement (std::unique_ptr<XMLElementNode> &&node) override {_svg.pushContextElement(std::move(node));} void popContextElement () override {_svg.popContextElement();} void setTextOrientation(bool vertical) override {_svg.setVertical(vertical);} - void moveToX (double x) override; - void moveToY (double y) override; + void moveToX (double x, bool forceSVGMove) override; + void moveToY (double y, bool forceSVGMove) override; void setFont (int num, const Font &font) override; void special (const std::string &spc, double dvi2bp, bool preprocessing=false) override; void beginPage (unsigned pageno, const std::vector<int32_t> &c) override; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp index 2291ca83ec1..05fec0e7c84 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.cpp @@ -66,10 +66,12 @@ JFM::JFM (istream &is) { void JFM::readTables (StreamReader &reader, int nt, int nw, int nh, int nd, int ni) { // determine smallest charcode with chartype > 0 - uint16_t minchar=0xFFFF, maxchar=0; + uint32_t minchar=0xFFFFFFFF, maxchar=0; for (int i=0; i < nt; i++) { - uint16_t c = (uint16_t)reader.readUnsigned(2); - uint16_t t = (uint16_t)reader.readUnsigned(2); + // support new JFM spec by texjporg + uint32_t c = reader.readUnsigned(2); + c += 0x10000 * reader.readUnsigned(1); + uint8_t t = uint8_t(reader.readUnsigned(1)); if (t > 0) { minchar = min(minchar, c); maxchar = max(maxchar, c); @@ -78,12 +80,13 @@ void JFM::readTables (StreamReader &reader, int nt, int nw, int nh, int nd, int // build charcode to chartype map if (minchar <= maxchar) { _minchar = minchar; - _charTypeTable.resize(maxchar-minchar+1); - memset(&_charTypeTable[0], 0, nt*sizeof(uint16_t)); + _charTypeTable.resize(maxchar-minchar+1, 0); reader.seek(-nt*4, ios::cur); for (int i=0; i < nt; i++) { - uint16_t c = (uint16_t)reader.readUnsigned(2); - uint16_t t = (uint16_t)reader.readUnsigned(2); + // support new JFM spec by texjporg + uint32_t c = reader.readUnsigned(2); + c += 0x10000 * reader.readUnsigned(1); + uint8_t t = uint8_t(reader.readUnsigned(1)); if (c >= minchar) _charTypeTable[c-minchar] = t; } @@ -93,8 +96,8 @@ void JFM::readTables (StreamReader &reader, int nt, int nw, int nh, int nd, int int JFM::charIndex (int c) const { - uint16_t chartype = 0; - if (!_charTypeTable.empty() && c >= _minchar && size_t(c) < _minchar+_charTypeTable.size()) + uint8_t chartype = 0; + if (!_charTypeTable.empty() && uint32_t(c) >= _minchar && uint32_t(c) < _minchar+_charTypeTable.size()) chartype = _charTypeTable[c-_minchar]; return TFM::charIndex(chartype); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.hpp index 908ad7a1c14..ba5b5ba876a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.hpp @@ -25,22 +25,21 @@ #include "TFM.hpp" -class JFM : public TFM -{ +class JFM : public TFM { public: JFM (std::istream &is); bool verticalLayout () const override {return _vertical;} - uint16_t minChar () const {return _minchar;} - uint16_t maxChar () const {return static_cast<uint16_t>(_minchar+_charTypeTable.size()-1);} + uint32_t minChar () const {return _minchar;} + uint32_t maxChar () const {return static_cast<uint32_t>(_minchar+_charTypeTable.size()-1);} protected: void readTables (StreamReader &reader, int nt, int nw, int nh, int nd, int ni); int charIndex (int c) const override; private: - uint16_t _minchar; ///< character code of first entry in character type table + uint32_t _minchar; ///< character code of first entry in character type table bool _vertical; ///< true if metrics refer to vertical text layout - std::vector<uint16_t> _charTypeTable; + std::vector<uint8_t> _charTypeTable; }; #endif diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/MiKTeXCom.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/MiKTeXCom.cpp index d22cc45f690..bce560c1dee 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/MiKTeXCom.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/MiKTeXCom.cpp @@ -18,7 +18,6 @@ ** along with this program; if not, see <http://www.gnu.org/licenses/>. ** *************************************************************************/ -#include <stdio.h> #include <comdef.h> #include <string> #include "MessageException.hpp" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.cpp index 24b76362bd5..c96aa1029bf 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.cpp @@ -125,11 +125,11 @@ void RangeMap::addRange (uint32_t cmin, uint32_t cmax, uint32_t vmin) { void RangeMap::adaptNeighbors (Ranges::iterator it) { if (it != _ranges.end()) { // adapt left neighbor - if (it != _ranges.begin() && it->min() <= (it-1)->max()) { - Ranges::iterator lit = it-1; // points to left neighbor + Ranges::iterator lit = it-1; // points to left neighbor + if (it != _ranges.begin() && it->min() <= lit->max()) { bool left_neighbor_valid = (it->min() > 0 && it->min()-1 >= lit->min()); - if (left_neighbor_valid) // is adapted left neighbor valid? - lit->max(it->min()-1); // => assign new max value + if (left_neighbor_valid) // is adapted left neighbor valid? + lit->max(it->min()-1); // => assign new max value if (!left_neighbor_valid || it->join(*lit)) it = _ranges.erase(lit); } @@ -176,6 +176,15 @@ uint32_t RangeMap::valueAt (uint32_t c) const { } +/** Returns the number of values mapped. */ +size_t RangeMap::numValues () const { + size_t count=0; + for (const Range &range : _ranges) + count += range.max()-range.min()+1; + return count; +} + + ostream& RangeMap::Range::write (ostream& os) const { return os << '[' << _min << ',' << _max << "] => " << _minval; } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.hpp index 70291696f66..4ae5c0c1ed0 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/RangeMap.hpp @@ -27,10 +27,8 @@ class RangeMap { - class Range - { + class Range { friend class RangeMap; - public: Range () : _min(0), _max(0), _minval(0) {} @@ -44,6 +42,7 @@ class RangeMap { uint32_t minval () const {return _minval;} uint32_t maxval () const {return valueAt(_max);} uint32_t valueAt (uint32_t c) const {return c-_min+_minval;} + uint32_t numKeys () const {return _max-_min+1;} bool operator < (const Range &r) const {return _min < r._min;} std::ostream& write (std::ostream &os) const; @@ -60,13 +59,70 @@ class RangeMap { using Ranges = std::vector<Range>; + class Iterator { + friend class RangeMap; + public: + void operator ++ () { + if (_currentKey < _rangeIterator->max()) + ++_currentKey; + else { + if (++_rangeIterator != _rangeMap._ranges.end()) + _currentKey = _rangeIterator->min(); + } + } + + void operator -- () { + if (_currentKey > _rangeIterator->min()) + --_currentKey; + else { + if (_rangeIterator != _rangeMap._ranges.begin()) + _currentKey = (--_rangeIterator)->max(); + } + } + + std::pair<uint32_t,uint32_t> operator * () const { + return std::pair<uint32_t,uint32_t>(_currentKey, _rangeMap.valueAt(_currentKey)); + } + + bool operator == (const Iterator &it) const { + bool ret = (_rangeIterator == it._rangeIterator); + if (ret && _rangeIterator != _rangeMap._ranges.end()) + ret = (_currentKey == it._currentKey); + return ret; + } + + bool operator != (const Iterator &it) const { + bool ret = (_rangeIterator != it._rangeIterator); + if (!ret && _rangeIterator != _rangeMap._ranges.end()) + ret = _currentKey != it._currentKey; + return ret; + } + + protected: + Iterator (const RangeMap &rangeMap, Ranges::const_iterator it) : _rangeMap(rangeMap), _rangeIterator(it), _currentKey() { + if (_rangeIterator != _rangeMap._ranges.end()) + _currentKey = _rangeIterator->min(); + } + + private: + const RangeMap &_rangeMap; + Ranges::const_iterator _rangeIterator; + uint32_t _currentKey; + }; + public: void addRange (uint32_t first, uint32_t last, uint32_t cid); bool valueExists (uint32_t c) const {return lookup(c) >= 0;} uint32_t valueAt (uint32_t c) const; - size_t size () const {return _ranges.size();} - bool empty () const {return _ranges.empty();} - void clear () {_ranges.clear();} + uint32_t minKey () const {return _ranges.empty() ? 0 : _ranges.front().min();} + uint32_t maxKey () const {return _ranges.empty() ? 0 : _ranges.back().max();} + size_t numRanges () const {return _ranges.size();} + size_t numValues () const; + bool empty () const {return _ranges.empty();} + void clear () {_ranges.clear();} + const Range& getRange (size_t n) const {return _ranges[n];} + Iterator begin () const {return Iterator(*this, _ranges.begin());} + Iterator end () const {return Iterator(*this, _ranges.end());} std::ostream& write (std::ostream &os) const; protected: diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/ToUnicodeMap.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/ToUnicodeMap.cpp index 1e405d94a28..dff9c923fad 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/ToUnicodeMap.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/ToUnicodeMap.cpp @@ -36,17 +36,17 @@ bool ToUnicodeMap::addMissingMappings (uint32_t maxIndex) { bool success=true; // collect Unicode points already in assigned NumericRanges<uint32_t> codepoints; - for (size_t i=0; i < size() && success; i++) + for (size_t i=0; i < numRanges() && success; i++) codepoints.addRange(rangeAt(i).minval(), rangeAt(i).maxval()); // fill unmapped ranges if (empty()) // no Unicode mapping present at all? success = fillRange(1, maxIndex, 1, codepoints, true); else { // (partial) Unicode mapping present? success = fillRange(1, rangeAt(0).min()-1, rangeAt(0).minval()-1, codepoints, false); - for (size_t i=0; i < size()-1 && success; i++) + for (size_t i=0; i < numRanges()-1 && success; i++) success = fillRange(rangeAt(i).max()+1, rangeAt(i+1).min()-1, rangeAt(i).maxval()+1, codepoints, true); if (success) - success = fillRange(rangeAt(size()-1).max()+1, maxIndex, rangeAt(size()-1).maxval()+1, codepoints, true); + success = fillRange(rangeAt(numRanges()-1).max()+1, maxIndex, rangeAt(numRanges()-1).maxval()+1, codepoints, true); } return success; } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp index 7f007697395..9b5baf9ef12 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp @@ -262,7 +262,7 @@ static double bit_sequence_to_gray (const string &hexstr) { setbits += bitset<CHUNKBITS>(val).count(); totalbits += 4*digitcount; } - return 1.0-double(setbits)/double(totalbits); + return totalbits == 0 ? 1.0 : 1.0-double(setbits)/double(totalbits); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp index 2a8e6d60425..89f698d3f37 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp @@ -117,7 +117,8 @@ static bool set_cache_dir (const CommandLine &args) { if (args.cacheOpt.given() && args.cacheOpt.value().empty()) { cout << "cache directory: " << (PhysicalFont::CACHE_PATH ? PhysicalFont::CACHE_PATH : "(none)") << '\n'; try { - FontCache::fontinfo(PhysicalFont::CACHE_PATH, cout, true); + if (PhysicalFont::CACHE_PATH) + FontCache::fontinfo(PhysicalFont::CACHE_PATH, cout, true); } catch (StreamReaderException &e) { Message::wstream(true) << "failed reading cache data\n"; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml b/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml index 39659844307..7613f44fb30 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml @@ -24,7 +24,7 @@ <program> <usage>[options] dvifile</usage> <usage>-E [options] epsfile</usage> - <description>This program converts DVI files, as created by TeX/LaTeX, to\nthe XML-based scalable vector graphics format SVG.</description> + <description>This program converts DVI files, as created by TeX/LaTeX, to\nthe XML-based scalable vector graphics format SVG.</description> <copyright>Copyright (C) 2005-2018 Martin Gieseking <martin.gieseking@uos.de></copyright> </program> <options> @@ -134,13 +134,13 @@ <arg type="string" name="dir" optional="yes"/> <description>set/print path of cache directory</description> </option> - <option long="exact" short="e"> - <description>compute exact glyph boxes</description> - </option> - <option long="keep"> - <description>keep temporary files</description> - </option> - <option long="libgs" if="!defined(HAVE_LIBGS) && !defined(DISABLE_GS)"> + <option long="exact" short="e"> + <description>compute exact glyph boxes</description> + </option> + <option long="keep"> + <description>keep temporary files</description> + </option> + <option long="libgs" if="!defined(HAVE_LIBGS) && !defined(DISABLE_GS)"> <arg name="filename" type="string"/> <description>set name of Ghostscript shared library</description> </option> @@ -156,7 +156,7 @@ <description>don't process [selected] specials</description> </option> <option long="trace-all" short="a"> - <arg name="retrace" type="bool" optional="yes" default="false"/> + <arg name="retrace" type="bool" optional="yes" default="false"/> <description>trace all glyphs of bitmap fonts</description> </option> </section> @@ -172,7 +172,7 @@ <description>print supported special sets and exit</description> </option> <option long="progress" short="P"> - <arg name="delay" type="double" optional="yes" default="0.5"/> + <arg name="delay" type="double" optional="yes" default="0.5"/> <description>enable progress indicator</description> </option> <option long="verbosity" short="v"> diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp index 5feeeb38f68..f76120ef8c9 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/version.hpp @@ -22,7 +22,7 @@ #define VERSION_HPP constexpr const char *PROGRAM_NAME = "dvisvgm"; -constexpr const char *PROGRAM_VERSION = "2.3.1"; +constexpr const char *PROGRAM_VERSION = "2.3.2"; #endif diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp index 9cfea3bc2ab..a8a109859d8 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/JFMReaderTest.cpp @@ -53,15 +53,15 @@ TEST_F(JFMReaderTest, properties) { EXPECT_FALSE(jfm->verticalLayout()); EXPECT_EQ(jfm->firstChar(), 0); EXPECT_EQ(jfm->lastChar(), 1); - EXPECT_EQ(jfm->minChar(), 13143); - EXPECT_EQ(jfm->maxChar(), 14696); + EXPECT_EQ(jfm->minChar(), 13143u); + EXPECT_EQ(jfm->maxChar(), 14696u); EXPECT_DOUBLE_EQ(jfm->getDesignSize(), 10.0*72.0/72.27); } TEST_F(JFMReaderTest, charWidth) { - uint16_t minchar = jfm->minChar(); - uint16_t maxchar = jfm->maxChar(); + uint32_t minchar = jfm->minChar(); + uint32_t maxchar = jfm->maxChar(); EXPECT_NEAR(jfm->getCharWidth(0), 9.963, 0.001); EXPECT_NEAR(jfm->getCharWidth(minchar), 4.981, 0.001); EXPECT_NEAR(jfm->getCharWidth(minchar+1), 4.981, 0.001); @@ -71,8 +71,8 @@ TEST_F(JFMReaderTest, charWidth) { TEST_F(JFMReaderTest, charHeight) { - uint16_t minchar = jfm->minChar(); - uint16_t maxchar = jfm->maxChar(); + uint32_t minchar = jfm->minChar(); + uint32_t maxchar = jfm->maxChar(); EXPECT_NEAR(jfm->getCharHeight(0), 8.767, 0.001); EXPECT_NEAR(jfm->getCharHeight(minchar), 8.767, 0.001); EXPECT_NEAR(jfm->getCharHeight(minchar+1), 8.767, 0.001); @@ -82,8 +82,8 @@ TEST_F(JFMReaderTest, charHeight) { TEST_F(JFMReaderTest, charDepth) { - uint16_t minchar = jfm->minChar(); - uint16_t maxchar = jfm->maxChar(); + uint32_t minchar = jfm->minChar(); + uint32_t maxchar = jfm->maxChar(); EXPECT_NEAR(jfm->getCharDepth(0), 1.195, 0.001); EXPECT_NEAR(jfm->getCharDepth(minchar), 1.195, 0.001); EXPECT_NEAR(jfm->getCharDepth(minchar+1), 1.195, 0.001); @@ -93,8 +93,8 @@ TEST_F(JFMReaderTest, charDepth) { TEST_F(JFMReaderTest, italicCorr) { - uint16_t minchar = jfm->minChar(); - uint16_t maxchar = jfm->maxChar(); + uint32_t minchar = jfm->minChar(); + uint32_t maxchar = jfm->maxChar(); EXPECT_DOUBLE_EQ(jfm->getItalicCorr(0), 0); EXPECT_DOUBLE_EQ(jfm->getItalicCorr(minchar), 0); EXPECT_DOUBLE_EQ(jfm->getItalicCorr(minchar+1), 0); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/RangeMapTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/RangeMapTest.cpp index 2364023f772..82b790e0883 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/RangeMapTest.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/RangeMapTest.cpp @@ -45,13 +45,13 @@ static void check_zero (const RangeMap &rangemap, int min, int max) { TEST(RangeMapTest, disjoint_ranges) { RangeMap rangemap; rangemap.addRange(5, 8, 1); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("A", rangemap, 5, 8, 1); CHECK_ZERO("B", rangemap, 0, 4); CHECK_ZERO("C", rangemap, 9, 20); rangemap.addRange(10, 15, 5); - ASSERT_EQ(rangemap.size(), 2u); + ASSERT_EQ(rangemap.numRanges(), 2u); CHECK_RANGE("D", rangemap, 5, 8, 1); CHECK_RANGE("E", rangemap, 10, 15, 5); CHECK_ZERO("F", rangemap, 0, 4); @@ -59,7 +59,7 @@ TEST(RangeMapTest, disjoint_ranges) { CHECK_ZERO("H", rangemap, 16, 20); rangemap.addRange(0, 3, 50); - ASSERT_EQ(rangemap.size(), 3u); + ASSERT_EQ(rangemap.numRanges(), 3u); CHECK_RANGE("I", rangemap, 0, 3, 50); CHECK_RANGE("J", rangemap, 5, 8, 1); CHECK_RANGE("K", rangemap, 10, 15, 5); @@ -68,7 +68,7 @@ TEST(RangeMapTest, disjoint_ranges) { CHECK_ZERO("N", rangemap, 16, 20); rangemap.addRange(16, 20, 1); - ASSERT_EQ(rangemap.size(), 4u); + ASSERT_EQ(rangemap.numRanges(), 4u); CHECK_RANGE("O", rangemap, 5, 8, 1); CHECK_RANGE("P", rangemap, 10, 15, 5); CHECK_RANGE("Q", rangemap, 0, 3, 50); @@ -79,20 +79,20 @@ TEST(RangeMapTest, disjoint_ranges) { TEST(RangeMapTest, touching_ranges1) { RangeMap rangemap; rangemap.addRange(5, 8, 10); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("A", rangemap, 5, 8, 10); rangemap.addRange(9, 15, 14); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("B", rangemap, 5, 15, 10); rangemap.addRange(1, 4, 5); - ASSERT_EQ(rangemap.size(), 2u); + ASSERT_EQ(rangemap.numRanges(), 2u); CHECK_RANGE("C", rangemap, 1, 4, 5); CHECK_RANGE("D", rangemap, 5, 15, 10); rangemap.addRange(1, 4, 6); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("E", rangemap, 1, 15, 6); } @@ -100,16 +100,16 @@ TEST(RangeMapTest, touching_ranges1) { TEST(RangeMapTest, touching_ranges2) { RangeMap rangemap; rangemap.addRange(7, 8, 10); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("A", rangemap, 7, 8, 10); rangemap.addRange(2, 3, 1); - ASSERT_EQ(rangemap.size(), 2u); + ASSERT_EQ(rangemap.numRanges(), 2u); CHECK_RANGE("B", rangemap, 2, 3, 1); CHECK_RANGE("C", rangemap, 7, 8, 10); rangemap.addRange(4, 4, 3); - ASSERT_EQ(rangemap.size(), 2u); + ASSERT_EQ(rangemap.numRanges(), 2u); CHECK_RANGE("D", rangemap, 2, 4, 1); CHECK_RANGE("E", rangemap, 7, 8, 10); } @@ -119,26 +119,26 @@ TEST(RangeMapTest, overlapping_ranges) { RangeMap rangemap; rangemap.addRange(5, 8, 10); rangemap.addRange(7, 15, 12); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("A", rangemap, 5, 15, 10); rangemap.addRange(10, 20, 1); - ASSERT_EQ(rangemap.size(), 2u); + ASSERT_EQ(rangemap.numRanges(), 2u); CHECK_RANGE("B", rangemap, 5, 9, 10); CHECK_RANGE("C", rangemap, 10, 20, 1); rangemap.addRange(2, 7, 7); - ASSERT_EQ(rangemap.size(), 2u); + ASSERT_EQ(rangemap.numRanges(), 2u); CHECK_RANGE("D", rangemap, 2, 9, 7); CHECK_RANGE("E", rangemap, 10, 20, 1); rangemap.addRange(1, 12, 100); - ASSERT_EQ(rangemap.size(), 2u); + ASSERT_EQ(rangemap.numRanges(), 2u); CHECK_RANGE("F", rangemap, 1, 12, 100); CHECK_RANGE("G", rangemap, 13, 20, 4); rangemap.addRange(0, 30, 1); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("H", rangemap, 0, 30, 1); } @@ -147,25 +147,41 @@ TEST(RangeMapTest, inner_ranges) { RangeMap rangemap; rangemap.addRange(5, 20, 1); rangemap.addRange(10, 15, 6); - ASSERT_EQ(rangemap.size(), 1u); + ASSERT_EQ(rangemap.numRanges(), 1u); CHECK_RANGE("A", rangemap, 5, 20, 1); rangemap.addRange(10, 15, 100); - ASSERT_EQ(rangemap.size(), 3u); + ASSERT_EQ(rangemap.numRanges(), 3u); CHECK_RANGE("B", rangemap, 5, 9, 1); CHECK_RANGE("C", rangemap, 10, 15, 100); CHECK_RANGE("D", rangemap, 16, 20, 12); rangemap.addRange(15, 15, 50); - ASSERT_EQ(rangemap.size(), 4u); + ASSERT_EQ(rangemap.numRanges(), 4u); CHECK_RANGE("E", rangemap, 5, 9, 1); CHECK_RANGE("F", rangemap, 10, 14, 100); CHECK_RANGE("G", rangemap, 15, 15, 50); CHECK_RANGE("H", rangemap, 16, 20, 12); rangemap.addRange(6, 19, 1); - ASSERT_EQ(rangemap.size(), 3u); + ASSERT_EQ(rangemap.numRanges(), 3u); CHECK_RANGE("I", rangemap, 5, 5, 1); CHECK_RANGE("J", rangemap, 6, 19, 1); CHECK_RANGE("K", rangemap, 20, 20, 16); } + + +TEST(RangeMapTest, iterators) { + RangeMap rangemap; + rangemap.addRange(5, 10, 1); + rangemap.addRange(20, 25, 60); + ASSERT_EQ(rangemap.numRanges(), 2u); + using Pair32 = pair<uint32_t,uint32_t>; + vector<Pair32> pairs = { + Pair32(5, 1), Pair32(6, 2), Pair32(7, 3), Pair32(8, 4), Pair32(9, 5), Pair32(10, 6), + Pair32(20, 60), Pair32(21, 61), Pair32(22, 62), Pair32(23, 63), Pair32(24, 64), Pair32(25, 65) + }; + int count=0; + for (auto p : rangemap) + ASSERT_EQ(p, pairs[count++]); +} diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp index d5c61d8f3ed..8b17e1397be 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/ToUnicodeMapTest.cpp @@ -38,7 +38,7 @@ static void check_range (const ToUnicodeMap &ucmap, uint32_t min, uint32_t max, TEST(ToUnicodeMapTest, addMissingMappings1) { ToUnicodeMap ucmap; ASSERT_TRUE(ucmap.addMissingMappings(20)); - ASSERT_EQ(ucmap.size(), 1u); + ASSERT_EQ(ucmap.numRanges(), 1u); CHECK_RANGE("A", ucmap, 1, 20, 1); } @@ -46,16 +46,16 @@ TEST(ToUnicodeMapTest, addMissingMappings1) { TEST(ToUnicodeMapTest, addMissingMappings2) { ToUnicodeMap ucmap; ucmap.addRange(5, 8, 40); - ASSERT_EQ(ucmap.size(), 1u); + ASSERT_EQ(ucmap.numRanges(), 1u); CHECK_RANGE("A", ucmap, 5, 8, 40); ucmap.addRange(10, 15, 50); - ASSERT_EQ(ucmap.size(), 2u); + ASSERT_EQ(ucmap.numRanges(), 2u); CHECK_RANGE("B", ucmap, 5, 8, 40); CHECK_RANGE("C", ucmap, 10, 15, 50); ASSERT_TRUE(ucmap.addMissingMappings(20)); - ASSERT_EQ(ucmap.size(), 2u); + ASSERT_EQ(ucmap.numRanges(), 2u); CHECK_RANGE("D", ucmap, 1, 9, 36); CHECK_RANGE("E", ucmap, 10, 20, 50); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/frktest.dvi b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/frktest.dvi Binary files differnew file mode 100644 index 00000000000..723b08a2964 --- /dev/null +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/frktest.dvi diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample.dvi b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample.dvi Binary files differnew file mode 100644 index 00000000000..87e6236021d --- /dev/null +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample.dvi diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample_v2.dvi b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample_v2.dvi Binary files differnew file mode 100644 index 00000000000..89471522369 --- /dev/null +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample_v2.dvi diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample_v3.dvi b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample_v3.dvi Binary files differnew file mode 100644 index 00000000000..26e2ce5cae7 --- /dev/null +++ b/Build/source/texk/dvisvgm/dvisvgm-src/tests/data/sample_v3.dvi diff --git a/Build/source/texk/dvisvgm/version.ac b/Build/source/texk/dvisvgm/version.ac index ef1fb185837..af95427ce55 100644 --- a/Build/source/texk/dvisvgm/version.ac +++ b/Build/source/texk/dvisvgm/version.ac @@ -9,4 +9,4 @@ dnl dnl -------------------------------------------------------- dnl dnl m4-include this file to define the current dvisvgm version -m4_define([dvisvgm_version], [2.3.1]) +m4_define([dvisvgm_version], [2.3.2]) |