summaryrefslogtreecommitdiff
path: root/dviware/dvisvgm/src
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-16 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2020-03-16 03:01:06 +0000
commitd50a41b6ab3d05fe5605a3a3b50ff68f61059296 (patch)
tree29468e087e9c19acf30b392dc705a54288d79137 /dviware/dvisvgm/src
parent87cddce361c3b477029d13b27bdaa57190b2d74b (diff)
CTAN sync 202003160301
Diffstat (limited to 'dviware/dvisvgm/src')
-rw-r--r--dviware/dvisvgm/src/AGLTable.hpp2
-rw-r--r--dviware/dvisvgm/src/BasicDVIReader.cpp2
-rw-r--r--dviware/dvisvgm/src/BasicDVIReader.hpp2
-rw-r--r--dviware/dvisvgm/src/Bezier.cpp6
-rw-r--r--dviware/dvisvgm/src/Bezier.hpp2
-rw-r--r--dviware/dvisvgm/src/BgColorSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/BgColorSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/Bitmap.cpp2
-rw-r--r--dviware/dvisvgm/src/Bitmap.hpp2
-rw-r--r--dviware/dvisvgm/src/BoundingBox.cpp4
-rw-r--r--dviware/dvisvgm/src/BoundingBox.hpp2
-rw-r--r--dviware/dvisvgm/src/CLCommandLine.cpp2
-rw-r--r--dviware/dvisvgm/src/CLCommandLine.hpp2
-rw-r--r--dviware/dvisvgm/src/CLOption.hpp2
-rw-r--r--dviware/dvisvgm/src/CMap.cpp2
-rw-r--r--dviware/dvisvgm/src/CMap.hpp2
-rw-r--r--dviware/dvisvgm/src/CMapManager.cpp2
-rw-r--r--dviware/dvisvgm/src/CMapManager.hpp2
-rw-r--r--dviware/dvisvgm/src/CMapReader.cpp2
-rw-r--r--dviware/dvisvgm/src/CMapReader.hpp2
-rw-r--r--dviware/dvisvgm/src/Calculator.cpp2
-rw-r--r--dviware/dvisvgm/src/Calculator.hpp2
-rw-r--r--dviware/dvisvgm/src/CharMapID.cpp2
-rw-r--r--dviware/dvisvgm/src/CharMapID.hpp2
-rw-r--r--dviware/dvisvgm/src/Character.hpp2
-rw-r--r--dviware/dvisvgm/src/Color.cpp2
-rw-r--r--dviware/dvisvgm/src/Color.hpp2
-rw-r--r--dviware/dvisvgm/src/ColorSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/ColorSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/CommandLine.hpp10
-rw-r--r--dviware/dvisvgm/src/DLLoader.cpp2
-rw-r--r--dviware/dvisvgm/src/DLLoader.hpp2
-rw-r--r--dviware/dvisvgm/src/DVIActions.hpp2
-rw-r--r--dviware/dvisvgm/src/DVIReader.cpp2
-rw-r--r--dviware/dvisvgm/src/DVIReader.hpp2
-rw-r--r--dviware/dvisvgm/src/DVIToSVG.cpp2
-rw-r--r--dviware/dvisvgm/src/DVIToSVG.hpp2
-rw-r--r--dviware/dvisvgm/src/DVIToSVGActions.cpp2
-rw-r--r--dviware/dvisvgm/src/DVIToSVGActions.hpp2
-rw-r--r--dviware/dvisvgm/src/Directory.cpp2
-rw-r--r--dviware/dvisvgm/src/Directory.hpp2
-rw-r--r--dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/DvisvgmSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/EPSFile.cpp2
-rw-r--r--dviware/dvisvgm/src/EPSFile.hpp2
-rw-r--r--dviware/dvisvgm/src/EPSToSVG.hpp4
-rw-r--r--dviware/dvisvgm/src/EllipticalArc.cpp2
-rw-r--r--dviware/dvisvgm/src/EllipticalArc.hpp2
-rw-r--r--dviware/dvisvgm/src/EmSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/EmSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/EncFile.cpp2
-rw-r--r--dviware/dvisvgm/src/EncFile.hpp2
-rw-r--r--dviware/dvisvgm/src/FileFinder.cpp2
-rw-r--r--dviware/dvisvgm/src/FileFinder.hpp2
-rw-r--r--dviware/dvisvgm/src/FilePath.cpp12
-rw-r--r--dviware/dvisvgm/src/FilePath.hpp4
-rw-r--r--dviware/dvisvgm/src/FileSystem.cpp2
-rw-r--r--dviware/dvisvgm/src/FileSystem.hpp2
-rw-r--r--dviware/dvisvgm/src/FixWord.hpp2
-rw-r--r--dviware/dvisvgm/src/Font.cpp8
-rw-r--r--dviware/dvisvgm/src/Font.hpp2
-rw-r--r--dviware/dvisvgm/src/FontCache.cpp2
-rw-r--r--dviware/dvisvgm/src/FontCache.hpp2
-rw-r--r--dviware/dvisvgm/src/FontEncoding.cpp2
-rw-r--r--dviware/dvisvgm/src/FontEncoding.hpp2
-rw-r--r--dviware/dvisvgm/src/FontEngine.cpp2
-rw-r--r--dviware/dvisvgm/src/FontEngine.hpp2
-rw-r--r--dviware/dvisvgm/src/FontManager.cpp2
-rw-r--r--dviware/dvisvgm/src/FontManager.hpp2
-rw-r--r--dviware/dvisvgm/src/FontMap.cpp2
-rw-r--r--dviware/dvisvgm/src/FontMap.hpp2
-rw-r--r--dviware/dvisvgm/src/FontMetrics.cpp2
-rw-r--r--dviware/dvisvgm/src/FontMetrics.hpp2
-rw-r--r--dviware/dvisvgm/src/FontStyle.hpp2
-rw-r--r--dviware/dvisvgm/src/FontWriter.cpp6
-rw-r--r--dviware/dvisvgm/src/FontWriter.hpp2
-rw-r--r--dviware/dvisvgm/src/GFGlyphTracer.cpp2
-rw-r--r--dviware/dvisvgm/src/GFGlyphTracer.hpp2
-rw-r--r--dviware/dvisvgm/src/GFReader.cpp2
-rw-r--r--dviware/dvisvgm/src/GFReader.hpp2
-rw-r--r--dviware/dvisvgm/src/GFTracer.cpp2
-rw-r--r--dviware/dvisvgm/src/GFTracer.hpp2
-rw-r--r--dviware/dvisvgm/src/Ghostscript.cpp5
-rw-r--r--dviware/dvisvgm/src/Ghostscript.hpp2
-rw-r--r--dviware/dvisvgm/src/Glyph.hpp2
-rw-r--r--dviware/dvisvgm/src/GlyphTracerMessages.hpp23
-rw-r--r--dviware/dvisvgm/src/GraphicsPath.hpp8
-rw-r--r--dviware/dvisvgm/src/HashFunction.cpp2
-rw-r--r--dviware/dvisvgm/src/HashFunction.hpp2
-rw-r--r--dviware/dvisvgm/src/HtmlSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/HtmlSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/HyperlinkManager.cpp2
-rw-r--r--dviware/dvisvgm/src/HyperlinkManager.hpp2
-rw-r--r--dviware/dvisvgm/src/ImageToSVG.cpp8
-rw-r--r--dviware/dvisvgm/src/ImageToSVG.hpp11
-rw-r--r--dviware/dvisvgm/src/InputBuffer.cpp2
-rw-r--r--dviware/dvisvgm/src/InputBuffer.hpp2
-rw-r--r--dviware/dvisvgm/src/InputReader.cpp2
-rw-r--r--dviware/dvisvgm/src/InputReader.hpp2
-rw-r--r--dviware/dvisvgm/src/JFM.cpp2
-rw-r--r--dviware/dvisvgm/src/JFM.hpp2
-rw-r--r--dviware/dvisvgm/src/Length.cpp2
-rw-r--r--dviware/dvisvgm/src/Length.hpp2
-rw-r--r--dviware/dvisvgm/src/MD5HashFunction.hpp2
-rw-r--r--dviware/dvisvgm/src/Makefile.am2
-rw-r--r--dviware/dvisvgm/src/MapLine.cpp2
-rw-r--r--dviware/dvisvgm/src/MapLine.hpp2
-rw-r--r--dviware/dvisvgm/src/Matrix.cpp30
-rw-r--r--dviware/dvisvgm/src/Matrix.hpp2
-rw-r--r--dviware/dvisvgm/src/Message.cpp2
-rw-r--r--dviware/dvisvgm/src/Message.hpp2
-rw-r--r--dviware/dvisvgm/src/MessageException.hpp2
-rw-r--r--dviware/dvisvgm/src/MetafontWrapper.cpp62
-rw-r--r--dviware/dvisvgm/src/MetafontWrapper.hpp8
-rw-r--r--dviware/dvisvgm/src/MiKTeXCom.cpp2
-rw-r--r--dviware/dvisvgm/src/MiKTeXCom.hpp2
-rw-r--r--dviware/dvisvgm/src/NoPsSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/NoPsSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/NumericRanges.hpp2
-rw-r--r--dviware/dvisvgm/src/PDFParser.cpp2
-rw-r--r--dviware/dvisvgm/src/PDFParser.hpp2
-rw-r--r--dviware/dvisvgm/src/PDFToSVG.hpp4
-rw-r--r--dviware/dvisvgm/src/PSFilter.hpp2
-rw-r--r--dviware/dvisvgm/src/PSInterpreter.cpp79
-rw-r--r--dviware/dvisvgm/src/PSInterpreter.hpp13
-rw-r--r--dviware/dvisvgm/src/PSPattern.cpp11
-rw-r--r--dviware/dvisvgm/src/PSPattern.hpp2
-rw-r--r--dviware/dvisvgm/src/PSPreviewFilter.cpp2
-rw-r--r--dviware/dvisvgm/src/PSPreviewFilter.hpp2
-rw-r--r--dviware/dvisvgm/src/PageRanges.cpp2
-rw-r--r--dviware/dvisvgm/src/PageRanges.hpp2
-rw-r--r--dviware/dvisvgm/src/PageSize.cpp18
-rw-r--r--dviware/dvisvgm/src/PageSize.hpp2
-rw-r--r--dviware/dvisvgm/src/Pair.hpp2
-rw-r--r--dviware/dvisvgm/src/PapersizeSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/PapersizeSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/PathClipper.cpp2
-rw-r--r--dviware/dvisvgm/src/PathClipper.hpp2
-rw-r--r--dviware/dvisvgm/src/PdfSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/PdfSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/PreScanDVIReader.cpp2
-rw-r--r--dviware/dvisvgm/src/PreScanDVIReader.hpp2
-rw-r--r--dviware/dvisvgm/src/Process.cpp2
-rw-r--r--dviware/dvisvgm/src/Process.hpp2
-rw-r--r--dviware/dvisvgm/src/PsSpecialHandler.cpp125
-rw-r--r--dviware/dvisvgm/src/PsSpecialHandler.hpp13
-rw-r--r--dviware/dvisvgm/src/RangeMap.cpp2
-rw-r--r--dviware/dvisvgm/src/RangeMap.hpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharHandlerFactory.cpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharHandlerFactory.hpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharPathHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharPathHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharTspanTextHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/SVGCharTspanTextHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/SVGOutput.cpp2
-rw-r--r--dviware/dvisvgm/src/SVGOutput.hpp2
-rw-r--r--dviware/dvisvgm/src/SVGSingleCharTextHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/SVGSingleCharTextHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/SVGTree.cpp2
-rw-r--r--dviware/dvisvgm/src/SVGTree.hpp2
-rw-r--r--dviware/dvisvgm/src/ShadingPatch.cpp2
-rw-r--r--dviware/dvisvgm/src/ShadingPatch.hpp2
-rw-r--r--dviware/dvisvgm/src/SignalHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/SignalHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/SourceInput.cpp2
-rw-r--r--dviware/dvisvgm/src/SourceInput.hpp2
-rw-r--r--dviware/dvisvgm/src/SpecialActions.hpp2
-rw-r--r--dviware/dvisvgm/src/SpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/SpecialManager.cpp2
-rw-r--r--dviware/dvisvgm/src/SpecialManager.hpp2
-rw-r--r--dviware/dvisvgm/src/StreamReader.cpp2
-rw-r--r--dviware/dvisvgm/src/StreamReader.hpp2
-rw-r--r--dviware/dvisvgm/src/StreamWriter.cpp2
-rw-r--r--dviware/dvisvgm/src/StreamWriter.hpp2
-rw-r--r--dviware/dvisvgm/src/Subfont.cpp2
-rw-r--r--dviware/dvisvgm/src/Subfont.hpp2
-rw-r--r--dviware/dvisvgm/src/System.cpp2
-rw-r--r--dviware/dvisvgm/src/System.hpp2
-rw-r--r--dviware/dvisvgm/src/TFM.cpp2
-rw-r--r--dviware/dvisvgm/src/TFM.hpp2
-rw-r--r--dviware/dvisvgm/src/TTFAutohint.cpp2
-rw-r--r--dviware/dvisvgm/src/TTFAutohint.hpp2
-rw-r--r--dviware/dvisvgm/src/TensorProductPatch.cpp6
-rw-r--r--dviware/dvisvgm/src/TensorProductPatch.hpp2
-rw-r--r--dviware/dvisvgm/src/Terminal.cpp2
-rw-r--r--dviware/dvisvgm/src/Terminal.hpp2
-rw-r--r--dviware/dvisvgm/src/ToUnicodeMap.cpp2
-rw-r--r--dviware/dvisvgm/src/ToUnicodeMap.hpp2
-rw-r--r--dviware/dvisvgm/src/TpicSpecialHandler.cpp2
-rw-r--r--dviware/dvisvgm/src/TpicSpecialHandler.hpp2
-rw-r--r--dviware/dvisvgm/src/TriangularPatch.cpp6
-rw-r--r--dviware/dvisvgm/src/TriangularPatch.hpp2
-rw-r--r--dviware/dvisvgm/src/TrueTypeFont.cpp2
-rw-r--r--dviware/dvisvgm/src/TrueTypeFont.hpp2
-rw-r--r--dviware/dvisvgm/src/Unicode.cpp2
-rw-r--r--dviware/dvisvgm/src/Unicode.hpp2
-rw-r--r--dviware/dvisvgm/src/VFActions.hpp2
-rw-r--r--dviware/dvisvgm/src/VFReader.cpp2
-rw-r--r--dviware/dvisvgm/src/VFReader.hpp2
-rw-r--r--dviware/dvisvgm/src/VectorIterator.hpp2
-rw-r--r--dviware/dvisvgm/src/VectorStream.hpp2
-rw-r--r--dviware/dvisvgm/src/XMLDocument.cpp2
-rw-r--r--dviware/dvisvgm/src/XMLDocument.hpp2
-rw-r--r--dviware/dvisvgm/src/XMLNode.cpp49
-rw-r--r--dviware/dvisvgm/src/XMLNode.hpp5
-rw-r--r--dviware/dvisvgm/src/XMLString.cpp2
-rw-r--r--dviware/dvisvgm/src/XMLString.hpp2
-rw-r--r--dviware/dvisvgm/src/XXHashFunction.hpp2
-rw-r--r--dviware/dvisvgm/src/ZLibOutputStream.hpp2
-rw-r--r--dviware/dvisvgm/src/dvisvgm.cpp10
-rw-r--r--dviware/dvisvgm/src/ffwrapper.c2
-rw-r--r--dviware/dvisvgm/src/ffwrapper.h2
-rw-r--r--dviware/dvisvgm/src/macros.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/AttributeExtractor.cpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/AttributeExtractor.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/DependencyGraph.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/GroupCollapser.cpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/GroupCollapser.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/OptimizerModule.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/RedundantElementRemover.cpp3
-rw-r--r--dviware/dvisvgm/src/optimizer/RedundantElementRemover.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/SVGOptimizer.cpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/SVGOptimizer.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/TextSimplifier.cpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/TextSimplifier.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/TransformSimplifier.cpp35
-rw-r--r--dviware/dvisvgm/src/optimizer/TransformSimplifier.hpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/WSNodeRemover.cpp2
-rw-r--r--dviware/dvisvgm/src/optimizer/WSNodeRemover.hpp2
-rw-r--r--dviware/dvisvgm/src/options.dtd2
-rw-r--r--dviware/dvisvgm/src/options.xml10
-rw-r--r--dviware/dvisvgm/src/psdefs.cpp230
-rw-r--r--dviware/dvisvgm/src/utility.cpp2
-rw-r--r--dviware/dvisvgm/src/utility.hpp24
-rw-r--r--dviware/dvisvgm/src/version.hpp.in2
-rw-r--r--dviware/dvisvgm/src/windows.hpp2
238 files changed, 792 insertions, 468 deletions
diff --git a/dviware/dvisvgm/src/AGLTable.hpp b/dviware/dvisvgm/src/AGLTable.hpp
index d973d1186b..c1d460273a 100644
--- a/dviware/dvisvgm/src/AGLTable.hpp
+++ b/dviware/dvisvgm/src/AGLTable.hpp
@@ -2,7 +2,7 @@
** AGLTable.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/BasicDVIReader.cpp b/dviware/dvisvgm/src/BasicDVIReader.cpp
index 272c88c3ad..bb30154e7b 100644
--- a/dviware/dvisvgm/src/BasicDVIReader.cpp
+++ b/dviware/dvisvgm/src/BasicDVIReader.cpp
@@ -2,7 +2,7 @@
** BasicDVIReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/BasicDVIReader.hpp b/dviware/dvisvgm/src/BasicDVIReader.hpp
index 14a1fb9858..7ce1f989e2 100644
--- a/dviware/dvisvgm/src/BasicDVIReader.hpp
+++ b/dviware/dvisvgm/src/BasicDVIReader.hpp
@@ -2,7 +2,7 @@
** BasicDVIReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Bezier.cpp b/dviware/dvisvgm/src/Bezier.cpp
index d2077bcfeb..87a0070621 100644
--- a/dviware/dvisvgm/src/Bezier.cpp
+++ b/dviware/dvisvgm/src/Bezier.cpp
@@ -2,7 +2,7 @@
** Bezier.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -168,7 +168,7 @@ static inline double dot_prod (const DPair &p1, const DPair &p2) {
static bool between (const DPair &p1, const DPair &p2, const DPair &p3, double delta) {
double sqr_dist = dot_prod(p2-p1, p2-p1);
double factor = sqr_dist == 0.0 ? 1.0 : sqr_dist;
- double area2 = fabs(signed_area(p1, p2, p3));
+ double area2 = abs(signed_area(p1, p2, p3));
return area2*area2/factor < delta // does p3 lay almost on the line through p1 and p2...
&& min(p1.x(), p2.x()) <= p3.x() // ...and on or inside the rectangle spanned by p1 and p2?
&& max(p1.x(), p2.x()) >= p3.x()
@@ -179,7 +179,7 @@ static bool between (const DPair &p1, const DPair &p2, const DPair &p3, double d
static inline bool near (const DPair &p1, const DPair &p2, double delta) {
DPair diff = p2-p1;
- return fabs(diff.x()) < delta && fabs(diff.y()) < delta;
+ return abs(diff.x()) < delta && abs(diff.y()) < delta;
}
diff --git a/dviware/dvisvgm/src/Bezier.hpp b/dviware/dvisvgm/src/Bezier.hpp
index 525ef23435..322dd4e72d 100644
--- a/dviware/dvisvgm/src/Bezier.hpp
+++ b/dviware/dvisvgm/src/Bezier.hpp
@@ -2,7 +2,7 @@
** Bezier.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/BgColorSpecialHandler.cpp b/dviware/dvisvgm/src/BgColorSpecialHandler.cpp
index 10c05fca05..3b315b50a3 100644
--- a/dviware/dvisvgm/src/BgColorSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/BgColorSpecialHandler.cpp
@@ -2,7 +2,7 @@
** BgColorSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/BgColorSpecialHandler.hpp b/dviware/dvisvgm/src/BgColorSpecialHandler.hpp
index e1061efc8c..9334a5c541 100644
--- a/dviware/dvisvgm/src/BgColorSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/BgColorSpecialHandler.hpp
@@ -2,7 +2,7 @@
** BgColorSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Bitmap.cpp b/dviware/dvisvgm/src/Bitmap.cpp
index 3fa554eed4..64ebd6195e 100644
--- a/dviware/dvisvgm/src/Bitmap.cpp
+++ b/dviware/dvisvgm/src/Bitmap.cpp
@@ -2,7 +2,7 @@
** Bitmap.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Bitmap.hpp b/dviware/dvisvgm/src/Bitmap.hpp
index 026edae9a2..0d04aa2a69 100644
--- a/dviware/dvisvgm/src/Bitmap.hpp
+++ b/dviware/dvisvgm/src/Bitmap.hpp
@@ -2,7 +2,7 @@
** Bitmap.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/BoundingBox.cpp b/dviware/dvisvgm/src/BoundingBox.cpp
index a076b52363..2dbcc2ebcd 100644
--- a/dviware/dvisvgm/src/BoundingBox.cpp
+++ b/dviware/dvisvgm/src/BoundingBox.cpp
@@ -2,7 +2,7 @@
** BoundingBox.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -207,7 +207,7 @@ void BoundingBox::operator += (const BoundingBox &bbox) {
static inline bool almost_equal (double v1, double v2) {
- return fabs(v1-v2) < 1e-10;
+ return abs(v1-v2) < 1e-10;
}
diff --git a/dviware/dvisvgm/src/BoundingBox.hpp b/dviware/dvisvgm/src/BoundingBox.hpp
index 8848f60f28..c52312a24a 100644
--- a/dviware/dvisvgm/src/BoundingBox.hpp
+++ b/dviware/dvisvgm/src/BoundingBox.hpp
@@ -2,7 +2,7 @@
** BoundingBox.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CLCommandLine.cpp b/dviware/dvisvgm/src/CLCommandLine.cpp
index 2b0c1b5359..1f6bb4475e 100644
--- a/dviware/dvisvgm/src/CLCommandLine.cpp
+++ b/dviware/dvisvgm/src/CLCommandLine.cpp
@@ -2,7 +2,7 @@
** CLCommandLine.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CLCommandLine.hpp b/dviware/dvisvgm/src/CLCommandLine.hpp
index a80d9b87d7..257ff4160f 100644
--- a/dviware/dvisvgm/src/CLCommandLine.hpp
+++ b/dviware/dvisvgm/src/CLCommandLine.hpp
@@ -2,7 +2,7 @@
** CLCommandLine.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CLOption.hpp b/dviware/dvisvgm/src/CLOption.hpp
index 54dff67025..d9da7ae008 100644
--- a/dviware/dvisvgm/src/CLOption.hpp
+++ b/dviware/dvisvgm/src/CLOption.hpp
@@ -2,7 +2,7 @@
** CLOption.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CMap.cpp b/dviware/dvisvgm/src/CMap.cpp
index fa92901eef..747fb5ad50 100644
--- a/dviware/dvisvgm/src/CMap.cpp
+++ b/dviware/dvisvgm/src/CMap.cpp
@@ -2,7 +2,7 @@
** CMap.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CMap.hpp b/dviware/dvisvgm/src/CMap.hpp
index 0f0259e853..63761ff2ff 100644
--- a/dviware/dvisvgm/src/CMap.hpp
+++ b/dviware/dvisvgm/src/CMap.hpp
@@ -2,7 +2,7 @@
** CMap.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CMapManager.cpp b/dviware/dvisvgm/src/CMapManager.cpp
index 779c6ee3a8..52b323ebc6 100644
--- a/dviware/dvisvgm/src/CMapManager.cpp
+++ b/dviware/dvisvgm/src/CMapManager.cpp
@@ -2,7 +2,7 @@
** CMapManager.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CMapManager.hpp b/dviware/dvisvgm/src/CMapManager.hpp
index 0635f2ec3e..aeb9156e84 100644
--- a/dviware/dvisvgm/src/CMapManager.hpp
+++ b/dviware/dvisvgm/src/CMapManager.hpp
@@ -2,7 +2,7 @@
** CMapManager.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CMapReader.cpp b/dviware/dvisvgm/src/CMapReader.cpp
index 6661afbbb1..51ba52b95d 100644
--- a/dviware/dvisvgm/src/CMapReader.cpp
+++ b/dviware/dvisvgm/src/CMapReader.cpp
@@ -2,7 +2,7 @@
** CMapReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CMapReader.hpp b/dviware/dvisvgm/src/CMapReader.hpp
index 3e5b841e0c..04ce5740c0 100644
--- a/dviware/dvisvgm/src/CMapReader.hpp
+++ b/dviware/dvisvgm/src/CMapReader.hpp
@@ -2,7 +2,7 @@
** CMapReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Calculator.cpp b/dviware/dvisvgm/src/Calculator.cpp
index 3091c9cf35..c5dc00df4d 100644
--- a/dviware/dvisvgm/src/Calculator.cpp
+++ b/dviware/dvisvgm/src/Calculator.cpp
@@ -2,7 +2,7 @@
** Calculator.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Calculator.hpp b/dviware/dvisvgm/src/Calculator.hpp
index cc3b2feb6b..92ec4e40b1 100644
--- a/dviware/dvisvgm/src/Calculator.hpp
+++ b/dviware/dvisvgm/src/Calculator.hpp
@@ -2,7 +2,7 @@
** Calculator.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CharMapID.cpp b/dviware/dvisvgm/src/CharMapID.cpp
index c04ae2ceb9..9c56afc73a 100644
--- a/dviware/dvisvgm/src/CharMapID.cpp
+++ b/dviware/dvisvgm/src/CharMapID.cpp
@@ -2,7 +2,7 @@
** CharMapID.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CharMapID.hpp b/dviware/dvisvgm/src/CharMapID.hpp
index cdc39ca94d..ed044a9cf3 100644
--- a/dviware/dvisvgm/src/CharMapID.hpp
+++ b/dviware/dvisvgm/src/CharMapID.hpp
@@ -2,7 +2,7 @@
** CharMapID.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Character.hpp b/dviware/dvisvgm/src/Character.hpp
index e232401fb8..667a583100 100644
--- a/dviware/dvisvgm/src/Character.hpp
+++ b/dviware/dvisvgm/src/Character.hpp
@@ -2,7 +2,7 @@
** Character.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Color.cpp b/dviware/dvisvgm/src/Color.cpp
index de7e9074ab..bf9a05d7a3 100644
--- a/dviware/dvisvgm/src/Color.cpp
+++ b/dviware/dvisvgm/src/Color.cpp
@@ -2,7 +2,7 @@
** Color.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Color.hpp b/dviware/dvisvgm/src/Color.hpp
index c58a97f0bb..6f6f812207 100644
--- a/dviware/dvisvgm/src/Color.hpp
+++ b/dviware/dvisvgm/src/Color.hpp
@@ -2,7 +2,7 @@
** Color.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ColorSpecialHandler.cpp b/dviware/dvisvgm/src/ColorSpecialHandler.cpp
index 4bfd494003..2cacf82992 100644
--- a/dviware/dvisvgm/src/ColorSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/ColorSpecialHandler.cpp
@@ -2,7 +2,7 @@
** ColorSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ColorSpecialHandler.hpp b/dviware/dvisvgm/src/ColorSpecialHandler.hpp
index 176253407e..eeab300f47 100644
--- a/dviware/dvisvgm/src/ColorSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/ColorSpecialHandler.hpp
@@ -2,7 +2,7 @@
** ColorSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/CommandLine.hpp b/dviware/dvisvgm/src/CommandLine.hpp
index b1f2636040..7ea6ddd76e 100644
--- a/dviware/dvisvgm/src/CommandLine.hpp
+++ b/dviware/dvisvgm/src/CommandLine.hpp
@@ -2,7 +2,7 @@
// It is part of the dvisvgm package and published under the terms
// of the GNU General Public License version 3, or (at your option) any later version.
// See file COPYING for further details.
-// Copyright (C) 2016-2019 Martin Gieseking <martin.gieseking@uos.de>
+// Copyright (C) 2016-2020 Martin Gieseking <martin.gieseking@uos.de>
#ifndef COMMANDLINE_HPP
#define COMMANDLINE_HPP
@@ -20,7 +20,7 @@ class CommandLine : public CL::CommandLine {
CommandLine () : CL::CommandLine(
"This program converts DVI files, as created by TeX/LaTeX, as well as\nEPS and PDF files to the XML-based scalable vector graphics format SVG.",
"[options] dvifile\n--eps [options] epsfile\n--pdf [options] pdffile",
- "Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de>"
+ "Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de>"
) {}
CommandLine (int argc, char **argv) : CommandLine() {
@@ -29,6 +29,7 @@ class CommandLine : public CL::CommandLine {
// option variables
TypedOption<std::string, Option::ArgMode::REQUIRED> bboxOpt {"bbox", 'b', "size", "min", "set size of bounding box"};
+ TypedOption<std::string, Option::ArgMode::REQUIRED> bitmapFormatOpt {"bitmap-format", 'B', "fmt", "jpeg", "set format used to embed PS/EPS bitmaps"};
TypedOption<std::string, Option::ArgMode::OPTIONAL> cacheOpt {"cache", 'C', "dir", "set/print path of cache directory"};
Option clipjoinOpt {"clipjoin", 'j', "compute intersection of clipping paths"};
Option colorOpt {"color", '\0', "colorize messages"};
@@ -36,7 +37,7 @@ class CommandLine : public CL::CommandLine {
Option commentsOpt {"comments", '\0', "add comments with additional information"};
Option epsOpt {"eps", 'E', "convert EPS file to SVG"};
Option exactBboxOpt {"exact-bbox", 'e', "compute exact glyph bounding boxes"};
- TypedOption<std::string, Option::ArgMode::REQUIRED> fontFormatOpt {"font-format", 'f', "format", "svg", "select file format of embedded fonts"};
+ TypedOption<std::string, Option::ArgMode::REQUIRED> fontFormatOpt {"font-format", 'f', "format", "svg", "set file format of embedded fonts"};
TypedOption<std::string, Option::ArgMode::REQUIRED> fontmapOpt {"fontmap", 'm', "filenames", "evaluate (additional) font map files"};
Option gradOverlapOpt {"grad-overlap", '\0', "create overlapping color gradient segments"};
TypedOption<int, Option::ArgMode::REQUIRED> gradSegmentsOpt {"grad-segments", '\0', "number", 20, "number of color gradient segments per row"};
@@ -98,6 +99,9 @@ class CommandLine : public CL::CommandLine {
{&stdinOpt, 0},
{&bboxOpt, 1},
#if !defined(DISABLE_GS)
+ {&bitmapFormatOpt, 1},
+#endif
+#if !defined(DISABLE_GS)
{&clipjoinOpt, 1},
#endif
{&colornamesOpt, 1},
diff --git a/dviware/dvisvgm/src/DLLoader.cpp b/dviware/dvisvgm/src/DLLoader.cpp
index b047203801..9a974e89d9 100644
--- a/dviware/dvisvgm/src/DLLoader.cpp
+++ b/dviware/dvisvgm/src/DLLoader.cpp
@@ -2,7 +2,7 @@
** DLLoader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DLLoader.hpp b/dviware/dvisvgm/src/DLLoader.hpp
index 6bfff573e2..469fd1c4aa 100644
--- a/dviware/dvisvgm/src/DLLoader.hpp
+++ b/dviware/dvisvgm/src/DLLoader.hpp
@@ -2,7 +2,7 @@
** DLLoader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DVIActions.hpp b/dviware/dvisvgm/src/DVIActions.hpp
index c42f446d9e..31ea693477 100644
--- a/dviware/dvisvgm/src/DVIActions.hpp
+++ b/dviware/dvisvgm/src/DVIActions.hpp
@@ -2,7 +2,7 @@
** DVIActions.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DVIReader.cpp b/dviware/dvisvgm/src/DVIReader.cpp
index b0bbabee94..417efe9304 100644
--- a/dviware/dvisvgm/src/DVIReader.cpp
+++ b/dviware/dvisvgm/src/DVIReader.cpp
@@ -2,7 +2,7 @@
** DVIReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DVIReader.hpp b/dviware/dvisvgm/src/DVIReader.hpp
index 972af2022a..fc1424aca3 100644
--- a/dviware/dvisvgm/src/DVIReader.hpp
+++ b/dviware/dvisvgm/src/DVIReader.hpp
@@ -2,7 +2,7 @@
** DVIReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DVIToSVG.cpp b/dviware/dvisvgm/src/DVIToSVG.cpp
index 4801bd80a0..7280495e83 100644
--- a/dviware/dvisvgm/src/DVIToSVG.cpp
+++ b/dviware/dvisvgm/src/DVIToSVG.cpp
@@ -2,7 +2,7 @@
** DVIToSVG.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DVIToSVG.hpp b/dviware/dvisvgm/src/DVIToSVG.hpp
index 40dbdc884f..1bafa7cb3d 100644
--- a/dviware/dvisvgm/src/DVIToSVG.hpp
+++ b/dviware/dvisvgm/src/DVIToSVG.hpp
@@ -2,7 +2,7 @@
** DVIToSVG.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DVIToSVGActions.cpp b/dviware/dvisvgm/src/DVIToSVGActions.cpp
index bb8e4d6f84..6239be3b01 100644
--- a/dviware/dvisvgm/src/DVIToSVGActions.cpp
+++ b/dviware/dvisvgm/src/DVIToSVGActions.cpp
@@ -2,7 +2,7 @@
** DVIToSVGActions.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DVIToSVGActions.hpp b/dviware/dvisvgm/src/DVIToSVGActions.hpp
index e9adc63e38..2ae3fb9a2e 100644
--- a/dviware/dvisvgm/src/DVIToSVGActions.hpp
+++ b/dviware/dvisvgm/src/DVIToSVGActions.hpp
@@ -2,7 +2,7 @@
** DVIToSVGActions.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Directory.cpp b/dviware/dvisvgm/src/Directory.cpp
index 748d1bc070..e7200a0dc3 100644
--- a/dviware/dvisvgm/src/Directory.cpp
+++ b/dviware/dvisvgm/src/Directory.cpp
@@ -2,7 +2,7 @@
** Directory.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Directory.hpp b/dviware/dvisvgm/src/Directory.hpp
index f6ec7a9602..d617b4fcbd 100644
--- a/dviware/dvisvgm/src/Directory.hpp
+++ b/dviware/dvisvgm/src/Directory.hpp
@@ -2,7 +2,7 @@
** Directory.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp b/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp
index dadf196f77..b2af27d636 100644
--- a/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/DvisvgmSpecialHandler.cpp
@@ -2,7 +2,7 @@
** DvisvgmSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/DvisvgmSpecialHandler.hpp b/dviware/dvisvgm/src/DvisvgmSpecialHandler.hpp
index a8bde952e6..0f73c73ecd 100644
--- a/dviware/dvisvgm/src/DvisvgmSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/DvisvgmSpecialHandler.hpp
@@ -2,7 +2,7 @@
** DvisvgmSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EPSFile.cpp b/dviware/dvisvgm/src/EPSFile.cpp
index 5a5fccc08f..1a19c07cc7 100644
--- a/dviware/dvisvgm/src/EPSFile.cpp
+++ b/dviware/dvisvgm/src/EPSFile.cpp
@@ -2,7 +2,7 @@
** EPSFile.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EPSFile.hpp b/dviware/dvisvgm/src/EPSFile.hpp
index 4fdd03ee1b..7b02db95b1 100644
--- a/dviware/dvisvgm/src/EPSFile.hpp
+++ b/dviware/dvisvgm/src/EPSFile.hpp
@@ -2,7 +2,7 @@
** EPSFile.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EPSToSVG.hpp b/dviware/dvisvgm/src/EPSToSVG.hpp
index 9b193dc9cb..64f5ac604d 100644
--- a/dviware/dvisvgm/src/EPSToSVG.hpp
+++ b/dviware/dvisvgm/src/EPSToSVG.hpp
@@ -2,7 +2,7 @@
** EPSToSVG.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -30,7 +30,7 @@ class EPSToSVG : public ImageToSVG {
public:
EPSToSVG (const std::string &fname, SVGOutputBase &out) : ImageToSVG(fname, out) {}
bool isSinglePageFormat() const override {return true;}
- int totalPageCount() override {return 1;}
+ int totalPageCount() const override {return 1;}
protected:
std::string imageFormat () const override {return "EPS";}
diff --git a/dviware/dvisvgm/src/EllipticalArc.cpp b/dviware/dvisvgm/src/EllipticalArc.cpp
index b820af0052..a151c51307 100644
--- a/dviware/dvisvgm/src/EllipticalArc.cpp
+++ b/dviware/dvisvgm/src/EllipticalArc.cpp
@@ -2,7 +2,7 @@
** EllipticalArc.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EllipticalArc.hpp b/dviware/dvisvgm/src/EllipticalArc.hpp
index 5d20558196..422a40b207 100644
--- a/dviware/dvisvgm/src/EllipticalArc.hpp
+++ b/dviware/dvisvgm/src/EllipticalArc.hpp
@@ -2,7 +2,7 @@
** EllipticalArc.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EmSpecialHandler.cpp b/dviware/dvisvgm/src/EmSpecialHandler.cpp
index c93a798fd7..efbd7abef3 100644
--- a/dviware/dvisvgm/src/EmSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/EmSpecialHandler.cpp
@@ -2,7 +2,7 @@
** EmSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EmSpecialHandler.hpp b/dviware/dvisvgm/src/EmSpecialHandler.hpp
index 242ef248ef..e20339e548 100644
--- a/dviware/dvisvgm/src/EmSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/EmSpecialHandler.hpp
@@ -2,7 +2,7 @@
** EmSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EncFile.cpp b/dviware/dvisvgm/src/EncFile.cpp
index dba0a2544a..ce0f18d81e 100644
--- a/dviware/dvisvgm/src/EncFile.cpp
+++ b/dviware/dvisvgm/src/EncFile.cpp
@@ -2,7 +2,7 @@
** EncFile.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/EncFile.hpp b/dviware/dvisvgm/src/EncFile.hpp
index fac26fd201..8f2b14c430 100644
--- a/dviware/dvisvgm/src/EncFile.hpp
+++ b/dviware/dvisvgm/src/EncFile.hpp
@@ -2,7 +2,7 @@
** EncFile.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FileFinder.cpp b/dviware/dvisvgm/src/FileFinder.cpp
index e867f648a7..a52ccd37d3 100644
--- a/dviware/dvisvgm/src/FileFinder.cpp
+++ b/dviware/dvisvgm/src/FileFinder.cpp
@@ -2,7 +2,7 @@
** FileFinder.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FileFinder.hpp b/dviware/dvisvgm/src/FileFinder.hpp
index 08c59a3372..7218bf6c0b 100644
--- a/dviware/dvisvgm/src/FileFinder.hpp
+++ b/dviware/dvisvgm/src/FileFinder.hpp
@@ -2,7 +2,7 @@
** FileFinder.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FilePath.cpp b/dviware/dvisvgm/src/FilePath.cpp
index 6f162bfab9..2150cf31f7 100644
--- a/dviware/dvisvgm/src/FilePath.cpp
+++ b/dviware/dvisvgm/src/FilePath.cpp
@@ -2,7 +2,7 @@
** FilePath.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -191,14 +191,16 @@ string FilePath::suffix () const {
/** Changes the suffix of the filename. If FilePath represents the
- * location of a directory (and not of a file) nothing happens.
- * @param[in] s new suffix */
-void FilePath::suffix (const string &s) {
+ * location of a directory (and not of a file) nothing happens. An
+ * empty new suffix leads to the removal of the current one.
+ * @param[in] newSuffix the new suffix */
+void FilePath::suffix (const string &newSuffix) {
if (!_fname.empty()) {
string current_suffix = suffix();
if (!current_suffix.empty())
_fname.erase(_fname.length()-current_suffix.length()-1);
- _fname += "."+s;
+ if (!newSuffix.empty())
+ _fname += "."+newSuffix;
}
}
diff --git a/dviware/dvisvgm/src/FilePath.hpp b/dviware/dvisvgm/src/FilePath.hpp
index 32a9be6814..e9d55562c5 100644
--- a/dviware/dvisvgm/src/FilePath.hpp
+++ b/dviware/dvisvgm/src/FilePath.hpp
@@ -2,7 +2,7 @@
** FilePath.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -52,7 +52,7 @@ class FilePath {
std::string shorterAbsoluteOrRelative (std::string reldir="", bool with_filename=true) const;
std::string basename () const;
std::string suffix () const;
- void suffix (const std::string &s);
+ void suffix (const std::string &newSuffix);
size_t depth () const {return _dirs.size();}
bool isFile () const {return !_fname.empty();}
bool empty () const {return _dirs.empty() && _fname.empty();}
diff --git a/dviware/dvisvgm/src/FileSystem.cpp b/dviware/dvisvgm/src/FileSystem.cpp
index 6a081ee24f..a1fafbdece 100644
--- a/dviware/dvisvgm/src/FileSystem.cpp
+++ b/dviware/dvisvgm/src/FileSystem.cpp
@@ -2,7 +2,7 @@
** FileSystem.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FileSystem.hpp b/dviware/dvisvgm/src/FileSystem.hpp
index b882caa9fa..f82ff1e870 100644
--- a/dviware/dvisvgm/src/FileSystem.hpp
+++ b/dviware/dvisvgm/src/FileSystem.hpp
@@ -2,7 +2,7 @@
** FileSystem.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FixWord.hpp b/dviware/dvisvgm/src/FixWord.hpp
index 94166b232c..3414e1ead4 100644
--- a/dviware/dvisvgm/src/FixWord.hpp
+++ b/dviware/dvisvgm/src/FixWord.hpp
@@ -2,7 +2,7 @@
** FixWord.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Font.cpp b/dviware/dvisvgm/src/Font.cpp
index 97520c5953..e40ad8a392 100644
--- a/dviware/dvisvgm/src/Font.cpp
+++ b/dviware/dvisvgm/src/Font.cpp
@@ -2,7 +2,7 @@
** Font.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -425,10 +425,10 @@ int PhysicalFont::traceAllGlyphs (bool includeCached, GFGlyphTracer::Callback *c
* @param[out] bbox the computed bounding box
* @param[in] cb optional calback object forwarded to the tracer
* @return true if the box could be computed successfully */
-bool PhysicalFont::getExactGlyphBox(int c, BoundingBox& bbox, GFGlyphTracer::Callback* cb) const {
+bool PhysicalFont::getExactGlyphBox (int c, BoundingBox& bbox, GFGlyphTracer::Callback* cb) const {
Glyph glyph;
if (getGlyph(c, glyph, cb)) {
- glyph.computeBBox(bbox);
+ bbox = glyph.computeBBox();
double s = scaledSize()/unitsPerEm();
bbox.scale(s, s);
return true;
@@ -608,7 +608,7 @@ double NativeFont::charWidth (int c) const {
FontEngine::instance().setFont(*this);
int upem = FontEngine::instance().getUnitsPerEM();
double w = upem ? (scaledSize()*FontEngine::instance().getAdvance(c)/upem*_style.extend) : 0;
- w += fabs(_style.slant*charHeight(c));
+ w += abs(_style.slant*charHeight(c));
return w;
}
diff --git a/dviware/dvisvgm/src/Font.hpp b/dviware/dvisvgm/src/Font.hpp
index 3273a0c14b..59556e7a81 100644
--- a/dviware/dvisvgm/src/Font.hpp
+++ b/dviware/dvisvgm/src/Font.hpp
@@ -2,7 +2,7 @@
** Font.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontCache.cpp b/dviware/dvisvgm/src/FontCache.cpp
index 34478542df..e024558913 100644
--- a/dviware/dvisvgm/src/FontCache.cpp
+++ b/dviware/dvisvgm/src/FontCache.cpp
@@ -2,7 +2,7 @@
** FontCache.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontCache.hpp b/dviware/dvisvgm/src/FontCache.hpp
index 0068b6c78b..8a6025a3d2 100644
--- a/dviware/dvisvgm/src/FontCache.hpp
+++ b/dviware/dvisvgm/src/FontCache.hpp
@@ -2,7 +2,7 @@
** FontCache.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontEncoding.cpp b/dviware/dvisvgm/src/FontEncoding.cpp
index 3b038b63c6..8f2673f123 100644
--- a/dviware/dvisvgm/src/FontEncoding.cpp
+++ b/dviware/dvisvgm/src/FontEncoding.cpp
@@ -2,7 +2,7 @@
** FontEncoding.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontEncoding.hpp b/dviware/dvisvgm/src/FontEncoding.hpp
index fffccd4224..1c4a979aa9 100644
--- a/dviware/dvisvgm/src/FontEncoding.hpp
+++ b/dviware/dvisvgm/src/FontEncoding.hpp
@@ -2,7 +2,7 @@
** FontEncoding.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontEngine.cpp b/dviware/dvisvgm/src/FontEngine.cpp
index 61efd68916..bee1ca886d 100644
--- a/dviware/dvisvgm/src/FontEngine.cpp
+++ b/dviware/dvisvgm/src/FontEngine.cpp
@@ -2,7 +2,7 @@
** FontEngine.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontEngine.hpp b/dviware/dvisvgm/src/FontEngine.hpp
index 33c9b96da2..5796c2b1b3 100644
--- a/dviware/dvisvgm/src/FontEngine.hpp
+++ b/dviware/dvisvgm/src/FontEngine.hpp
@@ -2,7 +2,7 @@
** FontEngine.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontManager.cpp b/dviware/dvisvgm/src/FontManager.cpp
index 4f236b3866..58d2dfc261 100644
--- a/dviware/dvisvgm/src/FontManager.cpp
+++ b/dviware/dvisvgm/src/FontManager.cpp
@@ -2,7 +2,7 @@
** FontManager.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontManager.hpp b/dviware/dvisvgm/src/FontManager.hpp
index 4405f67ecd..2fe88bee38 100644
--- a/dviware/dvisvgm/src/FontManager.hpp
+++ b/dviware/dvisvgm/src/FontManager.hpp
@@ -2,7 +2,7 @@
** FontManager.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontMap.cpp b/dviware/dvisvgm/src/FontMap.cpp
index cc48aef0e6..727fdd83ba 100644
--- a/dviware/dvisvgm/src/FontMap.cpp
+++ b/dviware/dvisvgm/src/FontMap.cpp
@@ -2,7 +2,7 @@
** FontMap.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontMap.hpp b/dviware/dvisvgm/src/FontMap.hpp
index cd109c1809..f4824aa7f1 100644
--- a/dviware/dvisvgm/src/FontMap.hpp
+++ b/dviware/dvisvgm/src/FontMap.hpp
@@ -2,7 +2,7 @@
** FontMap.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontMetrics.cpp b/dviware/dvisvgm/src/FontMetrics.cpp
index 003b80acad..7d858fea90 100644
--- a/dviware/dvisvgm/src/FontMetrics.cpp
+++ b/dviware/dvisvgm/src/FontMetrics.cpp
@@ -2,7 +2,7 @@
** FontMetrics.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontMetrics.hpp b/dviware/dvisvgm/src/FontMetrics.hpp
index ccba26b727..66637e3044 100644
--- a/dviware/dvisvgm/src/FontMetrics.hpp
+++ b/dviware/dvisvgm/src/FontMetrics.hpp
@@ -2,7 +2,7 @@
** FontMetrics.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontStyle.hpp b/dviware/dvisvgm/src/FontStyle.hpp
index 1088df3c4e..79a03dac36 100644
--- a/dviware/dvisvgm/src/FontStyle.hpp
+++ b/dviware/dvisvgm/src/FontStyle.hpp
@@ -2,7 +2,7 @@
** FontStyle.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/FontWriter.cpp b/dviware/dvisvgm/src/FontWriter.cpp
index d93402baf5..4dd4c5c0d8 100644
--- a/dviware/dvisvgm/src/FontWriter.cpp
+++ b/dviware/dvisvgm/src/FontWriter.cpp
@@ -2,7 +2,7 @@
** FontWriter.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -145,7 +145,7 @@ static void writeSFD (const string &sfdname, const PhysicalFont &font, const set
// ensure that the sum of the SFD's Ascent and Descent values equals the font's units per EM
double yext = font.ascent()+font.descent();
- double scale = double(font.unitsPerEm())/(yext != 0 ? yext : fabs(font.ascent()));
+ double scale = double(font.unitsPerEm())/(yext != 0 ? yext : abs(font.ascent()));
sfd <<
"Ascent: " << font.ascent()*scale << "\n"
"Descent: " << font.descent()*scale << "\n"
@@ -260,7 +260,7 @@ bool FontWriter::writeCSSFontFace (FontFormat format, const set<int> &charcodes,
os << "@font-face{"
<< "font-family:" << _font.name() << ';'
<< "src:url(data:" << info->mimetype << ";base64,";
- util::base64_copy(istreambuf_iterator<char>(ifs), istreambuf_iterator<char>(), ostreambuf_iterator<char>(os));
+ util::base64_copy(ifs, os);
os << ") format('" << info->formatstr_long << "');}\n";
ifs.close();
if (!PhysicalFont::KEEP_TEMP_FILES)
diff --git a/dviware/dvisvgm/src/FontWriter.hpp b/dviware/dvisvgm/src/FontWriter.hpp
index 458952cad9..e6cad37e88 100644
--- a/dviware/dvisvgm/src/FontWriter.hpp
+++ b/dviware/dvisvgm/src/FontWriter.hpp
@@ -2,7 +2,7 @@
** FontWriter.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/GFGlyphTracer.cpp b/dviware/dvisvgm/src/GFGlyphTracer.cpp
index 1b55afc593..db77ae1dc8 100644
--- a/dviware/dvisvgm/src/GFGlyphTracer.cpp
+++ b/dviware/dvisvgm/src/GFGlyphTracer.cpp
@@ -2,7 +2,7 @@
** GFGlyphTracer.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/GFGlyphTracer.hpp b/dviware/dvisvgm/src/GFGlyphTracer.hpp
index afe1b95253..d0d45ffd61 100644
--- a/dviware/dvisvgm/src/GFGlyphTracer.hpp
+++ b/dviware/dvisvgm/src/GFGlyphTracer.hpp
@@ -2,7 +2,7 @@
** GFGlyphTracer.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/GFReader.cpp b/dviware/dvisvgm/src/GFReader.cpp
index a7d314d3de..4712de41d3 100644
--- a/dviware/dvisvgm/src/GFReader.cpp
+++ b/dviware/dvisvgm/src/GFReader.cpp
@@ -2,7 +2,7 @@
** GFReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/GFReader.hpp b/dviware/dvisvgm/src/GFReader.hpp
index ad1e8b2220..e829bf8ffa 100644
--- a/dviware/dvisvgm/src/GFReader.hpp
+++ b/dviware/dvisvgm/src/GFReader.hpp
@@ -2,7 +2,7 @@
** GFReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/GFTracer.cpp b/dviware/dvisvgm/src/GFTracer.cpp
index e73aab12fd..4a3fa5e776 100644
--- a/dviware/dvisvgm/src/GFTracer.cpp
+++ b/dviware/dvisvgm/src/GFTracer.cpp
@@ -2,7 +2,7 @@
** GFTracer.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/GFTracer.hpp b/dviware/dvisvgm/src/GFTracer.hpp
index efe9476a8f..e72848896d 100644
--- a/dviware/dvisvgm/src/GFTracer.hpp
+++ b/dviware/dvisvgm/src/GFTracer.hpp
@@ -2,7 +2,7 @@
** GFTracer.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Ghostscript.cpp b/dviware/dvisvgm/src/Ghostscript.cpp
index c097ace667..1ff82314ec 100644
--- a/dviware/dvisvgm/src/Ghostscript.cpp
+++ b/dviware/dvisvgm/src/Ghostscript.cpp
@@ -2,7 +2,7 @@
** Ghostscript.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -144,6 +144,9 @@ static string get_libgs (const string &fname) {
dlname = "libgs." + to_string(i) + ".dylib";
if (loader.loadLibrary(dlname))
return dlname;
+ dlname = "libgs.dylib." + to_string(i);
+ if (loader.loadLibrary(dlname))
+ return dlname;
#endif
}
#endif
diff --git a/dviware/dvisvgm/src/Ghostscript.hpp b/dviware/dvisvgm/src/Ghostscript.hpp
index 4ea62f775f..8c9a429798 100644
--- a/dviware/dvisvgm/src/Ghostscript.hpp
+++ b/dviware/dvisvgm/src/Ghostscript.hpp
@@ -2,7 +2,7 @@
** Ghostscript.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Glyph.hpp b/dviware/dvisvgm/src/Glyph.hpp
index 6f457a778f..dfa8cb366a 100644
--- a/dviware/dvisvgm/src/Glyph.hpp
+++ b/dviware/dvisvgm/src/Glyph.hpp
@@ -2,7 +2,7 @@
** Glyph.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/GlyphTracerMessages.hpp b/dviware/dvisvgm/src/GlyphTracerMessages.hpp
index d48fe6f1b4..f291d05ccc 100644
--- a/dviware/dvisvgm/src/GlyphTracerMessages.hpp
+++ b/dviware/dvisvgm/src/GlyphTracerMessages.hpp
@@ -2,7 +2,7 @@
** GlyphTracerMessages.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -37,17 +37,18 @@ class GlyphTracerMessages : public GFGlyphTracer::Callback {
void beginChar (uint8_t c) override {
if (!_traced) {
- if (!_fname.empty())
+ if (!_fname.empty()) {
Message::mstream() << '\n';
- // extract font name from file path
- std::string fontname = _fname;
- size_t pos;
- if ((pos = fontname.rfind('/')) != std::string::npos)
- fontname = fontname.substr(pos+1);
- if ((pos = fontname.rfind('.')) != std::string::npos)
- fontname = fontname.substr(0, pos);
- Message::mstream(false, Message::MC_STATE)
- << "tracing glyphs of " << fontname << '\n';
+ // extract font name from file path
+ std::string fontname = _fname;
+ size_t pos;
+ if ((pos = fontname.rfind('/')) != std::string::npos)
+ fontname = fontname.substr(pos+1);
+ if ((pos = fontname.rfind('.')) != std::string::npos)
+ fontname = fontname.substr(0, pos);
+ Message::mstream(false, Message::MC_STATE)
+ << "tracing glyphs of " << fontname << '\n';
+ }
_traced = true;
}
}
diff --git a/dviware/dvisvgm/src/GraphicsPath.hpp b/dviware/dvisvgm/src/GraphicsPath.hpp
index bf09a37d09..565251c0d0 100644
--- a/dviware/dvisvgm/src/GraphicsPath.hpp
+++ b/dviware/dvisvgm/src/GraphicsPath.hpp
@@ -2,7 +2,7 @@
** GraphicsPath.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -540,7 +540,7 @@ class GraphicsPath {
}
}
- void arcto (double rx, double ry, double angle, bool laf, bool sweep, const Point &p) {
+ void arcto (T rx, T ry, double angle, bool laf, bool sweep, const Point &p) {
_commands.emplace_back(ArcTo{rx, ry, angle, laf, sweep, p});
_finalPoint = p;
}
@@ -597,7 +597,8 @@ class GraphicsPath {
/** Computes the bounding box of the current path.
* @param[out] bbox the computed bounding box */
- void computeBBox (BoundingBox &bbox) const {
+ BoundingBox computeBBox () const {
+ BoundingBox bbox;
struct BBoxActions : IterationActions {
explicit BBoxActions (BoundingBox &bb) : bbox(bb) {}
void moveto (const Point &p) override {bbox.embed(p);}
@@ -610,6 +611,7 @@ class GraphicsPath {
BoundingBox &bbox;
} actions(bbox);
iterate(actions, false);
+ return bbox;
}
/** Checks whether the current path describes a dot/point only (with no extent).
diff --git a/dviware/dvisvgm/src/HashFunction.cpp b/dviware/dvisvgm/src/HashFunction.cpp
index 517cc8f3cc..7f99dacaf0 100644
--- a/dviware/dvisvgm/src/HashFunction.cpp
+++ b/dviware/dvisvgm/src/HashFunction.cpp
@@ -2,7 +2,7 @@
** HashFunction.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/HashFunction.hpp b/dviware/dvisvgm/src/HashFunction.hpp
index bba61918ed..b13ee39a50 100644
--- a/dviware/dvisvgm/src/HashFunction.hpp
+++ b/dviware/dvisvgm/src/HashFunction.hpp
@@ -2,7 +2,7 @@
** HashFunction.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/HtmlSpecialHandler.cpp b/dviware/dvisvgm/src/HtmlSpecialHandler.cpp
index 43d3dbc224..01051f9d64 100644
--- a/dviware/dvisvgm/src/HtmlSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/HtmlSpecialHandler.cpp
@@ -2,7 +2,7 @@
** HtmlSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/HtmlSpecialHandler.hpp b/dviware/dvisvgm/src/HtmlSpecialHandler.hpp
index bb85b2ad2c..e09a6d7b51 100644
--- a/dviware/dvisvgm/src/HtmlSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/HtmlSpecialHandler.hpp
@@ -2,7 +2,7 @@
** HtmlSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/HyperlinkManager.cpp b/dviware/dvisvgm/src/HyperlinkManager.cpp
index de412afcdc..ef636c5aac 100644
--- a/dviware/dvisvgm/src/HyperlinkManager.cpp
+++ b/dviware/dvisvgm/src/HyperlinkManager.cpp
@@ -2,7 +2,7 @@
** HyperlinkManager.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/HyperlinkManager.hpp b/dviware/dvisvgm/src/HyperlinkManager.hpp
index 762b4a4cca..ca8d4fd0ef 100644
--- a/dviware/dvisvgm/src/HyperlinkManager.hpp
+++ b/dviware/dvisvgm/src/HyperlinkManager.hpp
@@ -2,7 +2,7 @@
** HyperlinkManager.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ImageToSVG.cpp b/dviware/dvisvgm/src/ImageToSVG.cpp
index 26edb3c753..dfb7943a06 100644
--- a/dviware/dvisvgm/src/ImageToSVG.cpp
+++ b/dviware/dvisvgm/src/ImageToSVG.cpp
@@ -2,7 +2,7 @@
** ImageToSVG.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -67,6 +67,7 @@ void ImageToSVG::convert (int pageno) {
"lly=" << bbox.minY() << " "
"urx=" << bbox.maxX() << " "
"ury=" << bbox.maxY();
+ _currentPageNumber = pageno;
if (!isSinglePageFormat())
ss << " page=" << pageno;
try {
@@ -147,8 +148,9 @@ void ImageToSVG::convert (const std::string &rangestr, pair<int,int> *pageinfo)
FilePath ImageToSVG::getSVGFilePath (unsigned pageno) const {
FilePath path;
- if (pageno == 1)
- path = _out.filepath(1, 1);
+ unsigned numPages = totalPageCount();
+ if (pageno >= 1 && pageno <= numPages)
+ path = _out.filepath(pageno, numPages);
return path;
}
diff --git a/dviware/dvisvgm/src/ImageToSVG.hpp b/dviware/dvisvgm/src/ImageToSVG.hpp
index a4e4de223f..92a860949c 100644
--- a/dviware/dvisvgm/src/ImageToSVG.hpp
+++ b/dviware/dvisvgm/src/ImageToSVG.hpp
@@ -2,7 +2,7 @@
** ImageToSVG.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -39,9 +39,9 @@ class ImageToSVG : protected SpecialActions {
void setPageTransformation (const std::string &transCmds) {_transCmds = transCmds;}
// void setPageSize (const std::string &name);
std::string filename () const {return _fname;}
- PSInterpreter& psInterpreter () {return _psHandler.psInterpreter();}
+ PSInterpreter& psInterpreter () const {return _psHandler.psInterpreter();}
virtual bool isSinglePageFormat () const =0;
- virtual int totalPageCount () =0;
+ virtual int totalPageCount () const =0;
protected:
void checkGSAndFileFormat ();
@@ -65,7 +65,7 @@ class ImageToSVG : protected SpecialActions {
void embed (const BoundingBox &bbox) override {_bbox.embed(bbox);}
void embed (const DPair &p, double r=0) override {if (r==0) _bbox.embed(p); else _bbox.embed(p, r);}
void progress (const char *id) override;
- unsigned getCurrentPageNumber() const override {return 0;}
+ unsigned getCurrentPageNumber() const override {return _currentPageNumber;}
BoundingBox& bbox () override {return _bbox;}
BoundingBox& bbox (const std::string &name, bool reset=false) override {return _bbox;}
FilePath getSVGFilePath (unsigned pageno) const override;
@@ -76,8 +76,9 @@ class ImageToSVG : protected SpecialActions {
SVGTree _svg;
SVGOutputBase &_out;
double _x=0, _y=0;
+ unsigned _currentPageNumber=0;
BoundingBox _bbox;
- PsSpecialHandler _psHandler;
+ mutable PsSpecialHandler _psHandler;
bool _haveGS=false; ///< true if Ghostscript is available
std::string _transCmds; ///< transformation commands
};
diff --git a/dviware/dvisvgm/src/InputBuffer.cpp b/dviware/dvisvgm/src/InputBuffer.cpp
index a952369afc..b6e85f27e1 100644
--- a/dviware/dvisvgm/src/InputBuffer.cpp
+++ b/dviware/dvisvgm/src/InputBuffer.cpp
@@ -2,7 +2,7 @@
** InputBuffer.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/InputBuffer.hpp b/dviware/dvisvgm/src/InputBuffer.hpp
index 8a62b6b011..1474ce0a52 100644
--- a/dviware/dvisvgm/src/InputBuffer.hpp
+++ b/dviware/dvisvgm/src/InputBuffer.hpp
@@ -2,7 +2,7 @@
** InputBuffer.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/InputReader.cpp b/dviware/dvisvgm/src/InputReader.cpp
index 5c9b9f5c62..074c184822 100644
--- a/dviware/dvisvgm/src/InputReader.cpp
+++ b/dviware/dvisvgm/src/InputReader.cpp
@@ -2,7 +2,7 @@
** InputReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/InputReader.hpp b/dviware/dvisvgm/src/InputReader.hpp
index 0ca4f10772..9825156c09 100644
--- a/dviware/dvisvgm/src/InputReader.hpp
+++ b/dviware/dvisvgm/src/InputReader.hpp
@@ -2,7 +2,7 @@
** InputReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/JFM.cpp b/dviware/dvisvgm/src/JFM.cpp
index a79fdf0c03..7c749fd34e 100644
--- a/dviware/dvisvgm/src/JFM.cpp
+++ b/dviware/dvisvgm/src/JFM.cpp
@@ -2,7 +2,7 @@
** JFM.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/JFM.hpp b/dviware/dvisvgm/src/JFM.hpp
index c51f371a5e..8d4a1daf21 100644
--- a/dviware/dvisvgm/src/JFM.hpp
+++ b/dviware/dvisvgm/src/JFM.hpp
@@ -2,7 +2,7 @@
** JFM.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Length.cpp b/dviware/dvisvgm/src/Length.cpp
index cbee103d49..d20af5056c 100644
--- a/dviware/dvisvgm/src/Length.cpp
+++ b/dviware/dvisvgm/src/Length.cpp
@@ -2,7 +2,7 @@
** Length.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Length.hpp b/dviware/dvisvgm/src/Length.hpp
index 3c4de91fae..1b0d35d35f 100644
--- a/dviware/dvisvgm/src/Length.hpp
+++ b/dviware/dvisvgm/src/Length.hpp
@@ -2,7 +2,7 @@
** Length.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/MD5HashFunction.hpp b/dviware/dvisvgm/src/MD5HashFunction.hpp
index e233673d36..f0eda874f2 100644
--- a/dviware/dvisvgm/src/MD5HashFunction.hpp
+++ b/dviware/dvisvgm/src/MD5HashFunction.hpp
@@ -2,7 +2,7 @@
** MD5HashFunction.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Makefile.am b/dviware/dvisvgm/src/Makefile.am
index fcab2ba5cc..e7c7c27522 100644
--- a/dviware/dvisvgm/src/Makefile.am
+++ b/dviware/dvisvgm/src/Makefile.am
@@ -1,5 +1,5 @@
## This file is part of dvisvgm
-## Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de>
+## Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de>
##
## Process this file with automake.
diff --git a/dviware/dvisvgm/src/MapLine.cpp b/dviware/dvisvgm/src/MapLine.cpp
index 57aa116f02..cd3d8ae7ea 100644
--- a/dviware/dvisvgm/src/MapLine.cpp
+++ b/dviware/dvisvgm/src/MapLine.cpp
@@ -2,7 +2,7 @@
** MapLine.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/MapLine.hpp b/dviware/dvisvgm/src/MapLine.hpp
index ea41fae0d0..9a6fa17648 100644
--- a/dviware/dvisvgm/src/MapLine.hpp
+++ b/dviware/dvisvgm/src/MapLine.hpp
@@ -2,7 +2,7 @@
** MapLine.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Matrix.cpp b/dviware/dvisvgm/src/Matrix.cpp
index f94e84809c..75d571877a 100644
--- a/dviware/dvisvgm/src/Matrix.cpp
+++ b/dviware/dvisvgm/src/Matrix.cpp
@@ -2,7 +2,7 @@
** Matrix.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -169,7 +169,7 @@ Matrix& Matrix::rotate (double deg) {
Matrix& Matrix::xskewByAngle (double deg) {
- if (fmod(fabs(deg)-90, 180) != 0)
+ if (fmod(abs(deg)-90, 180) != 0)
return xskewByRatio(tan(deg2rad(deg)));
return *this;
}
@@ -186,7 +186,7 @@ Matrix& Matrix::xskewByRatio (double xyratio) {
Matrix& Matrix::yskewByAngle (double deg) {
- if (fmod(fabs(deg)-90, 180) != 0)
+ if (fmod(abs(deg)-90, 180) != 0)
return yskewByRatio(tan(deg2rad(deg)));
return *this;
}
@@ -246,17 +246,17 @@ Matrix& Matrix::lmultiply (const Matrix &tm) {
Matrix& Matrix::invert () {
Matrix ret;
- if (double denom = det(*this)) {
- for (int i=0; i < 3; ++i) {
- for (int j=0; j < 3; ++j) {
- ret._values[i][j] = det(*this, i, j)/denom;
- if ((i+j)%2 != 0)
- ret._values[i][j] *= -1;
- }
+ double denom = det(*this);
+ if (abs(denom) < 1e-12)
+ throw exception();
+ for (int i=0; i < 3; ++i) {
+ for (int j=0; j < 3; ++j) {
+ ret._values[j][i] = det(*this, i, j)/denom;
+ if ((i+j)%2 != 0)
+ ret._values[j][i] *= -1;
}
- return *this = ret;
}
- throw exception();
+ return *this = ret;
}
@@ -469,7 +469,7 @@ static const char* ord_suffix (int n) {
static void skip_comma_wsp (istream &is) {
is >> ws;
- if (is.peek() == ',') is.ignore(1);
+ if (is.peek() == ',') is.get();
is >> ws;
}
@@ -494,13 +494,13 @@ static size_t parse_transform_cmd (istream &is, string cmd, size_t minparams, si
params.push_back(val);
is >> ws;
if (i == minparams && is.peek() == ')') {
- is.ignore(1);
+ is.get();
return i;
}
if (i == maxparams) {
if (is.peek() != ')')
throw ParserException("missing ')' at end of command '"+cmd+"'");
- is.ignore(1);
+ is.get();
}
skip_comma_wsp(is);
}
diff --git a/dviware/dvisvgm/src/Matrix.hpp b/dviware/dvisvgm/src/Matrix.hpp
index 733ff71fad..154ac8a37b 100644
--- a/dviware/dvisvgm/src/Matrix.hpp
+++ b/dviware/dvisvgm/src/Matrix.hpp
@@ -2,7 +2,7 @@
** Matrix.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Message.cpp b/dviware/dvisvgm/src/Message.cpp
index 85ed204cb4..caf8051f88 100644
--- a/dviware/dvisvgm/src/Message.cpp
+++ b/dviware/dvisvgm/src/Message.cpp
@@ -2,7 +2,7 @@
** Message.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Message.hpp b/dviware/dvisvgm/src/Message.hpp
index a7e6034021..fd6f048622 100644
--- a/dviware/dvisvgm/src/Message.hpp
+++ b/dviware/dvisvgm/src/Message.hpp
@@ -2,7 +2,7 @@
** Message.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/MessageException.hpp b/dviware/dvisvgm/src/MessageException.hpp
index c7aa342860..325e83e403 100644
--- a/dviware/dvisvgm/src/MessageException.hpp
+++ b/dviware/dvisvgm/src/MessageException.hpp
@@ -2,7 +2,7 @@
** MessageException.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/MetafontWrapper.cpp b/dviware/dvisvgm/src/MetafontWrapper.cpp
index 202b65d6ec..11667fb5e7 100644
--- a/dviware/dvisvgm/src/MetafontWrapper.cpp
+++ b/dviware/dvisvgm/src/MetafontWrapper.cpp
@@ -2,7 +2,7 @@
** MetafontWrapper.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -79,18 +79,8 @@ bool MetafontWrapper::call (const string &mode, double mag) {
string mf_messages;
mf_process.run(_dir, &mf_messages);
- // get resolution value from stdout created by above MF command
- char buf[256];
- istringstream iss(mf_messages);
- int resolution = 0;
- while (iss) {
- iss.getline(buf, sizeof(buf));
- string line = buf;
- if (line.substr(0, 3) == ">> ") {
- resolution = stoi(line.substr(3));
- break;
- }
- }
+ int resolution = getResolution(mf_messages);
+
// compose expected name of GF file (see Metafont Book, p. 324)
string gfname = _dir + _fontname + ".";
if (resolution > 0)
@@ -101,6 +91,52 @@ bool MetafontWrapper::call (const string &mode, double mag) {
}
+/** Returns the resolution applied to a GF file generated by Metafont. Since the resolution
+ * is part of the filename suffix, we need this value in order to address the file.
+ * @param[in] mfMessage output written to stdout by Metafont
+ * @return the resolution (>0 on success, 0 otherwise) */
+int MetafontWrapper::getResolution (const string &mfMessage) const {
+ int res = 0;
+ char buf[256];
+ if (!mfMessage.empty()) {
+ // try get resolution value written to stdout by above MF command
+ istringstream iss(mfMessage);
+ while (iss) {
+ iss.getline(buf, sizeof(buf));
+ string line = buf;
+ if (line.substr(0, 3) == ">> ") {
+ res = stoi(line.substr(3));
+ break;
+ }
+ }
+ }
+ // couldn't read resolution from stdout, try to get it from log file
+ if (res == 0) {
+ ifstream ifs(_dir+_fontname+".log");
+ while (ifs) {
+ ifs.getline(buf, sizeof(buf));
+ string line = buf;
+ if (line.substr(0, 18) == "Output written on ") {
+ line = line.substr(18);
+ size_t pos = line.find(' ');
+ line = line.substr(0, pos);
+ pos = line.rfind('.');
+ if (pos != string::npos && line.substr(line.length()-2) == "gf") {
+ line.pop_back();
+ line.pop_back();
+ try {
+ res = stoi(line.substr(pos+1));
+ }
+ catch (...) {
+ }
+ }
+ }
+ }
+ }
+ return res;
+}
+
+
/** Calls Metafont if output files (tfm and gf) don't already exist.
* @param[in] mode Metafont mode to be used (e.g. 'ljfour')
* @param[in] mag magnification factor
diff --git a/dviware/dvisvgm/src/MetafontWrapper.hpp b/dviware/dvisvgm/src/MetafontWrapper.hpp
index 031eb01ebd..582a146aee 100644
--- a/dviware/dvisvgm/src/MetafontWrapper.hpp
+++ b/dviware/dvisvgm/src/MetafontWrapper.hpp
@@ -2,7 +2,7 @@
** MetafontWrapper.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -26,14 +26,16 @@
class FileFinder;
-class MetafontWrapper
-{
+class MetafontWrapper {
public:
MetafontWrapper (std::string fname, std::string dir);
bool call (const std::string &mode, double mag);
bool make (const std::string &mode, double mag);
bool success () const;
+ protected:
+ int getResolution (const std::string &mfMessage) const;
+
private:
std::string _fontname;
std::string _dir;
diff --git a/dviware/dvisvgm/src/MiKTeXCom.cpp b/dviware/dvisvgm/src/MiKTeXCom.cpp
index 957173f126..9cd02edf41 100644
--- a/dviware/dvisvgm/src/MiKTeXCom.cpp
+++ b/dviware/dvisvgm/src/MiKTeXCom.cpp
@@ -2,7 +2,7 @@
** MiKTeXCom.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/MiKTeXCom.hpp b/dviware/dvisvgm/src/MiKTeXCom.hpp
index 5bf1981167..3da270cea1 100644
--- a/dviware/dvisvgm/src/MiKTeXCom.hpp
+++ b/dviware/dvisvgm/src/MiKTeXCom.hpp
@@ -2,7 +2,7 @@
** MiKTeXCom.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/NoPsSpecialHandler.cpp b/dviware/dvisvgm/src/NoPsSpecialHandler.cpp
index 533e5390be..f5b3d7244e 100644
--- a/dviware/dvisvgm/src/NoPsSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/NoPsSpecialHandler.cpp
@@ -2,7 +2,7 @@
** NoPsSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/NoPsSpecialHandler.hpp b/dviware/dvisvgm/src/NoPsSpecialHandler.hpp
index 027ea3fb62..9af3d47df5 100644
--- a/dviware/dvisvgm/src/NoPsSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/NoPsSpecialHandler.hpp
@@ -2,7 +2,7 @@
** NoPsSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/NumericRanges.hpp b/dviware/dvisvgm/src/NumericRanges.hpp
index c51f1eba73..a6ee109568 100644
--- a/dviware/dvisvgm/src/NumericRanges.hpp
+++ b/dviware/dvisvgm/src/NumericRanges.hpp
@@ -2,7 +2,7 @@
** NumericRanges.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PDFParser.cpp b/dviware/dvisvgm/src/PDFParser.cpp
index 1ecd40cba8..e511d4dc39 100644
--- a/dviware/dvisvgm/src/PDFParser.cpp
+++ b/dviware/dvisvgm/src/PDFParser.cpp
@@ -2,7 +2,7 @@
** PDFParser.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PDFParser.hpp b/dviware/dvisvgm/src/PDFParser.hpp
index 6471668307..b261ee9cf7 100644
--- a/dviware/dvisvgm/src/PDFParser.hpp
+++ b/dviware/dvisvgm/src/PDFParser.hpp
@@ -2,7 +2,7 @@
** PDFParser.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PDFToSVG.hpp b/dviware/dvisvgm/src/PDFToSVG.hpp
index d1871d0bb1..a6c71f964b 100644
--- a/dviware/dvisvgm/src/PDFToSVG.hpp
+++ b/dviware/dvisvgm/src/PDFToSVG.hpp
@@ -2,7 +2,7 @@
** PDFToSVG.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -32,7 +32,7 @@ class PDFToSVG : public ImageToSVG {
bool isSinglePageFormat() const override {return false;}
/** Returns the total number of pages in the PDF file. */
- int totalPageCount() override {
+ int totalPageCount() const override {
if (_totalPageCount < 0) {
_totalPageCount = psInterpreter().pdfPageCount(filename());
if (_totalPageCount < 1)
diff --git a/dviware/dvisvgm/src/PSFilter.hpp b/dviware/dvisvgm/src/PSFilter.hpp
index 2e1cac5c77..87aff89a7c 100644
--- a/dviware/dvisvgm/src/PSFilter.hpp
+++ b/dviware/dvisvgm/src/PSFilter.hpp
@@ -2,7 +2,7 @@
** PSFilter.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PSInterpreter.cpp b/dviware/dvisvgm/src/PSInterpreter.cpp
index 4b1d1fbc15..038e1326f2 100644
--- a/dviware/dvisvgm/src/PSInterpreter.cpp
+++ b/dviware/dvisvgm/src/PSInterpreter.cpp
@@ -2,7 +2,7 @@
** PSInterpreter.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -30,6 +30,7 @@
#include "PSFilter.hpp"
#include "PSInterpreter.hpp"
#include "SignalHandler.hpp"
+#include "utility.hpp"
using namespace std;
@@ -266,6 +267,7 @@ void PSInterpreter::callActions (InputReader &in) {
{"grestore", { 0, &PSActions::grestore}},
{"grestoreall", { 0, &PSActions::grestoreall}},
{"gsave", { 0, &PSActions::gsave}},
+ {"image", { 3, &PSActions::image}},
{"initclip", { 0, &PSActions::initclip}},
{"lineto", { 2, &PSActions::lineto}},
{"makepattern", {-1, &PSActions::makepattern}},
@@ -278,6 +280,7 @@ void PSInterpreter::callActions (InputReader &in) {
{"save", { 1, &PSActions::save}},
{"scale", { 2, &PSActions::scale}},
{"setblendmode", { 1, &PSActions::setblendmode}},
+ {"setcolorspace", { 1, &PSActions::setcolorspace}},
{"setcmykcolor", { 4, &PSActions::setcmykcolor}},
{"setdash", {-1, &PSActions::setdash}},
{"setgray", { 1, &PSActions::setgray}},
@@ -378,3 +381,77 @@ BoundingBox PSInterpreter::pdfPageBox (const string &fname, int pageno) {
pagebox = BoundingBox(stod(_rawData[0]), stod(_rawData[1]), stod(_rawData[2]), stod(_rawData[3]));
return pagebox;
}
+
+
+vector<PSDeviceInfo> PSInterpreter::getImageDeviceInfos () {
+ vector<PSDeviceInfo> infos {
+ {"none", "no processing of bitmap images"},
+ {"jpeg", "color JPEG format"},
+ {"jpeggray", "grayscale JPEG format"},
+ {"png", "grayscale or 24-bit color PNG format"},
+ {"pnggray", "grayscale PNG format"},
+ {"pngmono", "black-and-white PNG format"},
+ {"pngmonod", "dithered black-and-white PNG format"},
+ {"png16", "4-bit color PNG format"},
+ {"png256", "8-bit color PNG format"},
+ {"png16m", "24-bit color PNG format"},
+ };
+ return infos;
+}
+
+
+void PSInterpreter::listImageDeviceInfos (ostream &os) {
+ for (const PSDeviceInfo &info : getImageDeviceInfos())
+ os << setw(8) << left << info.name << " | " << info.description << '\n';
+}
+
+
+/** Returns true if a given PS device name is known. The function deosn't
+ * check whether the device is actually available.
+ * @param[in] deviceStr device specifier of the form <device name>[:<param>] */
+bool PSInterpreter::imageDeviceKnown (string deviceStr) {
+ if (deviceStr.empty() || !isalpha(deviceStr[0]))
+ return false;
+ deviceStr = deviceStr.substr(0, deviceStr.find(':')); // strip optional argument
+ auto infos = getImageDeviceInfos();
+ auto it = find_if(infos.begin(), infos.end(), [&](PSDeviceInfo &info) {
+ return info.name == deviceStr;
+ });
+ return it != infos.end();
+}
+
+
+/** Sets the output device used to create bitmap images.
+ * @param[in] deviceStr device specifier of the form <device name>[:<param>]
+ * @return true on success, false if device is not supported */
+bool PSInterpreter::setImageDevice (const string &deviceStr) {
+ auto params = util::split(deviceStr, ":");
+ string name = util::tolower(params[0]);
+ if (!imageDeviceKnown(name))
+ return false;
+ if (name != "jpeg" && name != "png" && name != "none") {
+ // check if image device is supported by Ghostscript
+ executeRaw("devicedict/"+name+" known{1}{0}ifelse\n", 1);
+ if (_rawData.empty() || _rawData[0] != "1")
+ throw PSException("output device '"+name+"' is not available");
+ }
+ string ps = "/@imgdevice("+name+")store ";
+ try {
+ if (params.size() > 1) {
+ // set JPEG quality level if given
+ if (name.substr(0, 4) == "jpeg") {
+ int quality = max(0, min(stoi(params[1]), 100));
+ ps += "/JPEGQ "+to_string(quality)+" def ";
+ }
+ else if (name == "pngmonod") {
+ int minFeatureSize = max(0, min(stoi(params[1]), 4));
+ ps += "/MinFeatureSize "+to_string(minFeatureSize)+" def ";
+ }
+ }
+ }
+ catch (...) {
+ throw PSException("invalid device option '"+params[1]+"' (integer expected)");
+ }
+ execute(ps);
+ return true;
+}
diff --git a/dviware/dvisvgm/src/PSInterpreter.hpp b/dviware/dvisvgm/src/PSInterpreter.hpp
index 8e75e3c5f1..138242abb7 100644
--- a/dviware/dvisvgm/src/PSInterpreter.hpp
+++ b/dviware/dvisvgm/src/PSInterpreter.hpp
@@ -2,7 +2,7 @@
** PSInterpreter.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -51,6 +51,7 @@ struct PSActions {
virtual void gsave (std::vector<double> &p) =0;
virtual void grestore (std::vector<double> &p) =0;
virtual void grestoreall (std::vector<double> &p) =0;
+ virtual void image (std::vector<double> &p) =0;
virtual void initclip (std::vector<double> &p) =0;
virtual void lineto (std::vector<double> &p) =0;
virtual void makepattern (std::vector<double> &p) =0;
@@ -62,6 +63,7 @@ struct PSActions {
virtual void save (std::vector<double> &p) =0;
virtual void scale (std::vector<double> &p) =0;
virtual void setblendmode (std::vector<double> &p) =0;
+ virtual void setcolorspace (std::vector<double> &p) =0;
virtual void setcmykcolor (std::vector<double> &cmyk) =0;
virtual void setdash (std::vector<double> &p) =0;
virtual void setgray (std::vector<double> &p) =0;
@@ -85,6 +87,11 @@ struct PSActions {
class PSFilter;
+struct PSDeviceInfo {
+ std::string name;
+ std::string description;
+};
+
/** This class provides methods to execute chunks of PostScript code and calls
* several template methods on invocation of selected PS operators (see PSActions). */
class PSInterpreter {
@@ -105,6 +112,10 @@ class PSInterpreter {
int pdfPageCount (const std::string &fname);
BoundingBox pdfPageBox (const std::string &fname, int pageno);
const std::vector<std::string>& rawData () const {return _rawData;}
+ bool setImageDevice (const std::string &deviceStr);
+ static std::vector<PSDeviceInfo> getImageDeviceInfos ();
+ static void listImageDeviceInfos (std::ostream &os);
+ static bool imageDeviceKnown (std::string deviceStr);
protected:
void init ();
diff --git a/dviware/dvisvgm/src/PSPattern.cpp b/dviware/dvisvgm/src/PSPattern.cpp
index 90ff6a5685..4659dc7a84 100644
--- a/dviware/dvisvgm/src/PSPattern.cpp
+++ b/dviware/dvisvgm/src/PSPattern.cpp
@@ -2,7 +2,7 @@
** PSPattern.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -151,12 +151,11 @@ void PSUncoloredTilingPattern::apply (SpecialActions &actions) {
setGroupNode(util::static_unique_ptr_cast<XMLElement>(getGroupNode()->clone()));
// assign current color to the pattern graphic
vector<XMLElement*> colored_elems;
- const array<const char*, 2> attribs = {{"fill", "stroke"}};
- for (const char *attrib : attribs) {
- getGroupNode()->getDescendants(nullptr, attrib, colored_elems);
+ for (const char *attrName : {"fill", "stroke"}) {
+ getGroupNode()->getDescendants(nullptr, attrName, colored_elems);
for (XMLElement *elem : colored_elems) {
- if (string(elem->getAttributeValue(attrib)) != "none")
- elem->addAttribute(attrib, _currentColor.svgColorString());
+ if (string(elem->getAttributeValue(attrName)) != "none")
+ elem->addAttribute(attrName, _currentColor.svgColorString());
}
colored_elems.clear();
}
diff --git a/dviware/dvisvgm/src/PSPattern.hpp b/dviware/dvisvgm/src/PSPattern.hpp
index 7dde27827d..2c53dd2b3e 100644
--- a/dviware/dvisvgm/src/PSPattern.hpp
+++ b/dviware/dvisvgm/src/PSPattern.hpp
@@ -2,7 +2,7 @@
** PSPattern.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PSPreviewFilter.cpp b/dviware/dvisvgm/src/PSPreviewFilter.cpp
index 6dac4945a8..20e8b53643 100644
--- a/dviware/dvisvgm/src/PSPreviewFilter.cpp
+++ b/dviware/dvisvgm/src/PSPreviewFilter.cpp
@@ -2,7 +2,7 @@
** PSPreviewFilter.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PSPreviewFilter.hpp b/dviware/dvisvgm/src/PSPreviewFilter.hpp
index 630a277b16..acadf9f39e 100644
--- a/dviware/dvisvgm/src/PSPreviewFilter.hpp
+++ b/dviware/dvisvgm/src/PSPreviewFilter.hpp
@@ -2,7 +2,7 @@
** PSPreviewFilter.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PageRanges.cpp b/dviware/dvisvgm/src/PageRanges.cpp
index e6c1a8287b..a08ad4aa54 100644
--- a/dviware/dvisvgm/src/PageRanges.cpp
+++ b/dviware/dvisvgm/src/PageRanges.cpp
@@ -2,7 +2,7 @@
** PageRanges.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PageRanges.hpp b/dviware/dvisvgm/src/PageRanges.hpp
index 5ecc7a998c..e6909b9cd1 100644
--- a/dviware/dvisvgm/src/PageRanges.hpp
+++ b/dviware/dvisvgm/src/PageRanges.hpp
@@ -2,7 +2,7 @@
** PageRanges.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PageSize.cpp b/dviware/dvisvgm/src/PageSize.cpp
index 2f0a48aeb9..ac8e1c5275 100644
--- a/dviware/dvisvgm/src/PageSize.cpp
+++ b/dviware/dvisvgm/src/PageSize.cpp
@@ -2,7 +2,7 @@
** PageSize.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -33,8 +33,8 @@ using namespace std;
* @param[out] width contains the page width when function returns
* @param[out] height contains the page height when function returns */
static void computeASize (int n, Length &width, Length &height) {
- height.set(floor(1189.0/pow(math::SQRT2, n)+0.5), Length::Unit::MM);
- width.set(floor(height.mm()/math::SQRT2+0.5), Length::Unit::MM);
+ height.set(round(1189.0/pow(math::SQRT2, n)), Length::Unit::MM);
+ width.set(round(height.mm()/math::SQRT2), Length::Unit::MM);
}
@@ -46,8 +46,8 @@ static void computeBSize (int n, Length &width, Length &height) {
Length w, h;
computeASize(n, width, height);
computeASize(n-1, w, h);
- width.set(floor(sqrt(width.mm() * w.mm())+0.5), Length::Unit::MM);
- height.set(floor(sqrt(height.mm() * h.mm())+0.5), Length::Unit::MM);
+ width.set(round(sqrt(width.mm() * w.mm())), Length::Unit::MM);
+ height.set(round(sqrt(height.mm() * h.mm())), Length::Unit::MM);
}
@@ -59,8 +59,8 @@ static void computeCSize (int n, Length &width, Length &height) {
Length w, h;
computeASize(n, width, height);
computeBSize(n, w, h);
- width.set(floor(sqrt(width.mm() * w.mm())+0.5), Length::Unit::MM);
- height.set(floor(sqrt(height.mm() * h.mm())+0.5), Length::Unit::MM);
+ width.set(round(sqrt(width.mm() * w.mm())), Length::Unit::MM);
+ height.set(round(sqrt(height.mm() * h.mm())), Length::Unit::MM);
}
@@ -72,8 +72,8 @@ static void computeDSize (int n, Length &width, Length &height) {
Length w, h;
computeASize(n, width, height);
computeBSize(n+1, w, h);
- width.set(floor(sqrt(width.mm() * w.mm())+0.5), Length::Unit::MM);
- height.set(floor(sqrt(height.mm() * h.mm())+0.5), Length::Unit::MM);
+ width.set(round(sqrt(width.mm() * w.mm())), Length::Unit::MM);
+ height.set(round(sqrt(height.mm() * h.mm())), Length::Unit::MM);
}
diff --git a/dviware/dvisvgm/src/PageSize.hpp b/dviware/dvisvgm/src/PageSize.hpp
index c785a89564..43c555b9dd 100644
--- a/dviware/dvisvgm/src/PageSize.hpp
+++ b/dviware/dvisvgm/src/PageSize.hpp
@@ -2,7 +2,7 @@
** PageSize.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Pair.hpp b/dviware/dvisvgm/src/Pair.hpp
index 5dd7c68a93..63806c5b6a 100644
--- a/dviware/dvisvgm/src/Pair.hpp
+++ b/dviware/dvisvgm/src/Pair.hpp
@@ -2,7 +2,7 @@
** Pair.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PapersizeSpecialHandler.cpp b/dviware/dvisvgm/src/PapersizeSpecialHandler.cpp
index 0907afc8f0..c2ab96a8a8 100644
--- a/dviware/dvisvgm/src/PapersizeSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/PapersizeSpecialHandler.cpp
@@ -2,7 +2,7 @@
** PapersizeSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PapersizeSpecialHandler.hpp b/dviware/dvisvgm/src/PapersizeSpecialHandler.hpp
index c7f8f26d60..ed836f37d7 100644
--- a/dviware/dvisvgm/src/PapersizeSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/PapersizeSpecialHandler.hpp
@@ -2,7 +2,7 @@
** PapersizeSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PathClipper.cpp b/dviware/dvisvgm/src/PathClipper.cpp
index f646289d25..4aa4373f46 100644
--- a/dviware/dvisvgm/src/PathClipper.cpp
+++ b/dviware/dvisvgm/src/PathClipper.cpp
@@ -2,7 +2,7 @@
** PathClipper.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PathClipper.hpp b/dviware/dvisvgm/src/PathClipper.hpp
index fb375db35f..e3e6bd1681 100644
--- a/dviware/dvisvgm/src/PathClipper.hpp
+++ b/dviware/dvisvgm/src/PathClipper.hpp
@@ -2,7 +2,7 @@
** PathClipper.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PdfSpecialHandler.cpp b/dviware/dvisvgm/src/PdfSpecialHandler.cpp
index 70174b0fe1..3466e44f8e 100644
--- a/dviware/dvisvgm/src/PdfSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/PdfSpecialHandler.cpp
@@ -2,7 +2,7 @@
** PdfSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PdfSpecialHandler.hpp b/dviware/dvisvgm/src/PdfSpecialHandler.hpp
index 389ee96b86..67512dd403 100644
--- a/dviware/dvisvgm/src/PdfSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/PdfSpecialHandler.hpp
@@ -2,7 +2,7 @@
** PdfSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PreScanDVIReader.cpp b/dviware/dvisvgm/src/PreScanDVIReader.cpp
index 7c964fae86..8e255ef088 100644
--- a/dviware/dvisvgm/src/PreScanDVIReader.cpp
+++ b/dviware/dvisvgm/src/PreScanDVIReader.cpp
@@ -2,7 +2,7 @@
** PreScanDVIReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PreScanDVIReader.hpp b/dviware/dvisvgm/src/PreScanDVIReader.hpp
index 5176f5a1f3..900fd1fc01 100644
--- a/dviware/dvisvgm/src/PreScanDVIReader.hpp
+++ b/dviware/dvisvgm/src/PreScanDVIReader.hpp
@@ -2,7 +2,7 @@
** PreScanDVIReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Process.cpp b/dviware/dvisvgm/src/Process.cpp
index de5394f1fd..2e15153b9e 100644
--- a/dviware/dvisvgm/src/Process.cpp
+++ b/dviware/dvisvgm/src/Process.cpp
@@ -2,7 +2,7 @@
** Process.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Process.hpp b/dviware/dvisvgm/src/Process.hpp
index 70eeafb9d8..53311921c9 100644
--- a/dviware/dvisvgm/src/Process.hpp
+++ b/dviware/dvisvgm/src/Process.hpp
@@ -2,7 +2,7 @@
** Process.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/PsSpecialHandler.cpp b/dviware/dvisvgm/src/PsSpecialHandler.cpp
index 31f8aa55e7..2301eeb571 100644
--- a/dviware/dvisvgm/src/PsSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/PsSpecialHandler.cpp
@@ -2,7 +2,7 @@
** PsSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -23,7 +23,6 @@
#include <fstream>
#include <memory>
#include <sstream>
-#include "EPSFile.hpp"
#include "FileFinder.hpp"
#include "FilePath.hpp"
#include "FileSystem.hpp"
@@ -36,6 +35,7 @@
#include "SVGTree.hpp"
#include "TensorProductPatch.hpp"
#include "TriangularPatch.hpp"
+#include "utility.hpp"
using namespace std;
@@ -44,10 +44,12 @@ bool PsSpecialHandler::COMPUTE_CLIPPATHS_INTERSECTIONS = false;
bool PsSpecialHandler::SHADING_SEGMENT_OVERLAP = false;
int PsSpecialHandler::SHADING_SEGMENT_SIZE = 20;
double PsSpecialHandler::SHADING_SIMPLIFY_DELTA = 0.01;
+string PsSpecialHandler::BITMAP_FORMAT;
-PsSpecialHandler::PsSpecialHandler () : _psi(this), _actions(), _previewFilter(_psi), _xmlnode(), _savenode()
+PsSpecialHandler::PsSpecialHandler () : _psi(this), _previewFilter(_psi)
{
+ _psi.setImageDevice(BITMAP_FORMAT);
}
@@ -83,6 +85,7 @@ void PsSpecialHandler::initgraphics () {
_blendmode = 0; // "normal" mode (no blending)
_sx = _sy = _cos = 1.0;
_pattern = nullptr;
+ _patternEnabled = false;
_currentcolor = Color::BLACK;
_dashoffset = 0;
_dashpattern.clear();
@@ -381,6 +384,13 @@ void PsSpecialHandler::imgfile (FileType filetype, const string &fname, const ma
}
+/** Returns path + basename of temporary bitmap images. */
+static string image_base_path (SpecialActions &actions) {
+ FilePath imgpath = actions.getSVGFilePath(actions.getCurrentPageNumber());
+ return FileSystem::tmpdir() + "/" + imgpath.basename() + "-tmp-";
+}
+
+
/** Creates an XML element containing the image data depending on the file type.
* @param[in] type file type of the image
* @param[in] fname file name/path of image file
@@ -421,14 +431,15 @@ unique_ptr<XMLElement> PsSpecialHandler::createImageNode (FileType type, const s
node = util::make_unique<XMLElement>("g"); // put SVG nodes created from the EPS/PDF file in this group
_xmlnode = node.get();
_psi.execute(
- "\n@beginspecial @setspecial" // enter special environment
- "/setpagedevice{@setpagedevice}def " // activate processing of operator "setpagedevice"
- "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')
- "(" + pathstr + ")run " // execute file content
- "@endspecial " // leave special environment
+ "\n@beginspecial @setspecial" // enter special environment
+ "/setpagedevice{@setpagedevice}def " // activate processing of operator "setpagedevice"
+ "/@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')
+ "(" + pathstr + ")run " // execute file content
+ "@endspecial\n" // leave special environment
);
if (node->empty())
node.reset(nullptr);
@@ -468,6 +479,11 @@ static bool transform_box_extents (const Matrix &matrix, double &w, double &h, d
}
+void PsSpecialHandler::dviBeginPage (unsigned int pageno, SpecialActions &actions) {
+ _psi.execute("/@imgbase("+image_base_path(actions)+")store\n"); // path and basename of image files
+}
+
+
void PsSpecialHandler::dviEndPage (unsigned, SpecialActions &actions) {
BoundingBox bbox;
if (_previewFilter.getBoundingBox(bbox)) { // is there any data written by preview package?
@@ -638,7 +654,7 @@ void PsSpecialHandler::stroke (vector<double> &p) {
}
else {
// compute bounding box
- _path.computeBBox(bbox);
+ bbox = _path.computeBBox();
bbox.expand(_linewidth/2);
ostringstream oss;
@@ -669,12 +685,10 @@ void PsSpecialHandler::stroke (vector<double> &p) {
path->addAttribute("stroke-dashoffset", _dashoffset);
}
}
- if (path && _clipStack.path()) {
+ if (path && _clipStack.path() && !_savenode) {
// assign clipping path and clip bounding box
path->addAttribute("clip-path", XMLString("url(#clip")+XMLString(_clipStack.topID())+")");
- BoundingBox clipbox;
- _clipStack.path()->computeBBox(clipbox);
- bbox.intersect(clipbox);
+ bbox.intersect(_clipStack.path()->computeBBox());
_clipStack.removePrependedPath();
}
if (_xmlnode)
@@ -696,8 +710,7 @@ void PsSpecialHandler::fill (vector<double> &p, bool evenodd) {
return;
// compute bounding box
- BoundingBox bbox;
- _path.computeBBox(bbox);
+ BoundingBox bbox = _path.computeBBox();
if (!_actions->getMatrix().isIdentity()) {
_path.transform(_actions->getMatrix());
if (!_xmlnode)
@@ -714,12 +727,10 @@ void PsSpecialHandler::fill (vector<double> &p, bool evenodd) {
path->addAttribute("fill", XMLString("url(#")+_pattern->svgID()+")");
else if (_actions->getColor() != Color::BLACK || _savenode)
path->addAttribute("fill", _actions->getColor().svgColorString());
- if (_clipStack.path()) {
+ if (_clipStack.path() && !_savenode) { // clip path active and not inside pattern definition?
// assign clipping path and clip bounding box
path->addAttribute("clip-path", XMLString("url(#clip")+XMLString(_clipStack.topID())+")");
- BoundingBox clipbox;
- _clipStack.path()->computeBBox(clipbox);
- bbox.intersect(clipbox);
+ bbox.intersect(_clipStack.path()->computeBBox());
_clipStack.removePrependedPath();
}
if (evenodd) // SVG default fill rule is "nonzero" algorithm
@@ -738,6 +749,62 @@ void PsSpecialHandler::fill (vector<double> &p, bool evenodd) {
}
+/** Postprocesses the 'image' operation performed by the PS interpreter. If
+ * the PS image operator succeeded, there's now a PNG file that must be embedded
+ * into the SVG file. */
+void PsSpecialHandler::image (std::vector<double> &p) {
+ int imgID = static_cast<int>(p[0]); // ID of PNG file written
+ if (imgID < 0) // no bitmap file written?
+ return;
+
+ double width = p[1];
+ double height = p[2];
+ string suffix = (BITMAP_FORMAT.substr(0, 3) == "png" ? ".png" : ".jpg");
+ string fname = image_base_path(*_actions)+to_string(imgID)+suffix;
+ ifstream ifs(fname, ios::binary);
+ if (ifs) {
+ ifs.close();
+ auto image = util::make_unique<XMLElement>("image");
+ double x = _actions->getX();
+ double y = _actions->getY();
+ image->addAttribute("x", x);
+ image->addAttribute("y", y);
+ image->addAttribute("width", util::to_string(width));
+ image->addAttribute("height", util::to_string(height));
+
+ // The current transformation matrix (CTM) maps the unit square to the rectangular region
+ // of the target canvas showing the bitmap (see PS Reference Manual, 4.10.3). Therefore,
+ // the local pixel coordinates of the original bitmap must be transformed by CTM*inv(M) to
+ // get the target coordinates. M is the matrix that maps the unit square to the bitmap rectangle.
+ Matrix matrix{width, 0, 0, 0, -height, height}; // maps unit square to bitmap rectangle
+ matrix = matrix.invert().lmultiply(_actions->getMatrix());
+ image->addAttribute("transform", matrix.toSVG());
+
+ // To prevent memory issues, only add the filename to the href attribute and tag it by '@'
+ // for later base64 encoding.
+ image->addAttribute("@xlink:href", string("data:image/")+(suffix == ".png" ? "png" : "jpeg")+";base64,"+fname);
+
+ // if set, assign clipping path to image
+ if (_clipStack.path()) {
+ auto group = util::make_unique<XMLElement>("g");
+ group->addAttribute("clip-path", XMLString("url(#clip")+XMLString(_clipStack.topID())+")");
+ group->append(std::move(image));
+ image = std::move(group); // handle the entire group as image to add
+ }
+ if (_xmlnode)
+ _xmlnode->append(std::move(image));
+ else {
+ _actions->svgTree().appendToPage(std::move(image));
+ BoundingBox bbox(x, y, x+width, y+height);
+ bbox.transform(matrix);
+ if (_clipStack.path())
+ bbox.intersect(_clipStack.path()->computeBBox());
+ _actions->embed(bbox);
+ }
+ }
+}
+
+
/** Creates a Matrix object from a given sequence of 6 double values.
* The given values must be arranged in PostScript matrix order.
* @param[in] v vector containing the matrix values
@@ -774,7 +841,6 @@ static void create_matrix (vector<double> &v, int startindex, Matrix &matrix) {
* 9-14: pattern matrix */
void PsSpecialHandler::makepattern (vector<double> &p) {
int pattern_type = static_cast<int>(p[0]);
- int id = static_cast<int>(p[1]);
switch (pattern_type) {
case 0:
// pattern definition completed
@@ -784,6 +850,7 @@ void PsSpecialHandler::makepattern (vector<double> &p) {
}
break;
case 1: { // tiling pattern
+ int id = static_cast<int>(p[1]);
BoundingBox bbox(p[2], p[3], p[4], p[5]);
const double &xstep=p[6], &ystep=p[7]; // horizontal and vertical distance of adjacent tiles
int paint_type = static_cast<int>(p[8]);
@@ -1184,7 +1251,8 @@ void PsSpecialHandler::rotate (vector<double> &p) {
void PsSpecialHandler::setgray (vector<double> &p) {
- _pattern = nullptr;
+ if (!_patternEnabled)
+ _pattern = nullptr;
_currentcolor.setGray(p[0]);
if (_actions)
_actions->setColor(_currentcolor);
@@ -1192,7 +1260,8 @@ void PsSpecialHandler::setgray (vector<double> &p) {
void PsSpecialHandler::setrgbcolor (vector<double> &p) {
- _pattern= nullptr;
+ if (!_patternEnabled)
+ _pattern= nullptr;
_currentcolor.setRGB(p[0], p[1], p[2]);
if (_actions)
_actions->setColor(_currentcolor);
@@ -1200,7 +1269,8 @@ void PsSpecialHandler::setrgbcolor (vector<double> &p) {
void PsSpecialHandler::setcmykcolor (vector<double> &p) {
- _pattern = nullptr;
+ if (!_patternEnabled)
+ _pattern = nullptr;
_currentcolor.setCMYK(p[0], p[1], p[2], p[3]);
if (_actions)
_actions->setColor(_currentcolor);
@@ -1208,7 +1278,8 @@ void PsSpecialHandler::setcmykcolor (vector<double> &p) {
void PsSpecialHandler::sethsbcolor (vector<double> &p) {
- _pattern = nullptr;
+ if (!_patternEnabled)
+ _pattern = nullptr;
_currentcolor.setHSB(p[0], p[1], p[2]);
if (_actions)
_actions->setColor(_currentcolor);
diff --git a/dviware/dvisvgm/src/PsSpecialHandler.hpp b/dviware/dvisvgm/src/PsSpecialHandler.hpp
index 6251e20a47..9dcbc2d4ce 100644
--- a/dviware/dvisvgm/src/PsSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/PsSpecialHandler.hpp
@@ -2,7 +2,7 @@
** PsSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -95,6 +95,7 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions {
static bool SHADING_SEGMENT_OVERLAP;
static int SHADING_SEGMENT_SIZE;
static double SHADING_SIMPLIFY_DELTA;
+ static std::string BITMAP_FORMAT;
protected:
void initialize ();
@@ -104,6 +105,7 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions {
void processHeaderFile (const char *fname);
void imgfile (FileType type, const std::string &fname, const std::map<std::string,std::string> &attr);
std::unique_ptr<XMLElement> createImageNode (FileType type, const std::string &fname, int pageno, BoundingBox bbox, bool clip);
+ void dviBeginPage (unsigned int pageno, SpecialActions &actions) override;
void dviEndPage (unsigned pageno, SpecialActions &actions) override;
void clip (Path path, bool evenodd);
void processSequentialPatchMesh (int shadingTypeID, ColorSpace cspace, VectorIterator<double> &it);
@@ -125,6 +127,7 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions {
void grestore (std::vector<double> &p) override;
void grestoreall (std::vector<double> &p) override;
void gsave (std::vector<double> &p) override;
+ void image (std::vector<double> &p) override;
void initclip (std::vector<double> &p) override;
void lineto (std::vector<double> &p) override;
void makepattern (std::vector<double> &p) override;
@@ -136,6 +139,7 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions {
void save (std::vector<double> &p) override;
void scale (std::vector<double> &p) override;
void setblendmode (std::vector<double> &p) override {_blendmode = int(p[0]);}
+ void setcolorspace (std::vector<double> &p) override {_patternEnabled = bool(p[0]);}
void setcmykcolor (std::vector<double> &cmyk) override;
void setdash (std::vector<double> &p) override;
void setgray (std::vector<double> &p) override;
@@ -158,11 +162,11 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions {
private:
PSInterpreter _psi;
- SpecialActions *_actions;
+ SpecialActions *_actions=nullptr;
PSPreviewFilter _previewFilter; ///< filter to extract information generated by the preview package
PsSection _psSection=PS_NONE; ///< current section processed (nothing yet, headers, or body specials)
- XMLElement *_xmlnode; ///< if != 0, created SVG elements are appended to this node
- XMLElement *_savenode; ///< pointer to temporaryly store _xmlnode
+ XMLElement *_xmlnode=nullptr; ///< if != 0, created SVG elements are appended to this node
+ XMLElement *_savenode=nullptr; ///< pointer to temporaryly store _xmlnode
std::string _headerCode; ///< collected literal PS header code
Path _path;
DPair _currentpoint; ///< current PS position in bp units
@@ -181,6 +185,7 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions {
ClippingStack _clipStack;
std::map<int, std::unique_ptr<PSPattern>> _patterns;
PSTilingPattern *_pattern; ///< current pattern
+ bool _patternEnabled; ///< true if active color space is a pattern
};
#endif
diff --git a/dviware/dvisvgm/src/RangeMap.cpp b/dviware/dvisvgm/src/RangeMap.cpp
index 5fa2bb10ab..86190cacf9 100644
--- a/dviware/dvisvgm/src/RangeMap.cpp
+++ b/dviware/dvisvgm/src/RangeMap.cpp
@@ -2,7 +2,7 @@
** RangeMap.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/RangeMap.hpp b/dviware/dvisvgm/src/RangeMap.hpp
index 9d3f2c2d95..3e3bff9d4b 100644
--- a/dviware/dvisvgm/src/RangeMap.hpp
+++ b/dviware/dvisvgm/src/RangeMap.hpp
@@ -2,7 +2,7 @@
** RangeMap.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharHandler.cpp b/dviware/dvisvgm/src/SVGCharHandler.cpp
index 3733053e4d..f8d75a28d3 100644
--- a/dviware/dvisvgm/src/SVGCharHandler.cpp
+++ b/dviware/dvisvgm/src/SVGCharHandler.cpp
@@ -2,7 +2,7 @@
** SVGCharHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharHandler.hpp b/dviware/dvisvgm/src/SVGCharHandler.hpp
index 48d24496fa..f75df47215 100644
--- a/dviware/dvisvgm/src/SVGCharHandler.hpp
+++ b/dviware/dvisvgm/src/SVGCharHandler.hpp
@@ -2,7 +2,7 @@
** SVGCharHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharHandlerFactory.cpp b/dviware/dvisvgm/src/SVGCharHandlerFactory.cpp
index 613f7e7d8b..397943ace0 100644
--- a/dviware/dvisvgm/src/SVGCharHandlerFactory.cpp
+++ b/dviware/dvisvgm/src/SVGCharHandlerFactory.cpp
@@ -2,7 +2,7 @@
** SVGCharHandlerFactory.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharHandlerFactory.hpp b/dviware/dvisvgm/src/SVGCharHandlerFactory.hpp
index 92a08dc196..f37b9977c2 100644
--- a/dviware/dvisvgm/src/SVGCharHandlerFactory.hpp
+++ b/dviware/dvisvgm/src/SVGCharHandlerFactory.hpp
@@ -2,7 +2,7 @@
** SVGCharHandlerFactory.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharPathHandler.cpp b/dviware/dvisvgm/src/SVGCharPathHandler.cpp
index 3962168ae2..7a766bae49 100644
--- a/dviware/dvisvgm/src/SVGCharPathHandler.cpp
+++ b/dviware/dvisvgm/src/SVGCharPathHandler.cpp
@@ -2,7 +2,7 @@
** SVGCharPathHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharPathHandler.hpp b/dviware/dvisvgm/src/SVGCharPathHandler.hpp
index ba172de340..c404cbcd5a 100644
--- a/dviware/dvisvgm/src/SVGCharPathHandler.hpp
+++ b/dviware/dvisvgm/src/SVGCharPathHandler.hpp
@@ -2,7 +2,7 @@
** SVGCharPathHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharTspanTextHandler.cpp b/dviware/dvisvgm/src/SVGCharTspanTextHandler.cpp
index a48f5f9a93..6b89348dc1 100644
--- a/dviware/dvisvgm/src/SVGCharTspanTextHandler.cpp
+++ b/dviware/dvisvgm/src/SVGCharTspanTextHandler.cpp
@@ -2,7 +2,7 @@
** SVGCharTspanTextHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGCharTspanTextHandler.hpp b/dviware/dvisvgm/src/SVGCharTspanTextHandler.hpp
index 01567997b6..b847965a1a 100644
--- a/dviware/dvisvgm/src/SVGCharTspanTextHandler.hpp
+++ b/dviware/dvisvgm/src/SVGCharTspanTextHandler.hpp
@@ -2,7 +2,7 @@
** SVGCharTspanTextHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGOutput.cpp b/dviware/dvisvgm/src/SVGOutput.cpp
index 1f9e244883..18702be776 100644
--- a/dviware/dvisvgm/src/SVGOutput.cpp
+++ b/dviware/dvisvgm/src/SVGOutput.cpp
@@ -2,7 +2,7 @@
** SVGOutput.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGOutput.hpp b/dviware/dvisvgm/src/SVGOutput.hpp
index 1f4da20ee8..f29a032674 100644
--- a/dviware/dvisvgm/src/SVGOutput.hpp
+++ b/dviware/dvisvgm/src/SVGOutput.hpp
@@ -2,7 +2,7 @@
** SVGOutput.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGSingleCharTextHandler.cpp b/dviware/dvisvgm/src/SVGSingleCharTextHandler.cpp
index 0d36b5a8b8..89d1c548b0 100644
--- a/dviware/dvisvgm/src/SVGSingleCharTextHandler.cpp
+++ b/dviware/dvisvgm/src/SVGSingleCharTextHandler.cpp
@@ -2,7 +2,7 @@
** SVGSingleCharTextHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGSingleCharTextHandler.hpp b/dviware/dvisvgm/src/SVGSingleCharTextHandler.hpp
index 7fd2174f12..67fcabd44c 100644
--- a/dviware/dvisvgm/src/SVGSingleCharTextHandler.hpp
+++ b/dviware/dvisvgm/src/SVGSingleCharTextHandler.hpp
@@ -2,7 +2,7 @@
** SVGSingleCharTextHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGTree.cpp b/dviware/dvisvgm/src/SVGTree.cpp
index 57b5fd5a4f..e35a14d9b3 100644
--- a/dviware/dvisvgm/src/SVGTree.cpp
+++ b/dviware/dvisvgm/src/SVGTree.cpp
@@ -2,7 +2,7 @@
** SVGTree.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SVGTree.hpp b/dviware/dvisvgm/src/SVGTree.hpp
index d351ec9799..a441a314a5 100644
--- a/dviware/dvisvgm/src/SVGTree.hpp
+++ b/dviware/dvisvgm/src/SVGTree.hpp
@@ -2,7 +2,7 @@
** SVGTree.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ShadingPatch.cpp b/dviware/dvisvgm/src/ShadingPatch.cpp
index 1ad0011daf..847dc3aa0c 100644
--- a/dviware/dvisvgm/src/ShadingPatch.cpp
+++ b/dviware/dvisvgm/src/ShadingPatch.cpp
@@ -2,7 +2,7 @@
** ShadingPatch.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ShadingPatch.hpp b/dviware/dvisvgm/src/ShadingPatch.hpp
index 4346301e7b..573188b77b 100644
--- a/dviware/dvisvgm/src/ShadingPatch.hpp
+++ b/dviware/dvisvgm/src/ShadingPatch.hpp
@@ -2,7 +2,7 @@
** ShadingPatch.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SignalHandler.cpp b/dviware/dvisvgm/src/SignalHandler.cpp
index 5af70be2e4..14badba085 100644
--- a/dviware/dvisvgm/src/SignalHandler.cpp
+++ b/dviware/dvisvgm/src/SignalHandler.cpp
@@ -2,7 +2,7 @@
** SignalHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SignalHandler.hpp b/dviware/dvisvgm/src/SignalHandler.hpp
index b97449399e..647a3650fc 100644
--- a/dviware/dvisvgm/src/SignalHandler.hpp
+++ b/dviware/dvisvgm/src/SignalHandler.hpp
@@ -2,7 +2,7 @@
** SignalHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SourceInput.cpp b/dviware/dvisvgm/src/SourceInput.cpp
index 35cdd24af9..5cd2e22749 100644
--- a/dviware/dvisvgm/src/SourceInput.cpp
+++ b/dviware/dvisvgm/src/SourceInput.cpp
@@ -2,7 +2,7 @@
** SourceInput.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SourceInput.hpp b/dviware/dvisvgm/src/SourceInput.hpp
index 3b0f7b3c62..63f4af9b7a 100644
--- a/dviware/dvisvgm/src/SourceInput.hpp
+++ b/dviware/dvisvgm/src/SourceInput.hpp
@@ -2,7 +2,7 @@
** SourceInput.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SpecialActions.hpp b/dviware/dvisvgm/src/SpecialActions.hpp
index 7e53303792..f8eba3fd12 100644
--- a/dviware/dvisvgm/src/SpecialActions.hpp
+++ b/dviware/dvisvgm/src/SpecialActions.hpp
@@ -2,7 +2,7 @@
** SpecialActions.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SpecialHandler.hpp b/dviware/dvisvgm/src/SpecialHandler.hpp
index 4a3439bb24..6c676a6ba0 100644
--- a/dviware/dvisvgm/src/SpecialHandler.hpp
+++ b/dviware/dvisvgm/src/SpecialHandler.hpp
@@ -2,7 +2,7 @@
** SpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SpecialManager.cpp b/dviware/dvisvgm/src/SpecialManager.cpp
index 4838cbdf47..f3b2f3aa50 100644
--- a/dviware/dvisvgm/src/SpecialManager.cpp
+++ b/dviware/dvisvgm/src/SpecialManager.cpp
@@ -2,7 +2,7 @@
** SpecialManager.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/SpecialManager.hpp b/dviware/dvisvgm/src/SpecialManager.hpp
index fe88eaf58e..4c4ccae281 100644
--- a/dviware/dvisvgm/src/SpecialManager.hpp
+++ b/dviware/dvisvgm/src/SpecialManager.hpp
@@ -2,7 +2,7 @@
** SpecialManager.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/StreamReader.cpp b/dviware/dvisvgm/src/StreamReader.cpp
index ccfb176abe..200b6592d9 100644
--- a/dviware/dvisvgm/src/StreamReader.cpp
+++ b/dviware/dvisvgm/src/StreamReader.cpp
@@ -2,7 +2,7 @@
** StreamReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/StreamReader.hpp b/dviware/dvisvgm/src/StreamReader.hpp
index 05c4e1e701..653b451b69 100644
--- a/dviware/dvisvgm/src/StreamReader.hpp
+++ b/dviware/dvisvgm/src/StreamReader.hpp
@@ -2,7 +2,7 @@
** StreamReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/StreamWriter.cpp b/dviware/dvisvgm/src/StreamWriter.cpp
index 6216468695..c0885c31b1 100644
--- a/dviware/dvisvgm/src/StreamWriter.cpp
+++ b/dviware/dvisvgm/src/StreamWriter.cpp
@@ -2,7 +2,7 @@
** StreamWriter.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/StreamWriter.hpp b/dviware/dvisvgm/src/StreamWriter.hpp
index 441a9a7e7f..16a54b1050 100644
--- a/dviware/dvisvgm/src/StreamWriter.hpp
+++ b/dviware/dvisvgm/src/StreamWriter.hpp
@@ -2,7 +2,7 @@
** StreamWriter.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Subfont.cpp b/dviware/dvisvgm/src/Subfont.cpp
index e0b2570d8c..eb7f244cdb 100644
--- a/dviware/dvisvgm/src/Subfont.cpp
+++ b/dviware/dvisvgm/src/Subfont.cpp
@@ -2,7 +2,7 @@
** Subfont.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Subfont.hpp b/dviware/dvisvgm/src/Subfont.hpp
index ca88520ea2..5125194e9d 100644
--- a/dviware/dvisvgm/src/Subfont.hpp
+++ b/dviware/dvisvgm/src/Subfont.hpp
@@ -2,7 +2,7 @@
** Subfont.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/System.cpp b/dviware/dvisvgm/src/System.cpp
index b2724bdcab..ed14df6821 100644
--- a/dviware/dvisvgm/src/System.cpp
+++ b/dviware/dvisvgm/src/System.cpp
@@ -2,7 +2,7 @@
** System.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/System.hpp b/dviware/dvisvgm/src/System.hpp
index fa29325252..72a0cb3da8 100644
--- a/dviware/dvisvgm/src/System.hpp
+++ b/dviware/dvisvgm/src/System.hpp
@@ -2,7 +2,7 @@
** System.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TFM.cpp b/dviware/dvisvgm/src/TFM.cpp
index 005081533e..ea6f2ecbe4 100644
--- a/dviware/dvisvgm/src/TFM.cpp
+++ b/dviware/dvisvgm/src/TFM.cpp
@@ -2,7 +2,7 @@
** TFM.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TFM.hpp b/dviware/dvisvgm/src/TFM.hpp
index f2fd3027eb..261a5ce736 100644
--- a/dviware/dvisvgm/src/TFM.hpp
+++ b/dviware/dvisvgm/src/TFM.hpp
@@ -2,7 +2,7 @@
** TFM.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TTFAutohint.cpp b/dviware/dvisvgm/src/TTFAutohint.cpp
index a7aef2a5ec..ad1b03f21a 100644
--- a/dviware/dvisvgm/src/TTFAutohint.cpp
+++ b/dviware/dvisvgm/src/TTFAutohint.cpp
@@ -2,7 +2,7 @@
** TTFAutohint.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TTFAutohint.hpp b/dviware/dvisvgm/src/TTFAutohint.hpp
index 417661d3bb..d23ceb2be0 100644
--- a/dviware/dvisvgm/src/TTFAutohint.hpp
+++ b/dviware/dvisvgm/src/TTFAutohint.hpp
@@ -2,7 +2,7 @@
** TTFAutohint.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TensorProductPatch.cpp b/dviware/dvisvgm/src/TensorProductPatch.cpp
index 52acd63179..dcd31e275d 100644
--- a/dviware/dvisvgm/src/TensorProductPatch.cpp
+++ b/dviware/dvisvgm/src/TensorProductPatch.cpp
@@ -2,7 +2,7 @@
** TensorProductPatch.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -300,9 +300,9 @@ DPair TensorProductPatch::blossomValue (double u1, double u2, double u3, double
/** Snaps value x to the interval [0,1]. Values lesser than or near 0 are mapped to 0, values
* greater than or near 1 are mapped to 1. */
static inline double snap (double x) {
- if (fabs(x) < 0.001)
+ if (abs(x) < 0.001)
return 0;
- if (fabs(1-x) < 0.001)
+ if (abs(1-x) < 0.001)
return 1;
return x;
}
diff --git a/dviware/dvisvgm/src/TensorProductPatch.hpp b/dviware/dvisvgm/src/TensorProductPatch.hpp
index 711feefc2d..e53604cf52 100644
--- a/dviware/dvisvgm/src/TensorProductPatch.hpp
+++ b/dviware/dvisvgm/src/TensorProductPatch.hpp
@@ -2,7 +2,7 @@
** TensorProductPatch.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Terminal.cpp b/dviware/dvisvgm/src/Terminal.cpp
index 0e46874895..3b2ff2b871 100644
--- a/dviware/dvisvgm/src/Terminal.cpp
+++ b/dviware/dvisvgm/src/Terminal.cpp
@@ -2,7 +2,7 @@
** Terminal.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Terminal.hpp b/dviware/dvisvgm/src/Terminal.hpp
index e452aa042f..fd7a920c16 100644
--- a/dviware/dvisvgm/src/Terminal.hpp
+++ b/dviware/dvisvgm/src/Terminal.hpp
@@ -2,7 +2,7 @@
** Terminal.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ToUnicodeMap.cpp b/dviware/dvisvgm/src/ToUnicodeMap.cpp
index f002038aec..6ab99a248e 100644
--- a/dviware/dvisvgm/src/ToUnicodeMap.cpp
+++ b/dviware/dvisvgm/src/ToUnicodeMap.cpp
@@ -2,7 +2,7 @@
** ToUnicodeMap.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ToUnicodeMap.hpp b/dviware/dvisvgm/src/ToUnicodeMap.hpp
index 8ab3474e65..74d6dcb648 100644
--- a/dviware/dvisvgm/src/ToUnicodeMap.hpp
+++ b/dviware/dvisvgm/src/ToUnicodeMap.hpp
@@ -2,7 +2,7 @@
** ToUnicodeMap.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TpicSpecialHandler.cpp b/dviware/dvisvgm/src/TpicSpecialHandler.cpp
index b97fa439af..47d3e46988 100644
--- a/dviware/dvisvgm/src/TpicSpecialHandler.cpp
+++ b/dviware/dvisvgm/src/TpicSpecialHandler.cpp
@@ -2,7 +2,7 @@
** TpicSpecialHandler.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TpicSpecialHandler.hpp b/dviware/dvisvgm/src/TpicSpecialHandler.hpp
index fa8ba706fd..f6ec271994 100644
--- a/dviware/dvisvgm/src/TpicSpecialHandler.hpp
+++ b/dviware/dvisvgm/src/TpicSpecialHandler.hpp
@@ -2,7 +2,7 @@
** TpicSpecialHandler.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TriangularPatch.cpp b/dviware/dvisvgm/src/TriangularPatch.cpp
index 01efe2e8f0..fadeb725ff 100644
--- a/dviware/dvisvgm/src/TriangularPatch.cpp
+++ b/dviware/dvisvgm/src/TriangularPatch.cpp
@@ -2,7 +2,7 @@
** TriangularPatch.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -142,9 +142,9 @@ Color TriangularPatch::averageColor (const Color &c1, const Color &c2, const Col
/** Snaps value x to the interval [0,1]. Values lesser than or near 0 are mapped to 0, values
* greater than or near 1 are mapped to 1. */
static inline double snap (double x) {
- if (fabs(x) < 0.001)
+ if (abs(x) < 0.001)
return 0;
- if (fabs(1-x) < 0.001)
+ if (abs(1-x) < 0.001)
return 1;
return x;
}
diff --git a/dviware/dvisvgm/src/TriangularPatch.hpp b/dviware/dvisvgm/src/TriangularPatch.hpp
index d329e43fa1..797068bacd 100644
--- a/dviware/dvisvgm/src/TriangularPatch.hpp
+++ b/dviware/dvisvgm/src/TriangularPatch.hpp
@@ -2,7 +2,7 @@
** TriangularPatch.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TrueTypeFont.cpp b/dviware/dvisvgm/src/TrueTypeFont.cpp
index 408a00eede..2921af59ea 100644
--- a/dviware/dvisvgm/src/TrueTypeFont.cpp
+++ b/dviware/dvisvgm/src/TrueTypeFont.cpp
@@ -2,7 +2,7 @@
** TrueTypeFont.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/TrueTypeFont.hpp b/dviware/dvisvgm/src/TrueTypeFont.hpp
index d2e5b6e98d..0ae155c52c 100644
--- a/dviware/dvisvgm/src/TrueTypeFont.hpp
+++ b/dviware/dvisvgm/src/TrueTypeFont.hpp
@@ -2,7 +2,7 @@
** TrueTypeFont.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Unicode.cpp b/dviware/dvisvgm/src/Unicode.cpp
index d4a18a7bb9..950209bda0 100644
--- a/dviware/dvisvgm/src/Unicode.cpp
+++ b/dviware/dvisvgm/src/Unicode.cpp
@@ -2,7 +2,7 @@
** Unicode.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/Unicode.hpp b/dviware/dvisvgm/src/Unicode.hpp
index e281edc791..bc9db7e731 100644
--- a/dviware/dvisvgm/src/Unicode.hpp
+++ b/dviware/dvisvgm/src/Unicode.hpp
@@ -2,7 +2,7 @@
** Unicode.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/VFActions.hpp b/dviware/dvisvgm/src/VFActions.hpp
index 73567109f7..2d4a2a2c5f 100644
--- a/dviware/dvisvgm/src/VFActions.hpp
+++ b/dviware/dvisvgm/src/VFActions.hpp
@@ -2,7 +2,7 @@
** VFActions.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/VFReader.cpp b/dviware/dvisvgm/src/VFReader.cpp
index 47f5e3f7b6..eb1193ddaa 100644
--- a/dviware/dvisvgm/src/VFReader.cpp
+++ b/dviware/dvisvgm/src/VFReader.cpp
@@ -2,7 +2,7 @@
** VFReader.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/VFReader.hpp b/dviware/dvisvgm/src/VFReader.hpp
index bd42289039..bbf4986d7f 100644
--- a/dviware/dvisvgm/src/VFReader.hpp
+++ b/dviware/dvisvgm/src/VFReader.hpp
@@ -2,7 +2,7 @@
** VFReader.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/VectorIterator.hpp b/dviware/dvisvgm/src/VectorIterator.hpp
index 17707fbc96..0fb53d78e4 100644
--- a/dviware/dvisvgm/src/VectorIterator.hpp
+++ b/dviware/dvisvgm/src/VectorIterator.hpp
@@ -2,7 +2,7 @@
** VectorIterator.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/VectorStream.hpp b/dviware/dvisvgm/src/VectorStream.hpp
index 9672e67435..0372d368d0 100644
--- a/dviware/dvisvgm/src/VectorStream.hpp
+++ b/dviware/dvisvgm/src/VectorStream.hpp
@@ -2,7 +2,7 @@
** VectorStream.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/XMLDocument.cpp b/dviware/dvisvgm/src/XMLDocument.cpp
index be14eaf678..ffe23b1f80 100644
--- a/dviware/dvisvgm/src/XMLDocument.cpp
+++ b/dviware/dvisvgm/src/XMLDocument.cpp
@@ -2,7 +2,7 @@
** XMLDocument.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/XMLDocument.hpp b/dviware/dvisvgm/src/XMLDocument.hpp
index e9132c44d8..2eaaee4a28 100644
--- a/dviware/dvisvgm/src/XMLDocument.hpp
+++ b/dviware/dvisvgm/src/XMLDocument.hpp
@@ -2,7 +2,7 @@
** XMLDocument.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/XMLNode.cpp b/dviware/dvisvgm/src/XMLNode.cpp
index 128be5b9e5..db07d95dd2 100644
--- a/dviware/dvisvgm/src/XMLNode.cpp
+++ b/dviware/dvisvgm/src/XMLNode.cpp
@@ -2,7 +2,7 @@
** XMLNode.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -19,15 +19,18 @@
*************************************************************************/
#include <algorithm>
-#include <map>
+#include <fstream>
#include <list>
+#include <map>
#include <sstream>
+#include "FileSystem.hpp"
#include "utility.hpp"
#include "XMLNode.hpp"
#include "XMLString.hpp"
using namespace std;
+bool XMLNode::KEEP_ENCODED_FILES=false;
bool XMLElement::WRITE_NEWLINES=true;
@@ -69,7 +72,7 @@ XMLElement::XMLElement (string name) : _name(std::move(name)) {
XMLElement::XMLElement (const XMLElement &node)
: XMLNode(node), _name(node._name), _attributes(node._attributes)
{
- for (XMLNode *child=_firstChild.get(); child; child = child->next())
+ for (XMLNode *child=node._firstChild.get(); child; child = child->next())
insertLast(child->clone());
}
@@ -84,6 +87,14 @@ XMLElement::XMLElement (XMLElement &&node) noexcept
}
+XMLElement::~XMLElement () {
+ // explicitly remove child nodes by iteration to prevent deep recursion
+ unique_ptr<XMLNode> child = std::move(_firstChild);
+ while (child && child->next())
+ child->removeNext();
+}
+
+
/** Removes all attributes and children. */
void XMLElement::clear () {
_attributes.clear();
@@ -315,8 +326,10 @@ unique_ptr<XMLNode> XMLElement::remove (XMLNode *child) {
bool XMLElement::getDescendants (const char *name, const char *attrName, vector<XMLElement*> &descendants) const {
for (XMLNode *child = _firstChild.get(); child; child = child->next()) {
if (XMLElement *elem = child->toElement()) {
- if ((!name || elem->name() == name) && (!attrName || elem->hasAttribute(attrName)))
- descendants.push_back(elem);
+ if (!name || !name[0] || (name[0] != '!' && elem->name() == name) || (name[0] == '!' && elem->name() != name+1)) {
+ if (!attrName || elem->hasAttribute(attrName))
+ descendants.push_back(elem);
+ }
elem->getDescendants(name, attrName, descendants);
}
}
@@ -347,8 +360,30 @@ XMLElement* XMLElement::getFirstDescendant (const char *name, const char *attrNa
ostream& XMLElement::write (ostream &os) const {
os << '<' << _name;
- for (const auto &attrib : _attributes)
- os << ' ' << attrib.name << "='" << attrib.value << '\'';
+ for (const auto &attrib : _attributes) {
+ os << ' ';
+ if (attrib.name.front() != '@')
+ os << attrib.name << "='" << attrib.value << '\'';
+ else {
+ os << attrib.name.substr(1) << "='";
+ size_t pos = attrib.value.find("base64,");
+ if (pos == string::npos)
+ os << attrib.value;
+ else {
+ os << attrib.value.substr(0, pos+7);
+ string fname = attrib.value.substr(pos+7);
+ ifstream ifs(fname, ios::binary);
+ if (ifs) {
+ os << '\n';
+ util::base64_copy(ifs, os, 200);
+ ifs.close();
+ if (!KEEP_ENCODED_FILES)
+ FileSystem::remove(fname);
+ }
+ }
+ os << "'";
+ }
+ }
if (empty())
os << "/>";
else {
diff --git a/dviware/dvisvgm/src/XMLNode.hpp b/dviware/dvisvgm/src/XMLNode.hpp
index b4e5ed6f2b..534ae87bd7 100644
--- a/dviware/dvisvgm/src/XMLNode.hpp
+++ b/dviware/dvisvgm/src/XMLNode.hpp
@@ -2,7 +2,7 @@
** XMLNode.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -63,6 +63,8 @@ class XMLNode {
XMLNode* prev () const {return _prev;}
XMLNode* next () const {return _next.get();}
+ static bool KEEP_ENCODED_FILES;
+
protected:
XMLNode* insertNext (std::unique_ptr<XMLNode> node);
std::unique_ptr<XMLNode> removeNext ();
@@ -126,6 +128,7 @@ class XMLElement : public XMLNode {
explicit XMLElement (std::string name);
XMLElement (const XMLElement &node);
XMLElement (XMLElement &&node) noexcept;
+ ~XMLElement ();
std::unique_ptr<XMLNode> clone () const override {return util::make_unique<XMLElement>(*this);}
void clear () override;
void addAttribute (const std::string &name, const std::string &value);
diff --git a/dviware/dvisvgm/src/XMLString.cpp b/dviware/dvisvgm/src/XMLString.cpp
index fcafb8d1ee..31de6a7b33 100644
--- a/dviware/dvisvgm/src/XMLString.cpp
+++ b/dviware/dvisvgm/src/XMLString.cpp
@@ -2,7 +2,7 @@
** XMLString.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/XMLString.hpp b/dviware/dvisvgm/src/XMLString.hpp
index fa9cf15f9e..52c227ae8a 100644
--- a/dviware/dvisvgm/src/XMLString.hpp
+++ b/dviware/dvisvgm/src/XMLString.hpp
@@ -2,7 +2,7 @@
** XMLString.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/XXHashFunction.hpp b/dviware/dvisvgm/src/XXHashFunction.hpp
index f81deddbd4..e44083f182 100644
--- a/dviware/dvisvgm/src/XXHashFunction.hpp
+++ b/dviware/dvisvgm/src/XXHashFunction.hpp
@@ -2,7 +2,7 @@
** XXHashFunction.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ZLibOutputStream.hpp b/dviware/dvisvgm/src/ZLibOutputStream.hpp
index 8331cb9eed..c1c065e357 100644
--- a/dviware/dvisvgm/src/ZLibOutputStream.hpp
+++ b/dviware/dvisvgm/src/ZLibOutputStream.hpp
@@ -2,7 +2,7 @@
** ZLibOutputStream.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/dvisvgm.cpp b/dviware/dvisvgm/src/dvisvgm.cpp
index 5828299fce..74a8e83abc 100644
--- a/dviware/dvisvgm/src/dvisvgm.cpp
+++ b/dviware/dvisvgm/src/dvisvgm.cpp
@@ -2,7 +2,7 @@
** dvisvgm.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -363,10 +363,18 @@ static void set_variables (const CommandLine &cmdline) {
PhysicalFont::KEEP_TEMP_FILES = cmdline.keepOpt.given();
PhysicalFont::METAFONT_MAG = max(1.0, cmdline.magOpt.value());
XMLString::DECIMAL_PLACES = max(0, min(6, cmdline.precisionOpt.value()));
+ XMLNode::KEEP_ENCODED_FILES = cmdline.keepOpt.given();
PsSpecialHandler::COMPUTE_CLIPPATHS_INTERSECTIONS = cmdline.clipjoinOpt.given();
PsSpecialHandler::SHADING_SEGMENT_OVERLAP = cmdline.gradOverlapOpt.given();
PsSpecialHandler::SHADING_SEGMENT_SIZE = max(1, cmdline.gradSegmentsOpt.value());
PsSpecialHandler::SHADING_SIMPLIFY_DELTA = cmdline.gradSimplifyOpt.value();
+ PsSpecialHandler::BITMAP_FORMAT = util::tolower(cmdline.bitmapFormatOpt.value());
+ if (!PSInterpreter::imageDeviceKnown(PsSpecialHandler::BITMAP_FORMAT)) {
+ ostringstream oss;
+ oss << "unknown image format '" << PsSpecialHandler::BITMAP_FORMAT << "'\nknown formats:\n";
+ PSInterpreter::listImageDeviceInfos(oss);
+ throw CL::CommandLineException(oss.str());
+ }
if (cmdline.optimizeOpt.given()) {
SVGOptimizer::MODULE_SEQUENCE = cmdline.optimizeOpt.value();
vector<string> modnames;
diff --git a/dviware/dvisvgm/src/ffwrapper.c b/dviware/dvisvgm/src/ffwrapper.c
index 68377f0762..61f17fdc6d 100644
--- a/dviware/dvisvgm/src/ffwrapper.c
+++ b/dviware/dvisvgm/src/ffwrapper.c
@@ -2,7 +2,7 @@
** ffwrapper.c **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/ffwrapper.h b/dviware/dvisvgm/src/ffwrapper.h
index f652a97f9a..e3e2f98832 100644
--- a/dviware/dvisvgm/src/ffwrapper.h
+++ b/dviware/dvisvgm/src/ffwrapper.h
@@ -2,7 +2,7 @@
** ffwrapper.h **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/macros.hpp b/dviware/dvisvgm/src/macros.hpp
index beeb54f04b..0a03776057 100644
--- a/dviware/dvisvgm/src/macros.hpp
+++ b/dviware/dvisvgm/src/macros.hpp
@@ -2,7 +2,7 @@
** macros.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/AttributeExtractor.cpp b/dviware/dvisvgm/src/optimizer/AttributeExtractor.cpp
index e26018253d..28046e45a2 100644
--- a/dviware/dvisvgm/src/optimizer/AttributeExtractor.cpp
+++ b/dviware/dvisvgm/src/optimizer/AttributeExtractor.cpp
@@ -2,7 +2,7 @@
** AttributeExtractor.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/AttributeExtractor.hpp b/dviware/dvisvgm/src/optimizer/AttributeExtractor.hpp
index c882e8b4c8..b4c6f2775c 100644
--- a/dviware/dvisvgm/src/optimizer/AttributeExtractor.hpp
+++ b/dviware/dvisvgm/src/optimizer/AttributeExtractor.hpp
@@ -2,7 +2,7 @@
** AttributeExtractor.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/DependencyGraph.hpp b/dviware/dvisvgm/src/optimizer/DependencyGraph.hpp
index c9111b43d5..98d2a8d699 100644
--- a/dviware/dvisvgm/src/optimizer/DependencyGraph.hpp
+++ b/dviware/dvisvgm/src/optimizer/DependencyGraph.hpp
@@ -2,7 +2,7 @@
** DependencyGraph.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/GroupCollapser.cpp b/dviware/dvisvgm/src/optimizer/GroupCollapser.cpp
index 36bf3a8cd5..b8a32786c1 100644
--- a/dviware/dvisvgm/src/optimizer/GroupCollapser.cpp
+++ b/dviware/dvisvgm/src/optimizer/GroupCollapser.cpp
@@ -2,7 +2,7 @@
** GroupCollapser.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/GroupCollapser.hpp b/dviware/dvisvgm/src/optimizer/GroupCollapser.hpp
index 9b5eb01829..08db518a90 100644
--- a/dviware/dvisvgm/src/optimizer/GroupCollapser.hpp
+++ b/dviware/dvisvgm/src/optimizer/GroupCollapser.hpp
@@ -2,7 +2,7 @@
** GroupCollapser.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/OptimizerModule.hpp b/dviware/dvisvgm/src/optimizer/OptimizerModule.hpp
index ff4fec1b4d..276cfa5578 100644
--- a/dviware/dvisvgm/src/optimizer/OptimizerModule.hpp
+++ b/dviware/dvisvgm/src/optimizer/OptimizerModule.hpp
@@ -2,7 +2,7 @@
** OptimizerModule.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/RedundantElementRemover.cpp b/dviware/dvisvgm/src/optimizer/RedundantElementRemover.cpp
index 85d8e5b1fa..906ccc2d14 100644
--- a/dviware/dvisvgm/src/optimizer/RedundantElementRemover.cpp
+++ b/dviware/dvisvgm/src/optimizer/RedundantElementRemover.cpp
@@ -2,7 +2,7 @@
** RedundantElementRemover.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -54,6 +54,7 @@ void RedundantElementRemover::execute (XMLElement *defs, XMLElement *context) {
}
// collect elements that reference a clipPath, i.e. have a clip-path attribute
vector<XMLElement*> descendants;
+ defs->getDescendants("!clipPath", "clip-path", descendants);
context->getDescendants(nullptr, "clip-path", descendants);
// remove referenced IDs and their dependencies from the dependency graph
for (const XMLElement *elem : descendants) {
diff --git a/dviware/dvisvgm/src/optimizer/RedundantElementRemover.hpp b/dviware/dvisvgm/src/optimizer/RedundantElementRemover.hpp
index dd46cfeba5..8d5a6b689f 100644
--- a/dviware/dvisvgm/src/optimizer/RedundantElementRemover.hpp
+++ b/dviware/dvisvgm/src/optimizer/RedundantElementRemover.hpp
@@ -2,7 +2,7 @@
** RedundantElementRemover.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/SVGOptimizer.cpp b/dviware/dvisvgm/src/optimizer/SVGOptimizer.cpp
index 0320f8b565..b2d45176e7 100644
--- a/dviware/dvisvgm/src/optimizer/SVGOptimizer.cpp
+++ b/dviware/dvisvgm/src/optimizer/SVGOptimizer.cpp
@@ -2,7 +2,7 @@
** SVGOptimizer.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/SVGOptimizer.hpp b/dviware/dvisvgm/src/optimizer/SVGOptimizer.hpp
index 809f1f497c..0da157fbbb 100644
--- a/dviware/dvisvgm/src/optimizer/SVGOptimizer.hpp
+++ b/dviware/dvisvgm/src/optimizer/SVGOptimizer.hpp
@@ -2,7 +2,7 @@
** SVGOptimizer.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/TextSimplifier.cpp b/dviware/dvisvgm/src/optimizer/TextSimplifier.cpp
index 23e0e386df..b94ab9458e 100644
--- a/dviware/dvisvgm/src/optimizer/TextSimplifier.cpp
+++ b/dviware/dvisvgm/src/optimizer/TextSimplifier.cpp
@@ -2,7 +2,7 @@
** TextSimplifier.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/TextSimplifier.hpp b/dviware/dvisvgm/src/optimizer/TextSimplifier.hpp
index 86f44e5051..cfdd548e87 100644
--- a/dviware/dvisvgm/src/optimizer/TextSimplifier.hpp
+++ b/dviware/dvisvgm/src/optimizer/TextSimplifier.hpp
@@ -2,7 +2,7 @@
** TextSimplifier.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/TransformSimplifier.cpp b/dviware/dvisvgm/src/optimizer/TransformSimplifier.cpp
index b9d4c3db59..461698b62a 100644
--- a/dviware/dvisvgm/src/optimizer/TransformSimplifier.cpp
+++ b/dviware/dvisvgm/src/optimizer/TransformSimplifier.cpp
@@ -2,7 +2,7 @@
** TransformSimplifier.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -61,7 +61,7 @@ void TransformSimplifier::execute (XMLElement *context) {
/** Tries to incorporate the translation and scaling components of the 'transform' attribute
* of a given element into the positional and/or size attributes of that element. If successful,
- * the 'transform' attribute is removed.
+ * the 'transform' attribute is either removed or simplified to a scale() matrix.
* Currently, only 'image' and 'rect' elements are considered.
* @param[in] elem element to check
* @param[in] matrix matrix representing the 'transform' attribute of the element
@@ -72,17 +72,30 @@ bool TransformSimplifier::incorporateTransform (XMLElement *elem, const Matrix &
double ty = matrix.get(1, 2);
double sx = matrix.get(0, 0);
double sy = matrix.get(1, 1);
+ double x=0, y=0;
+
if (const char *xstr = elem->getAttributeValue("x"))
- tx += sx*strtod(xstr, nullptr);
+ x = strtod(xstr, nullptr);
if (const char *ystr = elem->getAttributeValue("y"))
- ty += sy*strtod(ystr, nullptr);
- if (const char *wstr = elem->getAttributeValue("width"))
- elem->addAttribute("width", sx*strtod(wstr, nullptr));
- if (const char *hstr = elem->getAttributeValue("height"))
- elem->addAttribute("height", sy*strtod(hstr, nullptr));
- elem->addAttribute("x", tx); // update x attribute
- elem->addAttribute("y", ty); // update x attribute
- elem->removeAttribute("transform");
+ y = strtod(ystr, nullptr);
+ // width and height attributes must not become negative. Hence, only apply the scaling
+ // values if they are non-negative. Otherwise, keep a scaling matrix
+ if (sx < 0 || sy < 0) {
+ x += (sx == 0 ? 0 : tx/sx);
+ y += (sy == 0 ? 0 : ty/sy);
+ elem->addAttribute("transform", "scale("+XMLString(sx)+","+XMLString(sy)+")");
+ }
+ else {
+ x = x*sx + tx;
+ y = y*sy + ty;
+ if (const char *wstr = elem->getAttributeValue("width"))
+ elem->addAttribute("width", sx*strtod(wstr, nullptr));
+ if (const char *hstr = elem->getAttributeValue("height"))
+ elem->addAttribute("height", sy*strtod(hstr, nullptr));
+ elem->removeAttribute("transform");
+ }
+ elem->addAttribute("x", x); // update x attribute
+ elem->addAttribute("y", y); // update y attribute
return true;
}
return false;
diff --git a/dviware/dvisvgm/src/optimizer/TransformSimplifier.hpp b/dviware/dvisvgm/src/optimizer/TransformSimplifier.hpp
index c4b6d9ee16..5d503635ba 100644
--- a/dviware/dvisvgm/src/optimizer/TransformSimplifier.hpp
+++ b/dviware/dvisvgm/src/optimizer/TransformSimplifier.hpp
@@ -2,7 +2,7 @@
** TransformSimplifier.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/WSNodeRemover.cpp b/dviware/dvisvgm/src/optimizer/WSNodeRemover.cpp
index 2135e285bb..be58bf70fd 100644
--- a/dviware/dvisvgm/src/optimizer/WSNodeRemover.cpp
+++ b/dviware/dvisvgm/src/optimizer/WSNodeRemover.cpp
@@ -2,7 +2,7 @@
** WSNodeRemover.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/optimizer/WSNodeRemover.hpp b/dviware/dvisvgm/src/optimizer/WSNodeRemover.hpp
index c4fe7f989e..8c21ce2b6e 100644
--- a/dviware/dvisvgm/src/optimizer/WSNodeRemover.hpp
+++ b/dviware/dvisvgm/src/optimizer/WSNodeRemover.hpp
@@ -2,7 +2,7 @@
** WSNodeRemover.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/options.dtd b/dviware/dvisvgm/src/options.dtd
index 7e29babc43..d2806badce 100644
--- a/dviware/dvisvgm/src/options.dtd
+++ b/dviware/dvisvgm/src/options.dtd
@@ -3,7 +3,7 @@
** options.dtd **
** **
** This file is part of dvisvgm - a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/options.xml b/dviware/dvisvgm/src/options.xml
index 27975f1591..b1911694dd 100644
--- a/dviware/dvisvgm/src/options.xml
+++ b/dviware/dvisvgm/src/options.xml
@@ -3,7 +3,7 @@
** options.xml **
** **
** This file is part of dvisvgm - a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -26,7 +26,7 @@
<usage>--eps [options] epsfile</usage>
<usage>--pdf [options] pdffile</usage>
<description>This program converts DVI files, as created by TeX/LaTeX, as well as\nEPS and PDF files to the XML-based scalable vector graphics format SVG.</description>
- <copyright>Copyright (C) 2005-2019 Martin Gieseking &lt;martin.gieseking@uos.de></copyright>
+ <copyright>Copyright (C) 2005-2020 Martin Gieseking &lt;martin.gieseking@uos.de></copyright>
</program>
<options>
<section title="Input options">
@@ -53,6 +53,10 @@
<arg type="string" name="size" default="min"/>
<description>set size of bounding box</description>
</option>
+ <option long="bitmap-format" short="B" if="!defined(DISABLE_GS)">
+ <arg type="string" name="fmt" default="jpeg"/>
+ <description>set format used to embed PS/EPS bitmaps</description>
+ </option>
<option long="clipjoin" short="j" if="!defined(DISABLE_GS)">
<description>compute intersection of clipping paths</description>
</option>
@@ -64,7 +68,7 @@
</option>
<option long="font-format" short="f" if="!defined(DISABLE_WOFF)">
<arg type="string" name="format" default="svg"/>
- <description>select file format of embedded fonts</description>
+ <description>set file format of embedded fonts</description>
</option>
<option long="grad-overlap" if="!defined(DISABLE_GS)">
<description>create overlapping color gradient segments</description>
diff --git a/dviware/dvisvgm/src/psdefs.cpp b/dviware/dvisvgm/src/psdefs.cpp
index 04abb6227d..9c5991217d 100644
--- a/dviware/dvisvgm/src/psdefs.cpp
+++ b/dviware/dvisvgm/src/psdefs.cpp
@@ -2,7 +2,7 @@
** psdefs.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -22,104 +22,132 @@
const char *PSInterpreter::PSDEFS =
"<</Install{matrix setmatrix}/HWResolution[72 72]/PageSize[10000 10000]/Imaging"
-"BBox null>>setpagedevice/@dodraw true store/@patcnt 0 store/@GD globaldict def"
-"/@SD systemdict def/@UD userdict def @GD/@nulldev false put true setglobal @SD"
-"/:save @SD/save get put @SD/:restore @SD/restore get put @SD/:gsave @SD/gsave "
-"get put @SD/:grestore @SD/grestore get put @SD/:grestoreall @SD/grestoreall ge"
-"t put @SD/:newpath @SD/newpath get put @SD/:stroke @SD/stroke get put @SD/:fil"
-"l @SD/fill get put @SD/:eofill @SD/eofill get put @SD/:clip @SD/clip get put @"
-"SD/:eoclip @SD/eoclip get put @SD/:charpath @SD/charpath get put @SD/:show @SD"
-"/show get put @SD/:stringwidth @SD/stringwidth get put @SD/:nulldevice @SD/nul"
-"ldevice get put @SD/.setopacityalpha known not{@SD/.setopacityalpha{pop}put}if"
-" @SD/.setshapealpha known not{@SD/.setshapealpha{pop}put}if @SD/.setblendmode "
-"known not{@SD/.setblendmode{pop}put}if @SD/prseq{-1 1{-1 roll =only( )print}fo"
-"r(\\n)print}put @SD/prcmd{( )exch(\\ndvi.)3{print}repeat prseq}put @SD/cvxall{"
-"{cvx}forall}put @SD/defpr{[exch[/copy @SD]cvxall 5 -1 roll dup 6 1 roll[/get/e"
-"xec]cvxall 6 -1 roll dup 7 1 roll 4 -1 roll dup 5 1 roll dup length string cvs"
-"/prcmd cvx]cvx def}put @SD/querypos{{currentpoint}stopped{$error/newerror fals"
-"e put}{2(querypos)prcmd}ifelse}put @SD/applyscalevals{1 0 dtransform exch dup "
-"mul exch dup mul add sqrt 0 1 dtransform exch dup mul exch dup mul add sqrt 1 "
-"0 dtransform dup mul exch dup dup mul 3 -1 roll add dup 0 eq{pop}{sqrt div}ife"
-"lse 3(applyscalevals)prcmd}put @SD/prpath{{2(moveto)prcmd}{2(lineto)prcmd}{6(c"
-"urveto)prcmd}{0(closepath)prcmd}pathforall}put @SD/nulldevice{@GD/@nulldev tru"
-"e put :nulldevice 1 1(setnulldevice)prcmd}put @SD/charpath{/@dodraw false stor"
-"e :charpath/@dodraw true store}put @SD/stringwidth{/@dodraw false store :strin"
-"gwidth/@dodraw true store}put @SD/show{@dodraw @GD/@nulldev get not and{dup :g"
-"save currentpoint 2{50 mul exch}repeat :newpath moveto 50 50/scale sysexec tru"
-"e charpath fill :grestore/@dodraw false store :show/@dodraw true store}{:show}"
-"ifelse}put @SD/varxyshow{exch dup type/arraytype eq{<</arr 3 -1 roll/prc 5 -1 "
-"roll/chr 1 string/idx 0>>begin{chr 0 3 -1 roll put :gsave chr show :grestore c"
-"urrentpoint prc moveto/idx idx 1 add store}forall end}{pop show}ifelse}put @SD"
-"/xyshow{{exch arr idx 2 mul get add exch arr idx 2 mul 1 add get add}varxyshow"
-"}put @SD/xshow{{exch arr idx get add exch}varxyshow}put @SD/yshow{{arr idx get"
-" add}varxyshow}put @SD/awidthshow{{1 string dup 0 5 index put :gsave show :gre"
-"store pop 0 rmoveto 3 index eq{4 index 4 index rmoveto}if 1 index 1 index rmov"
-"eto}exch cshow 5{pop}repeat}put @SD/widthshow{0 0 3 -1 roll pstack awidthshow}"
-"put @SD/ashow{0 0 0 6 3 roll awidthshow}put @SD/newpath{:newpath 1 1(newpath)p"
-"rcmd}put @SD/stroke{@dodraw @GD/@nulldev get not and{prcolor 0 1(newpath)prcmd"
-" prpath 0(stroke)prcmd :newpath}{:stroke}ifelse}put @SD/fill{@dodraw @GD/@null"
-"dev get not and{prcolor 0 1(newpath)prcmd prpath 0(fill)prcmd :newpath}{:fill}"
-"ifelse}put @SD/eofill{@dodraw @GD/@nulldev get not and{prcolor 0 1(newpath)prc"
-"md prpath 0(eofill)prcmd :newpath}{:eofill}ifelse}put @SD/clip{:clip @GD/@null"
-"dev get not{0 1(newpath)prcmd prpath 0(clip)prcmd}if}put @SD/eoclip{:eoclip @G"
-"D/@nulldev get not{0 1(newpath)prcmd prpath 0(eoclip)prcmd}}put @SD/shfill{beg"
-"in currentdict/ShadingType known currentdict/ColorSpace known and currentdict/"
-"DataSource known and currentdict/Function known not and ShadingType 4 ge and D"
-"ataSource type/arraytype eq and{<</DeviceGray 1/DeviceRGB 3/DeviceCMYK 4/bgkno"
-"wn currentdict/Background known/bbknown currentdict/BBox known>>begin currentd"
-"ict ColorSpace known{ShadingType ColorSpace load bgknown{1 Background aload po"
-"p}{0}ifelse bbknown{1 BBox aload pop}{0}ifelse ShadingType 5 eq{VerticesPerRow"
-"}if DataSource aload length 4 add bgknown{ColorSpace load add}if bbknown{4 add"
-"}if ShadingType 5 eq{1 add}if(shfill)prcmd}if end}if end}put/@rect{4 -2 roll m"
-"oveto exch dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath}bind def/"
-"@rectcc{4 -2 roll moveto 2 copy 0 lt exch 0 lt xor{dup 0 exch rlineto exch 0 r"
-"lineto neg 0 exch rlineto}{exch dup 0 rlineto exch 0 exch rlineto neg 0 rlinet"
-"o}ifelse closepath}bind def @SD/rectclip{:newpath dup type/arraytype eq{aload "
-"length 4 idiv{@rectcc}repeat}{@rectcc}ifelse clip :newpath}put @SD/rectfill{gs"
-"ave :newpath dup type/arraytype eq{aload length 4 idiv{@rectcc}repeat}{@rectcc"
-"}ifelse fill grestore}put @SD/rectstroke{gsave :newpath dup type/arraytype eq{"
-"aload length 4 idiv{@rect}repeat}{@rect}ifelse stroke grestore}put false setgl"
-"obal @SD readonly pop/initclip 0 defpr/clippath 0 defpr/sysexec{@SD exch get e"
-"xec}def/adddot{dup length 1 add string dup 0 46 put dup 3 -1 roll 1 exch putin"
-"terval}def/setlinewidth{dup/setlinewidth sysexec 1(setlinewidth)prcmd}def/setl"
-"inecap 1 defpr/setlinejoin 1 defpr/setmiterlimit 1 defpr/setdash{mark 3 1 roll"
-" 2 copy/setdash sysexec exch aload length 1 add -1 roll counttomark(setdash)pr"
-"cmd pop}def/@setpagedevice{pop<<>>/setpagedevice sysexec matrix setmatrix newp"
-"ath 0(setpagedevice)prcmd}def/@checknulldev{@GD/@nulldev get{currentpagedevice"
-" maxlength 0 ne{@GD/@nulldev false put 0 1(setnulldevice)prcmd}if}if}def/prcol"
-"or{currentrgbcolor 3(setrgbcolor)prcmd}def/printgstate{@dodraw @GD/@nulldev ge"
-"t not and{matrix currentmatrix aload pop 6(setmatrix)prcmd applyscalevals curr"
-"entlinewidth 1(setlinewidth)prcmd currentlinecap 1(setlinecap)prcmd currentlin"
-"ejoin 1(setlinejoin)prcmd currentmiterlimit 1(setmiterlimit)prcmd currentrgbco"
-"lor 3(setrgbcolor)prcmd currentdash mark 3 1 roll exch aload length 1 add -1 r"
-"oll counttomark(setdash)prcmd pop}if}def/setgstate{/setgstate sysexec printgst"
-"ate}def/save{@UD begin/@saveID vmstatus pop pop def end :save @saveID 1(save)p"
-"rcmd}def/restore{:restore @checknulldev printgstate @UD/@saveID known{@UD begi"
-"n @saveID end}{0}ifelse 1(restore)prcmd}def/gsave 0 defpr/grestore{:grestore @"
-"checknulldev printgstate 0(grestore)prcmd}def/grestoreall{:grestoreall @checkn"
-"ulldev setstate 0(grestoreall)prcmd}def/rotate{dup type/arraytype ne @dodraw a"
-"nd{dup 1(rotate)prcmd}if/rotate sysexec applyscalevals}def/scale{dup type/arra"
-"ytype ne @dodraw and{2 copy 2(scale)prcmd}if/scale sysexec applyscalevals}def/"
-"translate{dup type/arraytype ne @dodraw and{2 copy 2(translate)prcmd}if/transl"
-"ate sysexec}def/setmatrix{dup/setmatrix sysexec @dodraw{aload pop 6(setmatrix)"
-"prcmd applyscalevals}{pop}ifelse}def/initmatrix{matrix setmatrix}def/concat{ma"
-"trix currentmatrix matrix concatmatrix setmatrix}def/makepattern{gsave<</mx 3 "
-"-1 roll>>begin dup/XUID[1000000 @patcnt]put mx/makepattern sysexec dup dup beg"
-"in PatternType @patcnt BBox aload pop XStep YStep PaintType mx aload pop 15(ma"
-"kepattern)prcmd :newpath matrix setmatrix PaintProc 0 1(makepattern)prcmd end/"
-"@patcnt @patcnt 1 add store end grestore}def/setpattern{begin PatternType 1 eq"
-"{PaintType 1 eq{XUID aload pop exch pop 1}{:gsave[currentcolorspace aload leng"
-"th -1 roll pop]setcolorspace/setcolor sysexec XUID aload pop exch pop currentr"
-"gbcolor :grestore 4}ifelse(setpattern)prcmd}{/setpattern sysexec}ifelse end}de"
-"f/setcolor{dup type/dicttype eq{setpattern}{/setcolor sysexec/currentrgbcolor "
-"sysexec setrgbcolor}ifelse}def/setgray 1 defpr/setcmykcolor 4 defpr/sethsbcolo"
-"r 3 defpr/setrgbcolor 3 defpr/.setopacityalpha{dup/.setopacityalpha sysexec 1("
-"setopacityalpha)prcmd}def/.setshapealpha{dup/.setshapealpha sysexec 1(setshape"
-"alpha)prcmd}def/.setblendmode{dup/.setblendmode sysexec<</Normal 0/Compatible "
-"0/Multiply 1/Screen 2/Overlay 3/SoftLight 4/HardLight 5/ColorDodge 6/ColorBurn"
-" 7/Darken 8/Lighten 9/Difference 10/Exclusion 11/Hue 12/Saturation 13/Color 14"
-"/Luminosity 15/CompatibleOverprint 16>>exch get 1(setblendmode)prcmd}def/@pdfp"
-"agecount{(r)file runpdfbegin pdfpagecount runpdfend}def/@pdfpagebox{(r)file ru"
-"npdfbegin dup dup 1 lt exch pdfpagecount gt or{pop}{pdfgetpage/MediaBox pget p"
-"op aload pop}ifelse runpdfend}def DELAYBIND{.bindnow}if ";
+"BBox null>>setpagedevice/@dodraw true store/@GD globaldict def/@SD systemdict "
+"def/@UD userdict def @GD/@nulldev false put @GD/@patcnt 0 put true setglobal @"
+"SD/:save @SD/save get put @SD/:restore @SD/restore get put @SD/:gsave @SD/gsav"
+"e get put @SD/:grestore @SD/grestore get put @SD/:grestoreall @SD/grestoreall "
+"get put @SD/:newpath @SD/newpath get put @SD/:stroke @SD/stroke get put @SD/:f"
+"ill @SD/fill get put @SD/:eofill @SD/eofill get put @SD/:clip @SD/clip get put"
+" @SD/:eoclip @SD/eoclip get put @SD/:charpath @SD/charpath get put @SD/:show @"
+"SD/show get put @SD/:stringwidth @SD/stringwidth get put @SD/:nulldevice @SD/n"
+"ulldevice get put @SD/:image @SD/image get put @SD/:colorimage @SD/colorimage "
+"get put @SD/.setopacityalpha known not{@SD/.setopacityalpha{pop}put}if @SD/.se"
+"tshapealpha known not{@SD/.setshapealpha{pop}put}if @SD/.setblendmode known no"
+"t{@SD/.setblendmode{pop}put}if @SD/prseq{-1 1{-1 roll =only( )print}for(\\n)pr"
+"int}put @SD/prcmd{( )exch(\\ndvi.)3{print}repeat prseq}put @SD/cvxall{{cvx}for"
+"all}put @SD/defpr{[exch[/copy @SD]cvxall 5 -1 roll dup 6 1 roll[/get/exec]cvxa"
+"ll 6 -1 roll dup 7 1 roll 4 -1 roll dup 5 1 roll dup length string cvs/prcmd c"
+"vx]cvx def}put @SD/querypos{{currentpoint}stopped{$error/newerror false put}{2"
+"(querypos)prcmd}ifelse}put @SD/applyscalevals{1 0 dtransform exch dup mul exch"
+" dup mul add sqrt 0 1 dtransform exch dup mul exch dup mul add sqrt 1 0 dtrans"
+"form dup mul exch dup dup mul 3 -1 roll add dup 0 eq{pop}{sqrt div}ifelse 3(ap"
+"plyscalevals)prcmd}put @SD/prpath{{2(moveto)prcmd}{2(lineto)prcmd}{6(curveto)p"
+"rcmd}{0(closepath)prcmd}pathforall}put @SD/nulldevice{@GD/@nulldev true put :n"
+"ulldevice 1 1(setnulldevice)prcmd}put @SD/charpath{/@dodraw false store :charp"
+"ath/@dodraw true store}put @SD/stringwidth{/@dodraw false store :stringwidth/@"
+"dodraw true store}put @SD/show{@dodraw @GD/@nulldev get not and{dup :gsave cur"
+"rentpoint 2{50 mul exch}repeat :newpath moveto 50 50/scale sysexec true charpa"
+"th fill :grestore/@dodraw false store :show/@dodraw true store}{:show}ifelse}p"
+"ut @SD/varxyshow{dup 0 ge{<</chr 3 -1 roll string/prc 5 -1 roll/arr 7 -1 roll/"
+"str 9 -1 roll/idx 0>>begin 0 chr length str length 1 sub{str exch chr length g"
+"etinterval/chr exch store :gsave chr show :grestore currentpoint prc moveto/id"
+"x idx 1 add store}for end}{pop pop show}ifelse}put @SD/xyshow{dup dup type/arr"
+"aytype eq exch length 0 gt and{dup length 2 idiv 2 index length exch idiv}{-1}"
+"ifelse{exch arr idx 2 mul get add exch arr idx 2 mul 1 add get add}exch varxys"
+"how}put @SD/xshow{dup dup type/arraytype eq exch length 0 gt and{dup length 2 "
+"index length exch idiv}{-1}ifelse{exch arr idx get add exch}exch varxyshow}put"
+" @SD/yshow{dup dup type/arraytype eq exch length 0 gt and{dup length 2 index l"
+"ength exch idiv}{-1}ifelse{arr idx get add}exch varxyshow}put @SD/awidthshow{{"
+"1 string dup 0 5 index put :gsave show :grestore pop 0 rmoveto 3 index eq{4 in"
+"dex 4 index rmoveto}if 1 index 1 index rmoveto}exch cshow 5{pop}repeat}put @SD"
+"/widthshow{0 0 3 -1 roll awidthshow}put @SD/ashow{0 0 0 6 3 roll awidthshow}pu"
+"t @SD/newpath{:newpath 1 1(newpath)prcmd}put @SD/stroke{@dodraw @GD/@nulldev g"
+"et not and{prcolor 0 1(newpath)prcmd prpath 0(stroke)prcmd :newpath}{:stroke}i"
+"felse}put @SD/fill{@dodraw @GD/@nulldev get not and{prcolor 0 1(newpath)prcmd "
+"prpath 0(fill)prcmd :newpath}{:fill}ifelse}put @SD/eofill{@dodraw @GD/@nulldev"
+" get not and{prcolor 0 1(newpath)prcmd prpath 0(eofill)prcmd :newpath}{:eofill"
+"}ifelse}put @SD/clip{:clip @GD/@nulldev get not{0 1(newpath)prcmd prpath 0(cli"
+"p)prcmd}if}put @SD/eoclip{:eoclip @GD/@nulldev get not{0 1(newpath)prcmd prpat"
+"h 0(eoclip)prcmd}}put @SD/shfill{begin currentdict/ShadingType known currentdi"
+"ct/ColorSpace known and currentdict/DataSource known and currentdict/Function "
+"known not and ShadingType 4 ge{DataSource type/arraytype eq{<</DeviceGray 1/De"
+"viceRGB 3/DeviceCMYK 4/bgknown currentdict/Background known/bbknown currentdic"
+"t/BBox known>>begin currentdict ColorSpace known{ShadingType ColorSpace load b"
+"gknown{1 Background aload pop}{0}ifelse bbknown{1 BBox aload pop}{0}ifelse Sha"
+"dingType 5 eq{VerticesPerRow}if DataSource aload length 4 add bgknown{ColorSpa"
+"ce load add}if bbknown{4 add}if ShadingType 5 eq{1 add}if(shfill)prcmd}if end}"
+"if}if end}put @SD/image{dup type/dicttype eq{dup}{<</Width 6 index/Height 7 in"
+"dex/colorimg false>>}ifelse @execimg}put @SD/colorimage{<<2 index{/Width 2 ind"
+"ex 8 add index/Height 4 index 9 add index}{/Width 8 index/Height 9 index}ifels"
+"e/colorimg true>>@execimg}put/@imgbase(./)def/@imgdevice(jpeg)def/@execimg{@GD"
+"/@imgcnt 2 copy .knownget{1 add}{1}ifelse put begin<</imgdev null/imgid @GD/@i"
+"mgcnt get/ispng @imgdevice 0 3 getinterval(png)eq dup/suffix exch{(.png)}{(.jp"
+"g)}ifelse/colorimg currentdict/colorimg .knownget dup{pop}if/colordev 1 index "
+"currentcolorspace dup length 1 ne exch 0 get/DeviceGray ne or or>>begin @imgde"
+"vice(png)ne @imgdevice(jpeg)ne and{@imgdevice cvn}{colordev{ispng{/png16m}{/jp"
+"eg}ifelse}{ispng{/pnggray}{/jpeggray}ifelse}ifelse}ifelse dup devicedict exch "
+"known{:gsave/imgdev exch finddevice def mark/OutputFile @imgbase imgid 20 stri"
+"ng cvs strconcat suffix strconcat/PageSize[Width Height]/UseFastColor true isp"
+"ng{@imgdevice(pngmonod)eq{/MinFeatureSize where{pop/MinFeatureSize MinFeatureS"
+"ize}if}if}{/JPEGQ where{pop/JPEGQ JPEGQ}if}ifelse imgdev putdeviceprops setdev"
+"ice[Width 0 0 Height neg 0 Height]/setmatrix sysexec colorimg{:colorimage}{:im"
+"age}ifelse/copypage sysexec mark/OutputFile()imgdev putdeviceprops pop :gresto"
+"re imgid Width Height 3(image)prcmd}{pop colorimg{:colorimage}{:image}ifelse}i"
+"felse end end}def/@rect{4 -2 roll moveto exch dup 0 rlineto exch 0 exch rlinet"
+"o neg 0 rlineto closepath}bind def/@rectcc{4 -2 roll moveto 2 copy 0 lt exch 0"
+" lt xor{dup 0 exch rlineto exch 0 rlineto neg 0 exch rlineto}{exch dup 0 rline"
+"to exch 0 exch rlineto neg 0 rlineto}ifelse closepath}bind def @SD/rectclip{:n"
+"ewpath dup type/arraytype eq{aload length 4 idiv{@rectcc}repeat}{@rectcc}ifels"
+"e clip :newpath}put @SD/rectfill{:gsave :newpath dup type/arraytype eq{aload l"
+"ength 4 idiv{@rectcc}repeat}{@rectcc}ifelse fill :grestore}put @SD/rectstroke{"
+"gsave :newpath dup type/arraytype eq{aload length 4 idiv{@rect}repeat}{@rect}i"
+"felse stroke grestore}put false setglobal @SD readonly pop/initclip 0 defpr/cl"
+"ippath 0 defpr/sysexec{@SD exch get exec}def/adddot{dup length 1 add string du"
+"p 0 46 put dup 3 -1 roll 1 exch putinterval}def/setlinewidth{dup/setlinewidth "
+"sysexec 1(setlinewidth)prcmd}def/setlinecap 1 defpr/setlinejoin 1 defpr/setmit"
+"erlimit 1 defpr/setdash{mark 3 1 roll 2 copy/setdash sysexec exch aload length"
+" 1 add -1 roll counttomark(setdash)prcmd pop}def/@setpagedevice{pop<<>>/setpag"
+"edevice sysexec matrix setmatrix newpath 0(setpagedevice)prcmd}def/@checknulld"
+"ev{@GD/@nulldev get{currentpagedevice maxlength 0 ne{@GD/@nulldev false put 0 "
+"1(setnulldevice)prcmd}if}if}def/prcolor{currentcolorspace @setcolorspace curre"
+"ntrgbcolor 3(setrgbcolor)prcmd}def/printgstate{@dodraw @GD/@nulldev get not an"
+"d{matrix currentmatrix aload pop 6(setmatrix)prcmd applyscalevals currentlinew"
+"idth 1(setlinewidth)prcmd currentlinecap 1(setlinecap)prcmd currentlinejoin 1("
+"setlinejoin)prcmd currentmiterlimit 1(setmiterlimit)prcmd prcolor currentdash "
+"mark 3 1 roll exch aload length 1 add -1 roll counttomark(setdash)prcmd pop}if"
+"}def/strconcat{exch dup length 2 index length add string dup dup 4 2 roll copy"
+" length 4 -1 roll putinterval}def/setgstate{/setgstate sysexec printgstate}def"
+"/save{@UD begin/@saveID vmstatus pop pop def end :save @saveID 1(save)prcmd}de"
+"f/restore{:restore @checknulldev printgstate @UD/@saveID known{@UD begin @save"
+"ID end}{0}ifelse 1(restore)prcmd}def/gsave 0 defpr/grestore{:grestore @checknu"
+"lldev printgstate 0(grestore)prcmd}def/grestoreall{:grestoreall @checknulldev "
+"setstate 0(grestoreall)prcmd}def/rotate{dup type/arraytype ne @dodraw and{dup "
+"1(rotate)prcmd}if/rotate sysexec applyscalevals}def/scale{dup type/arraytype n"
+"e @dodraw and{2 copy 2(scale)prcmd}if/scale sysexec applyscalevals}def/transla"
+"te{dup type/arraytype ne @dodraw and{2 copy 2(translate)prcmd}if/translate sys"
+"exec}def/setmatrix{dup/setmatrix sysexec @dodraw{aload pop 6(setmatrix)prcmd a"
+"pplyscalevals}{pop}ifelse}def/initmatrix{matrix setmatrix}def/concat{matrix cu"
+"rrentmatrix matrix concatmatrix setmatrix}def/makepattern{gsave<</mx 3 -1 roll"
+">>begin<</XUID[1000000 @patcnt]>>copy mx/makepattern sysexec dup begin Pattern"
+"Type 2 lt{PatternType @patcnt BBox aload pop XStep YStep PaintType mx aload po"
+"p 15(makepattern)prcmd :newpath matrix setmatrix dup PaintProc 0 1(makepattern"
+")prcmd @GD/@patcnt @patcnt 1 add put}if end end grestore}def/setpattern{begin "
+"PatternType 1 eq{PaintType 1 eq{XUID aload pop exch pop 1}{:gsave[currentcolor"
+"space aload length -1 roll pop]/setcolorspace sysexec/setcolor sysexec XUID al"
+"oad pop exch pop currentrgbcolor :grestore 4}ifelse(setpattern)prcmd currentco"
+"lorspace 0 get/Pattern ne{[/Pattern currentcolorspace]/setcolorspace sysexec}i"
+"f currentcolorspace @setcolorspace}{/setpattern sysexec}ifelse end}def/setcolo"
+"r{dup type/dicttype eq{setpattern}{/setcolor sysexec/currentrgbcolor sysexec s"
+"etrgbcolor}ifelse}def/setcolorspace{dup/setcolorspace sysexec @setcolorspace}d"
+"ef/@setcolorspace{dup type/arraytype eq{0 get}if/Pattern eq{1}{0}ifelse 1(setc"
+"olorspace)prcmd}def/setgray 1 defpr/setcmykcolor 4 defpr/sethsbcolor 3 defpr/s"
+"etrgbcolor 3 defpr/.setopacityalpha{dup/.setopacityalpha sysexec 1(setopacitya"
+"lpha)prcmd}def/.setshapealpha{dup/.setshapealpha sysexec 1(setshapealpha)prcmd"
+"}def/.setblendmode{dup/.setblendmode sysexec<</Normal 0/Compatible 0/Multiply "
+"1/Screen 2/Overlay 3/SoftLight 4/HardLight 5/ColorDodge 6/ColorBurn 7/Darken 8"
+"/Lighten 9/Difference 10/Exclusion 11/Hue 12/Saturation 13/Color 14/Luminosity"
+" 15/CompatibleOverprint 16>>exch get 1(setblendmode)prcmd}def/@pdfpagecount{(r"
+")file runpdfbegin pdfpagecount runpdfend}def/@pdfpagebox{(r)file runpdfbegin d"
+"up dup 1 lt exch pdfpagecount gt or{pop}{pdfgetpage/MediaBox pget pop aload po"
+"p}ifelse runpdfend}def DELAYBIND{.bindnow}if ";
diff --git a/dviware/dvisvgm/src/utility.cpp b/dviware/dvisvgm/src/utility.cpp
index f1ae59ec08..8fe31fcf2d 100644
--- a/dviware/dvisvgm/src/utility.cpp
+++ b/dviware/dvisvgm/src/utility.cpp
@@ -2,7 +2,7 @@
** utility.cpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/utility.hpp b/dviware/dvisvgm/src/utility.hpp
index 7127280284..7ad3bc8d69 100644
--- a/dviware/dvisvgm/src/utility.hpp
+++ b/dviware/dvisvgm/src/utility.hpp
@@ -2,7 +2,7 @@
** utility.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
@@ -88,10 +88,12 @@ std::vector<uint8_t> bytes (T val, int n=0) {
* the result to the range starting at 'dest'.
* @param[in] first initial position of the range to be encoded
* @param[in] last final position of the range to be encoded
- * @param[in] dest first position of the destination range */
+ * @param[in] dest first position of the destination range
+ * @param[in] wrap if > 0, add a newline after the given number of characters written */
template <typename InputIterator, typename OutputIterator>
-void base64_copy (InputIterator first, InputIterator last, OutputIterator dest) {
+void base64_copy (InputIterator first, InputIterator last, OutputIterator dest, int wrap=0) {
static const char *base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ int count=0;
while (first != last) {
int padding = 0;
unsigned char c0 = *first++, c1=0, c2=0;
@@ -106,15 +108,29 @@ void base64_copy (InputIterator first, InputIterator last, OutputIterator dest)
}
uint32_t n = (c0 << 16) | (c1 << 8) | c2;
for (int i=0; i <= 3-padding; i++) {
+ if (wrap > 0 && ++count > wrap) {
+ count = 1;
+ *dest++ = '\n';
+ }
*dest++ = base64_chars[(n >> 18) & 0x3f];
n <<= 6;
}
- while (padding--)
+ while (padding--) {
+ if (wrap > 0 && ++count > wrap) {
+ count = 1;
+ *dest++ = '\n';
+ }
*dest++ = '=';
+ }
}
}
+inline void base64_copy (std::istream &is, std::ostream &os, int wrap=0) {
+ base64_copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::ostreambuf_iterator<char>(os), wrap);
+}
+
+
/** Simple implementation mimicking std::make_unique introduced in C++14.
* Constructs an object of class T on the heap and returns a unique_ptr<T> to it.
* @param[in] args arguments forwarded to an constructor of T */
diff --git a/dviware/dvisvgm/src/version.hpp.in b/dviware/dvisvgm/src/version.hpp.in
index efbe631d5b..20ba32bbd5 100644
--- a/dviware/dvisvgm/src/version.hpp.in
+++ b/dviware/dvisvgm/src/version.hpp.in
@@ -2,7 +2,7 @@
** version.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **
diff --git a/dviware/dvisvgm/src/windows.hpp b/dviware/dvisvgm/src/windows.hpp
index e548ee099a..114420c3d5 100644
--- a/dviware/dvisvgm/src/windows.hpp
+++ b/dviware/dvisvgm/src/windows.hpp
@@ -2,7 +2,7 @@
** windows.hpp **
** **
** This file is part of dvisvgm -- a fast DVI to SVG converter **
-** Copyright (C) 2005-2019 Martin Gieseking <martin.gieseking@uos.de> **
+** Copyright (C) 2005-2020 Martin Gieseking <martin.gieseking@uos.de> **
** **
** This program is free software; you can redistribute it and/or **
** modify it under the terms of the GNU General Public License as **