summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2013-08-08 12:43:14 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2013-08-08 12:43:14 +0000
commit4913215ea3abb4340bcf56564eca84e8f6d0d9f3 (patch)
tree883cfb6d56fbfccb32f4687714a7de99b44f9874 /Build/source
parentde9ca7eda14337c01d1f75c831fdd2e78ef97381 (diff)
dvisvgm 1.4
git-svn-id: svn://tug.org/texlive/trunk@31387 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/README4
-rw-r--r--Build/source/texk/dvisvgm/ChangeLog6
-rw-r--r--Build/source/texk/dvisvgm/Makefile.am8
-rw-r--r--Build/source/texk/dvisvgm/Makefile.in46
-rw-r--r--Build/source/texk/dvisvgm/config.h.in3
-rwxr-xr-xBuild/source/texk/dvisvgm/configure88
-rw-r--r--Build/source/texk/dvisvgm/configure.ac31
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/TL-Changes15
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/patch-01-cpp26
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.3/config.rpath0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.3/src/ColorSpecialHandler.cpp269
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.3/src/Makefile.am52
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.3/src/psdefs.cpp84
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/ChangeLog (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/ChangeLog)5
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/TL-Changes17
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/patch-01-cpp71
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/patch-02-config_h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/patch-02-config_h)93
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/AUTHORS (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/AUTHORS)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/COPYING (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/COPYING)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/INSTALL (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/INSTALL)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/LGPL-2.1.txt (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/LGPL-2.1.txt)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/Makefile.am (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/Makefile.am)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/NEWS (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/NEWS)12
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/README (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/README)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/config.h.in (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/config.h.in)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/configure.ac (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/configure.ac)15
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/doc/Makefile.am (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/doc/Makefile.am)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/doc/dvisvgm.1 (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/doc/dvisvgm.1)29
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/doc/dvisvgm.txt.in (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/doc/dvisvgm.txt.in)16
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/BgColorSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/BgColorSpecialHandler.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/BgColorSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/BgColorSpecialHandler.h)2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Bitmap.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Bitmap.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Bitmap.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Bitmap.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/BoundingBox.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/BoundingBox.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/BoundingBox.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/BoundingBox.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.cpp221
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.h146
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.cpp140
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.h50
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.cpp264
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.h81
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CRC32.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/CRC32.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CRC32.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/CRC32.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Calculator.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Calculator.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Calculator.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Calculator.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.cpp35
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.h58
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Character.h46
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CmdLineParserBase.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/CmdLineParserBase.cpp)6
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CmdLineParserBase.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/CmdLineParserBase.h)4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Color.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Color.cpp)145
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Color.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Color.h)3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/ColorSpecialHandler.cpp125
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/ColorSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/ColorSpecialHandler.h)5
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CommandLine.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/CommandLine.cpp)58
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/CommandLine.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/CommandLine.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DLLoader.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DLLoader.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DLLoader.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DLLoader.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIActions.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIActions.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIActions.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIActions.h)3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIReader.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIReader.cpp)18
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIReader.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIReader.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVG.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVG.cpp)85
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVG.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVG.h)8
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVGActions.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVGActions.cpp)7
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVGActions.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVGActions.h)21
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Directory.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Directory.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Directory.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Directory.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DvisvgmSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DvisvgmSpecialHandler.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/DvisvgmSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/DvisvgmSpecialHandler.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSFile.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSFile.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSFile.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSFile.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSToSVG.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSToSVG.cpp)10
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSToSVG.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSToSVG.h)1
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EmSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/EmSpecialHandler.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EmSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/EmSpecialHandler.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EncFile.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEncoding.cpp)47
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/EncFile.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEncoding.h)17
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileFinder.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileFinder.cpp)81
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileFinder.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileFinder.h)3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FilePath.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FilePath.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FilePath.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FilePath.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileSystem.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileSystem.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileSystem.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileSystem.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Font.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Font.cpp)109
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Font.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Font.h)66
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontCache.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontCache.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontCache.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontCache.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.cpp59
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.h37
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEngine.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEngine.cpp)111
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEngine.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEngine.h)28
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontManager.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontManager.cpp)25
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontManager.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontManager.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMap.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMap.cpp)15
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMap.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMap.h)3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMetrics.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMetric.cpp)4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMetrics.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMetric.h)12
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFGlyphTracer.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFGlyphTracer.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFGlyphTracer.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFGlyphTracer.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFReader.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFReader.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFReader.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFReader.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFTracer.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFTracer.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFTracer.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFTracer.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Ghostscript.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Ghostscript.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Ghostscript.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Ghostscript.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Glyph.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Glyph.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GlyphTracerMessages.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GlyphTracerMessages.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/GraphicPath.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/GraphicPath.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/HtmlSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/HtmlSpecialHandler.cpp)40
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/HtmlSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/HtmlSpecialHandler.h)6
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputBuffer.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputBuffer.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputBuffer.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputBuffer.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputReader.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputReader.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputReader.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputReader.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/JFM.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/JFM.cpp)6
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/JFM.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/JFM.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Length.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Length.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Length.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Length.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Makefile.am53
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/MapLine.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/MapLine.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/MapLine.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/MapLine.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Matrix.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Matrix.cpp)18
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Matrix.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Matrix.h)2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Message.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Message.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Message.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Message.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/MessageException.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/MessageException.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/MetafontWrapper.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/MetafontWrapper.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/MetafontWrapper.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/MetafontWrapper.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/MiKTeXCom.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/MiKTeXCom.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/MiKTeXCom.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/MiKTeXCom.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/NoPsSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/NoPsSpecialHandler.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/NoPsSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/NoPsSpecialHandler.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSFilter.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocTypeNode.h)28
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSInterpreter.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSInterpreter.cpp)69
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSInterpreter.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSInterpreter.h)28
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPattern.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSPattern.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPattern.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSPattern.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.cpp113
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.h56
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageRanges.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageRanges.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageRanges.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageRanges.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageSize.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageSize.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageSize.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageSize.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Pair.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Pair.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PdfSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PdfSpecialHandler.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PdfSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PdfSpecialHandler.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Process.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Process.cpp)88
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Process.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Process.h)2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PsSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PsSpecialHandler.cpp)156
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/PsSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/PsSpecialHandler.h)15
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGOutputBase.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGOutputBase.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGTree.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGTree.cpp)5
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGTree.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGTree.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SignalHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SignalHandler.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SignalHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SignalHandler.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialActions.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialActions.h)20
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialHandler.h)1
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialManager.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialManager.cpp)40
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialManager.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialManager.h)3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamReader.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamReader.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamReader.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamReader.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamWriter.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamWriter.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamWriter.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamWriter.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Subfont.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Subfont.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Subfont.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Subfont.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/System.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/System.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/System.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/System.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/TFM.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/TFM.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/TFM.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/TFM.h)4
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Terminal.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Terminal.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/Terminal.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/Terminal.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/TpicSpecialHandler.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/TpicSpecialHandler.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/TpicSpecialHandler.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/TpicSpecialHandler.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFActions.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFActions.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFReader.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFReader.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFReader.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFReader.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/VectorStream.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/VectorStream.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLDocument.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocument.cpp)2
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLDocument.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocument.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLNode.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLNode.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLNode.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLNode.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLString.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLString.cpp)5
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLString.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLString.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/dvisvgm.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/dvisvgm.cpp)10
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/gzstream.cpp (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/gzstream.cpp)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/gzstream.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/gzstream.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/iapi.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/iapi.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/ierrors.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/ierrors.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/macros.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/macros.h)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/options.xml (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/options.xml)0
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/psdefs.cpp83
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-1.4/src/types.h (renamed from Build/source/texk/dvisvgm/dvisvgm-1.3/src/types.h)0
-rw-r--r--Build/source/texk/dvisvgm/version.ac2
194 files changed, 2885 insertions, 1019 deletions
diff --git a/Build/source/texk/README b/Build/source/texk/README
index 6e86e3033c8..9f1119fdf1d 100644
--- a/Build/source/texk/README
+++ b/Build/source/texk/README
@@ -59,8 +59,8 @@ dvipos - ?
dvipsk - maintained here, by us
-dvisvgm - checked 30may13
- http://downloads.sourceforge.net/dvisvgm/dvisvgm-1.3.tar.gz
+dvisvgm - checked 8aug13
+ http://downloads.sourceforge.net/dvisvgm/dvisvgm-1.4.tar.gz
gsftopk - from Paul Vojta's xdvi?
diff --git a/Build/source/texk/dvisvgm/ChangeLog b/Build/source/texk/dvisvgm/ChangeLog
index 1fdfa1a2d34..cb11c1dfe59 100644
--- a/Build/source/texk/dvisvgm/ChangeLog
+++ b/Build/source/texk/dvisvgm/ChangeLog
@@ -1,3 +1,9 @@
+2013-08-08 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Imported release 1.4.
+ * version.ac: Adapted.
+ * Makefile.am: Adjusted.
+
2013-05-17 Peter Breitenlohner <peb@mppmu.mpg.de>
* Imported release 1.3.
diff --git a/Build/source/texk/dvisvgm/Makefile.am b/Build/source/texk/dvisvgm/Makefile.am
index b3d1723151e..500cfd1752d 100644
--- a/Build/source/texk/dvisvgm/Makefile.am
+++ b/Build/source/texk/dvisvgm/Makefile.am
@@ -55,8 +55,12 @@ nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/BgColorSpecialHandler.cpp \
@DVISVGM_TREE@/src/Bitmap.cpp \
@DVISVGM_TREE@/src/BoundingBox.cpp \
+ @DVISVGM_TREE@/src/CMap.cpp \
+ @DVISVGM_TREE@/src/CMapManager.cpp \
+ @DVISVGM_TREE@/src/CMapReader.cpp \
@DVISVGM_TREE@/src/CRC32.cpp \
@DVISVGM_TREE@/src/Calculator.cpp \
+ @DVISVGM_TREE@/src/CharMapID.cpp \
@DVISVGM_TREE@/src/CmdLineParserBase.cpp \
@DVISVGM_TREE@/src/Color.cpp \
@DVISVGM_TREE@/src/ColorSpecialHandler.cpp \
@@ -70,6 +74,7 @@ nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/EPSFile.cpp \
@DVISVGM_TREE@/src/EPSToSVG.cpp \
@DVISVGM_TREE@/src/EmSpecialHandler.cpp \
+ @DVISVGM_TREE@/src/EncFile.cpp \
@DVISVGM_TREE@/src/FileFinder.cpp \
@DVISVGM_TREE@/src/FilePath.cpp \
@DVISVGM_TREE@/src/FileSystem.cpp \
@@ -79,7 +84,7 @@ nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/FontEngine.cpp \
@DVISVGM_TREE@/src/FontManager.cpp \
@DVISVGM_TREE@/src/FontMap.cpp \
- @DVISVGM_TREE@/src/FontMetric.cpp \
+ @DVISVGM_TREE@/src/FontMetrics.cpp \
@DVISVGM_TREE@/src/GFReader.cpp \
@DVISVGM_TREE@/src/GFGlyphTracer.cpp \
@DVISVGM_TREE@/src/GFTracer.cpp \
@@ -96,6 +101,7 @@ nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/NoPsSpecialHandler.cpp \
@DVISVGM_TREE@/src/PSInterpreter.cpp \
@DVISVGM_TREE@/src/PSPattern.cpp \
+ @DVISVGM_TREE@/src/PSPreviewFilter.cpp \
@DVISVGM_TREE@/src/PdfSpecialHandler.cpp \
@DVISVGM_TREE@/src/PageRanges.cpp \
@DVISVGM_TREE@/src/PageSize.cpp \
diff --git a/Build/source/texk/dvisvgm/Makefile.in b/Build/source/texk/dvisvgm/Makefile.in
index fd8c477e01a..a74134dfbf1 100644
--- a/Build/source/texk/dvisvgm/Makefile.in
+++ b/Build/source/texk/dvisvgm/Makefile.in
@@ -138,8 +138,12 @@ nodist_libdvisvgm_a_OBJECTS = \
@DVISVGM_TREE@/src/BgColorSpecialHandler.$(OBJEXT) \
@DVISVGM_TREE@/src/Bitmap.$(OBJEXT) \
@DVISVGM_TREE@/src/BoundingBox.$(OBJEXT) \
+ @DVISVGM_TREE@/src/CMap.$(OBJEXT) \
+ @DVISVGM_TREE@/src/CMapManager.$(OBJEXT) \
+ @DVISVGM_TREE@/src/CMapReader.$(OBJEXT) \
@DVISVGM_TREE@/src/CRC32.$(OBJEXT) \
@DVISVGM_TREE@/src/Calculator.$(OBJEXT) \
+ @DVISVGM_TREE@/src/CharMapID.$(OBJEXT) \
@DVISVGM_TREE@/src/CmdLineParserBase.$(OBJEXT) \
@DVISVGM_TREE@/src/Color.$(OBJEXT) \
@DVISVGM_TREE@/src/ColorSpecialHandler.$(OBJEXT) \
@@ -153,6 +157,7 @@ nodist_libdvisvgm_a_OBJECTS = \
@DVISVGM_TREE@/src/EPSFile.$(OBJEXT) \
@DVISVGM_TREE@/src/EPSToSVG.$(OBJEXT) \
@DVISVGM_TREE@/src/EmSpecialHandler.$(OBJEXT) \
+ @DVISVGM_TREE@/src/EncFile.$(OBJEXT) \
@DVISVGM_TREE@/src/FileFinder.$(OBJEXT) \
@DVISVGM_TREE@/src/FilePath.$(OBJEXT) \
@DVISVGM_TREE@/src/FileSystem.$(OBJEXT) \
@@ -162,7 +167,7 @@ nodist_libdvisvgm_a_OBJECTS = \
@DVISVGM_TREE@/src/FontEngine.$(OBJEXT) \
@DVISVGM_TREE@/src/FontManager.$(OBJEXT) \
@DVISVGM_TREE@/src/FontMap.$(OBJEXT) \
- @DVISVGM_TREE@/src/FontMetric.$(OBJEXT) \
+ @DVISVGM_TREE@/src/FontMetrics.$(OBJEXT) \
@DVISVGM_TREE@/src/GFReader.$(OBJEXT) \
@DVISVGM_TREE@/src/GFGlyphTracer.$(OBJEXT) \
@DVISVGM_TREE@/src/GFTracer.$(OBJEXT) \
@@ -179,6 +184,7 @@ nodist_libdvisvgm_a_OBJECTS = \
@DVISVGM_TREE@/src/NoPsSpecialHandler.$(OBJEXT) \
@DVISVGM_TREE@/src/PSInterpreter.$(OBJEXT) \
@DVISVGM_TREE@/src/PSPattern.$(OBJEXT) \
+ @DVISVGM_TREE@/src/PSPreviewFilter.$(OBJEXT) \
@DVISVGM_TREE@/src/PdfSpecialHandler.$(OBJEXT) \
@DVISVGM_TREE@/src/PageRanges.$(OBJEXT) \
@DVISVGM_TREE@/src/PageSize.$(OBJEXT) \
@@ -667,8 +673,11 @@ noinst_LIBRARIES = libdvisvgm.a
nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/BgColorSpecialHandler.cpp \
@DVISVGM_TREE@/src/Bitmap.cpp \
- @DVISVGM_TREE@/src/BoundingBox.cpp \
- @DVISVGM_TREE@/src/CRC32.cpp @DVISVGM_TREE@/src/Calculator.cpp \
+ @DVISVGM_TREE@/src/BoundingBox.cpp @DVISVGM_TREE@/src/CMap.cpp \
+ @DVISVGM_TREE@/src/CMapManager.cpp \
+ @DVISVGM_TREE@/src/CMapReader.cpp @DVISVGM_TREE@/src/CRC32.cpp \
+ @DVISVGM_TREE@/src/Calculator.cpp \
+ @DVISVGM_TREE@/src/CharMapID.cpp \
@DVISVGM_TREE@/src/CmdLineParserBase.cpp \
@DVISVGM_TREE@/src/Color.cpp \
@DVISVGM_TREE@/src/ColorSpecialHandler.cpp \
@@ -681,6 +690,7 @@ nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/DvisvgmSpecialHandler.cpp \
@DVISVGM_TREE@/src/EPSFile.cpp @DVISVGM_TREE@/src/EPSToSVG.cpp \
@DVISVGM_TREE@/src/EmSpecialHandler.cpp \
+ @DVISVGM_TREE@/src/EncFile.cpp \
@DVISVGM_TREE@/src/FileFinder.cpp \
@DVISVGM_TREE@/src/FilePath.cpp \
@DVISVGM_TREE@/src/FileSystem.cpp @DVISVGM_TREE@/src/Font.cpp \
@@ -689,7 +699,7 @@ nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/FontEngine.cpp \
@DVISVGM_TREE@/src/FontManager.cpp \
@DVISVGM_TREE@/src/FontMap.cpp \
- @DVISVGM_TREE@/src/FontMetric.cpp \
+ @DVISVGM_TREE@/src/FontMetrics.cpp \
@DVISVGM_TREE@/src/GFReader.cpp \
@DVISVGM_TREE@/src/GFGlyphTracer.cpp \
@DVISVGM_TREE@/src/GFTracer.cpp \
@@ -703,6 +713,7 @@ nodist_libdvisvgm_a_SOURCES = \
@DVISVGM_TREE@/src/NoPsSpecialHandler.cpp \
@DVISVGM_TREE@/src/PSInterpreter.cpp \
@DVISVGM_TREE@/src/PSPattern.cpp \
+ @DVISVGM_TREE@/src/PSPreviewFilter.cpp \
@DVISVGM_TREE@/src/PdfSpecialHandler.cpp \
@DVISVGM_TREE@/src/PageRanges.cpp \
@DVISVGM_TREE@/src/PageSize.cpp @DVISVGM_TREE@/src/Process.cpp \
@@ -793,12 +804,23 @@ clean-noinstLIBRARIES:
@DVISVGM_TREE@/src/BoundingBox.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
+@DVISVGM_TREE@/src/CMap.$(OBJEXT): @DVISVGM_TREE@/src/$(am__dirstamp) \
+ @DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
+@DVISVGM_TREE@/src/CMapManager.$(OBJEXT): \
+ @DVISVGM_TREE@/src/$(am__dirstamp) \
+ @DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
+@DVISVGM_TREE@/src/CMapReader.$(OBJEXT): \
+ @DVISVGM_TREE@/src/$(am__dirstamp) \
+ @DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@DVISVGM_TREE@/src/CRC32.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@DVISVGM_TREE@/src/Calculator.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
+@DVISVGM_TREE@/src/CharMapID.$(OBJEXT): \
+ @DVISVGM_TREE@/src/$(am__dirstamp) \
+ @DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@DVISVGM_TREE@/src/CmdLineParserBase.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@@ -838,6 +860,9 @@ clean-noinstLIBRARIES:
@DVISVGM_TREE@/src/EmSpecialHandler.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
+@DVISVGM_TREE@/src/EncFile.$(OBJEXT): \
+ @DVISVGM_TREE@/src/$(am__dirstamp) \
+ @DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@DVISVGM_TREE@/src/FileFinder.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@@ -864,7 +889,7 @@ clean-noinstLIBRARIES:
@DVISVGM_TREE@/src/FontMap.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
-@DVISVGM_TREE@/src/FontMetric.$(OBJEXT): \
+@DVISVGM_TREE@/src/FontMetrics.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@DVISVGM_TREE@/src/GFReader.$(OBJEXT): \
@@ -914,6 +939,9 @@ clean-noinstLIBRARIES:
@DVISVGM_TREE@/src/PSPattern.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
+@DVISVGM_TREE@/src/PSPreviewFilter.$(OBJEXT): \
+ @DVISVGM_TREE@/src/$(am__dirstamp) \
+ @DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@DVISVGM_TREE@/src/PdfSpecialHandler.$(OBJEXT): \
@DVISVGM_TREE@/src/$(am__dirstamp) \
@DVISVGM_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@@ -1051,8 +1079,12 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/BgColorSpecialHandler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/Bitmap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/BoundingBox.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/CMap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/CMapManager.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/CMapReader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/CRC32.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/Calculator.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/CharMapID.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/CmdLineParserBase.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/Color.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/ColorSpecialHandler.Po@am__quote@
@@ -1067,6 +1099,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/EPSFile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/EPSToSVG.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/EmSpecialHandler.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/EncFile.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FileFinder.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FilePath.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FileSystem.Po@am__quote@
@@ -1076,7 +1109,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FontEngine.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FontManager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FontMap.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FontMetric.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/FontMetrics.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/GFGlyphTracer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/GFReader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/GFTracer.Po@am__quote@
@@ -1093,6 +1126,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/NoPsSpecialHandler.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/PSInterpreter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/PSPattern.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/PSPreviewFilter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/PageRanges.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/PageSize.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@@DVISVGM_TREE@/src/$(DEPDIR)/PdfSpecialHandler.Po@am__quote@
diff --git a/Build/source/texk/dvisvgm/config.h.in b/Build/source/texk/dvisvgm/config.h.in
index 45d7c709f55..aa5bbd51f51 100644
--- a/Build/source/texk/dvisvgm/config.h.in
+++ b/Build/source/texk/dvisvgm/config.h.in
@@ -135,6 +135,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if the kpathsea headers are not C++ safe. */
+#undef KPSE_CXX_UNSAFE
+
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
diff --git a/Build/source/texk/dvisvgm/configure b/Build/source/texk/dvisvgm/configure
index 54a1b55c080..0426a5455de 100755
--- a/Build/source/texk/dvisvgm/configure
+++ b/Build/source/texk/dvisvgm/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 1.3.
+# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 1.4.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -590,12 +590,12 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dvisvgm (TeX Live)'
PACKAGE_TARNAME='dvisvgm--tex-live-'
-PACKAGE_VERSION='1.3'
-PACKAGE_STRING='dvisvgm (TeX Live) 1.3'
+PACKAGE_VERSION='1.4'
+PACKAGE_STRING='dvisvgm (TeX Live) 1.4'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
-ac_unique_file="dvisvgm-1.3/src/dvisvgm.cpp"
+ac_unique_file="dvisvgm-1.4/src/dvisvgm.cpp"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
@@ -1371,7 +1371,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures dvisvgm (TeX Live) 1.3 to adapt to many kinds of systems.
+\`configure' configures dvisvgm (TeX Live) 1.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1442,7 +1442,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dvisvgm (TeX Live) 1.3:";;
+ short | recursive ) echo "Configuration of dvisvgm (TeX Live) 1.4:";;
esac
cat <<\_ACEOF
@@ -1579,7 +1579,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dvisvgm (TeX Live) configure 1.3
+dvisvgm (TeX Live) configure 1.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2401,7 +2401,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by dvisvgm (TeX Live) $as_me 1.3, which was
+It was created by dvisvgm (TeX Live) $as_me 1.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -7892,7 +7892,7 @@ fi
# Define the identity of the package.
PACKAGE='dvisvgm--tex-live-'
- VERSION='1.3'
+ VERSION='1.4'
cat >>confdefs.h <<_ACEOF
@@ -17745,7 +17745,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-dvisvgm (TeX Live) config.lt 1.3
+dvisvgm (TeX Live) config.lt 1.4
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -19410,6 +19410,10 @@ else
fi
+kpse_save_CPPFLAGS=$CPPFLAGS
+kpse_save_LIBS=$LIBS
+
+
if test "x$enable_build" != xno || test -f config.force; then
# Checks for more libraries.
@@ -19419,8 +19423,6 @@ eval LIBS=\"$ZLIB_LIBS \$LIBS\"
ac_fn_c_check_func "$LINENO" "gzopen" "ac_cv_func_gzopen"
if test "x$ac_cv_func_gzopen" = xyes; then :
-$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
-
else
as_fn_error $? "cannot find/use zlib" "$LINENO" 5
fi
@@ -19432,8 +19434,6 @@ eval LIBS=\"$FREETYPE2_LIBS \$LIBS\"
ac_fn_c_check_func "$LINENO" "FT_Init_FreeType" "ac_cv_func_FT_Init_FreeType"
if test "x$ac_cv_func_FT_Init_FreeType" = xyes; then :
-$as_echo "#define HAVE_LIBFREETYPE 1" >>confdefs.h
-
else
as_fn_error $? "cannot find/use libfreetype" "$LINENO" 5
fi
@@ -19445,13 +19445,48 @@ eval LIBS=\"$KPATHSEA_LIBS \$LIBS\"
ac_fn_c_check_func "$LINENO" "kpse_set_program_name" "ac_cv_func_kpse_set_program_name"
if test "x$ac_cv_func_kpse_set_program_name" = xyes; then :
-$as_echo "#define HAVE_LIBKPATHSEA 1" >>confdefs.h
-
else
as_fn_error $? "cannot find/use libkpathsea" "$LINENO" 5
fi
+# Check if the kpathsea headers are C++ safe.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ac_link="./libtool --mode=link --tag=CXX $ac_link"
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <kpathsea/kpathsea.h>
+int
+main ()
+{
+printf("%s\n", concat("one", "two"))
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+else
+ as_fn_error $? "Sorry, your kpathsea headers are too old" "$LINENO" 5
+
+$as_echo "#define KPSE_CXX_UNSAFE 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_link="./libtool --mode=link --tag=CC $ac_link"
+
+
echo timestamp >config.force
fi
@@ -19459,7 +19494,22 @@ CPPFLAGS=$kpse_save_CPPFLAGS
LIBS=$kpse_save_LIBS
-DVISVGM_TREE=dvisvgm-1.3
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_LIBFREETYPE 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_LIBKPATHSEA 1" >>confdefs.h
+
+if false; then
+
+$as_echo "#define KPSE_CXX_UNSAFE 1" >>confdefs.h
+
+fi
+
+DVISVGM_TREE=dvisvgm-1.4
ac_config_files="$ac_config_files Makefile"
@@ -20011,7 +20061,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dvisvgm (TeX Live) $as_me 1.3, which was
+This file was extended by dvisvgm (TeX Live) $as_me 1.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20077,7 +20127,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-dvisvgm (TeX Live) config.status 1.3
+dvisvgm (TeX Live) config.status 1.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/texk/dvisvgm/configure.ac b/Build/source/texk/dvisvgm/configure.ac
index 81c1b684067..f428120bbce 100644
--- a/Build/source/texk/dvisvgm/configure.ac
+++ b/Build/source/texk/dvisvgm/configure.ac
@@ -103,32 +103,45 @@ AC_SUBST([LIBGS_INCLUDES])
AC_SUBST([LIBGS_LIBS])
AM_CONDITIONAL([dlloader], [test "x$libgs_mode" = xload])
+KPSE_SAVE_FLAGS
+
if test "x$enable_build" != xno || test -f config.force; then
# Checks for more libraries.
KPSE_ADD_FLAGS([zlib])
-AC_CHECK_FUNC([gzopen],
- [AC_DEFINE([HAVE_LIBZ], 1,
- [Define to 1 if you have the `z' library (-lz).])],
+AC_CHECK_FUNC([gzopen], [],
[AC_MSG_ERROR([cannot find/use zlib])])
KPSE_ADD_FLAGS([freetype2])
-AC_CHECK_FUNC([FT_Init_FreeType],
- [AC_DEFINE([HAVE_LIBFREETYPE], 1,
- [Define to 1 if you have the `freetype2' library (-lfreetype).])],
+AC_CHECK_FUNC([FT_Init_FreeType], [],
[AC_MSG_ERROR([cannot find/use libfreetype])])
KPSE_ADD_FLAGS([kpathsea])
-AC_CHECK_FUNC([kpse_set_program_name],
- [AC_DEFINE([HAVE_LIBKPATHSEA], 1,
- [Define to 1 if you have the `kpathsea' library (-lkpathsea).])],
+AC_CHECK_FUNC([kpse_set_program_name], [],
[AC_MSG_ERROR([cannot find/use libkpathsea])])
+# Check if the kpathsea headers are C++ safe.
+AC_LANG_PUSH([C++])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <kpathsea/kpathsea.h>]],
+ [[printf("%s\n", concat("one", "two"))]])],
+ [],
+ [AC_MSG_ERROR([Sorry, your kpathsea headers are too old])
+ AC_DEFINE([KPSE_CXX_UNSAFE], 1,
+ [Define to 1 if the kpathsea headers are not C++ safe.])])
+AC_LANG_POP([C++])
+
echo timestamp >config.force
fi
KPSE_RESTORE_FLAGS
+AC_DEFINE([HAVE_LIBZ], 1, [Define to 1 if you have the `z' library (-lz).])
+AC_DEFINE([HAVE_LIBFREETYPE], 1, [Define to 1 if you have the `freetype2' library (-lfreetype).])
+AC_DEFINE([HAVE_LIBKPATHSEA], 1, [Define to 1 if you have the `kpathsea' library (-lkpathsea).])
+if false; then
+ AC_DEFINE([KPSE_CXX_UNSAFE], 1, [Define to 1 if the kpathsea headers are not C++ safe.])
+fi
+
AC_SUBST([DVISVGM_TREE], [dvisvgm-]dvisvgm_version)
AC_CONFIG_FILES([Makefile])
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/TL-Changes b/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/TL-Changes
deleted file mode 100644
index 59930768c30..00000000000
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/TL-Changes
+++ /dev/null
@@ -1,15 +0,0 @@
-Changes applied to the dvisvgm-1.3 tree as obtained from:
- http://downloads.sourceforge.net/dvisvgm/dvisvgm-1.3.tar.gz
-
-Removed:
- Makefile.in
- aclocal.m4
- config.guess
- config.sub
- configure
- depcomp
- install-sh
- missing
- tests/
- */Makefile.in
-
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/patch-01-cpp b/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/patch-01-cpp
deleted file mode 100644
index 2472d5cfaa0..00000000000
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/patch-01-cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -ur dvisvgm-1.3.orig/src/FileFinder.cpp dvisvgm-1.3/src/FileFinder.cpp
---- dvisvgm-1.3.orig/src/FileFinder.cpp 2013-05-13 13:15:57.000000000 +0200
-+++ dvisvgm-1.3/src/FileFinder.cpp 2013-06-16 18:31:08.000000000 +0200
-@@ -27,21 +27,12 @@
- #include "FontMap.h"
- #include "Message.h"
-
--using namespace std;
--
- #ifdef MIKTEX
- #include "MessageException.h"
- #include "MiKTeXCom.h"
- static MiKTeXCom *miktex=0;
- #else
-- // unfortunately, the kpathsea headers are not C++-ready,
-- // so we have to wrap it with some ugly code
-- namespace KPS {
-- extern "C" {
-- #include <kpathsea/kpathsea.h>
-- }
-- }
-- using namespace KPS;
-+ #include <kpathsea/kpathsea.h>
- #endif
-
- // ---------------------------------------------------
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/config.rpath b/Build/source/texk/dvisvgm/dvisvgm-1.3/config.rpath
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/config.rpath
+++ /dev/null
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/ColorSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.3/src/ColorSpecialHandler.cpp
deleted file mode 100644
index d156a43770f..00000000000
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/ColorSpecialHandler.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/*************************************************************************
-** ColorSpecialHandler.cpp **
-** **
-** This file is part of dvisvgm -- the DVI to SVG converter **
-** Copyright (C) 2005-2013 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 **
-** published by the Free Software Foundation; either version 3 of **
-** the License, or (at your option) any later version. **
-** **
-** This program is distributed in the hope that it will be useful, but **
-** WITHOUT ANY WARRANTY; without even the implied warranty of **
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
-** GNU General Public License for more details. **
-** **
-** You should have received a copy of the GNU General Public License **
-** along with this program; if not, see <http://www.gnu.org/licenses/>. **
-*************************************************************************/
-
-#include <algorithm>
-#include <cmath>
-#include <cstring>
-#include <iomanip>
-#include <sstream>
-#include <vector>
-#include "ColorSpecialHandler.h"
-#include "SpecialActions.h"
-
-using namespace std;
-
-
-
-/** Approximates a CMYK color by an RGB triple. The component values
- * are expected to be normalized, i.e. 0 <= cmyk[i],rgb[j] <= 1.
- * @param[in] cmyk color in CMYK space
- * @param[out] rgb RGB approximation */
-static void cmyk_to_rgb (const vector<float> &cmyk, vector<float> &rgb) {
- for (int i=0; i < 3; i++)
- rgb[i] = 1.0f-min(1.0f, cmyk[i]+cmyk[3]);
-}
-
-
-/** Converts a color given in HSB coordinates to RGB.
- * @param[in] hsb color in HSB space
- * @param[out] rgb color in RGB space */
-static void hsb_to_rgb (const vector<float> &hsb, vector<float> &rgb) {
- if (hsb[1] == 0)
- rgb[0] = rgb[1] = rgb[2] = hsb[2];
- else {
- float h = hsb[0]-floor(hsb[0]);
- float i = floor(6*h);
- float f = 6.0f*h-i;
- float p = hsb[2]*(1-hsb[1]);
- float q = hsb[2]*(1-hsb[1]*f);
- float t = hsb[2]*(1-hsb[1]*(1-f));
- switch (int(i)) {
- case 0 : rgb[0]=hsb[2]; rgb[1]=t; rgb[2]=p; break;
- case 1 : rgb[0]=q; rgb[1]=hsb[2]; rgb[2]=p; break;
- case 2 : rgb[0]=p; rgb[1]=hsb[2]; rgb[2]=t; break;
- case 3 : rgb[0]=p; rgb[1]=q; rgb[2]=hsb[2]; break;
- case 4 : rgb[0]=t; rgb[1]=p; rgb[2]=hsb[2]; break;
- case 5 : rgb[0]=hsb[2]; rgb[1]=p; rgb[2]=q; break;
- default: ; // prevent compiler warning
- }
- }
-}
-
-
-/** Converts a gray value to RGB.
- * @param[in] gray normalized gray value (0 <= gray <= 1)
- * @param[out] rgb resulting RGB triple */
-static void gray_to_rgb (const float gray, vector<float> &rgb) {
- for (int i=0; i < 3; i++)
- rgb[i] = gray;
-}
-
-
-static float read_float (istream &is) {
- is.clear();
- float v;
- is >> v;
- if (is.fail())
- throw SpecialException("number expected");
- return v;
-}
-
-
-/** Reads multiple float values from a given stream. The number of
- * values read is determined by the size of the result vector.
- * @param[in] is stream to be read from
- * @param[out] v the resulting floats */
-static void read_floats (istream &is, vector<float> &v) {
- for (size_t i=0; i < v.size(); i++)
- v[i] = read_float(is);
-}
-
-
-static bool color_constant (const string &c, vector<float> &rgb) {
- // converted color constants from color.pro
- const struct {
- const char *name;
- const float rgb[3];
- }
- constants[] = {
- {"Apricot", {1, 0.68f, 0.48f}},
- {"Aquamarine", {0.18f, 1, 0.7f}},
- {"Bittersweet", {0.76f, 0.01f, 0}},
- {"Black", {0, 0, 0}},
- {"Blue", {0, 0, 1}},
- {"BlueGreen", {0.15f, 1, 0.67f}},
- {"BlueViolet", {0.1f, 0.05f, 0.96f}},
- {"BrickRed", {0.72f, 0, 0}},
- {"Brown", {0.4f, 0, 0}},
- {"BurntOrange", {1, 0.49f, 0}},
- {"CadetBlue", {0.38f, 0.43f, 0.77f}},
- {"CarnationPink", {1, 0.37f, 1}},
- {"Cerulean", {0.06f, 0.89f, 1}},
- {"CornflowerBlue", {0.35f, 0.87f, 1}},
- {"Cyan", {0, 1, 1}},
- {"Dandelion", {1, 0.71f, 0.16f}},
- {"DarkOrchid", {0.6f, 0.2f, 0.8f}},
- {"Emerald", {0, 1, 0.5f}},
- {"ForestGreen", {0, 0.88f, 0}},
- {"Fuchsia", {0.45f, 0.01f, 0.92f}},
- {"Goldenrod", {1, 0.9f, 0.16f}},
- {"Gray", {0.5f, 0.5f, 0.5f}},
- {"Green", {0, 1, 0}},
- {"GreenYellow", {0.85f, 1, 0.31f}},
- {"JungleGreen", {0.01f, 1, 0.48f}},
- {"Lavender", {1, 0.52f, 1}},
- {"LimeGreen", {0.5f, 1, 0}},
- {"Magenta", {1, 0, 1}},
- {"Mahogany", {0.65f, 0, 0}},
- {"Maroon", {0.68f, 0, 0}},
- {"Melon", {1, 0.54f, 0.5f}},
- {"MidnightBlue", {0, 0.44f, 0.57f}},
- {"Mulberry", {0.64f, 0.08f, 0.98f}},
- {"NavyBlue", {0.06f, 0.46f, 1}},
- {"OliveGreen", {0, 0.6f, 0}},
- {"Orange", {1, 0.39f, 0.13f}},
- {"OrangeRed", {1, 0, 0.5f}},
- {"Orchid", {0.68f, 0.36f, 1}},
- {"Peach", {1, 0.5f, 0.3f}},
- {"Periwinkle", {0.43f, 0.45f, 1}},
- {"PineGreen", {0, 0.75f, 0.16f}},
- {"Plum", {0.5f, 0, 1}},
- {"ProcessBlue", {0.04f, 1, 1}},
- {"Purple", {0.55f, 0.14f, 1}},
- {"RawSienna", {0.55f, 0, 0}},
- {"Red", {1, 0, 0}},
- {"RedOrange", {1, 0.23f, 0.13f}},
- {"RedViolet", {0.59f, 0, 0.66f}},
- {"Rhodamine", {1, 0.18f, 1}},
- {"RoyalBlue", {0, 0.5f, 1}},
- {"RoyalPurple", {0.25f, 0.1f, 1}},
- {"RubineRed", {1, 0, 0.87f}},
- {"Salmon", {1, 0.47f, 0.62f}},
- {"SeaGreen", {0.31f, 1, 0.5f}},
- {"Sepia", {0.3f, 0, 0}},
- {"SkyBlue", {0.38f, 1, 0.88f}},
- {"SpringGreen", {0.74f, 1, 0.24f}},
- {"Tan", {0.86f, 0.58f, 0.44f}},
- {"TealBlue", {0.12f, 0.98f, 0.64f}},
- {"Thistle", {0.88f, 0.41f, 1}},
- {"Turquoise", {0.15f, 1, 0.8f}},
- {"Violet", {0.21f, 0.12f, 1}},
- {"VioletRed", {1, 0.19f, 1}},
- {"White", {1, 1, 1}},
- {"WildStrawberry", {1, 0.04f, 0.61f}},
- {"Yellow", {1, 1, 0}},
- {"YellowGreen", {0.56f, 1, 0.26f}},
- {"YellowOrange", {1, 0.58f, 0}}
- };
- // binary search
- int first=0, last=68-1;
- while (first <= last) {
- int mid = first+(last-first)/2;
- int cmp = strcmp(constants[mid].name, c.c_str());
- if (cmp > 0)
- last = mid-1;
- else if (cmp < 0)
- first = mid+1;
- else {
- rgb[0] = constants[mid].rgb[0];
- rgb[1] = constants[mid].rgb[1];
- rgb[2] = constants[mid].rgb[2];
- return true;
- }
- }
- return false;
-}
-
-
-/** Reads a color statement from an input stream and converts it to RGB.
- * A color statement has the following syntax:
- * <color model> <component values>
- * Currently, the following color models are supported: rgb, cmyk, hsb and gray.
- * Examples: rgb 1 0.5 0, gray 0.5
- * @param[in] model if model != "" this value specifies the model, otherwise it's read from the stream
- * @param[in] is stream to be read from
- * @param[out] resulting RGB triple
- * @return true if statement has successfully been read */
-static void read_color (string model, istream &is, vector<float> &rgb) {
- if (model.empty())
- is >> model;
- if (model == "rgb")
- read_floats(is, rgb);
- else if (model == "cmyk") {
- vector<float> cmyk(4);
- read_floats(is, cmyk);
- cmyk_to_rgb(cmyk, rgb);
- }
- else if (model == "hsb") {
- vector<float> hsb(3);
- read_floats(is, hsb);
- hsb_to_rgb(hsb, rgb);
- }
- else if (model == "gray")
- gray_to_rgb(read_float(is), rgb);
- else if (!color_constant(model, rgb))
- throw SpecialException("unknown color statement");
- if (rgb[0] > 1 || rgb[1] > 1 || rgb[2] > 1) {
- ostringstream oss;
- oss << "invalid RGB value (" << rgb[0] << ',' << rgb[1] << ',' << rgb[2] << ')';
- throw SpecialException(oss.str());
- }
-}
-
-
-bool ColorSpecialHandler::process (const char *prefix, istream &is, SpecialActions *actions) {
- vector<float> rgb(3);
- if (prefix && strcmp(prefix, "background") == 0) {
- read_color("", is, rgb);
- actions->setBgColor(rgb);
- }
- else {
- string cmd;
- is >> cmd;
- if (cmd == "push") { // color push <model> <params>
- read_color("", is, rgb);
- _colorStack.push(rgb);
- }
- else if (cmd == "pop") {
- if (!_colorStack.empty()) // color pop
- _colorStack.pop();
- }
- else { // color <model> <params>
- read_color(cmd, is, rgb);
- while (!_colorStack.empty())
- _colorStack.pop();
- _colorStack.push(rgb);
- }
- if (actions) {
- if (_colorStack.empty())
- actions->setColor(Color::BLACK);
- else
- actions->setColor(_colorStack.top());
- }
- }
- return true;
-}
-
-
-const char** ColorSpecialHandler::prefixes () const {
- static const char *pfx[] = {"color", 0};
- return pfx;
-}
-
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Makefile.am b/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Makefile.am
deleted file mode 100644
index 4312db05d86..00000000000
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Makefile.am
+++ /dev/null
@@ -1,52 +0,0 @@
-:## This file is part of dvisvgm
-## Copyright (C) 2005-2013 Martin Gieseking <martin.gieseking@uos.de>
-##
-## Process this file with automake.
-
-bin_PROGRAMS = dvisvgm
-noinst_LIBRARIES = libdvisvgm.a
-
-dvisvgm_SOURCES = gzstream.h \
- dvisvgm.cpp gzstream.cpp
-
-dvisvgm_LDADD = $(noinst_LIBRARIES) @EXTRA_LIBS@
-dvisvgm_DEPENDENCIES = $(noinst_LIBRARIES) @EXTRA_LIBS@
-
-libdvisvgm_a_SOURCES = Bitmap.h BoundingBox.h BgColorSpecialHandler.h Calculator.h CmdLineParserBase.h Color.h CRC32.h \
- ColorSpecialHandler.h CommandLine.h Directory.h DLLoader.h DVIActions.h DVIReader.h DvisvgmSpecialHandler.h DVIToSVG.h \
- DVIToSVGActions.h EmSpecialHandler.h EPSFile.h EPSToSVG.h FileFinder.h FilePath.h FileSystem.h Font.h FontCache.h \
- FontEncoding.h FontEngine.h FontManager.h FontMap.h FontMetric.h GFReader.h GFTracer.h GFGlyphTracer.h Ghostscript.h \
- Glyph.h GlyphTracerMessages.h GraphicPath.h HtmlSpecialHandler.h InputBuffer.h InputReader.h JFM.h Length.h macros.h \
- MapLine.h Matrix.h Message.h MessageException.h MetafontWrapper.h NoPsSpecialHandler.h PageRanges.h PageSize.h Pair.h \
- PdfSpecialHandler.h Process.h PSInterpreter.h PSPattern.h PsSpecialHandler.h SignalHandler.h SpecialActions.h SpecialHandler.h \
- SpecialManager.h StreamReader.h StreamWriter.h Subfont.h SVGOutputBase.h SVGTree.h System.h Terminal.h TpicSpecialHandler.h \
- TFM.h types.h VectorStream.h VFActions.h VFReader.h XMLDocTypeNode.h XMLDocument.h XMLNode.h XMLString.h \
- BgColorSpecialHandler.cpp Bitmap.cpp BoundingBox.cpp Calculator.cpp CmdLineParserBase.cpp Color.cpp \
- ColorSpecialHandler.cpp CommandLine.cpp CRC32.cpp Directory.cpp DLLoader.cpp DVIActions.cpp DVIReader.cpp \
- DvisvgmSpecialHandler.cpp DVIToSVG.cpp DVIToSVGActions.cpp EmSpecialHandler.cpp EPSFile.cpp EPSToSVG.cpp FileFinder.cpp \
- FilePath.cpp FileSystem.cpp Font.cpp FontCache.cpp FontEncoding.cpp FontEngine.cpp FontManager.cpp FontMap.cpp \
- FontMetric.cpp GFReader.cpp GFGlyphTracer.cpp GFTracer.cpp Ghostscript.cpp HtmlSpecialHandler.cpp InputBuffer.cpp \
- InputReader.cpp JFM.cpp Length.cpp MapLine.cpp Matrix.cpp Message.cpp MetafontWrapper.cpp NoPsSpecialHandler.cpp \
- PageRanges.cpp PageSize.cpp PdfSpecialHandler.cpp Process.cpp psdefs.cpp PSInterpreter.cpp PSPattern.cpp PsSpecialHandler.cpp \
- SignalHandler.cpp SpecialManager.cpp StreamReader.cpp StreamWriter.cpp Subfont.cpp SVGTree.cpp System.cpp Terminal.cpp TFM.cpp \
- TpicSpecialHandler.cpp VFReader.cpp XMLDocument.cpp XMLNode.cpp XMLString.cpp
-
-EXTRA_DIST = options.xml iapi.h ierrors.h MiKTeXCom.h MiKTeXCom.cpp
-
-AM_CXXFLAGS = -Wall -Wnon-virtual-dtor
-
-# the command-line parser is generated from options.xml by opt2cpp
-CommandLine.cpp: options.xml
- if test -f opt2cpp.xsl; then \
- rm -f $@ $*.h; \
- xsltproc opt2cpp.xsl $<; \
- fi
-
-# Create a C string definition containing the PostScript routines psdefs.ps needed by class PSInterpreter
-$(srcdir)/psdefs.cpp: psdefs.ps
- if test -f $<; then \
- ps2c PSInterpreter::PSDEFS $< >$@; \
- fi
-
-psdefs.ps: ;
-
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/psdefs.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.3/src/psdefs.cpp
deleted file mode 100644
index 259105a3529..00000000000
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/psdefs.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*************************************************************************
-** psdefs.cpp **
-** **
-** This file is part of dvisvgm -- the DVI to SVG converter **
-** Copyright (C) 2005-2013 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 **
-** published by the Free Software Foundation; either version 3 of **
-** the License, or (at your option) any later version. **
-** **
-** This program is distributed in the hope that it will be useful, but **
-** WITHOUT ANY WARRANTY; without even the implied warranty of **
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
-** GNU General Public License for more details. **
-** **
-** You should have received a copy of the GNU General Public License **
-** along with this program; if not, see <http://www.gnu.org/licenses/>. **
-*************************************************************************/
-
-#include "PSInterpreter.h"
-
-const char *PSInterpreter::PSDEFS =
-"3 dict dup begin/Install{matrix setmatrix}def/HWResolution[72 72]def/PageSize[10"
-"000 10000]def end setpagedevice/@dodraw true store/@patcnt 0 store/@SD systemdic"
-"t def/@UD userdict def true setglobal @SD/:save @SD/save get put @SD/:restore @S"
-"D/restore get put @SD/:gsave @SD/gsave get put @SD/:grestore @SD/grestore get pu"
-"t @SD/:grestoreall @SD/grestoreall 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/s"
-"how get put @SD/.setopacityalpha known not{@SD/.setopacityalpha{pop}put}if @SD/p"
-"rval{dup type/stringtype eq{print}{30 string cvs print}ifelse}put @SD/prseq{-1 1"
-"{-1 roll prval( )print}for(\\n)print}put @SD/prcmd{( )exch(\\ndvi.)3{print}repea"
-"t prseq}put @SD/cvxall{{cvx}forall}put @SD/defpr{[exch[/copy @SD]cvxall 5 -1 rol"
-"l dup 6 1 roll[/get/exec]cvxall 6 -1 roll dup 7 1 roll 4 -1 roll dup 5 1 roll du"
-"p length string cvs/prcmd cvx]cvx def}put @SD/querypos{{currentpoint}stopped{$er"
-"ror/newerror false put}{2(querypos)prcmd}ifelse}put @SD/applyscalevals{1 0 trans"
-"form 0 0 transform 3 -1 roll sub dup mul 3 1 roll sub dup mul add sqrt 0 1 trans"
-"form 0 0 transform 3 -1 roll sub dup mul 3 1 roll sub dup mul add sqrt 1 0 trans"
-"form dup mul exch dup dup mul 3 -1 roll add sqrt div 3(applyscalevals)prcmd}def "
-"@SD/prpath{{2(moveto)prcmd}{2(lineto)prcmd}{6(curveto)prcmd}{0(closepath)prcmd}p"
-"athforall}put @SD/charpath{/@dodraw false store :charpath/@dodraw true store}put"
-" @SD/show{@dodraw{dup :gsave true charpath eofill :grestore :show}if}put @SD/str"
-"oke{@dodraw{0(newpath)prcmd prpath 0(stroke)prcmd newpath}{:stroke}ifelse}put @S"
-"D/fill{@dodraw{0(newpath)prcmd prpath 0(fill)prcmd newpath}{:fill}ifelse}put @SD"
-"/eofill{@dodraw{0(newpath)prcmd prpath 0(eofill)prcmd newpath}{:eofill}ifelse}pu"
-"t @SD/clip{:clip 0(newpath)prcmd prpath 0(clip)prcmd}put @SD/eoclip{:eoclip 0(ne"
-"wpath)prcmd prpath 0(eoclip)prcmd}put @SD/bop{pop pop}put/@rect{4 -2 roll moveto"
-" 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 rlineto ne"
-"g 0 exch rlineto}{exch dup 0 rlineto exch 0 exch rlineto neg 0 rlineto}ifelse cl"
-"osepath}bind def @SD/rectclip{newpath dup type/arraytype eq{aload length 4 idiv{"
-"@rectcc}repeat}{@rectcc}ifelse clip newpath}put @SD/rectfill{gsave newpath dup t"
-"ype/arraytype eq{aload length 4 idiv{@rectcc}repeat}{@rectcc}ifelse fill grestor"
-"e}put @SD/rectstroke{gsave newpath dup type/arraytype eq{aload length 4 idiv{@re"
-"ct}repeat}{@rect}ifelse stroke grestore}put false setglobal @SD readonly pop/ini"
-"tclip 0 defpr/sysexec{@SD exch get exec}def/adddot{dup length 1 add string dup 0"
-" 46 put dup 3 -1 roll 1 exch putinterval}def/setlinewidth{dup/setlinewidth sysex"
-"ec applyscalevals 1(setlinewidth)prcmd}def/setlinecap 1 defpr/setlinejoin 1 defp"
-"r/setmiterlimit 1 defpr/setdash{mark 3 1 roll 2 copy/setdash sysexec applyscalev"
-"als exch aload length 1 add -1 roll counttomark(setdash)prcmd pop}def/setgstate{"
-"currentlinewidth 1(setlinewidth)prcmd currentlinecap 1(setlinecap)prcmd currentl"
-"inejoin 1(setlinejoin)prcmd currentmiterlimit 1(setmiterlimit)prcmd currentrgbco"
-"lor 3(setrgbcolor)prcmd 6 array currentmatrix aload pop 6(setmatrix)prcmd curren"
-"tdash mark 3 1 roll exch aload length 1 add -1 roll counttomark(setdash)prcmd po"
-"p}def/save{@UD begin/@saveID vmstatus pop pop def end :save @saveID 1(save)prcmd"
-"}def/restore{:restore setgstate @UD/@saveID known{@UD begin @saveID end}{0}ifels"
-"e 1(restore)prcmd}def/gsave 0 defpr/grestore{:grestore setgstate 0(grestore)prcm"
-"d}def/grestoreall{:grestoreall setstate 0(grestoreall)prcmd}def/rotate{dup type/"
-"arraytype ne{dup 1(rotate)prcmd}if/rotate sysexec}def/scale{dup type/arraytype n"
-"e{2 copy 2(scale)prcmd}if/scale sysexec}def/translate{dup type/arraytype ne{2 co"
-"py 2(translate)prcmd}if/translate sysexec}def/setmatrix{dup/setmatrix sysexec al"
-"oad pop 6(setmatrix)prcmd}def/initmatrix{matrix setmatrix}def/concat{matrix curr"
-"entmatrix matrix concatmatrix setmatrix}def/makepattern{gsave <</mx 3 -1 roll >>"
-" begin dup/XUID[1000000 @patcnt]put mx/makepattern sysexec dup dup begin Pattern"
-"Type @patcnt BBox aload pop XStep YStep PaintType mx aload pop 15(makepattern)pr"
-"cmd 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{X"
-"UID aload pop exch pop 1}{:gsave[currentcolorspace aload length -1 roll pop]setc"
-"olorspace/setcolor sysexec XUID aload pop exch pop currentrgbcolor :grestore 4}i"
-"felse(setpattern)prcmd}{/setpattern sysexec}ifelse end}def/setcolor{dup type/dic"
-"ttype eq{setpattern}{/setcolor sysexec}ifelse}def/setgray 1 defpr/setcmykcolor 4"
-" defpr/sethsbcolor 3 defpr/setrgbcolor 3 defpr/.setopacityalpha{dup/.setopacitya"
-"lpha sysexec 1(setopacityalpha)prcmd}def ";
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/ChangeLog b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/ChangeLog
index a2f1f54d37c..1ff8e921ac4 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/ChangeLog
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-08 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Import release 1.4.
+ * patch-01-cpp, patch-02-config_h: Adapted.
+
2013-06-28 Peter Breitenlohner <peb@mppmu.mpg.de>
* patch-02-config_h (new): Include <config.h> always first.
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/TL-Changes b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/TL-Changes
new file mode 100644
index 00000000000..f7e22dd79d1
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/TL-Changes
@@ -0,0 +1,17 @@
+Changes applied to the dvisvgm-1.4 tree as obtained from:
+ http://downloads.sourceforge.net/dvisvgm/dvisvgm-1.4.tar.gz
+
+Removed:
+ ChangeLog
+ Makefile.in
+ aclocal.m4
+ config.guess
+ config.sub
+ configure
+ depcomp
+ install-sh
+ missing
+ test-driver
+ tests/
+ */Makefile.in
+
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/patch-01-cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/patch-01-cpp
new file mode 100644
index 00000000000..499f13207e0
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/patch-01-cpp
@@ -0,0 +1,71 @@
+diff -ur dvisvgm-1.4.orig/configure.ac dvisvgm-1.4/configure.ac
+--- dvisvgm-1.4.orig/configure.ac 2013-08-02 15:04:11.000000000 +0200
++++ dvisvgm-1.4/configure.ac 2013-08-08 14:02:36.000000000 +0200
+@@ -146,6 +146,17 @@
+ fi
+ fi
+
++# Check if the kpathsea headers are C++ safe
++AC_MSG_CHECKING([if the kpathsea headers are C++ safe])
++AC_LANG_PUSH([C++])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <kpathsea/kpathsea.h>]],
++ [[printf("%s\n", concat("one", "two"))]])],
++ [AC_MSG_RESULT([yes])],
++ [AC_MSG_RESULT([no])
++ AC_DEFINE([KPSE_CXX_UNSAFE], 1,
++ [Define to 1 if the kpathsea headers are not C++ safe.])])
++AC_LANG_POP([C++])
++
+ AC_SUBST(DATE)
+ AC_SUBST(EXTRA_LIBS)
+ AC_SUBST(AM_CPPFLAGS)
+diff -ur dvisvgm-1.4.orig/src/FileFinder.cpp dvisvgm-1.4/src/FileFinder.cpp
+--- dvisvgm-1.4.orig/src/FileFinder.cpp 2013-08-02 15:04:11.000000000 +0200
++++ dvisvgm-1.4/src/FileFinder.cpp 2013-08-08 13:38:15.000000000 +0200
+@@ -18,6 +18,24 @@
+ ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+ *************************************************************************/
+
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#ifdef MIKTEX
++ #include "MessageException.h"
++ #include "MiKTeXCom.h"
++ static MiKTeXCom *miktex=0;
++#else
++ #ifdef KPSE_CXX_UNSAFE
++ extern "C" {
++ #endif
++ #include <kpathsea/kpathsea.h>
++ #ifdef KPSE_CXX_UNSAFE
++ }
++ #endif
++#endif
++
+ #include <cstdlib>
+ #include <fstream>
+ #include <map>
+@@ -28,21 +46,6 @@
+ #include "Message.h"
+ #include "Process.h"
+
+-#ifdef MIKTEX
+- #include "MessageException.h"
+- #include "MiKTeXCom.h"
+- static MiKTeXCom *miktex=0;
+-#else
+- // unfortunately, the kpathsea headers are not C++-ready,
+- // so we have to wrap it with some ugly code
+- namespace KPS {
+- extern "C" {
+- #include <kpathsea/kpathsea.h>
+- }
+- }
+- using namespace KPS;
+-#endif
+-
+ // ---------------------------------------------------
+
+ static bool _initialized = false;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/patch-02-config_h b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/patch-02-config_h
index 539b44a5ff5..d98248e036e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3-PATCHES/patch-02-config_h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4-PATCHES/patch-02-config_h
@@ -1,8 +1,8 @@
Include <config.h> always first.
-diff -ur dvisvgm-1.3.orig/src/CommandLine.cpp dvisvgm-1.3/src/CommandLine.cpp
---- dvisvgm-1.3.orig/src/CommandLine.cpp 2013-05-13 13:16:06.000000000 +0200
-+++ dvisvgm-1.3/src/CommandLine.cpp 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/CommandLine.cpp dvisvgm-1.4/src/CommandLine.cpp
+--- dvisvgm-1.4.orig/src/CommandLine.cpp 2013-07-16 18:12:56.000000000 +0200
++++ dvisvgm-1.4/src/CommandLine.cpp 2013-08-08 13:24:11.000000000 +0200
@@ -4,11 +4,11 @@
// See file COPYING for further details.
// (C) 2009-2013 Martin Gieseking <martin.gieseking@uos.de>
@@ -16,9 +16,9 @@ diff -ur dvisvgm-1.3.orig/src/CommandLine.cpp dvisvgm-1.3/src/CommandLine.cpp
using namespace std;
-diff -ur dvisvgm-1.3.orig/src/EPSToSVG.cpp dvisvgm-1.3/src/EPSToSVG.cpp
---- dvisvgm-1.3.orig/src/EPSToSVG.cpp 2013-05-02 13:48:08.000000000 +0200
-+++ dvisvgm-1.3/src/EPSToSVG.cpp 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/EPSToSVG.cpp dvisvgm-1.4/src/EPSToSVG.cpp
+--- dvisvgm-1.4.orig/src/EPSToSVG.cpp 2013-08-02 15:04:11.000000000 +0200
++++ dvisvgm-1.4/src/EPSToSVG.cpp 2013-08-08 13:24:11.000000000 +0200
@@ -18,16 +18,6 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
@@ -53,42 +53,9 @@ diff -ur dvisvgm-1.3.orig/src/EPSToSVG.cpp dvisvgm-1.3/src/EPSToSVG.cpp
using namespace std;
-diff -ur dvisvgm-1.3.orig/src/FileFinder.cpp dvisvgm-1.3/src/FileFinder.cpp
---- dvisvgm-1.3.orig/src/FileFinder.cpp 2013-06-16 18:31:08.000000000 +0200
-+++ dvisvgm-1.3/src/FileFinder.cpp 2013-06-28 18:55:26.000000000 +0200
-@@ -18,6 +18,14 @@
- ** along with this program; if not, see <http://www.gnu.org/licenses/>. **
- *************************************************************************/
-
-+#ifdef MIKTEX
-+ #include "MessageException.h"
-+ #include "MiKTeXCom.h"
-+ static MiKTeXCom *miktex=0;
-+#else
-+ #include <kpathsea/kpathsea.h>
-+#endif
-+
- #include <cstdlib>
- #include <fstream>
- #include <map>
-@@ -27,14 +35,6 @@
- #include "FontMap.h"
- #include "Message.h"
-
--#ifdef MIKTEX
-- #include "MessageException.h"
-- #include "MiKTeXCom.h"
-- static MiKTeXCom *miktex=0;
--#else
-- #include <kpathsea/kpathsea.h>
--#endif
--
- // ---------------------------------------------------
-
- static bool _initialized = false;
-diff -ur dvisvgm-1.3.orig/src/FileSystem.cpp dvisvgm-1.3/src/FileSystem.cpp
---- dvisvgm-1.3.orig/src/FileSystem.cpp 2013-01-16 18:23:09.000000000 +0100
-+++ dvisvgm-1.3/src/FileSystem.cpp 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/FileSystem.cpp dvisvgm-1.4/src/FileSystem.cpp
+--- dvisvgm-1.4.orig/src/FileSystem.cpp 2013-01-21 16:53:23.000000000 +0100
++++ dvisvgm-1.4/src/FileSystem.cpp 2013-08-08 13:24:11.000000000 +0200
@@ -18,16 +18,16 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
@@ -110,9 +77,9 @@ diff -ur dvisvgm-1.3.orig/src/FileSystem.cpp dvisvgm-1.3/src/FileSystem.cpp
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-diff -ur dvisvgm-1.3.orig/src/PSInterpreter.cpp dvisvgm-1.3/src/PSInterpreter.cpp
---- dvisvgm-1.3.orig/src/PSInterpreter.cpp 2013-03-01 10:39:28.000000000 +0100
-+++ dvisvgm-1.3/src/PSInterpreter.cpp 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/PSInterpreter.cpp dvisvgm-1.4/src/PSInterpreter.cpp
+--- dvisvgm-1.4.orig/src/PSInterpreter.cpp 2013-08-02 15:04:11.000000000 +0200
++++ dvisvgm-1.4/src/PSInterpreter.cpp 2013-08-08 13:24:11.386995185 +0200
@@ -18,6 +18,7 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
@@ -121,17 +88,17 @@ diff -ur dvisvgm-1.3.orig/src/PSInterpreter.cpp dvisvgm-1.3/src/PSInterpreter.cp
#include <cstring>
#include <fstream>
#include <iostream>
-@@ -25,7 +26,6 @@
- #include "FileFinder.h"
+@@ -26,7 +27,6 @@
#include "InputReader.h"
#include "Message.h"
+ #include "PSFilter.h"
-#include "PSInterpreter.h"
#include "SignalHandler.h"
using namespace std;
-diff -ur dvisvgm-1.3.orig/src/PSInterpreter.h dvisvgm-1.3/src/PSInterpreter.h
---- dvisvgm-1.3.orig/src/PSInterpreter.h 2013-03-01 10:39:28.000000000 +0100
-+++ dvisvgm-1.3/src/PSInterpreter.h 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/PSInterpreter.h dvisvgm-1.4/src/PSInterpreter.h
+--- dvisvgm-1.4.orig/src/PSInterpreter.h 2013-08-02 15:04:11.000000000 +0200
++++ dvisvgm-1.4/src/PSInterpreter.h 2013-08-08 13:24:11.000000000 +0200
@@ -21,11 +21,11 @@
#ifndef PSINTERPRETER_H
#define PSINTERPRETER_H
@@ -145,9 +112,9 @@ diff -ur dvisvgm-1.3.orig/src/PSInterpreter.h dvisvgm-1.3/src/PSInterpreter.h
#include "InputReader.h"
#include "MessageException.h"
-diff -ur dvisvgm-1.3.orig/src/PsSpecialHandler.cpp dvisvgm-1.3/src/PsSpecialHandler.cpp
---- dvisvgm-1.3.orig/src/PsSpecialHandler.cpp 2013-03-01 10:39:28.000000000 +0100
-+++ dvisvgm-1.3/src/PsSpecialHandler.cpp 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/PsSpecialHandler.cpp dvisvgm-1.4/src/PsSpecialHandler.cpp
+--- dvisvgm-1.4.orig/src/PsSpecialHandler.cpp 2013-08-02 15:04:11.000000000 +0200
++++ dvisvgm-1.4/src/PsSpecialHandler.cpp 2013-08-08 13:24:11.000000000 +0200
@@ -18,13 +18,13 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
@@ -162,10 +129,10 @@ diff -ur dvisvgm-1.3.orig/src/PsSpecialHandler.cpp dvisvgm-1.3/src/PsSpecialHand
-#include "Ghostscript.h"
#include "Message.h"
#include "PSPattern.h"
- #include "PsSpecialHandler.h"
-diff -ur dvisvgm-1.3.orig/src/System.cpp dvisvgm-1.3/src/System.cpp
---- dvisvgm-1.3.orig/src/System.cpp 2013-01-16 18:23:09.000000000 +0100
-+++ dvisvgm-1.3/src/System.cpp 2013-06-28 18:55:26.000000000 +0200
+ #include "PSPreviewFilter.h"
+diff -ur dvisvgm-1.4.orig/src/System.cpp dvisvgm-1.4/src/System.cpp
+--- dvisvgm-1.4.orig/src/System.cpp 2013-01-21 16:53:23.000000000 +0100
++++ dvisvgm-1.4/src/System.cpp 2013-08-08 13:24:11.000000000 +0200
@@ -18,13 +18,13 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
@@ -183,9 +150,9 @@ diff -ur dvisvgm-1.3.orig/src/System.cpp dvisvgm-1.3/src/System.cpp
#if defined (HAVE_SYS_TIME_H)
#include <sys/time.h>
#elif defined (HAVE_SYS_TIMEB_H)
-diff -ur dvisvgm-1.3.orig/src/Terminal.cpp dvisvgm-1.3/src/Terminal.cpp
---- dvisvgm-1.3.orig/src/Terminal.cpp 2013-05-02 13:48:08.000000000 +0200
-+++ dvisvgm-1.3/src/Terminal.cpp 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/Terminal.cpp dvisvgm-1.4/src/Terminal.cpp
+--- dvisvgm-1.4.orig/src/Terminal.cpp 2013-05-08 19:29:03.000000000 +0200
++++ dvisvgm-1.4/src/Terminal.cpp 2013-08-08 13:24:11.000000000 +0200
@@ -18,12 +18,12 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
@@ -201,9 +168,9 @@ diff -ur dvisvgm-1.3.orig/src/Terminal.cpp dvisvgm-1.3/src/Terminal.cpp
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
-diff -ur dvisvgm-1.3.orig/src/dvisvgm.cpp dvisvgm-1.3/src/dvisvgm.cpp
---- dvisvgm-1.3.orig/src/dvisvgm.cpp 2013-05-13 13:15:57.000000000 +0200
-+++ dvisvgm-1.3/src/dvisvgm.cpp 2013-06-28 18:55:26.000000000 +0200
+diff -ur dvisvgm-1.4.orig/src/dvisvgm.cpp dvisvgm-1.4/src/dvisvgm.cpp
+--- dvisvgm-1.4.orig/src/dvisvgm.cpp 2013-08-02 15:04:11.000000000 +0200
++++ dvisvgm-1.4/src/dvisvgm.cpp 2013-08-08 13:24:11.000000000 +0200
@@ -18,6 +18,14 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/AUTHORS b/Build/source/texk/dvisvgm/dvisvgm-1.4/AUTHORS
index d9b6468421e..d9b6468421e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/AUTHORS
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/AUTHORS
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/COPYING b/Build/source/texk/dvisvgm/dvisvgm-1.4/COPYING
index 94a9ed024d3..94a9ed024d3 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/COPYING
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/COPYING
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/INSTALL b/Build/source/texk/dvisvgm/dvisvgm-1.4/INSTALL
index a4b34144dcf..a4b34144dcf 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/INSTALL
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/INSTALL
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/LGPL-2.1.txt b/Build/source/texk/dvisvgm/dvisvgm-1.4/LGPL-2.1.txt
index 602bfc94635..602bfc94635 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/LGPL-2.1.txt
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/LGPL-2.1.txt
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/Makefile.am b/Build/source/texk/dvisvgm/dvisvgm-1.4/Makefile.am
index a3462b39cdb..a3462b39cdb 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/Makefile.am
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/Makefile.am
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/NEWS b/Build/source/texk/dvisvgm/dvisvgm-1.4/NEWS
index b6c0c98060a..018dab8dc6c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/NEWS
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/NEWS
@@ -1,3 +1,15 @@
+dvisvgm-1.4 (2013-08-02)
+- added basic support for CMap files and CID-based fonts
+- added character mapping from CIDs to char codes based on the encoding tables of a non-CID font
+- added support for OTF fonts
+- added evaluation of bounding box data generated by the preview package
+- extended option --linkmark to mark hyperlinked areas with an arbitrary background color
+- PS handler: improved evaluation of PS header specials
+- PS handler: improved evaluation of operator 'show'
+- removed DOCTYPE declaration from generated SVG files
+- removed encoding attribute from xml declaration (replaces ISO-8859-1 with UTF-8)
+- various code improvements and refactorings
+
dvisvgm-1.3 (2013-05-13)
- added support for hyperref specials
- added command-line option --linkmarker to select the way how to mark hyperlinked areas
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/README b/Build/source/texk/dvisvgm/dvisvgm-1.4/README
index d9728660268..d9728660268 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/README
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/README
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/config.h.in b/Build/source/texk/dvisvgm/dvisvgm-1.4/config.h.in
index b027999e9b3..b027999e9b3 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/config.h.in
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/config.h.in
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/configure.ac b/Build/source/texk/dvisvgm/dvisvgm-1.4/configure.ac
index f4ff7d70248..5674e7f50f2 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/configure.ac
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/configure.ac
@@ -4,8 +4,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([dvisvgm],[1.3],[martin.gieseking@uos.de])
-DATE="May 2013"
+AC_INIT([dvisvgm],[1.4],[martin.gieseking@uos.de])
+DATE="Juli 2013"
AC_CONFIG_SRCDIR(src)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
@@ -146,6 +146,17 @@ if test "$withval" != no; then
fi
fi
+# Check if the kpathsea headers are C++ safe
+AC_MSG_CHECKING([if the kpathsea headers are C++ safe])
+AC_LANG_PUSH([C++])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <kpathsea/kpathsea.h>]],
+ [[printf("%s\n", concat("one", "two"))]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_DEFINE([KPSE_CXX_UNSAFE], 1,
+ [Define to 1 if the kpathsea headers are not C++ safe.])])
+AC_LANG_POP([C++])
+
AC_SUBST(DATE)
AC_SUBST(EXTRA_LIBS)
AC_SUBST(AM_CPPFLAGS)
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/doc/Makefile.am b/Build/source/texk/dvisvgm/dvisvgm-1.4/doc/Makefile.am
index fb5c56ffedf..fb5c56ffedf 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/doc/Makefile.am
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/doc/Makefile.am
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/doc/dvisvgm.1 b/Build/source/texk/dvisvgm/dvisvgm-1.4/doc/dvisvgm.1
index 193fad44ed2..6ec3d631413 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/doc/dvisvgm.1
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/doc/dvisvgm.1
@@ -2,12 +2,12 @@
.\" Title: dvisvgm
.\" Author: Martin Gieseking <martin.gieseking@uos.de>
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 05/13/2013
+.\" Date: 08/02/2013
.\" Manual: dvisvgm Manual
-.\" Source: dvisvgm 1.3
+.\" Source: dvisvgm 1.4
.\" Language: English
.\"
-.TH "DVISVGM" "1" "05/13/2013" "dvisvgm 1\&.3" "dvisvgm Manual"
+.TH "DVISVGM" "1" "08/02/2013" "dvisvgm 1\&.4" "dvisvgm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -201,7 +201,8 @@ for further information\&.
\fB\-e, \-\-exact\fR
.RS 4
If this option is given, dvisvgm computes the precise bounding box of each character\&. By default, the values stored in a font\(cqs TFM file are used to determine a glyph\(cqs extent\&. As these values are intended to realize optimal character placements and are not designed to represent the exact dimensions, they don\(cqt necessarily correspond with the bounds of the visual glyphs\&. Thus, width and/or height of some glyphs may be larger than the respective TFM values\&. As a result, this can lead to clipped characters at the bounds of the SVG graphic\&. With option
-\fB\-\-exact\fR, dvisvgm analyzes the actual shape of each character and derives a usually tight bounding box\&.
+\fB\-\-exact\fR
+given, dvisvgm analyzes the actual shape of each character and derives a usually tight bounding box\&.
.RE
.PP
\fB\-m, \-\-fontmap\fR=\fIfilenames\fR
@@ -288,7 +289,16 @@ argument can take one of the values
\fIbox\fR
draws a rectangle around the linked area, and
\fInone\fR
-tells dvisvgm not to add any visible objects to hyperlinks\&.
+tells dvisvgm not to add any visible objects to hyperlinks\&. Additionally, the argument
+\fItype\fR
+can take a dvips color name as listed here:
+http://en\&.wikibooks\&.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips
+It\(cqs also possible to give an explicit hexadecimal RGB value of the form
+\fI#RRGGBB\fR, e\&.g\&.
+\fI#0000ff\fR
+or simply
+\fI#ff\fR
+for blue\&. The color is used to highlight the linked area\&.
.RE
.PP
\fB\-l, \-\-list\-specials\fR
@@ -315,7 +325,7 @@ If this option is given, dvisvgm doesn\(cqt create SVG
\fIfont\fR
elements but uses
\fIpaths\fR
-instead\&. The resulting SVG files tends to be larger but concurrently more compatible with most applications that don\(cqt support SVG fonts yet\&. The optional argument
+instead\&. The resulting SVG files tend to be larger but they are concurrently more compatible with most applications that don\(cqt support SVG fonts yet\&. The optional argument
\fIvariant\fR
selects the method how to substitute fonts by paths\&. Variant 0 creates
\fIpath\fR
@@ -801,6 +811,11 @@ are supported by dvisvgm\&. These specials allow modifying the font map tree dur
.RS 4
The famous DVI driver dvips introduced its own set of specials in order to embed PostScript code into DVI files, which greatly improves the capabilities of DVI documents\&. One aim of dvisvgm is to completely evaluate all PostScript snippets and to convert a large amount of it to SVG\&. However, in contrast to dvips, dvisvgm uses floating point arithmetics to compute the precise position of each graphic element, i\&.e\&. it doesn\(cqt round the coordinates\&. Therefore, the relative locations of the graphic elements may slightly differ from those computed by dvips\&.
.sp
+The PostScript handler also recognizes and evaluates bounding box data generated by the
+\fIpreview\fR
+package with option
+\fItightpage\fR\&. If the data is present in a DVI file, dvisvgm adapts the bounding box of the generated SVG file accordingly, and prints a message showing the width, height, and depth of the box in TeX point units\&. Especially, the depth value can be used to vertically align the SVG graphics with the baseline of surrounding text in HTML or XSL\-FO documents, for example\&.
+.sp
Since PostScript is a rather complex language, dvisvgm does not try to implement its own PostScript interpreter but relies on Ghostscript instead\&. If the Ghostscript library was not linked while building dvisvgm, it is looked up and loaded dynamically during runtime\&. In this case, dvisvgm looks for
\fIlibgs\&.so\fR
on Unix\-like systems, and for
@@ -878,7 +893,7 @@ If dvisvgm was linked without the Ghostscript library, and if PostScript support
.sp
The pre\-compiled Windows versions of dvisvgm require a working installation of MiKTeX 2\&.9 or above\&. dvisvgm does not work together with the portable edition of MiKTeX because it relies on MiKTeX\(cqs COM interface only accessible in a local installation\&. To enable the evaluation of PostScript specials, the original Ghostscript DLL \fIgsdll32\&.dll\fR must be present and reachable through the search path\&. 64\-bit Windows builds require the 64\-bit Ghostscript DLL \fIgsdll64\&.dll\fR\&. Both DLLs come with the corresponding Ghostscript installers available from www\&.ghostscript\&.com\&.
.sp
-The environment variable DVISVGM_COLORS specifies the colors used to highlight various parts of dvisvgm\(cqs message output\&. It is only evaluated if option \fB\-\-color\fR is given\&. The value of DVISVGM_COLORS is a list of colon\-separated entries of the form \fIgg\fR=\fIBF\fR, where \fIgg\fR denotes one of the color group indicators listed below, and \fIBF\fR are two hexadecimal digits specifying the background (first digit) and foreground/text color (second digit)\&. The color color values are defined as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8=bright red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta, D=bright cyan, E=bright gray, F=white\&. Depending on the terminal, the colors may differ\&. Rather than changing both the text and background color, it\(cqs also possible to change only one of them: An asterisk (*) in place of a hexadecimal digit indicates the default text or background color of the terminal\&.
+The environment variable DVISVGM_COLORS specifies the colors used to highlight various parts of dvisvgm\(cqs message output\&. It is only evaluated if option \fB\-\-color\fR is given\&. The value of DVISVGM_COLORS is a list of colon\-separated entries of the form \fIgg\fR=\fIBF\fR, where \fIgg\fR denotes one of the color group indicators listed below, and \fIBF\fR are two hexadecimal digits specifying the background (first digit) and foreground/text color (second digit)\&. The color values are defined as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=gray, 8=bright red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta, D=bright cyan, E=bright gray, F=white\&. Depending on the terminal, the colors may differ\&. Rather than changing both the text and background color, it\(cqs also possible to change only one of them: An asterisk (*) in place of a hexadecimal digit indicates the default text or background color of the terminal\&.
.sp
All malformed entries in the list are silently ignored\&.
.TS
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/doc/dvisvgm.txt.in b/Build/source/texk/dvisvgm/dvisvgm-1.4/doc/dvisvgm.txt.in
index 0d5edbdabc2..e6fbdfa7775 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/doc/dvisvgm.txt.in
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/doc/dvisvgm.txt.in
@@ -147,7 +147,7 @@ the values stored in a font's TFM file are used to determine a glyph's extent. A
intended to realize optimal character placements and are not designed to represent the exact dimensions,
they don't necessarily correspond with the bounds of the visual glyphs. Thus, width and/or height
of some glyphs may be larger than the respective TFM values. As a result, this can lead to clipped
-characters at the bounds of the SVG graphic. With option *--exact*, dvisvgm analyzes the actual shape
+characters at the bounds of the SVG graphic. With option *--exact* given, dvisvgm analyzes the actual shape
of each character and derives a usually tight bounding box.
@@ -212,6 +212,10 @@ Selects the method how to mark hyperlinked areas. The 'type' argument can take o
'none', 'box', and 'line', where the latter is the default, i.e. all links are underlined when
dvisvgm is called without option *--linkmark*. Type 'box' draws a rectangle around the linked
area, and 'none' tells dvisvgm not to add any visible objects to hyperlinks.
+Additionally, the argument 'type' can take a dvips color name as listed here:
+http://en.wikibooks.org/wiki/LaTeX/Colors#The_68_standard_colors_known_to_dvips
+It's also possible to give an explicit hexadecimal RGB value of the form '#RRGGBB', e.g. '#0000ff'
+or simply '#ff' for blue. The color is used to highlight the linked area.
*-l, --list-specials*::
@@ -236,7 +240,7 @@ This option disables these calls.
*-n, --no-fonts*[='variant']::
If this option is given, dvisvgm doesn't create SVG 'font' elements but uses 'paths' instead. The
-resulting SVG files tends to be larger but concurrently more compatible with most applications that
+resulting SVG files tend to be larger but they are concurrently more compatible with most applications that
don't support SVG fonts yet. The optional argument 'variant' selects the method how to substitute fonts
by paths. Variant 0 creates 'path' and 'use' elements. Variant 1 creates 'path' elements only.
Option *--no-fonts* implies *--no-styles*.
@@ -517,6 +521,12 @@ PostScript snippets and to convert a large amount of it to SVG. However, in cont
arithmetics to compute the precise position of each graphic element, i.e. it doesn't round the coordinates. Therefore,
the relative locations of the graphic elements may slightly differ from those computed by dvips.
+
+The PostScript handler also recognizes and evaluates bounding box data generated by the 'preview' package with
+option 'tightpage'. If the data is present in a DVI file, dvisvgm adapts the bounding box of the generated SVG file
+accordingly, and prints a message showing the width, height, and depth of the box in TeX point units. Especially,
+the depth value can be used to vertically align the SVG graphics with the baseline of surrounding text in HTML or XSL-FO
+documents, for example.
++
Since PostScript is a rather complex language, dvisvgm does not try to implement its own PostScript interpreter but relies on
Ghostscript instead. If the Ghostscript library was not linked while building dvisvgm, it is looked up and loaded dynamically
during runtime. In this case, dvisvgm looks for 'libgs.so' on Unix-like systems, and for 'gsdll32.dll' or 'gsdll64.dll' on Windows.
@@ -574,7 +584,7 @@ The environment variable +DVISVGM_COLORS+ specifies the colors used to highlight
message output. It is only evaluated if option *--color* is given. The value of +DVISVGM_COLORS+ is a list of
colon-separated entries of the form 'gg'='BF', where 'gg' denotes one of the color group indicators listed
below, and 'BF' are two hexadecimal digits specifying the background (first digit) and foreground/text color
-(second digit). The color color values are defined as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue,
+(second digit). The color values are defined as follows: 0=black, 1=red, 2=green, 3=yellow, 4=blue,
5=magenta, 6=cyan, 7=gray, 8=bright red, 9=bright green, A=bright yellow, B=bright blue, C=bright magenta,
D=bright cyan, E=bright gray, F=white. Depending on the terminal, the colors may differ. Rather than changing
both the text and background color, it's also possible to change only one of them: An asterisk (*) in
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BgColorSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BgColorSpecialHandler.cpp
index a225d360910..a225d360910 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BgColorSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BgColorSpecialHandler.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BgColorSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BgColorSpecialHandler.h
index 98dd814ba9e..e8b9ec21eed 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BgColorSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BgColorSpecialHandler.h
@@ -21,7 +21,7 @@
#ifndef BGCOLORSPECIALHANDLER_H
#define BGCOLORSPECIALHANDLER_H
-#include "SpecialManager.h"
+#include "SpecialHandler.h"
struct BgColorSpecialHandler : SpecialHandler
{
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Bitmap.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Bitmap.cpp
index e72d5ee34ac..e72d5ee34ac 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Bitmap.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Bitmap.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Bitmap.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Bitmap.h
index 1a1f19caf15..1a1f19caf15 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Bitmap.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Bitmap.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BoundingBox.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BoundingBox.cpp
index 85ec9c4c452..85ec9c4c452 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BoundingBox.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BoundingBox.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BoundingBox.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BoundingBox.h
index b3a4016f52a..b3a4016f52a 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/BoundingBox.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/BoundingBox.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.cpp
new file mode 100644
index 00000000000..870962f0714
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.cpp
@@ -0,0 +1,221 @@
+/*************************************************************************
+** CMap.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include <algorithm>
+#include <sstream>
+#include <set>
+#include <vector>
+#include "CMap.h"
+#include "FileFinder.h"
+#include "InputReader.h"
+
+using namespace std;
+
+
+const char* CMap::path () const {
+ return FileFinder::lookup(name(), "cmap", false);
+}
+
+
+/** Returns the RO (Registry-Ordering) string of the CMap. */
+string SegmentedCMap::getROString() const {
+ if (_registry.empty() || _ordering.empty())
+ return "";
+ return _registry + "-" + _ordering;
+}
+
+
+/** Tries to merge range r into this one. This is only possible if the ranges
+ * touch or overlap and if the assigned CIDs match at the junction points.
+ * @param[in] r range to join
+ * @return true if join was successful */
+bool SegmentedCMap::Range::join (const Range &r) {
+ // check most common cases first
+ if (_max+1 < r._min || _min-1 > r._max) // disjoint ranges?
+ return false;
+ if (r._min-1 == _max) { // does r touch *this on the right?
+ if (decode(r._min) == r._cid) {
+ _max = r._max;
+ return true;
+ }
+ return false;
+ }
+ if (r._max+1 == _min) { // does r touch *this on the left
+ if (r.decode(_min) == _cid) {
+ setMinAndAdaptCID(r._min);
+ return true;
+ }
+ return false;
+ }
+ // the following cases should be pretty rare
+ if (r._min <= _min && r._max >= _max) { // does r overlap *this on both sides?
+ *this = r;
+ return true;
+ }
+ if (r._min < _min) { // left overlap only?
+ if (r.decode(_min) == _cid) {
+ _min = r._min;
+ _cid = r._cid;
+ return true;
+ }
+ return false;
+ }
+ if (r._max > _max) { // right overlap only?
+ if (decode(r._min) == r._cid) {
+ _max = r._max;
+ return true;
+ }
+ return false;
+ }
+ // r completely inside *this
+ return decode(r._min) == r._cid;
+}
+
+
+/** Adapts the left and right neighbor elements of a newly inserted range.
+ * The new range could overlap ranges in the neighborhood so that those must be
+ * adapted or removed. All ranges in the range vector are ordered ascendingly, i.e.
+ * [min_1, max_1],...,[min_n, max_n] where min_i < min_j for all i < j.
+ * @param[in,out] ranges range collection to be adapted
+ * @param[in] it pointer to the newly inserted range */
+void SegmentedCMap::adaptNeighbors (Ranges &ranges, Ranges::iterator it) {
+ if (it != ranges.end()) {
+ // adapt left neighbor
+ SegmentedCMap::Ranges::iterator lit = it-1; // points to left neighbor
+ if (it != ranges.begin() && it->min() <= lit->max()) {
+ bool left_neighbor_valid = (it->min() > 0 && it->min()-1 >= lit->min());
+ if (left_neighbor_valid) // is adapted left neighbor valid?
+ lit->_max = it->min()-1; // => assign new max value
+ if (!left_neighbor_valid || it->join(*lit))
+ it = ranges.erase(lit);
+ }
+ // remove right neighbors completely overlapped by *it
+ SegmentedCMap::Ranges::iterator rit = it+1; // points to right neighbor
+ while (rit != ranges.end() && it->max() >= rit->max()) { // complete overlap?
+ ranges.erase(rit);
+ rit = it+1;
+ }
+ // adapt rightmost range partially overlapped by *it
+ if (rit != ranges.end()) {
+ if (it->max() >= rit->min())
+ rit->setMinAndAdaptCID(it->max()+1);
+ // try to merge right neighbor into *this
+ if (it->join(*rit))
+ ranges.erase(rit); // remove merged neighbor
+ }
+ }
+}
+
+
+/** Adds a new code range. The range describes a mapping from character codes c to CIDs, where
+ * c \in [cmin,cmax] and CID(c):=cid+c-cmin.
+ * @param[in,out] ranges collection the new range is added to
+ * @param[in] cmin smallest character code in the range
+ * @param[in] cmax largest character code in the range
+ * @param[in] cid CID of the smallest character code (cmin) */
+void SegmentedCMap::addRange (Ranges &ranges, UInt32 cmin, UInt32 cmax, UInt32 cid) {
+ if (cmin > cmax)
+ swap(cmin, cmax);
+
+ Range range(cmin, cmax, cid);
+ if (ranges.empty())
+ ranges.push_back(range);
+ else {
+ // check for simple cases that can be handled pretty fast
+ Range &lrange = *ranges.begin();
+ Range &rrange = *ranges.rbegin();
+ if (cmin > rrange.max()) { // non-overlapping range at end of vector?
+ if (!rrange.join(range))
+ ranges.push_back(range);
+ }
+ else if (cmax < lrange.min()) { // non-overlapping range at begin of vector?
+ if (!lrange.join(range))
+ ranges.insert(ranges.begin(), range);
+ }
+ else {
+ // ranges overlap and/or must be inserted somewhere inside the vector
+ Ranges::iterator it = lower_bound(ranges.begin(), ranges.end(), range);
+ const bool at_end = (it == ranges.end());
+ if (at_end)
+ --it;
+ if (!it->join(range)) {
+ if (it->min() < cmin && it->max() > cmax) { // new range completely inside an existing range?
+ //split existing range
+ UInt32 itmax = it->max();
+ it->_max = cmin-1;
+ it = ranges.insert(it+1, Range(cmax+1, itmax, it->decode(cmax+1)));
+ }
+ else if (at_end) // does new range overlap right side of last range in vector?
+ it = ranges.end(); // => append new range at end of vector
+ it = ranges.insert(it, range);
+ }
+ adaptNeighbors(ranges, it); // resolve overlaps
+ }
+ }
+}
+
+
+/** Returns the CID for a given character code. */
+UInt32 SegmentedCMap::cid (UInt32 c) const {
+ int pos = lookup(_cidranges, c);
+ if (pos >= 0)
+ return _cidranges[pos].decode(c);
+ if (_basemap)
+ return _basemap->cid(c);
+ return 0;
+}
+
+
+/** Returns the character code of a base font for a given CID. */
+UInt32 SegmentedCMap::bfcode (UInt32 cid) const {
+ int pos = lookup(_bfranges, cid);
+ if (pos >= 0)
+ return _bfranges[pos].decode(cid);
+ if (_basemap)
+ return _basemap->bfcode(cid);
+ return 0;
+}
+
+
+/** Finds the index of the range that contains a given value c.
+ * @param[in] c find range that contains this value
+ * @return index of the range found, or -1 if range was not found */
+int SegmentedCMap::lookup (const Ranges &ranges, UInt32 c) const {
+ // simple binary search
+ int left=0, right=ranges.size()-1;
+ while (left <= right) {
+ int mid = (left+right)/2;
+ if (c < ranges[mid].min())
+ right = mid-1;
+ else if (c > ranges[mid].max())
+ left = mid+1;
+ else
+ return mid;
+ }
+ return -1;
+}
+
+
+void SegmentedCMap::write (ostream &os) const {
+ for (size_t i=0; i < _cidranges.size(); i++) {
+ const Range &r = _cidranges[i];
+ os << '[' << r.min() << ',' << r.max() << "] => " << r.cid() << '\n';
+ }
+}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.h
new file mode 100644
index 00000000000..5663499e9ee
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMap.h
@@ -0,0 +1,146 @@
+/*************************************************************************
+** CMap.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#ifndef CMAP_H
+#define CMAP_H
+
+#include <algorithm>
+#include <ostream>
+#include <vector>
+#include "FontEncoding.h"
+#include "types.h"
+
+
+struct CMap : public FontEncoding
+{
+ virtual ~CMap () {}
+ virtual bool vertical () const =0;
+ virtual bool mapsToCID () const =0;
+ virtual const char* path () const;
+ virtual UInt32 cid (UInt32 c) const =0;
+ virtual UInt32 bfcode (UInt32 cid) const =0;
+ virtual std::string getROString () const =0;
+
+ Character decode (UInt32 c) const {
+ if (mapsToCID())
+ return Character(Character::INDEX, cid(c));
+ return Character(Character::CHRCODE, bfcode(c));
+ }
+};
+
+
+struct IdentityCMap : public CMap
+{
+ UInt32 cid (UInt32 c) const {return c;}
+ UInt32 bfcode (UInt32 cid) const {return 0;}
+ std::string getROString () const {return "Adobe-Identity";}
+ bool mapsToCID() const {return true;}
+};
+
+
+struct IdentityHCMap : public IdentityCMap
+{
+ bool vertical () const {return false;}
+ const char* name () const {return "Identity-H";}
+};
+
+
+struct IdentityVCMap : public IdentityCMap
+{
+ bool vertical () const {return true;}
+ const char* name () const {return "Identity-V";}
+};
+
+
+struct UnicodeCMap : public CMap
+{
+ bool vertical () const {return false;}
+ const char* name () const {return "unicode";}
+ bool mapsToCID () const {return false;}
+ const char* path () const {return 0;}
+ UInt32 cid (UInt32 c) const {return c;}
+ UInt32 bfcode (UInt32 cid) const {return cid;}
+ std::string getROString () const {return "";}
+};
+
+
+class SegmentedCMap : public CMap
+{
+ friend class CMapReader;
+
+ class Range {
+ friend class SegmentedCMap;
+
+ public:
+ Range () : _min(0), _max(0), _cid(0) {}
+
+ Range (UInt32 min, UInt32 max, UInt32 cid) : _min(min), _max(max), _cid(cid) {
+ if (_min > _max)
+ std::swap(_min, _max);
+ }
+
+ UInt32 min () const {return _min;}
+ UInt32 max () const {return _max;}
+ UInt32 cid () const {return _cid;}
+ UInt32 decode (UInt32 c) const {return c-_min+_cid;}
+ bool operator < (const Range &r) const {return _min < r._min;}
+
+ protected:
+ bool join (const Range &r);
+ void setMinAndAdaptCID (UInt32 c) {_cid = decode(c); _min = c;}
+
+ private:
+ UInt32 _min, _max;
+ UInt32 _cid;
+ };
+
+ typedef std::vector<Range> Ranges;
+
+ public:
+ SegmentedCMap (const std::string &name) : _name(name), _basemap(0), _vertical(false), _mapsToCID(true) {}
+ const char* name () const {return _name.c_str();}
+ UInt32 cid (UInt32 c) const;
+ UInt32 bfcode (UInt32 cid) const;
+ void addCIDRange (UInt32 first, UInt32 last, UInt32 cid) {addRange(_cidranges, first, last, cid);}
+ void addBFRange (UInt32 first, UInt32 last, UInt32 chrcode) {addRange(_bfranges, first, last, chrcode);}
+ void write (std::ostream &os) const;
+ bool vertical () const {return _vertical;}
+ bool mapsToCID () const {return _mapsToCID;}
+ size_t numCIDRanges () const {return _cidranges.size();}
+ size_t numBFRanges () const {return _bfranges.size();}
+ std::string getROString () const;
+
+ protected:
+ void addRange (Ranges &ranges, UInt32 first, UInt32 last, UInt32 cid);
+ void adaptNeighbors (Ranges &ranges, Ranges::iterator it);
+ int lookup (const Ranges &ranges, UInt32 c) const;
+
+ private:
+ std::string _name;
+ std::string _registry;
+ std::string _ordering;
+ CMap *_basemap;
+ bool _vertical;
+ bool _mapsToCID; // true: chrcode->CID, false: CID->charcode
+ Ranges _cidranges;
+ Ranges _bfranges;
+};
+
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.cpp
new file mode 100644
index 00000000000..9322bc3099a
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.cpp
@@ -0,0 +1,140 @@
+/*************************************************************************
+** CMapManager.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include <sstream>
+#include "CMap.h"
+#include "CMapManager.h"
+#include "CMapReader.h"
+#include "Font.h"
+#include "FileFinder.h"
+#include "Message.h"
+
+using namespace std;
+
+
+CMapManager::~CMapManager () {
+ for (CMaps::iterator it=_cmaps.begin(); it != _cmaps.end(); ++it)
+ delete it->second;
+}
+
+
+CMapManager& CMapManager::instance () {
+ static CMapManager cmm;
+ return cmm;
+}
+
+
+/** Loads a cmap and returns the corresponding object. */
+CMap* CMapManager::lookup (const string &name) {
+ CMaps::iterator it = _cmaps.find(name);
+ if (it != _cmaps.end())
+ return it->second;
+
+ if (_includedCMaps.find(name) != _includedCMaps.end()) {
+ _level = 0;
+ ostringstream oss;
+ oss << "circular reference of CMap " << name;
+ throw CMapReaderException(oss.str());
+ }
+
+ CMap *cmap=0;
+ if (name == "Identity-H")
+ cmap = new IdentityHCMap;
+ else if (name == "Identity-V")
+ cmap = new IdentityVCMap;
+ else if (name == "unicode")
+ cmap = new UnicodeCMap;
+ if (cmap) {
+ _cmaps[name] = cmap;
+ return cmap;
+ }
+ // Load cmap data of file <name> and also process all cmaps referenced by operator "usecmap".
+ // This can lead to a sequence of further calls of lookup(). In order to prevent infinite loops
+ // due to (disallowed) circular cmap inclusions, we keep track of all cmaps processed during
+ // a sequence of inclusions.
+ _includedCMaps.insert(name); // save name of current cmap being processed
+ _level++; // increase nesting level
+ try {
+ CMapReader reader;
+ if (!(cmap = reader.read(name))) {
+ _level = 1;
+ Message::wstream(true) << "CMap file '" << name << "' not found\n";
+ }
+ _cmaps[name] = cmap;
+ }
+ catch (const CMapReaderException &e) {
+ Message::estream(true) << "CMap file " << name << ": " << e.what() << "\n";
+ }
+ if (--_level == 0) // back again at initial nesting level?
+ _includedCMaps.clear(); // => names of included cmaps are no longer needed
+ return cmap;
+}
+
+
+/** Looks for a base font CMap and a compatible encoding table in a given font. The CMap describe
+ * the mapping from CIDs to character codes where the latter are relative to the encoding table
+ * identified by charmapID.
+ * cmap:X->CID, bfmap:CID->Y, enctable:Y->CharCode
+ * @param[in] font look for available encoding tables in this font
+ * @param[in] cmap take the source registry-ordering pair from this CMap
+ * @param[out] charmapID ID of the compatible character map found in the given font
+ * @return base font CMap that maps from CIDs to character codes */
+CMap* CMapManager::findCompatibleBaseFontMap (const PhysicalFont *font, const CMap *cmap, CharMapID &charmapID) {
+ if (!font || !cmap)
+ return 0;
+
+ static const struct CharMapIDToEncName {
+ CharMapID id;
+ const char *encname;
+ } encodings[] = {
+ {CharMapID::WIN_UCS4, "UCS4"},
+ {CharMapID::WIN_UCS2, "UCS2"},
+ {CharMapID::WIN_SHIFTJIS, "90ms-RKSJ"},
+ {CharMapID::WIN_PRC, "GBK-EUC"},
+ {CharMapID::WIN_BIG5, "ETen-B5"},
+ {CharMapID::WIN_WANSUNG, "KSCms-UHC"},
+ {CharMapID::MAC_JAPANESE, "90pv-RKSJ"},
+ {CharMapID::MAC_TRADCHINESE, "B5pc"},
+ {CharMapID::MAC_SIMPLCHINESE, "GBpc-EUC"},
+ {CharMapID::MAC_KOREAN, "KSCpc-EUC"}
+ };
+
+ // get IDs of all available charmaps in font
+ vector<CharMapID> charmapIDs;
+ font->collectCharMapIDs(charmapIDs);
+
+ const bool is_unicode_map = dynamic_cast<const UnicodeCMap*>(cmap);
+ const size_t num_encodings = is_unicode_map ? 2 : sizeof(encodings)/sizeof(CharMapIDToEncName);
+
+ // try to find a compatible encoding CMap
+ const string ro = cmap->getROString();
+ for (const CharMapIDToEncName *enc=encodings; enc < enc+num_encodings; enc++) {
+ for (size_t i=0; i < charmapIDs.size(); i++) {
+ if (enc->id == charmapIDs[i]) {
+ string cmapname = ro+"-"+enc->encname;
+ if (is_unicode_map || FileFinder::lookup(cmapname, "cmap", false)) {
+ charmapID = enc->id;
+ return is_unicode_map ? const_cast<CMap*>(cmap) : lookup(cmapname);
+ }
+ }
+ }
+ }
+ return 0;
+}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.h
new file mode 100644
index 00000000000..cb1dbe7a8b1
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapManager.h
@@ -0,0 +1,50 @@
+/*************************************************************************
+** CMapManager.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#ifndef CMAPMANAGER_H
+#define CMAPMANAGER_H
+
+#include <map>
+#include <set>
+#include <string>
+#include "CharMapID.h"
+#include "Font.h"
+
+struct CMap;
+
+class CMapManager
+{
+ typedef std::map<std::string, CMap*> CMaps;
+ public:
+ ~CMapManager ();
+ CMap* lookup (const std::string &name);
+ CMap* findCompatibleBaseFontMap (const PhysicalFont *font, const CMap *cmap, CharMapID &charmapID);
+ static CMapManager& instance ();
+
+ protected:
+ CMapManager () : _level(0) {}
+
+ private:
+ CMaps _cmaps; ///< loaded cmaps
+ int _level; ///< current inclusion depth; >0 if a cmap loaded by "usecmap" is being processed
+ std::set<std::string> _includedCMaps; ///< names of cmaps loaded by "usecmap"
+};
+
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.cpp
new file mode 100644
index 00000000000..c7858ad34b5
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.cpp
@@ -0,0 +1,264 @@
+/*************************************************************************
+** CMapReader.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include <fstream>
+#include <sstream>
+#include "CMap.h"
+#include "CMapManager.h"
+#include "CMapReader.h"
+#include "FileFinder.h"
+#include "InputReader.h"
+
+using namespace std;
+
+
+CMapReader::CMapReader () : _cmap(0), _inCMap(false)
+{
+}
+
+
+/** Reads a cmap file and returns the corresponding CMap object.
+ * @param fname[in] name/path of cmap file
+ * @return CMap object representing the read data, or 0 if file could not be read */
+CMap* CMapReader::read (const string &fname) {
+ if (const char *path = FileFinder::lookup(fname.c_str(), "cmap", false)) {
+ ifstream ifs(path);
+ if (ifs)
+ return read(ifs, fname);
+ }
+ _tokens.clear();
+ return 0;
+}
+
+
+/** Reads cmap data from a given stream and returns the corresponding CMap object.
+ * @param is[in] cmap data input stream
+ * @param is[in] name name of CMap to be read
+ * @return CMap object representing the read data, or 0 if file could not be read */
+CMap* CMapReader::read (std::istream& is, const string &name) {
+ _tokens.clear();
+ _cmap = new SegmentedCMap(name);
+ StreamInputReader ir(is);
+ try {
+ while (ir) {
+ Token token(ir);
+ if (token.type() == Token::TT_EOF)
+ break;
+ if (_inCMap) {
+ if (token.type() == Token::TT_OPERATOR)
+ executeOperator(token.strvalue(), ir);
+ else
+ _tokens.push_back(token);
+ }
+ else if (token.type() == Token::TT_OPERATOR && token.strvalue() == "begincmap")
+ _inCMap = true;
+ }
+ }
+ catch (CMapReaderException &e) {
+ delete _cmap;
+ _cmap = 0;
+ throw;
+ }
+ return _cmap;
+}
+
+
+void CMapReader::executeOperator (const string &op, InputReader &ir) {
+ const struct Operator {
+ const char *name;
+ void (CMapReader::*handler)(InputReader&);
+ } operators[] = {
+ {"beginbfchar", &CMapReader::op_beginbfchar},
+ {"beginbfrange", &CMapReader::op_beginbfrange},
+ {"begincidrange", &CMapReader::op_begincidrange},
+ {"def", &CMapReader::op_def},
+ {"endcmap", &CMapReader::op_endcmap},
+ {"usecmap", &CMapReader::op_usecmap},
+ };
+
+ for (size_t i=0; i < sizeof(operators)/sizeof(Operator); i++) {
+ if (operators[i].name == op) {
+ (this->*operators[i].handler)(ir);
+ break;
+ }
+ }
+ _tokens.clear();
+}
+
+
+void CMapReader::op_def (InputReader&) {
+ size_t size = _tokens.size();
+ if (size >= 2) {
+ const string val = popToken().strvalue();
+ const string name = popToken().strvalue();
+ if (name == "CMapName") {
+ if (val != _cmap->_name)
+ throw CMapReaderException("CMapName doesn't match filename");
+ }
+ else if (name == "WMode") {
+ if (val == "0" || val == "1")
+ _cmap->_vertical = (val == "1");
+ else
+ throw CMapReaderException("invalid WMode (0 or 1 expected)");
+ }
+ else if (name == "Registry")
+ _cmap->_registry = val;
+ else if (name == "Ordering")
+ _cmap->_ordering = val;
+ }
+}
+
+
+void CMapReader::op_endcmap (InputReader &) {
+ _inCMap = false;
+}
+
+
+void CMapReader::op_usecmap (InputReader &) {
+ if (_tokens.empty())
+ throw CMapReaderException("stack underflow while processing usecmap");
+ else {
+ const string name = popToken().strvalue();
+ if ((_cmap->_basemap = CMapManager::instance().lookup(name)) == 0)
+ throw CMapReaderException("CMap file '"+name+"' not found");
+ }
+}
+
+
+static UInt32 parse_hexentry (InputReader &ir) {
+ ir.skipSpace();
+ if (ir.get() != '<')
+ throw CMapReaderException("invalid range entry ('<' expected)");
+ int val;
+ if (!ir.parseInt(16, val))
+ throw CMapReaderException("invalid range entry (hexadecimal value expected)");
+ if (ir.get() != '>')
+ throw CMapReaderException("invalid range entry ('>' expected)");
+ return UInt32(val);
+}
+
+
+void CMapReader::op_begincidrange (InputReader &ir) {
+ if (!_tokens.empty() && _tokens.back().type() == Token::TT_NUMBER) {
+ ir.skipSpace();
+ int num_entries = static_cast<int>(popToken().numvalue());
+ while (num_entries > 0 && ir.peek() == '<') {
+ UInt32 first = parse_hexentry(ir);
+ UInt32 last = parse_hexentry(ir);
+ UInt32 cid;
+ ir.skipSpace();
+ if (!ir.parseUInt(cid))
+ throw CMapReaderException("invalid range entry (decimal value expected)");
+ _cmap->addCIDRange(first, last, cid);
+ ir.skipSpace();
+ }
+ }
+}
+
+
+void CMapReader::op_beginbfrange (InputReader &ir) {
+ if (!_tokens.empty() && _tokens.back().type() == Token::TT_NUMBER) {
+ ir.skipSpace();
+ int num_entries = static_cast<int>(popToken().numvalue());
+ while (num_entries > 0 && ir.peek() == '<') {
+ UInt32 first = parse_hexentry(ir);
+ UInt32 last = parse_hexentry(ir);
+ UInt32 chrcode = parse_hexentry(ir);
+ _cmap->addBFRange(first, last, chrcode);
+ ir.skipSpace();
+ }
+ _cmap->_mapsToCID = false;
+ }
+}
+
+
+void CMapReader::op_beginbfchar (InputReader &ir) {
+ if (!_tokens.empty() && _tokens.back().type() == Token::TT_NUMBER) {
+ ir.skipSpace();
+ int num_entries = static_cast<int>(popToken().numvalue());
+ while (num_entries > 0 && ir.peek() == '<') {
+ UInt32 cid = parse_hexentry(ir);
+ ir.skipSpace();
+ if (ir.peek() == '/')
+ throw CMapReaderException("mapping of named characters is not supported");
+ UInt32 chrcode = parse_hexentry(ir);
+ _cmap->addBFRange(cid, cid, chrcode);
+ ir.skipSpace();
+ }
+ _cmap->_mapsToCID = false;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////////
+
+CMapReader::Token::Token (InputReader &ir) {
+ scan(ir);
+}
+
+
+/** Reads the next characters from the input stream to create a token. */
+void CMapReader::Token::scan (InputReader &ir) {
+ ir.skipSpace();
+ while (ir.peek() == '%') { // comment?
+ while (ir.peek() != '\n') // => skip until end of line
+ ir.get();
+ ir.skipSpace();
+ }
+ ir.skipSpace();
+ if (ir.eof())
+ _type = TT_EOF;
+ else if (ir.peek() == '/') { // PS name?
+ ir.get();
+ while (!strchr("[]{}<>", ir.peek()) && !isspace(ir.peek()))
+ _value += ir.get();
+ _type = TT_NAME;
+ }
+ else if (ir.peek() == '(') { // string?
+ ir.get();
+ int level=0;
+ while (ir.peek() != ')' || level > 0) {
+ if (ir.peek() == '(')
+ level++;
+ else if (ir.peek() == ')' && level > 0)
+ level--;
+ _value += ir.get();
+ }
+ ir.get(); // skip ')'
+ _type = TT_STRING;
+ }
+ else if (strchr("[]{}<>", ir.peek())) { // PS delimiter
+ _value = ir.get();
+ _type = TT_DELIM;
+ }
+ else if (isdigit(ir.peek())) { // number?
+ double val;
+ if (ir.parseDouble(val)) {
+ ostringstream oss;
+ oss << val;
+ _value = oss.str();
+ _type = TT_NUMBER;
+ }
+ }
+ else {
+ while (!strchr("[]{}<>", ir.peek()) && !isspace(ir.peek()))
+ _value += ir.get();
+ _type = TT_OPERATOR;
+ }
+}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.h
new file mode 100644
index 00000000000..4e0ae9ac266
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CMapReader.h
@@ -0,0 +1,81 @@
+/*************************************************************************
+** CMapReader.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#ifndef CMAPREADER_H
+#define CMAPREADER_H
+
+#include <cstdlib>
+#include <istream>
+#include <string>
+#include <vector>
+#include "MessageException.h"
+
+
+struct CMap;
+class InputReader;
+
+class CMapReader
+{
+ class Token
+ {
+ public:
+ enum Type {TT_UNKNOWN, TT_EOF, TT_DELIM, TT_NUMBER, TT_STRING, TT_NAME, TT_OPERATOR};
+
+ public:
+ Token (InputReader &ir);
+ void scan (InputReader &ir);
+ Type type () const {return _type;}
+ const std::string& strvalue () const {return _value;}
+ double numvalue () const {return std::atof(_value.c_str());}
+
+ private:
+ Type _type;
+ std::string _value;
+ };
+
+ public:
+ CMapReader ();
+ CMap* read (const std::string &fname);
+ CMap* read (std::istream &is, const std::string &name);
+
+ protected:
+ Token popToken () {Token t=_tokens.back(); _tokens.pop_back(); return t;}
+ void executeOperator (const std::string &op, InputReader &ir);
+ void op_beginbfchar (InputReader &ir);
+ void op_beginbfrange (InputReader &ir);
+ void op_begincidrange (InputReader &ir);
+ void op_def (InputReader &ir);
+ void op_endcmap (InputReader &ir);
+ void op_usecmap (InputReader &ir);
+
+ private:
+ SegmentedCMap *_cmap; ///< CMap being read
+ std::vector<Token> _tokens; ///< stack of tokens to be processed
+ bool _inCMap; ///< operator begincmap has been executed
+};
+
+
+
+struct CMapReaderException : public MessageException
+{
+ CMapReaderException (const std::string &msg) : MessageException(msg) {}
+};
+
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CRC32.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CRC32.cpp
index 2295ab17bde..2295ab17bde 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CRC32.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CRC32.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CRC32.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CRC32.h
index ca8ec359d0f..ca8ec359d0f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CRC32.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CRC32.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Calculator.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Calculator.cpp
index 2814cc286e0..2814cc286e0 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Calculator.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Calculator.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Calculator.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Calculator.h
index 36bb39d679c..36bb39d679c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Calculator.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Calculator.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.cpp
new file mode 100644
index 00000000000..596e669365f
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.cpp
@@ -0,0 +1,35 @@
+/*************************************************************************
+** CharMapID.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include "CharMapID.h"
+
+const CharMapID CharMapID::WIN_SYMBOL(3, 0);
+const CharMapID CharMapID::WIN_UCS2(3, 1);
+const CharMapID CharMapID::WIN_SHIFTJIS(3, 2);
+const CharMapID CharMapID::WIN_PRC(3, 3);
+const CharMapID CharMapID::WIN_BIG5(3, 4);
+const CharMapID CharMapID::WIN_WANSUNG(3, 5);
+const CharMapID CharMapID::WIN_JOHAB(3, 6);
+const CharMapID CharMapID::WIN_UCS4(3, 10);
+
+const CharMapID CharMapID::MAC_JAPANESE(1, 1);
+const CharMapID CharMapID::MAC_TRADCHINESE(1, 2);
+const CharMapID CharMapID::MAC_KOREAN(1, 3);
+const CharMapID CharMapID::MAC_SIMPLCHINESE(1, 25);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.h
new file mode 100644
index 00000000000..79d6e9bd538
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CharMapID.h
@@ -0,0 +1,58 @@
+/*************************************************************************
+** CharMapID.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#ifndef CHARMAPID_H
+#define CHARMAPID_H
+
+#include "types.h"
+
+/** Represents a character map of a font. */
+struct CharMapID {
+ CharMapID () : platform_id(0), encoding_id(0) {}
+ CharMapID (UInt8 plf_id, UInt8 enc_id) : platform_id(plf_id), encoding_id(enc_id) {}
+
+ bool operator == (const CharMapID &ids) const {
+ return platform_id == ids.platform_id && encoding_id == ids.encoding_id;
+ }
+
+ bool operator != (const CharMapID &ids) const {
+ return platform_id != ids.platform_id || encoding_id != ids.encoding_id;
+ }
+
+ bool valid () const {return platform_id != 0 && encoding_id != 0;}
+
+ static const CharMapID WIN_SYMBOL;
+ static const CharMapID WIN_UCS2;
+ static const CharMapID WIN_SHIFTJIS;
+ static const CharMapID WIN_PRC;
+ static const CharMapID WIN_BIG5;
+ static const CharMapID WIN_WANSUNG;
+ static const CharMapID WIN_JOHAB;
+ static const CharMapID WIN_UCS4;
+ static const CharMapID MAC_JAPANESE;
+ static const CharMapID MAC_TRADCHINESE;
+ static const CharMapID MAC_SIMPLCHINESE;
+ static const CharMapID MAC_KOREAN;
+
+ UInt8 platform_id;
+ UInt8 encoding_id;
+};
+
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Character.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Character.h
new file mode 100644
index 00000000000..8d5a6965af7
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Character.h
@@ -0,0 +1,46 @@
+/*************************************************************************
+** Character.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#ifndef CHARACTER_H
+#define CHARACTER_H
+
+#include "types.h"
+
+class Character
+{
+ public:
+ enum Type {CHRCODE, INDEX, NAME};
+ Character (const char *name) : _type(NAME), _name(name) {}
+ Character (Type type, UInt32 val) : _type(type), _number(val) {}
+ Character (Type type, const Character &c) : _type(type), _number(c.type() != NAME ? c._number : 0) {}
+ Type type () const {return _type;}
+ const char* name () const {return _name;}
+ UInt32 number () const {return _number;}
+
+ private:
+ Type _type;
+ union {
+ UInt32 _number;
+ const char *_name;
+ };
+};
+
+#endif
+
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CmdLineParserBase.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CmdLineParserBase.cpp
index 27b607555b9..a929fd1c00b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CmdLineParserBase.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CmdLineParserBase.cpp
@@ -71,13 +71,13 @@ void CmdLineParserBase::parse (int argc, char **argv, bool printErrors) {
do {
int shortname = ir.get();
if (const Option *opt = option(shortname)) {
- if (!combined || opt->argmode == 0) {
- if (opt->argmode == 'r' && strlen(argv[i]) == 2) { // required argument separated by whitespace?
+ if (!combined || opt->argmode == ARG_NONE) {
+ if (opt->argmode == ARG_REQUIRED && strlen(argv[i]) == 2) { // required argument separated by whitespace?
if (i+1 < argc && argv[i+1][0] != '-')
ib.assign(argv[++i]);
}
(*opt->handler)(this, ir, *opt, false);
- if (opt->argmode == 0)
+ if (opt->argmode == ARG_NONE)
combined = true;
}
else {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CmdLineParserBase.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CmdLineParserBase.h
index 35e20e3735c..b37cbb0863c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CmdLineParserBase.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CmdLineParserBase.h
@@ -53,11 +53,13 @@ class CmdLineParserBase
LocalHandler _handler;
};
+ enum ArgMode {ARG_NONE, ARG_OPTIONAL, ARG_REQUIRED};
+
struct Option {
~Option () {delete handler;}
char shortname;
const char *longname;
- char argmode; // mode of option argument: '\0'=none, 'o'=optional, 'r'=required
+ ArgMode argmode; // mode of option argument
const OptionHandler *handler;
};
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Color.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Color.cpp
index 45d5ce453da..b81ded6efc5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Color.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Color.cpp
@@ -18,7 +18,10 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
+#include <cctype>
#include <cmath>
+#include <cstdlib>
+#include <cstring>
#include <iomanip>
#include <sstream>
#include "Color.h"
@@ -26,14 +29,32 @@
using namespace std;
-
-const Color Color::BLACK(0);
+const Color Color::BLACK(UInt32(0));
const Color Color::WHITE(UInt8(255), UInt8(255), UInt8(255));
-const Color Color::TRANSPARENT(0xff000000);
+const Color Color::TRANSPARENT(UInt32(0xff000000));
static inline UInt8 float_to_byte (float v) {
- return (UInt8) (floor(255*v+0.5));
+ v = max(0.0f, min(1.0f, v));
+ return UInt8(floor(255*v+0.5));
+}
+
+
+static void tolower (string &str) {
+ for (size_t i=0; i < str.length(); i++)
+ str[i] = tolower(str[i]);
+}
+
+
+Color::Color (const char *name) {
+ if (!set(name, false))
+ setGray(UInt8(0));
+}
+
+
+Color::Color (const string &name) {
+ if (!set(name, false))
+ setGray(UInt8(0));
}
@@ -42,6 +63,120 @@ void Color::set (float r, float g, float b) {
}
+bool Color::set (string name, bool case_sensitive) {
+ if (name[0] == '#') {
+ char *p=0;
+ _rgb = UInt32(strtol(name.c_str()+1, &p, 16));
+ while (isspace(*p))
+ p++;
+ return (*p == 0 && _rgb <= 0xFFFFFF);
+ }
+ // converted color constants from color.pro
+ static const struct ColorConstant {
+ const char *name;
+ const UInt32 rgb;
+ }
+ constants[] = {
+ {"Apricot", 0xFFAD7A},
+ {"Aquamarine", 0x2DFFB2},
+ {"Bittersweet", 0xC10200},
+ {"Black", 0x000000},
+ {"Blue", 0x0000FF},
+ {"BlueGreen", 0x26FFAA},
+ {"BlueViolet", 0x190CF4},
+ {"BrickRed", 0xB70000},
+ {"Brown", 0x660000},
+ {"BurntOrange", 0xFF7C00},
+ {"CadetBlue", 0x606DC4},
+ {"CarnationPink", 0xFF5EFF},
+ {"Cerulean", 0x0FE2FF},
+ {"CornflowerBlue", 0x59DDFF},
+ {"Cyan", 0x00FFFF},
+ {"Dandelion", 0xFFB528},
+ {"DarkOrchid", 0x9932CC},
+ {"Emerald", 0x00FF7F},
+ {"ForestGreen", 0x00E000},
+ {"Fuchsia", 0x7202EA},
+ {"Goldenrod", 0xFFE528},
+ {"Gray", 0x7F7F7F},
+ {"Green", 0x00FF00},
+ {"GreenYellow", 0xD8FF4F},
+ {"JungleGreen", 0x02FF7A},
+ {"Lavender", 0xFF84FF},
+ {"LimeGreen", 0x7FFF00},
+ {"Magenta", 0xFF00FF},
+ {"Mahogany", 0xA50000},
+ {"Maroon", 0xAD0000},
+ {"Melon", 0xFF897F},
+ {"MidnightBlue", 0x007091},
+ {"Mulberry", 0xA314F9},
+ {"NavyBlue", 0x0F75FF},
+ {"OliveGreen", 0x009900},
+ {"Orange", 0xFF6321},
+ {"OrangeRed", 0xFF007F},
+ {"Orchid", 0xAD5BFF},
+ {"Peach", 0xFF7F4C},
+ {"Periwinkle", 0x6D72FF},
+ {"PineGreen", 0x00BF28},
+ {"Plum", 0x7F00FF},
+ {"ProcessBlue", 0x0AFFFF},
+ {"Purple", 0x8C23FF},
+ {"RawSienna", 0x8C0000},
+ {"Red", 0xFF0000},
+ {"RedOrange", 0xFF3A21},
+ {"RedViolet", 0x9600A8},
+ {"Rhodamine", 0xFF2DFF},
+ {"RoyalBlue", 0x007FFF},
+ {"RoyalPurple", 0x3F19FF},
+ {"RubineRed", 0xFF00DD},
+ {"Salmon", 0xFF779E},
+ {"SeaGreen", 0x4FFF7F},
+ {"Sepia", 0x4C0000},
+ {"SkyBlue", 0x60FFE0},
+ {"SpringGreen", 0xBCFF3D},
+ {"Tan", 0xDB9370},
+ {"TealBlue", 0x1EF9A3},
+ {"Thistle", 0xE068FF},
+ {"Turquoise", 0x26FFCC},
+ {"Violet", 0x351EFF},
+ {"VioletRed", 0xFF30FF},
+ {"White", 0xFFFFFF},
+ {"WildStrawberry", 0xFF0A9B},
+ {"Yellow", 0xFFFF00},
+ {"YellowGreen", 0x8EFF42},
+ {"YellowOrange", 0xFF9300},
+ };
+ if (!case_sensitive) {
+ tolower(name);
+ for (size_t i=0; i < sizeof(constants)/sizeof(ColorConstant); i++) {
+ string cmpname = constants[i].name;
+ tolower(cmpname);
+ if (name == cmpname) {
+ _rgb = constants[i].rgb;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // binary search
+ int first=0, last=sizeof(constants)/sizeof(ColorConstant)-1;
+ while (first <= last) {
+ int mid = first+(last-first)/2;
+ int cmp = strcmp(constants[mid].name, name.c_str());
+ if (cmp > 0)
+ last = mid-1;
+ else if (cmp < 0)
+ first = mid+1;
+ else {
+ _rgb = constants[mid].rgb;
+ return true;
+ }
+ }
+ return false;
+}
+
+
void Color::setHSB (float h, float s, float b) {
vector<float> hsb(3), rgb(3);
hsb[0] = h;
@@ -90,7 +225,7 @@ string Color::rgbString () const {
* @param[out] rgb RGB approximation */
void Color::CMYK2RGB (const vector<float> &cmyk, vector<float> &rgb) {
for (int i=0; i < 3; i++)
- rgb[i] = 1.0f-min(1.0f, cmyk[i]+cmyk[3]);
+ rgb[i] = 1.0f-max(0.0f, min(1.0f, cmyk[i]+cmyk[3]));
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Color.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Color.h
index 24b33c7bb95..56a69dd2da8 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Color.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Color.h
@@ -42,11 +42,14 @@ class Color
Color (UInt8 r, UInt8 g, UInt8 b) {set(r,g,b);}
Color (float r, float g, float b) {set(r,g,b);}
Color (const std::vector<float> &rgb) {set(rgb[0], rgb[1], rgb[2]);}
+ Color (const char *name);
+ Color (const std::string &name);
operator UInt32 () const {return _rgb;}
bool operator == (const Color &c) {return _rgb == c._rgb;}
bool operator != (const Color &c) {return _rgb != c._rgb;}
void set (UInt8 r, UInt8 g, UInt8 b) {_rgb = (r << 16) | (g << 8) | b;}
void set (float r, float g, float b);
+ bool set (std::string name, bool case_sensitive=true);
void setGray (UInt8 g) {set(g,g,g);}
void setGray (float g) {set(g,g,g);}
void setHSB (float h, float s, float b);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/ColorSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/ColorSpecialHandler.cpp
new file mode 100644
index 00000000000..912f43cc5ac
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/ColorSpecialHandler.cpp
@@ -0,0 +1,125 @@
+/*************************************************************************
+** ColorSpecialHandler.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include <algorithm>
+#include <cmath>
+#include <cstring>
+#include <iomanip>
+#include <sstream>
+#include <vector>
+#include "ColorSpecialHandler.h"
+#include "SpecialActions.h"
+
+using namespace std;
+
+
+static float read_float (istream &is) {
+ is.clear();
+ float v;
+ is >> v;
+ if (is.fail())
+ throw SpecialException("number expected");
+ return v;
+}
+
+
+/** Reads multiple float values from a given stream. The number of
+ * values read is determined by the size of the result vector.
+ * @param[in] is stream to be read from
+ * @param[out] v the resulting floats */
+static void read_floats (istream &is, vector<float> &v) {
+ for (size_t i=0; i < v.size(); i++)
+ v[i] = read_float(is);
+}
+
+
+/** Reads a color statement from an input stream and converts it to RGB.
+ * A color statement has the following syntax:
+ * <color model> <component values>
+ * Currently, the following color models are supported: rgb, cmyk, hsb and gray.
+ * Examples: rgb 1 0.5 0, gray 0.5
+ * @param[in] model if model != "" this value specifies the model, otherwise it's read from the stream
+ * @param[in] is stream to be read from
+ * @param[out] resulting RGB triple
+ * @return true if statement has successfully been read */
+static void read_color (string model, istream &is, Color &color) {
+ if (model.empty())
+ is >> model;
+ if (model == "rgb") {
+ vector<float> rgb(3);
+ read_floats(is, rgb);
+ color.set(rgb[0], rgb[1], rgb[2]);
+ }
+ else if (model == "cmyk") {
+ vector<float> cmyk(4);
+ read_floats(is, cmyk);
+ color.setCMYK(cmyk[0], cmyk[1], cmyk[2], cmyk[3]);
+ }
+ else if (model == "hsb") {
+ vector<float> hsb(3);
+ read_floats(is, hsb);
+ color.setHSB(hsb[0], hsb[1], hsb[2]);
+ }
+ else if (model == "gray")
+ color.setGray(read_float(is));
+ else if (!color.set(model, true))
+ throw SpecialException("unknown color statement");
+}
+
+
+bool ColorSpecialHandler::process (const char *prefix, istream &is, SpecialActions *actions) {
+ Color color;
+ if (prefix && strcmp(prefix, "background") == 0) {
+ read_color("", is, color);
+ actions->setBgColor(color);
+ }
+ else {
+ string cmd;
+ is >> cmd;
+ if (cmd == "push") { // color push <model> <params>
+ read_color("", is, color);
+ _colorStack.push(color);
+ }
+ else if (cmd == "pop") {
+ if (!_colorStack.empty()) // color pop
+ _colorStack.pop();
+ }
+ else { // color <model> <params>
+ read_color(cmd, is, color);
+ while (!_colorStack.empty())
+ _colorStack.pop();
+ _colorStack.push(color);
+ }
+ if (actions) {
+ if (_colorStack.empty())
+ actions->setColor(Color::BLACK);
+ else
+ actions->setColor(_colorStack.top());
+ }
+ }
+ return true;
+}
+
+
+const char** ColorSpecialHandler::prefixes () const {
+ static const char *pfx[] = {"color", 0};
+ return pfx;
+}
+
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/ColorSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/ColorSpecialHandler.h
index a9b73dc8b74..b5559481b00 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/ColorSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/ColorSpecialHandler.h
@@ -23,13 +23,12 @@
#include <stack>
#include <vector>
+#include "Color.h"
#include "SpecialHandler.h"
class ColorSpecialHandler : public SpecialHandler
{
- typedef std::vector<float> RGB;
-
public:
bool process (const char *prefix, std::istream &is, SpecialActions *actions);
const char* name () const {return "color";}
@@ -37,7 +36,7 @@ class ColorSpecialHandler : public SpecialHandler
const char** prefixes () const;
private:
- std::stack<RGB> _colorStack;
+ std::stack<Color> _colorStack;
};
#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CommandLine.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CommandLine.cpp
index 7f3ca4a0e63..bb5f866d06b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CommandLine.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CommandLine.cpp
@@ -13,39 +13,39 @@
using namespace std;
const CmdLineParserBase::Option CommandLine::_options[] = {
- {'b', "bbox", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_bbox)},
- {'C', "cache", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_cache)},
- {'\0', "color", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_color)},
+ {'b', "bbox", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_bbox)},
+ {'C', "cache", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_cache)},
+ {'\0', "color", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_color)},
#if !defined(DISABLE_GS)
- {'E', "eps", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_eps)},
+ {'E', "eps", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_eps)},
#endif
- {'e', "exact", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_exact)},
- {'m', "fontmap", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_fontmap)},
- {'h', "help", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_help)},
- {'\0', "keep", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_keep)},
+ {'e', "exact", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_exact)},
+ {'m', "fontmap", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_fontmap)},
+ {'h', "help", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_help)},
+ {'\0', "keep", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_keep)},
#if !defined(HAVE_LIBGS) && !defined(DISABLE_GS)
- {'\0', "libgs", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_libgs)},
+ {'\0', "libgs", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_libgs)},
#endif
- {'L', "linkmark", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_linkmark)},
- {'l', "list-specials", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_list_specials)},
- {'M', "mag", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_mag)},
- {'n', "no-fonts", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_fonts)},
- {'\0', "no-mktexmf", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_mktexmf)},
- {'S', "no-specials", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_specials)},
- {'\0', "no-styles", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_styles)},
- {'o', "output", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_output)},
- {'p', "page", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_page)},
- {'d', "precision", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_precision)},
- {'P', "progress", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_progress)},
- {'r', "rotate", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_rotate)},
- {'c', "scale", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_scale)},
- {'s', "stdout", 0, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_stdout)},
- {'a', "trace-all", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_trace_all)},
- {'T', "transform", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_transform)},
- {'t', "translate", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_translate)},
- {'v', "verbosity", 'r', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_verbosity)},
- {'V', "version", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_version)},
- {'z', "zip", 'o', new OptionHandlerImpl<CommandLine>(&CommandLine::handle_zip)},
+ {'L', "linkmark", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_linkmark)},
+ {'l', "list-specials", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_list_specials)},
+ {'M', "mag", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_mag)},
+ {'n', "no-fonts", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_fonts)},
+ {'\0', "no-mktexmf", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_mktexmf)},
+ {'S', "no-specials", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_specials)},
+ {'\0', "no-styles", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_no_styles)},
+ {'o', "output", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_output)},
+ {'p', "page", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_page)},
+ {'d', "precision", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_precision)},
+ {'P', "progress", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_progress)},
+ {'r', "rotate", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_rotate)},
+ {'c', "scale", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_scale)},
+ {'s', "stdout", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_stdout)},
+ {'a', "trace-all", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_trace_all)},
+ {'T', "transform", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_transform)},
+ {'t', "translate", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_translate)},
+ {'v', "verbosity", ARG_REQUIRED, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_verbosity)},
+ {'V', "version", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_version)},
+ {'z', "zip", ARG_OPTIONAL, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_zip)},
};
const CmdLineParserBase::Option* CommandLine::options (size_t *numopts) const {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CommandLine.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CommandLine.h
index e1611191816..e1611191816 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/CommandLine.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/CommandLine.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DLLoader.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DLLoader.cpp
index 30317455ba6..30317455ba6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DLLoader.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DLLoader.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DLLoader.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DLLoader.h
index 3052d13714e..3052d13714e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DLLoader.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DLLoader.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIActions.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIActions.cpp
index f9c95dc3754..f9c95dc3754 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIActions.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIActions.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIActions.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIActions.h
index 9bb7186e60c..53edb402615 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIActions.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIActions.h
@@ -41,9 +41,10 @@ struct DVIActions
virtual void setRule (double x, double y, double height, double width) {}
virtual void moveToX (double x) {}
virtual void moveToY (double y) {}
+ virtual bool fontProcessingEnabled () const {return true;}
virtual void defineFont (int num, const Font *font) {}
virtual void setFont (int num, const Font *font) {}
- virtual void special (const std::string &s) {}
+ virtual void special (const std::string &s, double dvi2pt) {}
virtual void preamble (const std::string &cmt) {}
virtual void postamble () {}
virtual void beginPage (unsigned pageno, Int32 *c) {}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIReader.cpp
index 323580fef51..fbde83c40be 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIReader.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIReader.cpp
@@ -463,6 +463,9 @@ void DVIReader::putChar (UInt32 c, bool moveCursor) {
if (!_inPage)
throw DVIException("set_char or put_char outside of page");
+ if (_actions && !_actions->fontProcessingEnabled())
+ return;
+
FontManager &fm = FontManager::instance();
Font *font = fm.getFont(_currFontNum);
if (!font)
@@ -587,7 +590,7 @@ void DVIReader::cmdXXX (int len) {
UInt32 numBytes = readUnsigned(len);
string s = readString(numBytes);
if (_actions)
- _actions->special(s);
+ _actions->special(s, _scaleFactor);
}
else
throw DVIException("special outside of page");
@@ -598,6 +601,9 @@ void DVIReader::cmdXXX (int len) {
* @param[in] num font number
* @throw DVIException if font number is undefined */
void DVIReader::cmdFontNum0 (int num) {
+ if (_actions && !_actions->fontProcessingEnabled())
+ return;
+
if (Font *font = FontManager::instance().getFont(num)) {
_currFontNum = num;
if (_actions && !dynamic_cast<VirtualFont*>(font))
@@ -627,7 +633,9 @@ void DVIReader::cmdFontNum (int len) {
* @param[in] ds design size in TeX point units
* @param[in] ss scaled size in TeX point units */
void DVIReader::defineFont (UInt32 fontnum, const string &name, UInt32 cs, double ds, double ss) {
- FontManager &fm = FontManager::instance();
+ if (_actions && !_actions->fontProcessingEnabled())
+ return;
+ FontManager &fm = FontManager::instance();
int id = fm.registerFont(fontnum, name, cs, ds, ss);
Font *font = fm.getFontById(id);
if (VirtualFont *vf = dynamic_cast<VirtualFont*>(font)) {
@@ -640,7 +648,7 @@ void DVIReader::defineFont (UInt32 fontnum, const string &name, UInt32 cs, doubl
fm.leaveVF();
}
if (_actions)
- _actions->defineFont(id, font);
+ _actions->defineFont(id, font);
}
@@ -669,8 +677,8 @@ void DVIReader::cmdFontDef (int len) {
* @param[in] dsize design size in TeX point units
* @param[in] ssize scaled size in TeX point units */
void DVIReader::defineVFFont (UInt32 fontnum, string path, string name, UInt32 checksum, double dsize, double ssize) {
- VirtualFont *vf = FontManager::instance().getVF();
- defineFont(fontnum, name, checksum, dsize, ssize * vf->scaleFactor());
+ if (VirtualFont *vf = FontManager::instance().getVF())
+ defineFont(fontnum, name, checksum, dsize, ssize * vf->scaleFactor());
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIReader.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIReader.h
index 2d24d6b24f6..2d24d6b24f6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIReader.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIReader.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVG.cpp
index cfa246f0f09..5265a592199 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVG.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVG.cpp
@@ -47,12 +47,6 @@
#include "PageRanges.h"
#include "PageSize.h"
#include "SVGOutputBase.h"
-#include "SVGTree.h"
-#include "TFM.h"
-#include "XMLDocument.h"
-#include "XMLDocTypeNode.h"
-#include "XMLNode.h"
-#include "XMLString.h"
//
///////////////////////////////////
// special handlers
@@ -91,10 +85,18 @@ class PSHeaderActions : public DVIActions
public :
PSHeaderActions (DVIToSVG &dvisvg) : _dvisvg(dvisvg) {}
- void special (const std::string &s) {
+ void special (const std::string &str, double dvi2pt) {
// execute PS headers only
- if (!s.empty() && (s[0] == '!' || s.substr(0, 7) == "header="))
- _dvisvg.specialManager().process(s, 0);
+ if (!str.empty() && (str[0] == '!' || str.substr(0, 7) == "header="))
+ _dvisvg.specialManager().process(str, dvi2pt, 0);
+ }
+
+ bool fontProcessingEnabled () const {
+ return false;
+ }
+
+ void endPage (unsigned) {
+ _dvisvg.specialManager().leavePSHeaderSection();
}
BoundingBox& bbox () {return _bbox;}
@@ -142,14 +144,19 @@ void DVIToSVG::convert (unsigned first, unsigned last, pair<int,int> *pageinfo)
}
last = min(last, getTotalPages());
- if (first > 1) {
- // ensure loading of PostScript prologues given at the beginning of the first page
- // (prologue files are always referenced in first page)
- PSHeaderActions headerActions(*this);
- DVIActions *save = replaceActions(&headerActions);
+ // ensure loading of PostScript prologues given at the beginning of the first page
+ // (prologue files are always referenced in first page)
+ PSHeaderActions headerActions(*this);
+ DVIActions *save = replaceActions(&headerActions);
+ try {
executePage(1);
replaceActions(save);
}
+ catch (PSException &e) {
+ replaceActions(save);
+ throw;
+ }
+
for (unsigned i=first; i <= last; ++i) {
executePage(i);
embedFonts(_svg.rootNode());
@@ -209,21 +216,12 @@ void DVIToSVG::endPage (unsigned pageno) {
_specialManager.notifyEndPage(pageno);
// set bounding box and apply page transformations
BoundingBox &bbox = getActions()->bbox();
- if (!_transCmds.empty()) {
- Calculator calc;
- calc.setVariable("ux", bbox.minX());
- calc.setVariable("uy", bbox.minY());
- calc.setVariable("w", bbox.width());
- calc.setVariable("h", bbox.height());
- calc.setVariable("pt", 1);
- calc.setVariable("in", 72.27);
- calc.setVariable("cm", 72.27/2.54);
- calc.setVariable("mm", 72.27/25.4);
- Matrix matrix(_transCmds, calc);
- static_cast<DVIToSVGActions*>(getActions())->setPageMatrix(matrix);
- if (_bboxString == "min")
- bbox.transform(matrix);
- }
+ bbox.unlock();
+ Matrix matrix;
+ getPageTransformation(matrix);
+ static_cast<DVIToSVGActions*>(getActions())->setPageMatrix(matrix);
+ if (_bboxString == "min")
+ bbox.transform(matrix);
if (string("dvi none min").find(_bboxString) == string::npos) {
istringstream iss(_bboxString);
StreamInputReader ir(iss);
@@ -259,16 +257,37 @@ void DVIToSVG::endPage (unsigned pageno) {
_svg.setBBox(bbox);
Message::mstream(false) << '\n';
- Message::mstream(false, Message::MC_PAGE_SIZE) << "page size: " << bbox.width() << "pt"
- " x " << bbox.height() << "pt"
- " (" << bbox.width()/72.27*25.4 << "mm"
- " x " << bbox.height()/72.27*25.4 << "mm)";
+ Message::mstream(false, Message::MC_PAGE_SIZE) << "page size: " << XMLString(bbox.width()) << "pt"
+ " x " << XMLString(bbox.height()) << "pt"
+ " (" << XMLString(bbox.width()/72.27*25.4) << "mm"
+ " x " << XMLString(bbox.height()/72.27*25.4) << "mm)";
Message::mstream(false) << '\n';
}
}
}
+void DVIToSVG::getPageTransformation(Matrix &matrix) const {
+ if (_transCmds.empty())
+ matrix.set(1); // unity matrix
+ else {
+ Calculator calc;
+ if (getActions()) {
+ BoundingBox &bbox = getActions()->bbox();
+ calc.setVariable("ux", bbox.minX());
+ calc.setVariable("uy", bbox.minY());
+ calc.setVariable("w", bbox.width());
+ calc.setVariable("h", bbox.height());
+ }
+ calc.setVariable("pt", 1);
+ calc.setVariable("in", 72.27);
+ calc.setVariable("cm", 72.27/2.54);
+ calc.setVariable("mm", 72.27/25.4);
+ matrix.set(_transCmds, calc);
+ }
+}
+
+
static void collect_chars (map<const Font*, set<int> > &fm) {
typedef const map<const Font*, set<int> > UsedCharsMap;
FORALL(fm, UsedCharsMap::const_iterator, it) {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVG.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVG.h
index 309c6204c23..b69bfeca297 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVG.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVG.h
@@ -28,6 +28,7 @@
#include "SpecialManager.h"
#include "SVGTree.h"
+class Matrix;
struct SVGOutputBase;
class DVIToSVG : public DVIReader
@@ -38,9 +39,10 @@ class DVIToSVG : public DVIReader
void convert (unsigned firstPage, unsigned lastPage, std::pair<int,int> *pageinfo=0);
void convert (const std::string &range, std::pair<int,int> *pageinfo=0);
const SpecialManager* setProcessSpecials (const char *ignorelist=0, bool pswarning=false);
- const SpecialManager& specialManager () const {return _specialManager;}
- void setPageSize (const std::string &name) {_bboxString = name;}
- void setTransformation (const std::string &cmds) {_transCmds = cmds;}
+ const SpecialManager& specialManager () const {return _specialManager;}
+ void setPageSize (const std::string &name) {_bboxString = name;}
+ void setPageTransformation (const std::string &cmds) {_transCmds = cmds;}
+ void getPageTransformation (Matrix &matrix) const;
public:
static char TRACE_MODE;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVGActions.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVGActions.cpp
index 15bf47824e0..c46352a6001 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVGActions.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVGActions.cpp
@@ -175,10 +175,11 @@ void DVIToSVGActions::setFont (int num, const Font *font) {
/** This method is called when a "special" command was found in the DVI file.
- * @param[in] s the special expression */
-void DVIToSVGActions::special (const string &s) {
+ * @param[in] s the special expression
+ * @param[in] dvi2pt factor to scale DVI units to TeX points */
+void DVIToSVGActions::special (const string &s, double dvi2pt) {
try {
- _dvisvg.specialManager().process(s, this, this);
+ _dvisvg.specialManager().process(s, dvi2pt, this, this);
// @@ output message in case of unsupported specials?
}
catch (const SpecialException &e) {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVGActions.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVGActions.h
index f89f95e2ca9..731aedc9a31 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DVIToSVGActions.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DVIToSVGActions.h
@@ -50,19 +50,20 @@ class DVIToSVGActions : public DVIActions, public SpecialActions, public Special
void setChar (double x, double y, unsigned c, const Font *f);
void setRule (double x, double y, double height, double width);
void setBgColor (const Color &color);
- void setColor (const Color &color) {_svg.setColor(color);}
- void setMatrix (const Matrix &m) {_svg.setMatrix(m);}
- const Matrix& getMatrix () const {return _svg.getMatrix();}
- Color getColor () const {return _svg.getColor();}
- void appendToPage (XMLNode *node) {_svg.appendToPage(node);}
- void appendToDefs (XMLNode *node) {_svg.appendToDefs(node);}
- void prependToPage (XMLNode *node) {_svg.prependToPage(node);}
- void pushContextElement (XMLElementNode *node) {_svg.pushContextElement(node);}
- void popContextElement () {_svg.popContextElement();}
+ void setColor (const Color &color) {_svg.setColor(color);}
+ void setMatrix (const Matrix &m) {_svg.setMatrix(m);}
+ const Matrix& getMatrix () const {return _svg.getMatrix();}
+ void getPageTransform (Matrix &matrix) const {_dvisvg.getPageTransformation(matrix);}
+ Color getColor () const {return _svg.getColor();}
+ void appendToPage (XMLNode *node) {_svg.appendToPage(node);}
+ void appendToDefs (XMLNode *node) {_svg.appendToDefs(node);}
+ void prependToPage (XMLNode *node) {_svg.prependToPage(node);}
+ void pushContextElement (XMLElementNode *node) {_svg.pushContextElement(node);}
+ void popContextElement () {_svg.popContextElement();}
void moveToX (double x);
void moveToY (double y);
void setFont (int num, const Font *font);
- void special (const std::string &s);
+ void special (const std::string &s, double dvi2pt);
void preamble (const std::string &cmt);
void postamble ();
void beginPage (unsigned pageno, Int32 *c);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Directory.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Directory.cpp
index c13ebe35a38..c13ebe35a38 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Directory.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Directory.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Directory.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Directory.h
index 6420bec6d19..6420bec6d19 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Directory.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Directory.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DvisvgmSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DvisvgmSpecialHandler.cpp
index 11e3c0fc42a..11e3c0fc42a 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DvisvgmSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DvisvgmSpecialHandler.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DvisvgmSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DvisvgmSpecialHandler.h
index 93e726fe634..93e726fe634 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/DvisvgmSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/DvisvgmSpecialHandler.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSFile.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSFile.cpp
index cbeb5600366..cbeb5600366 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSFile.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSFile.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSFile.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSFile.h
index 60a4c007d39..60a4c007d39 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSFile.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSFile.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSToSVG.cpp
index 0a5e03f33e4..f8dccd2b9a4 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSToSVG.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSToSVG.cpp
@@ -52,6 +52,8 @@ void EPSToSVG::convert () {
BoundingBox bbox;
epsfile.bbox(bbox);
+ if (bbox.width() == 0 || bbox.height() == 0)
+ Message::wstream(true) << "bounding box of file " << _fname << " is empty\n";
Message::mstream(false, Message::MC_PAGE_NUMBER) << "processing file " << _fname << '\n';
Message::mstream().indent(1);
_svg.newPage(1);
@@ -69,10 +71,10 @@ void EPSToSVG::convert () {
_svg.appendToDoc(new XMLCommentNode(" This file was generated by dvisvgm " VERSION_STR " "));
_svg.write(_out.getPageStream(1, 1));
string svgfname = _out.filename(1, 1);
- Message::mstream(false, Message::MC_PAGE_SIZE) << "graphic size: " << bbox.width() << "pt"
- " x " << bbox.height() << "pt"
- " (" << bbox.width()/72.27*25.4 << "mm"
- " x " << bbox.height()/72.27*25.4 << "mm)\n";
+ Message::mstream(false, Message::MC_PAGE_SIZE) << "graphic size: " << XMLString(bbox.width()) << "pt"
+ " x " << XMLString(bbox.height()) << "pt"
+ " (" << XMLString(bbox.width()/72.27*25.4) << "mm"
+ " x " << XMLString(bbox.height()/72.27*25.4) << "mm)\n";
Message::mstream(false, Message::MC_PAGE_WRITTEN) << "graphic written to " << (svgfname.empty() ? "<stdout>" : svgfname) << '\n';
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSToSVG.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSToSVG.h
index 3d97ce465e2..46360e820a5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EPSToSVG.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EPSToSVG.h
@@ -46,6 +46,7 @@ class EPSToSVG : protected SpecialActions
Color getColor () const {return _svg.getColor();}
void setMatrix (const Matrix &m) {_svg.setMatrix(m);}
const Matrix& getMatrix () const {return _svg.getMatrix();}
+ void getPageTransform (Matrix &matrix) const {}
void setBgColor (const Color &color) {}
void appendToPage (XMLNode *node) {_svg.appendToPage(node);}
void appendToDefs (XMLNode *node) {_svg.appendToDefs(node);}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EmSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EmSpecialHandler.cpp
index dbd1fd4b169..dbd1fd4b169 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EmSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EmSpecialHandler.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EmSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EmSpecialHandler.h
index 56cb934b385..56cb934b385 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/EmSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EmSpecialHandler.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEncoding.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EncFile.cpp
index c506292362c..ea8dc418cf5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEncoding.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EncFile.cpp
@@ -1,5 +1,5 @@
/*************************************************************************
-** FontEncoding.cpp **
+** EncFile.cpp **
** **
** This file is part of dvisvgm -- the DVI to SVG converter **
** Copyright (C) 2005-2013 Martin Gieseking <martin.gieseking@uos.de> **
@@ -20,7 +20,7 @@
#include <fstream>
#include "Font.h"
-#include "FontEncoding.h"
+#include "EncFile.h"
#include "FontMap.h"
#include "InputBuffer.h"
#include "InputReader.h"
@@ -33,20 +33,20 @@ static string read_entry (InputReader &in);
static bool valid_name_char (int c);
-FontEncoding::FontEncoding (const string &encname) : _encname(encname)
+EncFile::EncFile (const string &encname) : _encname(encname)
{
read();
}
-const char* FontEncoding::path () const {
+const char* EncFile::path () const {
return FileFinder::lookup(_encname+".enc", false);
}
/** Search for suitable enc-file and read its encoding information.
* The file contents must be a valid PostScript vector with 256 entries. */
-void FontEncoding::read () {
+void EncFile::read () {
if (const char *p = path()) {
ifstream ifs(p);
read(ifs);
@@ -57,7 +57,7 @@ void FontEncoding::read () {
/** Read encoding information from stream. */
-void FontEncoding::read (istream &is) {
+void EncFile::read (istream &is) {
StreamInputBuffer ib(is, 256);
BufferInputReader in(ib);
_table.resize(256);
@@ -126,39 +126,8 @@ static bool valid_name_char (int c) {
/** Returns an entry of the encoding table.
* @param[in] c character code
* @return character name assigned to character code c*/
-const char* FontEncoding::getEntry (int c) const {
- if (c >= 0 && (size_t)c < _table.size())
+const char* EncFile::charName (UInt32 c) const {
+ if (c < _table.size())
return !_table[c].empty() ? _table[c].c_str() : 0;
return 0;
}
-
-
-struct EncodingMap : public map<string, FontEncoding*>
-{
- ~EncodingMap () {
- for (EncodingMap::iterator it=begin(); it != end(); ++it)
- delete it->second;
- }
-};
-
-
-/** Returns the encoding of a font.
- * @param[in] fontname name of font whose encoding will be returned
- * @return pointer to encoding object, or 0 if there is no encoding defined */
-FontEncoding* FontEncoding::encoding (string fontname) {
- static EncodingMap encmap;
- size_t pos = fontname.rfind('.');
- if (pos != string::npos)
- fontname = fontname.substr(0, pos); // strip extension
- if (const FontMap::Entry *entry = FontMap::instance().lookup(fontname)) {
- EncodingMap::const_iterator it = encmap.find(entry->encname);
- if (it != encmap.end())
- return it->second;
- if (FileFinder::lookup(entry->encname + ".enc", false)) {
- FontEncoding *enc = new FontEncoding(entry->encname);
- encmap[entry->encname] = enc;
- return enc;
- }
- }
- return 0;
-} \ No newline at end of file
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEncoding.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EncFile.h
index 3170d850256..29a11b0b352 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEncoding.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/EncFile.h
@@ -1,5 +1,5 @@
/*************************************************************************
-** FontEncoding.h **
+** EncFile.h **
** **
** This file is part of dvisvgm -- the DVI to SVG converter **
** Copyright (C) 2005-2013 Martin Gieseking <martin.gieseking@uos.de> **
@@ -18,27 +18,28 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
-#ifndef FONTENCODING_H
-#define FONTENCODING_H
+#ifndef ENCFILE_H
+#define ENCFILE_H
#include <istream>
#include <map>
#include <string>
#include <vector>
+#include "FontEncoding.h"
#include "types.h"
-class FontEncoding
+class EncFile : public FontEncoding
{
public:
- FontEncoding (const std::string &name);
+ EncFile (const std::string &name);
void read ();
void read (std::istream &is);
int size () const {return _table.size();}
- std::string name () const {return _encname;}
- const char* getEntry (int c) const;
+ const char* name () const {return _encname.c_str();}
+ const char* charName (UInt32 c) const;
+ Character decode (UInt32 c) const {return Character(charName(c));}
const char* path () const;
- static FontEncoding* encoding (std::string fontname);
private:
std::string _encname;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileFinder.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileFinder.cpp
index 69f72206280..0fec710b4ac 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileFinder.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileFinder.cpp
@@ -18,12 +18,22 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef MIKTEX
#include "MessageException.h"
#include "MiKTeXCom.h"
static MiKTeXCom *miktex=0;
#else
+ #ifdef KPSE_CXX_UNSAFE
+ extern "C" {
+ #endif
#include <kpathsea/kpathsea.h>
+ #ifdef KPSE_CXX_UNSAFE
+ }
+ #endif
#endif
#include <cstdlib>
@@ -34,6 +44,7 @@
#include "FileSystem.h"
#include "FontMap.h"
#include "Message.h"
+#include "Process.h"
// ---------------------------------------------------
@@ -42,7 +53,7 @@ static bool _mktex_enabled = false;
// ---------------------------------------------------
-static const char* find_file (const std::string &fname);
+static const char* find_file (const std::string &fname, const char *ftype);
static const char* find_mapped_file (std::string fname);
static const char* mktex (const std::string &fname);
@@ -74,7 +85,7 @@ void FileFinder::init (const char *argv0, const char *progname, bool enable_mkte
/** Cleans up the FileFinder. This function must be called before leaving the
- * applications main() function. */
+ * application's main() function. */
void FileFinder::finish () {
#ifdef MIKTEX
if (miktex) {
@@ -95,7 +106,7 @@ std::string FileFinder::version () {
init("", "", false);
autoinit = true;
}
- string ret = miktex->getVersion();
+ std::string ret = miktex->getVersion();
if (autoinit)
finish();
return ret;
@@ -116,15 +127,22 @@ std::string FileFinder::version () {
/** Determines filetype by the filename extension and calls kpse_find_file
* to actually look up the file.
* @param[in] fname name of file to look up
+ * @param[in] ftype expected file format of file fname; if 0, it's derived from the filename suffix
* @return file path on success, 0 otherwise */
-static const char* find_file (const std::string &fname) {
- if (!_initialized)
+static const char* find_file (const std::string &fname, const char *ftype) {
+ if (!_initialized || fname.empty())
return 0;
- size_t pos = fname.rfind('.');
- if (pos == std::string::npos)
- return 0; // no extension => no search
- const std::string ext = fname.substr(pos+1); // file extension
+ std::string ext;
+ if (ftype)
+ ext = ftype;
+ else {
+ size_t pos = fname.rfind('.');
+ if (pos == std::string::npos)
+ return 0; // no extension and no file type => no search
+ ext = fname.substr(pos+1);
+ }
+
static std::string buf;
#ifdef MIKTEX
if (ext == "dll" || ext == "exe") {
@@ -133,6 +151,14 @@ static const char* find_file (const std::string &fname) {
if (FileSystem::exists(buf.c_str()))
return buf.c_str();
}
+ else if (ext == "cmap") {
+ // The MiKTeX SDK doesn't support the lookup of files without suffix (yet), thus
+ // it's not possible to find cmap files which usually don't have a suffix. In order
+ // to work around this, we try to lookup the files by calling kpsewhich.
+ Process process("kpsewhich", std::string("-format=cmap ")+fname);
+ process.run(&buf);
+ return buf.empty() ? 0 : buf.c_str();
+ }
return miktex->findFile(fname.c_str());
#else
#ifdef TEXLIVEWIN32
@@ -147,17 +173,19 @@ static const char* find_file (const std::string &fname) {
#endif
static std::map<std::string, kpse_file_format_type> types;
if (types.empty()) {
- types["tfm"] = kpse_tfm_format;
- types["pfb"] = kpse_type1_format;
- types["vf"] = kpse_vf_format;
- types["mf"] = kpse_mf_format;
- types["ttc"] = kpse_truetype_format;
- types["ttf"] = kpse_truetype_format;
- types["map"] = kpse_fontmap_format;
- types["sty"] = kpse_tex_format;
- types["enc"] = kpse_enc_format;
- types["pro"] = kpse_tex_ps_header_format;
- types["sfd"] = kpse_sfd_format;
+ types["tfm"] = kpse_tfm_format;
+ types["pfb"] = kpse_type1_format;
+ types["vf"] = kpse_vf_format;
+ types["mf"] = kpse_mf_format;
+ types["ttc"] = kpse_truetype_format;
+ types["ttf"] = kpse_truetype_format;
+ types["otf"] = kpse_opentype_format;
+ types["map"] = kpse_fontmap_format;
+ types["cmap"] = kpse_cmap_format;
+ types["sty"] = kpse_tex_format;
+ types["enc"] = kpse_enc_format;
+ types["pro"] = kpse_tex_ps_header_format;
+ types["sfd"] = kpse_sfd_format;
}
std::map<std::string, kpse_file_format_type>::iterator it = types.find(ext.c_str());
if (it == types.end())
@@ -190,10 +218,10 @@ static const char* find_mapped_file (std::string fname) {
if (const FontMap::Entry *entry = FontMap::instance().lookup(base)) {
const char *path=0;
if (entry->fontname.find('.') != std::string::npos) // does the mapped filename has an extension?
- path = find_file(entry->fontname); // look for that file
+ path = find_file(entry->fontname, 0); // look for that file
else { // otherwise, use extension of unmapped file
fname = entry->fontname + "." + ext;
- (path = find_file(fname)) || (path = mktex(fname));
+ (path = find_file(fname, 0)) || (path = mktex(fname));
}
return path;
}
@@ -219,9 +247,9 @@ static const char* mktex (const std::string &fname) {
const char *path = 0;
#ifdef MIKTEX
// maketfm and makemf are located in miktex/bin which is in the search PATH
- string toolname = (ext == "tfm" ? "miktex-maketfm" : "miktex-makemf");
+ std::string toolname = (ext == "tfm" ? "miktex-maketfm" : "miktex-makemf");
system((toolname+".exe "+fname).c_str());
- path = find_file(fname);
+ path = find_file(fname, 0);
#else
kpse_file_format_type type = (ext == "tfm" ? kpse_tfm_format : kpse_mf_format);
path = kpse_make_tex(type, fname.c_str());
@@ -238,11 +266,12 @@ static const char* mktex (const std::string &fname) {
* - in case of tfm or mf files: invokes the external mktextfm/mktexmf tool
* to create the missing file
* @param[in] fname name of file to look up
+ * @param[in] ftype type/format of file to look up
* @param[in] extended if true, use fontmap lookup and mktexFOO calls
* @return path to file on success, 0 otherwise */
-const char* FileFinder::lookup (const std::string &fname, bool extended) {
+const char* FileFinder::lookup (const std::string &fname, const char *ftype, bool extended) {
const char *path;
- if ((path = find_file(fname)) || (extended && ((path = find_mapped_file(fname)) || (path = mktex(fname)))))
+ if ((path = find_file(fname, ftype)) || (extended && ((path = find_mapped_file(fname)) || (path = mktex(fname)))))
return path;
return 0;
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileFinder.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileFinder.h
index f0d8dbba001..b958303bd55 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileFinder.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileFinder.h
@@ -28,7 +28,8 @@ struct FileFinder
static void init (const char *argv0, const char *progname, bool enable_mktexmf);
static void finish ();
static std::string version ();
- static const char* lookup (const std::string &fname, bool extended=true);
+ static const char* lookup (const std::string &fname, const char *ftype, bool extended=true);
+ static const char* lookup (const std::string &fname, bool extended=true) {return lookup(fname, 0, extended);}
};
#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FilePath.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FilePath.cpp
index 2d7e676772a..2d7e676772a 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FilePath.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FilePath.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FilePath.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FilePath.h
index 5bd3fdf98e2..5bd3fdf98e2 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FilePath.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FilePath.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileSystem.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileSystem.cpp
index ea45b65a7ee..ea45b65a7ee 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileSystem.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileSystem.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileSystem.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileSystem.h
index c920a5046e6..c920a5046e6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FileSystem.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FileSystem.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Font.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Font.cpp
index 45950818ea3..f477fbecad1 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Font.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Font.cpp
@@ -22,9 +22,11 @@
#include <iostream>
#include <fstream>
#include <sstream>
+#include "CMap.h"
#include "FileFinder.h"
#include "FileSystem.h"
#include "Font.h"
+#include "FontEncoding.h"
#include "FontEngine.h"
#include "FontMap.h"
#include "GFGlyphTracer.h"
@@ -64,6 +66,38 @@ UInt32 Font::unicode (UInt32 c) const {
}
+/** Retrieves the encoding pair assigned to this font. The first encoding
+ * is the main one assigned in the map file. The second encoding is optional
+ * and computed implicitely if a non-CID-based font has a CMap assigned in the
+ * font map. In this case, the second encoding maps from the CIDs that result
+ * from the first encoding to the char codes of the font. That requires the
+ * selection of a compatible encoding table provided by the font file.
+ * @param[out] encpair the encoding pair assigned to this font
+ * @return true if an encoding is assigned to this font */
+bool Font::encodings (FontEncodingPair &encpair) const {
+ string fontname = name();
+ size_t pos = fontname.rfind('.');
+ if (pos != string::npos)
+ fontname = fontname.substr(0, pos); // strip extension
+ if (const FontMap::Entry *entry = FontMap::instance().lookup(fontname)) {
+ if ((encpair.first = FontEncoding::encoding(entry->encname))) {
+ encpair.second = entry->bfmap;
+ return true;
+ }
+ }
+ return false;
+}
+
+
+/** Returns the encoding object of this font which is asigned in a map file.
+ * If there's no encoding assigned, the function returns 0. */
+FontEncoding* Font::encoding () const {
+ FontEncodingPair encpair;
+ if (encodings(encpair))
+ return encpair.first;
+ return 0;
+}
+
///////////////////////////////////////////////////////////////////////////////////////
@@ -80,10 +114,10 @@ TFMFont::~TFMFont () {
/** Returns a font metrics object for the current font.
* @throw FontException if TFM file can't be found */
-const FontMetric* TFMFont::getMetrics () const {
+const FontMetrics* TFMFont::getMetrics () const {
if (!_metrics) {
try {
- _metrics = FontMetric::read(_fontname.c_str());
+ _metrics = FontMetrics::read(_fontname.c_str());
if (!_metrics) {
_metrics = new NullFontMetric;
Message::wstream(true) << "can't find "+_fontname+".tfm\n";
@@ -118,7 +152,8 @@ double TFMFont::charDepth (int c) const {return getMetrics() ? getMetrics()->ge
double TFMFont::charHeight (int c) const {return getMetrics() ? getMetrics()->getCharHeight(c) : 0;}
-bool TFMFont::verifyChecksums () const {
+/** Tests if the checksum of the font matches that of the corresponding TFM file. */
+bool TFMFont::verifyChecksums () const {
if (_checksum != 0 && getMetrics() && getMetrics()->getChecksum() != 0)
return _checksum == getMetrics()->getChecksum();
return true;
@@ -144,8 +179,9 @@ Font* PhysicalFont::create (string name, int fontindex, UInt32 checksum, double
const char* PhysicalFont::path () const {
- string ext;
+ const char *ext=0;
switch (type()) {
+ case OTF: ext = "otf"; break;
case PFB: ext = "pfb"; break;
case TTC: ext = "ttc"; break;
case TTF: ext = "ttf"; break;
@@ -155,6 +191,31 @@ const char* PhysicalFont::path () const {
}
+/** Returns true if this font is CID-based. */
+bool PhysicalFont::isCIDFont () const {
+ if (type() == MF)
+ return false;
+ FontEngine::instance().setFont(*this);
+ return FontEngine::instance().isCIDFont();
+}
+
+
+/** Decodes a character code used in the DVI file to the code required to
+ * address the correct character in the font.
+ * @param[in] c DVI character to decode
+ * @return target character code or name */
+Character PhysicalFont::decodeChar (UInt32 c) const {
+ FontEncodingPair encpair;
+ if (encodings(encpair)) {
+ Character chr = encpair.first->decode(c);
+ if (!encpair.second)
+ return chr;
+ return encpair.second->decode(chr.number());
+ }
+ return Character(Character::CHRCODE, c);
+}
+
+
/** Returns the number of units per EM. The EM square is the virtual area a glyph is designed on.
* All coordinates used to specify portions of the glyph are relative to the origin (0,0) at the
* lower left corner of this square, while the upper right corner is located at (m,m), where m
@@ -179,12 +240,10 @@ double PhysicalFont::hAdvance (int c) const {
if (type() == MF)
return unitsPerEm()*charWidth(c)/designSize();
FontEngine::instance().setFont(*this);
- if (FontEncoding *enc = encoding())
- return FontEngine::instance().getHAdvance(enc->getEntry(c));
if (const FontMap::Entry *map_entry = FontMap::instance().lookup(name()))
if (Subfont *sf = map_entry->subfont)
c = sf->decode(c);
- return FontEngine::instance().getHAdvance(c);
+ return FontEngine::instance().getHAdvance(decodeChar(c));
}
@@ -192,14 +251,10 @@ string PhysicalFont::glyphName (int c) const {
if (type() == MF)
return "";
FontEngine::instance().setFont(*this);
- if (FontEncoding *enc = encoding()) {
- const char *name = enc->getEntry(c);
- return name ? name : "";
- }
if (const FontMap::Entry *map_entry = FontMap::instance().lookup(name()))
if (Subfont *sf = map_entry->subfont)
c = sf->decode(c);
- return FontEngine::instance().getGlyphName(c);
+ return FontEngine::instance().getGlyphName(decodeChar(c));
}
@@ -219,6 +274,17 @@ int PhysicalFont::descent () const {
}
+/** Retrieve the IDs of all charachter maps available in the font file.
+ * @param[out] charMapIDs IDs of the found character maps
+ * @return number of found character maps */
+int PhysicalFont::collectCharMapIDs (std::vector<CharMapID> &charMapIDs) const {
+ if (type() == MF)
+ return 0;
+ FontEngine::instance().setFont(*this);
+ return FontEngine::instance().getCharMapIDs(charMapIDs);
+}
+
+
/** Extracts the glyph outlines of a given character.
* @param[in] c character code of requested glyph
* @param[out] glyph path segments of the glyph outline
@@ -258,19 +324,13 @@ bool PhysicalFont::getGlyph (int c, GraphicPath<Int32> &glyph, GFGlyphTracer::Ca
}
}
}
- else { // PFB or TTF
+ else { // vector fonts (OTF, PFB, TTF, TTC)
bool ok=true;
FontEngine::instance().setFont(*this);
- if (FontEncoding *enc = encoding()) {
- if (const char *encname = enc->getEntry(c))
- ok = FontEngine::instance().traceOutline(encname, glyph, false);
- }
- else {
- if (const FontMap::Entry *map_entry = FontMap::instance().lookup(name()))
- if (Subfont *sf = map_entry->subfont)
- c = sf->decode(c);
- ok = FontEngine::instance().traceOutline(c, glyph, false);
- }
+ if (const FontMap::Entry *map_entry = FontMap::instance().lookup(name()))
+ if (Subfont *sf = map_entry->subfont)
+ c = sf->decode(c);
+ ok = FontEngine::instance().traceOutline(decodeChar(c), glyph, false);
glyph.closeOpenSubPaths();
return ok;
}
@@ -297,7 +357,7 @@ bool PhysicalFont::createGF (string &gfname) const {
int PhysicalFont::traceAllGlyphs (bool includeCached, GFGlyphTracer::Callback *cb) const {
int count = 0;
if (type() == MF && CACHE_PATH) {
- if (const FontMetric *metrics = getMetrics()) {
+ if (const FontMetrics *metrics = getMetrics()) {
int fchar = metrics->firstChar();
int lchar = metrics->lastChar();
string gfname;
@@ -394,6 +454,7 @@ UInt32 PhysicalFontImpl::unicode (UInt32 c) const {
}
+/** Delete all temporary font files created by Metafont. */
void PhysicalFontImpl::tidy () const {
if (type() == MF) {
const char *ext[] = {"gf", "tfm", "log", 0};
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Font.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Font.h
index 1f04140d4d2..330f6af868f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Font.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Font.h
@@ -24,8 +24,9 @@
#include <map>
#include <string>
#include <vector>
+#include "Character.h"
+#include "CharMapID.h"
#include "FontCache.h"
-#include "FontEncoding.h"
#include "GFGlyphTracer.h"
#include "Glyph.h"
#include "GraphicPath.h"
@@ -34,8 +35,11 @@
#include "VFReader.h"
#include "types.h"
-struct FontMetric;
+struct FontEncoding;
+struct FontMetrics;
+
+typedef std::pair<FontEncoding*, const FontEncoding*> FontEncodingPair;
/** Abstract base for all font classes. */
struct Font {
@@ -58,9 +62,10 @@ struct Font {
virtual double charDepth (int c) const =0;
virtual double charHeight (int c) const =0;
virtual double italicCorr (int c) const =0;
- virtual const FontMetric* getMetrics () const =0;
+ virtual const FontMetrics* getMetrics () const =0;
virtual const char* path () const =0;
- virtual FontEncoding* encoding () const {return FontEncoding::encoding(name());}
+ virtual FontEncoding* encoding () const;
+ virtual bool encodings (FontEncodingPair &encpair) const;
virtual bool getGlyph (int c, Glyph &glyph, GFGlyphTracer::Callback *cb=0) const =0;
virtual UInt32 unicode (UInt32 c) const;
virtual void tidy () const {}
@@ -86,7 +91,7 @@ struct EmptyFont : public Font
double charHeight (int c) const {return 6.833;} // height of cmr10's 'M' in pt
double charDepth (int c) const {return 0;}
double italicCorr (int c) const {return 0;}
- const FontMetric* getMetrics () const {return 0;}
+ const FontMetrics* getMetrics () const {return 0;}
const char* path () const {return 0;}
bool getGlyph (int c, Glyph &glyph, GFGlyphTracer::Callback *cb=0) const {return false;}
@@ -99,32 +104,39 @@ struct EmptyFont : public Font
class PhysicalFont : public virtual Font
{
public:
- enum Type {MF, PFB, TTC, TTF};
+ enum Type {MF, OTF, PFB, TTC, TTF};
+
static Font* create (std::string name, UInt32 checksum, double dsize, double ssize, PhysicalFont::Type type);
- static Font* create (std::string name, int fontindex, UInt32 checksum, double dsize, double ssize);
- virtual Type type () const =0;
- virtual bool getGlyph (int c, Glyph &glyph, GFGlyphTracer::Callback *cb=0) const;
- virtual bool getGlyphBox (int c, BoundingBox &bbox, GFGlyphTracer::Callback *cb=0) const;
- virtual int hAdvance () const;
- virtual double hAdvance (int c) const;
- std::string glyphName (int c) const;
- virtual int unitsPerEm () const;
- virtual int ascent () const;
- virtual int descent () const;
- virtual int traceAllGlyphs (bool includeCached, GFGlyphTracer::Callback *cb=0) const;
- const char* path () const;
+ static Font* create (std::string name, int fontindex, UInt32 checksum, double dsize, double ssize);
+ virtual Type type () const =0;
+ virtual bool getGlyph (int c, Glyph &glyph, GFGlyphTracer::Callback *cb=0) const;
+ virtual bool getGlyphBox (int c, BoundingBox &bbox, GFGlyphTracer::Callback *cb=0) const;
+ virtual bool isCIDFont () const;
+ virtual int hAdvance () const;
+ virtual double hAdvance (int c) const;
+ std::string glyphName (int c) const;
+ virtual int unitsPerEm () const;
+ virtual int ascent () const;
+ virtual int descent () const;
+ virtual int traceAllGlyphs (bool includeCached, GFGlyphTracer::Callback *cb=0) const;
virtual void setStyle (double bold, double extend, double slant) {}
+ const char* path () const;
+ int collectCharMapIDs (std::vector<CharMapID> &charmapIDs) const;
+ void setCharMapID (const CharMapID &id) {_charmapID = id;}
+ CharMapID getCharMapID () const {return _charmapID;}
protected:
- bool createGF (std::string &gfname) const;
+ bool createGF (std::string &gfname) const;
+ Character decodeChar (UInt32 c) const;
public:
- static bool KEEP_TEMP_FILES;
- static const char *CACHE_PATH; ///< path to cache directory (0 if caching is disabled)
- static double METAFONT_MAG; ///< magnification factor for Metafont calls
+ CharMapID _charmapID; ///< ID of the font's charmap to use
+ static bool KEEP_TEMP_FILES;
+ static const char *CACHE_PATH; ///< path to cache directory (0 if caching is disabled)
+ static double METAFONT_MAG; ///< magnification factor for Metafont calls
protected:
- static FontCache _cache;
+ static FontCache _cache;
};
@@ -150,7 +162,7 @@ class TFMFont : public virtual Font
public:
TFMFont (std::string name, UInt32 checksum, double dsize, double ssize);
~TFMFont ();
- const FontMetric* getMetrics () const;
+ const FontMetrics* getMetrics () const;
std::string name () const {return _fontname;}
double designSize () const {return _dsize;}
double scaledSize () const {return _ssize;}
@@ -161,7 +173,7 @@ class TFMFont : public virtual Font
bool verifyChecksums () const;
private:
- mutable FontMetric *_metrics;
+ mutable FontMetrics *_metrics;
std::string _fontname;
UInt32 _checksum; ///< cheksum to be compared with TFM checksum
double _dsize; ///< design size in TeX point units
@@ -182,7 +194,7 @@ class PhysicalFontProxy : public PhysicalFont
double charDepth (int c) const {return _pf->charDepth(c);}
double charHeight (int c) const {return _pf->charHeight(c);}
double italicCorr (int c) const {return _pf->italicCorr(c);}
- const FontMetric* getMetrics () const {return _pf->getMetrics();}
+ const FontMetrics* getMetrics () const {return _pf->getMetrics();}
Type type () const {return _pf->type();}
UInt32 unicode (UInt32 c) const {return _pf->unicode(c);}
int fontIndex () const {return _pf->fontIndex();}
@@ -238,7 +250,7 @@ class VirtualFontProxy : public VirtualFont
double charDepth (int c) const {return _vf->charDepth(c);}
double charHeight (int c) const {return _vf->charHeight(c);}
double italicCorr (int c) const {return _vf->italicCorr(c);}
- const FontMetric* getMetrics () const {return _vf->getMetrics();}
+ const FontMetrics* getMetrics () const {return _vf->getMetrics();}
const char* path () const {return _vf->path();}
protected:
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontCache.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontCache.cpp
index a36df9afa82..a36df9afa82 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontCache.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontCache.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontCache.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontCache.h
index cf4cbef7ec2..cf4cbef7ec2 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontCache.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontCache.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.cpp
new file mode 100644
index 00000000000..fe6a8819ed8
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.cpp
@@ -0,0 +1,59 @@
+/*************************************************************************
+** FontEncoding.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include "CMap.h"
+#include "CMapManager.h"
+#include "EncFile.h"
+#include "FileFinder.h"
+#include "FontEncoding.h"
+
+using namespace std;
+
+
+struct EncodingMap : public map<string, EncFile*>
+{
+ ~EncodingMap () {
+ for (EncodingMap::iterator it=begin(); it != end(); ++it)
+ delete it->second;
+ }
+};
+
+
+/** Returns the encoding object for a given encoding name.
+ * @param[in] encname name of the encoding to lookup
+ * @return pointer to encoding object, or 0 if there is no encoding defined */
+FontEncoding* FontEncoding::encoding (const string &encname) {
+ if (encname.empty())
+ return 0;
+ // initially, try to find an .enc file with the given name
+ static EncodingMap encmap;
+ EncodingMap::const_iterator it = encmap.find(encname);
+ if (it != encmap.end())
+ return it->second;
+ if (FileFinder::lookup(encname + ".enc", false)) {
+ EncFile *enc = new EncFile(encname);
+ encmap[encname] = enc;
+ return enc;
+ }
+ // no .enc file found => try to find a CMap
+ if (CMap *cmap = CMapManager::instance().lookup(encname))
+ return cmap;
+ return 0;
+}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.h
new file mode 100644
index 00000000000..41ce932e16a
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEncoding.h
@@ -0,0 +1,37 @@
+/*************************************************************************
+** FontEncoding.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#ifndef FONTENCODING_H
+#define FONTENCODING_H
+
+#include "Character.h"
+#include "types.h"
+
+
+struct FontEncoding
+{
+ virtual ~FontEncoding () {}
+ virtual const char* name () const =0;
+ virtual Character decode (UInt32 c) const =0;
+ virtual const char* path () const =0;
+ static FontEncoding* encoding (const std::string &fontname);
+};
+
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEngine.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEngine.cpp
index ab53b1bd644..ae1f2090498 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEngine.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEngine.cpp
@@ -114,19 +114,31 @@ static void build_reverse_map (FT_Face face, map<UInt32, UInt32> &reverseMap) {
* @param[in] fname path to font file
* @param[in] fontindex index of font in font collection (multi-font files, like TTC)
* @return true on success */
-bool FontEngine::setFont (const string &fname, int fontindex) {
+bool FontEngine::setFont (const string &fname, int fontindex, const CharMapID &charMapID) {
if (FT_New_Face(_library, fname.c_str(), fontindex, &_currentFace)) {
Message::estream(true) << "FontEngine: error reading file " << fname << '\n';
return false;
}
- // look for a custom character map
- for (int i=0; i < _currentFace->num_charmaps; i++) {
- FT_CharMap charmap = _currentFace->charmaps[i];
- if (charmap->encoding == FT_ENCODING_ADOBE_CUSTOM) {
- FT_Set_Charmap(_currentFace, charmap);
- break;
- }
- }
+ if (charMapID.valid()) {
+ for (int i=0; i < _currentFace->num_charmaps; i++) {
+ FT_CharMap ft_cmap = _currentFace->charmaps[i];
+ if (ft_cmap->platform_id == charMapID.platform_id && ft_cmap->encoding_id == charMapID.encoding_id) {
+ FT_Set_Charmap(_currentFace, ft_cmap);
+ return true;
+ }
+ }
+ return false;
+ }
+ else {
+ // look for a custom character map
+ for (int i=0; i < _currentFace->num_charmaps; i++) {
+ FT_CharMap charmap = _currentFace->charmaps[i];
+ if (charmap->encoding == FT_ENCODING_ADOBE_CUSTOM) {
+ FT_Set_Charmap(_currentFace, charmap);
+ break;
+ }
+ }
+ }
return true;
}
@@ -134,12 +146,19 @@ bool FontEngine::setFont (const string &fname, int fontindex) {
bool FontEngine::setFont (const Font &font) {
if (!_currentFont || _currentFont->name() != font.name()) {
_currentFont = &font;
- return setFont(font.path(), font.fontIndex());
+ const PhysicalFont *pf = dynamic_cast<const PhysicalFont*>(&font);
+ return setFont(font.path(), font.fontIndex(), pf ? pf->getCharMapID() : CharMapID());
}
return true;
}
+bool FontEngine::isCIDFont() const {
+ FT_Bool cid_keyed;
+ return FT_Get_CID_Is_Internally_CID_Keyed(_currentFace, &cid_keyed) == 0 && cid_keyed;
+}
+
+
void FontEngine::buildTranslationMap (map<UInt32, UInt32> &translationMap) const {
FT_CharMap unicodeMap=0, customMap=0;
for (int i=0; i < _currentFace->num_charmaps; i++) {
@@ -200,23 +219,24 @@ int FontEngine::getHAdvance () const {
}
-int FontEngine::getHAdvance (unsigned c) const {
+int FontEngine::getHAdvance (const Character &c) const {
if (_currentFace) {
- int index = FT_Get_Char_Index(_currentFace, (FT_ULong)c);
- FT_Load_Glyph(_currentFace, index, FT_LOAD_NO_SCALE);
+ FT_Load_Glyph(_currentFace, charIndex(c), FT_LOAD_NO_SCALE);
return _currentFace->glyph->metrics.horiAdvance;
}
return 0;
}
-int FontEngine::getHAdvance (const char *name) const {
- if (_currentFace && name) {
- int index = FT_Get_Name_Index(_currentFace, (FT_String*)name);
- FT_Load_Glyph(_currentFace, index, FT_LOAD_NO_SCALE);
- return _currentFace->glyph->metrics.horiAdvance;
+int FontEngine::charIndex (const Character &c) const {
+ switch (c.type()) {
+ case Character::CHRCODE:
+ return FT_Get_Char_Index(_currentFace, (FT_ULong)c.number());
+ case Character::NAME:
+ return FT_Get_Name_Index(_currentFace, (FT_String*)c.name());
+ default:
+ return c.number();
}
- return 0;
}
@@ -239,31 +259,19 @@ int FontEngine::getNextChar () const {
/** Returns the glyph name for a given charater code.
* @param[in] c char code
* @return glyph name */
-string FontEngine::getGlyphName (unsigned c) const {
+string FontEngine::getGlyphName (const Character &c) const {
+ if (c.type() == Character::NAME)
+ return c.name();
+
if (_currentFace && FT_HAS_GLYPH_NAMES(_currentFace)) {
char buf[256];
- int index = FT_Get_Char_Index(_currentFace, c);
- FT_Get_Glyph_Name(_currentFace, index, buf, 256);
+ FT_Get_Glyph_Name(_currentFace, charIndex(c), buf, 256);
return string(buf);
}
return "";
}
-/* Returns the character code for a given glyph name.
- * @param name glyph name
- * @return char code or 0 if name couldn't be found
-int FontEngine::getCharByGlyphName (const char *name) const {
- if (_currentFace && FT_HAS_GLYPH_NAMES(_currentFace)) {
- int index = FT_Get_Name_Index(_currentFace, (FT_String*)name);
- map<UInt32, UInt32>::const_iterator it = _reverseMap.find(index);
- if (it != _reverseMap.end())
- return it->second;
- }
- return 0;
-}*/
-
-
vector<int> FontEngine::getPanose () const {
vector<int> panose(10);
if (_currentFace) {
@@ -276,6 +284,19 @@ vector<int> FontEngine::getPanose () const {
}
+int FontEngine::getCharMapIDs (vector<CharMapID> &charmapIDs) const {
+ int num_charmaps=0;
+ if (_currentFace) {
+ num_charmaps = _currentFace->num_charmaps;
+ for (int i=0; i < num_charmaps; i++) {
+ FT_CharMap charmap = _currentFace->charmaps[i];
+ charmapIDs.push_back(CharMapID(charmap->platform_id, charmap->encoding_id));
+ }
+ }
+ return num_charmaps;
+}
+
+
// handle API change in freetype version 2.2.1
#if FREETYPE_MAJOR > 2 || (FREETYPE_MAJOR == 2 && (FREETYPE_MINOR > 2 || (FREETYPE_MINOR == 2 && FREETYPE_PATCH >= 1)))
typedef const FT_Vector *FTVectorPtr;
@@ -359,21 +380,9 @@ static bool trace_outline (FT_Face face, const Font *font, int index, Glyph &gly
* @param[in] scale if true the current pt size will be considered otherwise
* the plain TrueType units are used.
* @return false on errors */
-bool FontEngine::traceOutline (UInt16 chr, Glyph &glyph, bool scale) const {
- if (_currentFace) {
- int index = FT_Get_Char_Index(_currentFace, chr);
- return trace_outline(_currentFace, _currentFont, index, glyph, scale);
- }
- Message::wstream(true) << "FontEngine: can't trace outline, no font face selected\n";
- return false;
-}
-
-
-bool FontEngine::traceOutline (const char *name, Glyph &glyph, bool scale) const {
- if (_currentFace) {
- int index = FT_Get_Name_Index(_currentFace, (FT_String*)name);
- return trace_outline(_currentFace, _currentFont, index, glyph, scale);
- }
+bool FontEngine::traceOutline (const Character &c, Glyph &glyph, bool scale) const {
+ if (_currentFace)
+ return trace_outline(_currentFace, _currentFont, charIndex(c), glyph, scale);
Message::wstream(true) << "FontEngine: can't trace outline, no font face selected\n";
return false;
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEngine.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEngine.h
index 68652b66523..27cc7284eb8 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontEngine.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontEngine.h
@@ -23,50 +23,54 @@
#include <ft2build.h>
#include FT_FREETYPE_H
+#include FT_CID_H
#include <map>
#include <string>
#include <vector>
-#include "types.h"
+#include "Character.h"
+#include "CharMapID.h"
+#include "Font.h"
#include "Glyph.h"
+#include "types.h"
-struct Font;
/** This class provides methods to handle font files and font data.
* It's a wrapper for the Freetype font library. */
class FontEngine
{
public:
- ~FontEngine ();
+ ~FontEngine ();
static FontEngine& instance ();
static std::string version ();
void setDeviceResolution (int x, int y);
- bool setFont (const Font &font);
- bool traceOutline (UInt16 chr, Glyph &glyph, bool scale=true) const;
- bool traceOutline (const char *name, Glyph &glyph, bool scale) const;
+ bool setFont (const Font &font);
+ bool isCIDFont() const;
+ bool traceOutline (const Character &c, Glyph &glyph, bool scale=true) const;
const char* getFamilyName () const;
const char* getStyleName () const;
int getUnitsPerEM () const;
int getAscender () const;
int getDescender () const;
int getHAdvance () const;
- int getHAdvance (unsigned int c) const;
- int getHAdvance (const char *name) const;
+ int getHAdvance (const Character &c) const;
int getFirstChar () const;
int getNextChar () const;
+ int getCharMapIDs (std::vector<CharMapID> &charmapIDs) const;
std::vector<int> getPanose () const;
- std::string getGlyphName (unsigned int c) const;
+ std::string getGlyphName (const Character &c) const;
int getCharByGlyphName (const char *name) const;
void buildTranslationMap (std::map<UInt32,UInt32> &translationMap) const;
protected:
- FontEngine ();
- bool setFont (const std::string &fname, int fontindex=0);
+ FontEngine ();
+ bool setFont (const std::string &fname, int fontindex, const CharMapID &charmapID);
+ int charIndex (const Character &c) const;
private:
int _horDeviceRes, _vertDeviceRes;
mutable unsigned int _currentChar, _currentGlyphIndex;
FT_Face _currentFace;
- FT_Library _library;
+ FT_Library _library;
const Font *_currentFont;
};
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontManager.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontManager.cpp
index 0481b59a969..1a13de50420 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontManager.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontManager.cpp
@@ -22,13 +22,14 @@
#include <cstdlib>
#include <fstream>
#include <set>
+#include "CMap.h"
#include "Font.h"
-#include "FontEncoding.h"
#include "FontManager.h"
#include "FontMap.h"
#include "FileFinder.h"
#include "Message.h"
#include "macros.h"
+#include "CMapManager.h"
using namespace std;
@@ -151,6 +152,8 @@ static Font* create_font (const string &filename, const string &fontname, int fo
if (!ext.empty() && FileFinder::lookup(filename)) {
if (ext == "pfb")
return PhysicalFont::create(fontname, checksum, dsize, ssize, PhysicalFont::PFB);
+ if (ext == "otf")
+ return PhysicalFont::create(fontname, checksum, dsize, ssize, PhysicalFont::OTF);
if (ext == "ttf")
return PhysicalFont::create(fontname, checksum, dsize, ssize, PhysicalFont::TTF);
if (ext == "ttc")
@@ -197,13 +200,25 @@ int FontManager::registerFont (UInt32 fontnum, string name, UInt32 checksum, dou
newfont = create_font(filename, name, fontindex, checksum, dsize, ssize);
else {
// try various font file formats if the given file has no extension
- const char *exts[] = {".pfb", ".ttc", ".ttf", ".vf", ".mf", 0};
+ const char *exts[] = {"pfb", "otf", "ttc", "ttf", "vf", "mf", 0};
for (const char **p = exts; *p && !newfont; ++p)
- newfont = create_font(filename+*p, name, fontindex, checksum, dsize, ssize);
+ newfont = create_font(filename+"."+*p, name, fontindex, checksum, dsize, ssize);
}
- if (map_entry)
- if (PhysicalFont *pf = dynamic_cast<PhysicalFont*>(newfont))
+ if (map_entry) {
+ if (PhysicalFont *pf = dynamic_cast<PhysicalFont*>(newfont)) {
pf->setStyle(map_entry->bold, map_entry->extend, map_entry->slant);
+ CMap *cmap = dynamic_cast<CMap*>(pf->encoding());
+ if (cmap && !pf->isCIDFont()) {
+ CharMapID charMapID;
+ if (CMap *bfmap = CMapManager::instance().findCompatibleBaseFontMap(pf, cmap, charMapID)) {
+ FontMap::instance().setBaseFontMap(name, bfmap);
+ pf->setCharMapID(charMapID);
+ }
+ else
+ Message::wstream(true) << "no suitable encoding table found for font " << filename << "\n";
+ }
+ }
+ }
if (!newfont) {
// create dummy font as a placeholder if the proper font is not available
newfont = new EmptyFont(name);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontManager.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontManager.h
index 9207ecba460..9207ecba460 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontManager.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontManager.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMap.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMap.cpp
index cd349080d14..64db5cb73da 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMap.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMap.cpp
@@ -23,6 +23,7 @@
#include <iostream>
#include <limits>
#include <vector>
+#include "CMap.h"
#include "Directory.h"
#include "FileFinder.h"
#include "FontManager.h"
@@ -58,7 +59,8 @@ bool FontMap::read (const string &fname, FontMap::Mode mode) {
int line_number = 1;
while (ifs) {
- if (strchr("\n&#%;*", ifs.peek())) // comment line?
+ int c = ifs.peek();
+ if (c < 0 || strchr("\n&#%;*", c)) // comment or empty line?
ifs.ignore(numeric_limits<int>::max(), '\n');
else {
try {
@@ -293,10 +295,17 @@ void FontMap::clear (bool unlocked_only) {
}
}
+
+void FontMap::setBaseFontMap (const std::string &fontname, const CMap *bfmap) {
+ Iterator it = _entries.find(fontname);
+ if (it != _entries.end())
+ it->second->bfmap = bfmap;
+}
+
/////////////////////////////////////////////////
FontMap::Entry::Entry (const MapLine &mapline, Subfont *sf)
- : fontname(mapline.fontfname()), encname(mapline.encname()), subfont(sf), fontindex(mapline.fontindex()), locked(false),
- bold(mapline.bold()), slant(mapline.slant()), extend(mapline.extend())
+ : fontname(mapline.fontfname()), encname(mapline.encname()), bfmap(0), subfont(sf), fontindex(mapline.fontindex()),
+ locked(false), bold(mapline.bold()), slant(mapline.slant()), extend(mapline.extend())
{
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMap.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMap.h
index b3c1b85a304..b9372a281f1 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMap.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMap.h
@@ -25,6 +25,7 @@
#include <ostream>
#include <string>
+struct CMap;
class MapLine;
class Subfont;
@@ -36,6 +37,7 @@ class FontMap
Entry (const MapLine &mapline, Subfont *subfont=0);
std::string fontname; ///< target font name
std::string encname; ///< name of font encoding
+ const CMap *bfmap; ///< base font map to map from CID to another encoding
Subfont *subfont;
int fontindex; ///< index of font in multi-font file
bool locked;
@@ -62,6 +64,7 @@ class FontMap
bool remove (const MapLine &mapline);
void lockFont (const std::string &fontname);
void clear (bool unlocked_only=false);
+ void setBaseFontMap (const std::string &fontname, const CMap *bfmap);
std::ostream& write (std::ostream &os) const;
const Entry* lookup(const std::string &fontname) const;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMetric.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMetrics.cpp
index 7d0b262e457..2348b21508b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMetric.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMetrics.cpp
@@ -20,14 +20,14 @@
#include <fstream>
#include "FileFinder.h"
-#include "FontMetric.h"
+#include "FontMetrics.h"
#include "JFM.h"
#include "TFM.h"
using namespace std;
-FontMetric* FontMetric::read (const char *fontname) {
+FontMetrics* FontMetrics::read (const char *fontname) {
const char *path = FileFinder::lookup(string(fontname) + ".tfm");
ifstream ifs(path, ios::binary);
if (!ifs)
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMetric.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMetrics.h
index 58dde4d9ab3..f75dd9e97bd 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/FontMetric.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/FontMetrics.h
@@ -18,16 +18,16 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
-#ifndef FONTMETRIC_H
-#define FONTMETRIC_H
+#ifndef FONTMETRICS_H
+#define FONTMETRICS_H
#include <istream>
#include "MessageException.h"
#include "types.h"
-struct FontMetric
+struct FontMetrics
{
- virtual ~FontMetric () {}
+ virtual ~FontMetrics () {}
virtual double getDesignSize () const =0;
virtual double getCharWidth (int c) const =0;
virtual double getCharHeight (int c) const =0;
@@ -36,11 +36,11 @@ struct FontMetric
virtual UInt32 getChecksum () const =0;
virtual UInt16 firstChar () const =0;
virtual UInt16 lastChar () const =0;
- static FontMetric* read (const char *fontname);
+ static FontMetrics* read (const char *fontname);
};
-struct NullFontMetric : public FontMetric
+struct NullFontMetric : public FontMetrics
{
double getDesignSize () const {return 1;}
double getCharWidth (int c) const {return 0;}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFGlyphTracer.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFGlyphTracer.cpp
index c40702e595f..c40702e595f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFGlyphTracer.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFGlyphTracer.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFGlyphTracer.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFGlyphTracer.h
index 379ed1d98c8..379ed1d98c8 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFGlyphTracer.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFGlyphTracer.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFReader.cpp
index 1bb6c426549..1bb6c426549 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFReader.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFReader.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFReader.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFReader.h
index 0d9a7bb0e32..0d9a7bb0e32 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFReader.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFReader.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFTracer.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFTracer.cpp
index 69a078456a0..69a078456a0 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFTracer.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFTracer.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFTracer.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFTracer.h
index ba15961db65..ba15961db65 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GFTracer.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GFTracer.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Ghostscript.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Ghostscript.cpp
index 7da863cbc82..7da863cbc82 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Ghostscript.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Ghostscript.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Ghostscript.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Ghostscript.h
index ccfd5b0b0f4..ccfd5b0b0f4 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Ghostscript.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Ghostscript.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Glyph.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Glyph.h
index b598dc5002d..b598dc5002d 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Glyph.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Glyph.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GlyphTracerMessages.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GlyphTracerMessages.h
index 2b0cedcd8b6..2b0cedcd8b6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GlyphTracerMessages.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GlyphTracerMessages.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GraphicPath.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GraphicPath.h
index 46a3b0cc335..46a3b0cc335 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/GraphicPath.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/GraphicPath.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/HtmlSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/HtmlSpecialHandler.cpp
index bf19c6335d1..0d4a3bb14c5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/HtmlSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/HtmlSpecialHandler.cpp
@@ -28,8 +28,9 @@
using namespace std;
-// variable to select the link marker variant (none, underlined, or boxed)
+// variable to select the link marker variant (none, underlined, boxed, or colored background)
HtmlSpecialHandler::LinkMarker HtmlSpecialHandler::LINK_MARKER = HtmlSpecialHandler::LM_LINE;
+Color HtmlSpecialHandler::LINK_BGCOLOR;
bool HtmlSpecialHandler::process (const char *prefix, istream &is, SpecialActions *actions) {
@@ -134,20 +135,31 @@ void HtmlSpecialHandler::markLinkedBox () {
double h = linewidth;
if (LINK_MARKER == LM_LINE)
rect->addAttribute("fill", _actions->getColor().rgbString());
- else { // LM_BOX
+ else {
x -= linewidth;
y = bbox.minY()-linewidth;
w += 2*linewidth;
h += bbox.height()+linewidth;
- rect->addAttribute("fill", "none");
- rect->addAttribute("stroke", _actions->getColor().rgbString());
- rect->addAttribute("stroke-width", linewidth);
+ if (LINK_MARKER == LM_BGCOLOR)
+ rect->addAttribute("fill", LINK_BGCOLOR.rgbString());
+ else { // LM_BOX
+ rect->addAttribute("fill", "none");
+ rect->addAttribute("stroke", _actions->getColor().rgbString());
+ rect->addAttribute("stroke-width", linewidth);
+ }
}
rect->addAttribute("x", x);
rect->addAttribute("y", y);
rect->addAttribute("width", w);
rect->addAttribute("height", h);
- _actions->appendToPage(rect);
+ _actions->prependToPage(rect);
+ if (LINK_MARKER == LM_BOX) {
+ x -= linewidth;
+ y -= linewidth;
+ w += 2*linewidth;
+ h += 2*linewidth;
+ }
+ _actions->embed(BoundingBox(x, y, x+w, y+h));
}
// Create an invisible rectangle around the linked area so that it's easier to access.
// This is only necessary when using paths rather than real text elements together with fonts.
@@ -199,6 +211,22 @@ void HtmlSpecialHandler::dviEndPage (unsigned pageno) {
}
+bool HtmlSpecialHandler::setLinkMarker (const string &type) {
+ if (type.empty() || type == "none")
+ LINK_MARKER = LM_NONE;
+ else if (type == "line")
+ LINK_MARKER = LM_LINE;
+ else if (type == "box")
+ LINK_MARKER = LM_BOX;
+ else {
+ if (!LINK_BGCOLOR.set(type, false))
+ return false;
+ LINK_MARKER = LM_BGCOLOR;
+ }
+ return true;
+}
+
+
const char** HtmlSpecialHandler::prefixes () const {
static const char *pfx[] = {"html:", 0};
return pfx;
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/HtmlSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/HtmlSpecialHandler.h
index 2c0bb7e88a4..6e1e0e40c53 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/HtmlSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/HtmlSpecialHandler.h
@@ -23,6 +23,7 @@
#include <map>
#include <string>
+#include "Color.h"
#include "SpecialHandler.h"
struct SpecialActions;
@@ -46,8 +47,11 @@ class HtmlSpecialHandler : public SpecialHandler, public DVIEndPageListener, pub
const char* info () const {return "hyperref specials";}
const char** prefixes () const;
- enum LinkMarker {LM_NONE, LM_LINE, LM_BOX};
+ static bool setLinkMarker (const std::string &type);
+
+ enum LinkMarker {LM_NONE, LM_LINE, LM_BOX, LM_BGCOLOR};
static LinkMarker LINK_MARKER; ///< selects how linked areas are marked
+ static Color LINK_BGCOLOR; ///< background color if anchor linkmark type == LT_BGCOLOR
protected:
void hrefAnchor (std::string uri);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputBuffer.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputBuffer.cpp
index ad99305fa3c..ad99305fa3c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputBuffer.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputBuffer.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputBuffer.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputBuffer.h
index c25df9a1452..c25df9a1452 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputBuffer.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputBuffer.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputReader.cpp
index c2eaa249ff0..c2eaa249ff0 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputReader.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputReader.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputReader.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputReader.h
index 7d1ee838110..7d1ee838110 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/InputReader.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/InputReader.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/JFM.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/JFM.cpp
index 9c6425645de..922f064f080 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/JFM.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/JFM.cpp
@@ -61,6 +61,7 @@ JFM::JFM (istream &is) {
void JFM::readTables (StreamReader &sr, int nt, int nw, int nh, int nd, int ni) {
+ // determine smallest charcode with chartype > 0
UInt16 minchar=0xFFFF, maxchar=0;
for (int i=0; i < nt; i++) {
UInt16 c = (UInt16)sr.readUnsigned(2);
@@ -70,6 +71,7 @@ void JFM::readTables (StreamReader &sr, int nt, int nw, int nh, int nd, int ni)
maxchar = max(maxchar, c);
}
}
+ // build charcode to chartype map
if (minchar <= maxchar) {
_minchar = minchar;
_charTypeTable.resize(maxchar-minchar+1);
@@ -87,10 +89,8 @@ void JFM::readTables (StreamReader &sr, int nt, int nw, int nh, int nd, int ni)
int JFM::charIndex (int c) const {
- if (_charTypeTable.empty())
- return TFM::charIndex(c);
UInt16 chartype = 0;
- if (c >= _minchar && size_t(c) < _minchar+_charTypeTable.size())
+ if (!_charTypeTable.empty() && c >= _minchar && size_t(c) < _minchar+_charTypeTable.size())
chartype = _charTypeTable[c-_minchar];
return TFM::charIndex(chartype);
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/JFM.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/JFM.h
index 2a59c486104..2a59c486104 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/JFM.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/JFM.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Length.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Length.cpp
index aae20b74e59..aae20b74e59 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Length.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Length.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Length.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Length.h
index 995ba068cee..995ba068cee 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Length.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Length.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Makefile.am b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Makefile.am
new file mode 100644
index 00000000000..4c964fa1f9e
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Makefile.am
@@ -0,0 +1,53 @@
+:## This file is part of dvisvgm
+## Copyright (C) 2005-2013 Martin Gieseking <martin.gieseking@uos.de>
+##
+## Process this file with automake.
+
+bin_PROGRAMS = dvisvgm
+noinst_LIBRARIES = libdvisvgm.a
+
+dvisvgm_SOURCES = gzstream.h \
+ dvisvgm.cpp gzstream.cpp
+
+dvisvgm_LDADD = $(noinst_LIBRARIES) @EXTRA_LIBS@
+dvisvgm_DEPENDENCIES = $(noinst_LIBRARIES) @EXTRA_LIBS@
+
+libdvisvgm_a_SOURCES = Bitmap.h BoundingBox.h BgColorSpecialHandler.h Calculator.h Character.h CharMapID.h CMap.h CMapManager.h CMapReader.h \
+ CmdLineParserBase.h Color.h CRC32.h ColorSpecialHandler.h CommandLine.h Directory.h DLLoader.h DVIActions.h DVIReader.h \
+ DvisvgmSpecialHandler.h DVIToSVG.h DVIToSVGActions.h EncFile.h EmSpecialHandler.h EPSFile.h EPSToSVG.h FileFinder.h FilePath.h \
+ FileSystem.h Font.h FontCache.h FontEncoding.h FontEngine.h FontManager.h FontMap.h FontMetrics.h GFReader.h GFTracer.h \
+ GFGlyphTracer.h Ghostscript.h Glyph.h GlyphTracerMessages.h GraphicPath.h HtmlSpecialHandler.h InputBuffer.h InputReader.h \
+ JFM.h Length.h macros.h MapLine.h Matrix.h Message.h MessageException.h MetafontWrapper.h NoPsSpecialHandler.h PageRanges.h \
+ PageSize.h Pair.h PdfSpecialHandler.h Process.h PSFilter.h PSInterpreter.h PSPattern.h PSPreviewFilter.h PsSpecialHandler.h \
+ SignalHandler.h SpecialActions.h SpecialHandler.h SpecialManager.h StreamReader.h StreamWriter.h Subfont.h SVGOutputBase.h \
+ SVGTree.h System.h Terminal.h TpicSpecialHandler.h TFM.h types.h VectorStream.h VFActions.h VFReader.h \
+ XMLDocument.h XMLNode.h XMLString.h \
+ BgColorSpecialHandler.cpp Bitmap.cpp BoundingBox.cpp Calculator.cpp CharMapID.cpp CMap.cpp CMapManager.cpp CMapReader.cpp \
+ CmdLineParserBase.cpp Color.cpp ColorSpecialHandler.cpp CommandLine.cpp CRC32.cpp Directory.cpp DLLoader.cpp DVIActions.cpp \
+ DVIReader.cpp DvisvgmSpecialHandler.cpp DVIToSVG.cpp DVIToSVGActions.cpp EmSpecialHandler.cpp EncFile.cpp EPSFile.cpp EPSToSVG.cpp \
+ FileFinder.cpp FilePath.cpp FileSystem.cpp Font.cpp FontCache.cpp FontEncoding.cpp FontEngine.cpp FontManager.cpp FontMap.cpp \
+ FontMetrics.cpp GFReader.cpp GFGlyphTracer.cpp GFTracer.cpp Ghostscript.cpp HtmlSpecialHandler.cpp InputBuffer.cpp \
+ InputReader.cpp JFM.cpp Length.cpp MapLine.cpp Matrix.cpp Message.cpp MetafontWrapper.cpp NoPsSpecialHandler.cpp \
+ PageRanges.cpp PageSize.cpp PdfSpecialHandler.cpp Process.cpp psdefs.cpp PSInterpreter.cpp PSPattern.cpp PSPreviewFilter.cpp \
+ PsSpecialHandler.cpp SignalHandler.cpp SpecialManager.cpp StreamReader.cpp StreamWriter.cpp Subfont.cpp SVGTree.cpp System.cpp \
+ Terminal.cpp TFM.cpp TpicSpecialHandler.cpp VFReader.cpp XMLDocument.cpp XMLNode.cpp XMLString.cpp
+
+EXTRA_DIST = options.xml iapi.h ierrors.h MiKTeXCom.h MiKTeXCom.cpp
+
+AM_CXXFLAGS = -Wall -Wnon-virtual-dtor
+
+# the command-line parser is generated from options.xml by opt2cpp
+CommandLine.cpp: options.xml
+ if test -f opt2cpp.xsl; then \
+ rm -f $@ $*.h; \
+ xsltproc opt2cpp.xsl $<; \
+ fi
+
+# Create a C string definition containing the PostScript routines psdefs.ps needed by class PSInterpreter
+$(srcdir)/psdefs.cpp: psdefs.ps
+ if test -f $<; then \
+ ps2c PSInterpreter::PSDEFS $< >$@; \
+ fi
+
+psdefs.ps: ;
+
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MapLine.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MapLine.cpp
index 99dce4f9547..99dce4f9547 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MapLine.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MapLine.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MapLine.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MapLine.h
index 87451dc912d..87451dc912d 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MapLine.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MapLine.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Matrix.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Matrix.cpp
index 6aba0d04bdd..fb22448be28 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Matrix.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Matrix.cpp
@@ -66,9 +66,7 @@ static inline double deg2rad (double deg) {
/** Creates a diagonal matrix ((d,0,0),(0,d,0),(0,0,d)).
* @param[in] d value of diagonal elements */
Matrix::Matrix (double d) {
- for (int i=0; i < 3; i++)
- for (int j=0; j < 3; j++)
- _values[i][j] = (i==j ? d : 0);
+ set(d);
}
@@ -97,6 +95,14 @@ Matrix::Matrix (const string &cmds, Calculator &calc) {
}
+Matrix& Matrix::set (double d) {
+ for (int i=0; i < 3; i++)
+ for (int j=0; j < 3; j++)
+ _values[i][j] = (i==j ? d : 0);
+ return *this;
+}
+
+
Matrix& Matrix::set (double v[], unsigned size) {
size = min(size, 9u);
for (unsigned i=0; i < size; i++)
@@ -122,6 +128,12 @@ Matrix& Matrix::set (const vector<double> &v, int start) {
}
+Matrix& Matrix::set(const string &cmds, Calculator &calc) {
+ parse(cmds, calc);
+ return *this;
+}
+
+
Matrix& Matrix::translate (double tx, double ty) {
if (tx != 0 || ty != 0) {
TranslationMatrix t(tx, ty);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Matrix.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Matrix.h
index d3a52439021..b452f3cc88f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Matrix.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Matrix.h
@@ -45,8 +45,10 @@ class Matrix
Matrix (double d=0);
Matrix (double v[], unsigned size=9);
Matrix (const std::vector<double> &v, int start=0);
+ Matrix& set (double d);
Matrix& set (double v[], unsigned size);
Matrix& set (const std::vector<double> &v, int start=0);
+ Matrix& set (const std::string &cmds, Calculator &calc);
double get (int row, int col) const {return _values[row][col];}
Matrix& transpose ();
Matrix& invert ();
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Message.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Message.cpp
index 38407ad5f6d..38407ad5f6d 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Message.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Message.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Message.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Message.h
index bc4a9ed016c..bc4a9ed016c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Message.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Message.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MessageException.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MessageException.h
index e6c4ace019f..e6c4ace019f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MessageException.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MessageException.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MetafontWrapper.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MetafontWrapper.cpp
index 37e3b68f92f..37e3b68f92f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MetafontWrapper.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MetafontWrapper.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MetafontWrapper.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MetafontWrapper.h
index 2a69654ff95..2a69654ff95 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MetafontWrapper.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MetafontWrapper.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MiKTeXCom.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MiKTeXCom.cpp
index 18a36666f9a..18a36666f9a 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MiKTeXCom.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MiKTeXCom.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MiKTeXCom.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MiKTeXCom.h
index 3f387c8204b..3f387c8204b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/MiKTeXCom.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/MiKTeXCom.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/NoPsSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/NoPsSpecialHandler.cpp
index e996ca24dea..e996ca24dea 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/NoPsSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/NoPsSpecialHandler.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/NoPsSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/NoPsSpecialHandler.h
index e2f38302186..e2f38302186 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/NoPsSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/NoPsSpecialHandler.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocTypeNode.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSFilter.h
index ad1cd0f3b38..abb707b86e5 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocTypeNode.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSFilter.h
@@ -1,5 +1,5 @@
/*************************************************************************
-** XMLDocTypeNode.h **
+** PSFilter.h **
** **
** This file is part of dvisvgm -- the DVI to SVG converter **
** Copyright (C) 2005-2013 Martin Gieseking <martin.gieseking@uos.de> **
@@ -18,24 +18,24 @@
** along with this program; if not, see <http://www.gnu.org/licenses/>. **
*************************************************************************/
-#ifndef XMLDOCTYPENODE_H
-#define XMLDOCTYPENODE_H
+#ifndef PSFILTER_H
+#define PSFILTER_H
-#include "XMLNode.h"
+class PSInterpreter;
-class XMLDocTypeNode : public XMLDeclarationNode
+class PSFilter
{
- public:
- XMLDocTypeNode (const std::string &rootName, const std::string &type, const std::string &param)
- : XMLDeclarationNode("DOCTYPE", rootName + " " + type + " " + param) {}
-};
+ public:
+ PSFilter (PSInterpreter &psi) : _psi(psi) {}
+ virtual ~PSFilter () {}
+ virtual void execute (const char *code, size_t len) =0;
+ virtual bool active () const =0;
+ protected:
+ PSInterpreter& psInterpreter () {return _psi;}
-class XMLEntityNode : public XMLDeclarationNode
-{
- public:
- XMLEntityNode (const std::string &n, const std::string &v)
- : XMLDeclarationNode("ENTITY", n + " " + v) {}
+ private:
+ PSInterpreter &_psi;
};
#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSInterpreter.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSInterpreter.cpp
index eadf5e8be9c..db48ca933be 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSInterpreter.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSInterpreter.cpp
@@ -26,6 +26,7 @@
#include "FileFinder.h"
#include "InputReader.h"
#include "Message.h"
+#include "PSFilter.h"
#include "SignalHandler.h"
using namespace std;
@@ -46,7 +47,7 @@ const char *PSInterpreter::GSARGS[] = {
/** Constructs a new PSInterpreter object.
* @param[in] actions template methods to be executed after recognizing the corresponding PS operator. */
PSInterpreter::PSInterpreter (PSActions *actions)
- : _mode(PS_NONE), _actions(actions), _bytesToRead(0), _inError(false), _initialized(false)
+ : _mode(PS_NONE), _actions(actions), _filter(0), _bytesToRead(0), _inError(false), _initialized(false)
{
}
@@ -103,10 +104,19 @@ bool PSInterpreter::execute (const char *str, size_t len, bool flush) {
}
checkStatus(status);
- bool finished=false;
+ bool complete=false;
if (_bytesToRead > 0 && len >= _bytesToRead) {
len = _bytesToRead;
- finished = true;
+ complete = true;
+ }
+
+ if (_filter && _filter->active()) {
+ PSFilter *filter = _filter;
+ _filter = 0; // prevent recursion when filter calls execute()
+ filter->execute(str, len);
+ if (filter->active()) // filter still active after execution?
+ _filter = filter;
+ return complete;
}
// feed Ghostscript with code chunks that are not larger than 64KB
@@ -129,25 +139,34 @@ bool PSInterpreter::execute (const char *str, size_t len, bool flush) {
// force writing contents of output buffer
_gs.run_string_continue("\nflush ", 7, 0, &status);
}
- return finished;
+ return complete;
}
/** Executes a chunk of PostScript code read from a stream. The method returns on EOF.
* @param[in] is the input stream
* @return true if the assigned number of bytes have been read */
-bool PSInterpreter::execute (istream &is) {
+bool PSInterpreter::execute (istream &is, bool flush) {
char buf[4096];
bool finished = false;
while (is && !is.eof() && !finished) {
is.read(buf, 4096);
finished = execute(buf, is.gcount(), false);
}
- execute("\n", 1);
+ execute("\n", 1, flush);
return finished;
}
+bool PSInterpreter::executeRaw (const string &str, int n) {
+ _rawData.clear();
+ ostringstream oss;
+ oss << str << ' ' << n << " (raw) prcmd\n";
+ execute(oss.str());
+ return !_rawData.empty();
+}
+
+
/** This callback function handles input from stdin to Ghostscript. Currently not needed.
* @param[in] inst pointer to calling instance of PSInterpreter
* @param[in] buf takes the read characters
@@ -256,6 +275,7 @@ void PSInterpreter::callActions (InputReader &in) {
{"moveto", 2, &PSActions::moveto},
{"newpath", 0, &PSActions::newpath},
{"querypos", 2, &PSActions::querypos},
+ {"raw", -1, 0},
{"restore", 1, &PSActions::restore},
{"rotate", 1, &PSActions::rotate},
{"save", 1, &PSActions::save},
@@ -287,26 +307,37 @@ void PSInterpreter::callActions (InputReader &in) {
else if (cmp < 0)
first = mid+1;
else {
- // collect parameters and call handler
- vector<string> params;
- int pcount = operators[mid].pcount;
- if (pcount < 0) { // variable number of parameters?
+ if (!operators[mid].op) { // raw string data received
+ _rawData.clear();
in.skipSpace();
- while (!in.eof()) { // read all available parameters
- params.push_back(in.getString());
+ while (!in.eof()) {
+ _rawData.push_back(in.getString());
in.skipSpace();
}
}
- else { // fixed number of parameters
- for (int i=0; i < pcount; i++) {
+ else {
+ // collect parameters and call handler
+ vector<string> params;
+ int pcount = operators[mid].pcount;
+ if (pcount < 0) { // variable number of parameters?
in.skipSpace();
- params.push_back(in.getString());
+ while (!in.eof()) { // read all available parameters
+ params.push_back(in.getString());
+ in.skipSpace();
+ }
+ }
+ else { // fix number of parameters
+ for (int i=0; i < pcount; i++) {
+ in.skipSpace();
+ params.push_back(in.getString());
+ }
}
+ vector<double> v(params.size());
+ str2double(params, v);
+ (_actions->*operators[mid].op)(v);
+ _actions->executed();
}
- vector<double> v(params.size());
- str2double(params, v);
- (_actions->*operators[mid].op)(v);
- _actions->executed();
+ break;
}
}
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSInterpreter.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSInterpreter.h
index a3f5fbb99fc..1414b8623af 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSInterpreter.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSInterpreter.h
@@ -78,6 +78,7 @@ struct PSActions
virtual void executed () {} // triggered if one of the above PS operators has been executed
};
+class PSFilter;
/** This class provides methods to execute chunks of PostScript code and calls
* several template methods on invocation of selected PS operators (see PSActions). */
@@ -88,12 +89,15 @@ class PSInterpreter
public:
PSInterpreter (PSActions *actions=0);
bool execute (const char *str, size_t len, bool flush=true);
- bool execute (const char *str) {return execute(str, std::strlen(str));}
- bool execute (const std::string &str) {return execute(str.c_str());}
- bool execute (std::istream &is);
+ bool execute (const char *str, bool flush=true) {return execute(str, std::strlen(str), flush);}
+ bool execute (const std::string &str, bool flush=true) {return execute(str.c_str(), flush);}
+ bool execute (std::istream &is, bool flush=true);
+ bool executeRaw (const std::string &str, int n);
bool active () const {return _mode != PS_QUIT;}
void limit (size_t max_bytes) {_bytesToRead = max_bytes;}
+ void setFilter (PSFilter *filter) {_filter = filter;}
PSActions* setActions (PSActions *actions);
+ const std::vector<std::string>& rawData () const {return _rawData;}
protected:
void init ();
@@ -107,15 +111,17 @@ class PSInterpreter
private:
Ghostscript _gs;
- Mode _mode; ///< current execution mode
- PSActions *_actions; ///< actions to be performed
- size_t _bytesToRead; ///< if > 0, maximal number of bytes to be processed by following calls of execute()
+ Mode _mode; ///< current execution mode
+ PSActions *_actions; ///< actions to be performed
+ PSFilter *_filter; ///< active filter used to process PS code
+ size_t _bytesToRead; ///< if > 0, maximal number of bytes to be processed by following calls of execute()
std::vector<char> _linebuf;
- std::string _errorMessage; ///< text of error message
- bool _inError; ///< true if scanning error message
- bool _initialized; ///< true if PSInterpreter has been completely initialized
- static const char *GSARGS[]; ///< parameters passed to Ghostscript
- static const char *PSDEFS; ///< initial PostScript definitions
+ std::string _errorMessage; ///< text of error message
+ bool _inError; ///< true if scanning error message
+ bool _initialized; ///< true if PSInterpreter has been completely initialized
+ std::vector<std::string> _rawData; ///< raw data received
+ static const char *GSARGS[]; ///< parameters passed to Ghostscript
+ static const char *PSDEFS; ///< initial PostScript definitions
};
#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSPattern.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPattern.cpp
index 52fbf16c589..52fbf16c589 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSPattern.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPattern.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSPattern.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPattern.h
index 7e2848dea3b..7e2848dea3b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PSPattern.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPattern.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.cpp
new file mode 100644
index 00000000000..cdbee3ce28a
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.cpp
@@ -0,0 +1,113 @@
+/*************************************************************************
+** PSPreviewFilter.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include <vector>
+
+#include "InputBuffer.h"
+#include "InputReader.h"
+#include "PSInterpreter.h"
+#include "PSPreviewFilter.h"
+#include "SpecialActions.h"
+
+
+using namespace std;
+
+PSPreviewFilter::PSPreviewFilter (PSInterpreter &psi) : PSFilter(psi), _active(false), _tightpage(false)
+{
+}
+
+
+/** Activates this filter so that the PS code will be redirected through it if
+ * it's hooked into the PSInterpreter. */
+void PSPreviewFilter::activate () {
+ _tightpage = _active = false;
+ // try to retrieve version string of preview package set in the PS header section
+ if (psInterpreter().executeRaw("SDict begin currentdict/preview@version known{preview@version}{0}ifelse end", 1))
+ _version = psInterpreter().rawData()[0];
+ // check if tightpage option was set
+ if (_version != "0" && psInterpreter().executeRaw("SDict begin preview@tightpage end", 1)) {
+ _tightpage = (psInterpreter().rawData()[0] == "true");
+ _active = true;
+ }
+ _boxExtents.clear();
+}
+
+
+/** Tries to extract the bounding box information from a chunk of PostScript code.
+ * @param[in] code pointer to buffer with PS code to filter
+ * @param[in] len number of bytes in buffer */
+void PSPreviewFilter::execute (const char *code, size_t len) {
+ // If the "tightpage" option was set in the TeX file, 7 integers representing the
+ // extent of the bounding box are present at the begin of each page.
+ if (!_tightpage)
+ psInterpreter().execute(code, len);
+ else {
+ CharInputBuffer ib(code, len);
+ BufferInputReader ir(ib);
+ ir.skipSpace();
+ int val;
+ while (ir.parseInt(val) && _boxExtents.size() <= 7) {
+ _boxExtents.push_back(val);
+ ir.skipSpace();
+ }
+ }
+ _active = false; // no further processing required
+}
+
+
+/** Returns the bounding box defined by the preview package. */
+bool PSPreviewFilter::getBoundingBox (BoundingBox &bbox) const {
+ if (_boxExtents.size() < 7)
+ return false;
+ double left = -_boxExtents[0]*_dvi2pt;
+ bbox = BoundingBox(-left, -height(), width()-left, depth());
+ return true;
+}
+
+
+/** Gets the 4 border values set by the preview package.
+ * @return true if the border data is available */
+bool PSPreviewFilter::getBorders (double &left, double &right, double &top, double &bottom) const {
+ if (_boxExtents.size() < 4)
+ return false;
+ left = -_boxExtents[0]*_dvi2pt;
+ top = -_boxExtents[1]*_dvi2pt;
+ right = _boxExtents[2]*_dvi2pt;
+ bottom = _boxExtents[3]*_dvi2pt;
+ return true;
+}
+
+
+/** Returns the box height in TeX points, or -1 if no data was found or read yet. */
+double PSPreviewFilter::height () const {
+ return _boxExtents.size() > 4 ? (_boxExtents[4]-_boxExtents[1])*_dvi2pt : -1;
+}
+
+
+/** Returns the box depth in TeX points, or -1 if no data was found or read yet. */
+double PSPreviewFilter::depth () const {
+ return _boxExtents.size() > 5 ? (_boxExtents[5]+_boxExtents[3])*_dvi2pt : -1;
+}
+
+
+/** Returns the box width in TeX points, or -1 if no data was found or read yet. */
+double PSPreviewFilter::width () const {
+ return _boxExtents.size() > 6 ? (_boxExtents[6]+_boxExtents[2]-_boxExtents[0])*_dvi2pt : -1;
+}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.h
new file mode 100644
index 00000000000..7662dfa74cc
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PSPreviewFilter.h
@@ -0,0 +1,56 @@
+/*************************************************************************
+** PSPreviewFilter.h **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#ifndef PSPREVIEWFILTER_H
+#define PSPREVIEWFILTER_H
+
+#include <string>
+#include <vector>
+#include "BoundingBox.h"
+#include "PSFilter.h"
+
+struct SpecialActions;
+
+class PSPreviewFilter : public PSFilter
+{
+ public:
+ PSPreviewFilter (PSInterpreter &psi);
+ void activate ();
+ void execute (const char *code, size_t len);
+ bool active () const {return _active;}
+ std::string version () const {return _version;}
+ bool tightpage () const {return _tightpage;}
+ void setDviScaleFactor (double dvi2pt) {_dvi2pt = dvi2pt;}
+ bool getBorders (double &left, double &right, double &top, double &bottom) const;
+ void assignBorders (BoundingBox &bbox) const;
+ bool getBoundingBox (BoundingBox &bbox) const;
+ double height () const;
+ double depth () const;
+ double width () const;
+
+ private:
+ std::string _version; ///< version string of preview package
+ bool _active; ///< true if filter is active
+ bool _tightpage; ///< true if tightpage option was given
+ double _dvi2pt; ///< factor to convert dvi units to TeX points
+ std::vector<int> _boxExtents;
+};
+
+#endif
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageRanges.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageRanges.cpp
index 8a20a35d52b..8a20a35d52b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageRanges.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageRanges.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageRanges.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageRanges.h
index 0e5cd58e5ff..0e5cd58e5ff 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageRanges.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageRanges.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageSize.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageSize.cpp
index 7ff9eb42c0f..7ff9eb42c0f 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageSize.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageSize.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageSize.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageSize.h
index bb7a55c7cdc..bb7a55c7cdc 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PageSize.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PageSize.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Pair.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Pair.h
index a3dc5a12af3..a3dc5a12af3 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Pair.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Pair.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PdfSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PdfSpecialHandler.cpp
index f3d8464704c..f3d8464704c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PdfSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PdfSpecialHandler.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PdfSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PdfSpecialHandler.h
index 43cdd1045de..43cdd1045de 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PdfSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PdfSpecialHandler.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Process.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Process.cpp
index a76219e9846..c9f38b004d0 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Process.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Process.cpp
@@ -19,12 +19,12 @@
*************************************************************************/
#ifdef __WIN32__
-#include <windows.h>
+ #include <windows.h>
#else
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <signal.h>
+ #include <fcntl.h>
+ #include <sys/wait.h>
+ #include <unistd.h>
+ #include <signal.h>
#endif
#include <cstdlib>
@@ -41,7 +41,34 @@ Process::Process (const string &cmd, const string &paramstr)
}
-#ifndef __WIN32__
+#ifdef __WIN32__
+static void pipe_read (HANDLE handle, string &out) {
+ char buf[4096];
+ out.clear();
+ for (;;) {
+ DWORD num_chars;
+ bool success = ReadFile(handle, buf, 1024, &num_chars, NULL);
+ if (!success || num_chars == 0)
+ break;
+ out.append(buf, num_chars);
+ }
+ // remove trailing space
+ if (!out.empty()) {
+ int pos = out.size()-1;
+ while (pos >= 0 && isspace(out[pos]))
+ pos--;
+ out.erase(pos+1);
+ }
+}
+
+
+static inline void close_handle (HANDLE handle) {
+ if (handle != NULL)
+ CloseHandle(handle);
+}
+
+#else
+
/** Extracts whitespace-sparated parameters from a string.
* @param[in] paramstr the parameter string
* @param[out] params vector holding the extracted parameters */
@@ -70,42 +97,61 @@ static void split_paramstr (string paramstr, vector<const char*> &params) {
left = ++right;
}
}
+
#endif
/** Runs the process and waits until it's finished.
- * @param[in] quiet if true, output to stdout/stderr is suppressed
+ * @param[out] out takes the output written to stdout by the executed process
* @return true if process terminated properly
* @throw SignalException if CTRL-C was pressed during execution */
-bool Process::run (bool quiet) {
+bool Process::run (string *out) {
#ifdef __WIN32__
SECURITY_ATTRIBUTES sa;
- ZeroMemory(&sa, sizeof(sa));
- sa.nLength = sizeof(sa);
+ ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = true;
STARTUPINFO si;
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
+ ZeroMemory(&si, sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESTDHANDLES;
- HANDLE devnull = CreateFile("nul", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, &sa, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ HANDLE devnull = NULL;
+ HANDLE proc_read_handle = NULL;
+ HANDLE proc_write_handle = NULL;
+ if (out) {
+ CreatePipe(&proc_read_handle, &proc_write_handle, &sa, 0);
+ SetHandleInformation(proc_read_handle, HANDLE_FLAG_INHERIT, 0);
+ si.hStdOutput = proc_write_handle;
+ }
+ else {
+ devnull = CreateFile("nul", GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, &sa, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ si.hStdOutput = devnull;
+ }
si.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
- si.hStdOutput = quiet ? devnull : GetStdHandle(STD_OUTPUT_HANDLE);
+
PROCESS_INFORMATION pi;
ZeroMemory(&pi, sizeof(pi));
-
+ DWORD exitcode = DWORD(-1);
string cmdline = _cmd+" "+_paramstr;
- CreateProcess(NULL, (LPSTR)cmdline.c_str(), NULL, NULL, true, 0, NULL, NULL, &si, &pi);
- WaitForSingleObject(pi.hProcess, INFINITE);
- DWORD exitcode = (DWORD)-1;
- GetExitCodeProcess(pi.hProcess, &exitcode);
- CloseHandle(devnull);
+ bool success = CreateProcess(NULL, (LPSTR)cmdline.c_str(), NULL, NULL, true, 0, NULL, NULL, &si, &pi);
+ if (success) {
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ GetExitCodeProcess(pi.hProcess, &exitcode);
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+ close_handle(proc_write_handle); // must be closed before reading from pipe to prevent blocking
+ if (success && out)
+ pipe_read(proc_read_handle, *out);
+ close_handle(proc_read_handle);
+ close_handle(devnull);
return exitcode == 0;
#else
pid_t pid = fork();
if (pid == 0) { // child process
- if (quiet) {
+ if (!out) {
int devnull = open(FileSystem::DEVNULL, O_WRONLY);
if (devnull >= 0) {
dup2(devnull, STDOUT_FILENO);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Process.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Process.h
index 973fabf2baf..caf80de4c14 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Process.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Process.h
@@ -27,7 +27,7 @@ class Process
{
public:
Process (const std::string &cmd, const std::string &paramstr);
- bool run (bool quiet=true);
+ bool run (std::string *out=0);
protected:
Process (const Process& orig) {}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PsSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PsSpecialHandler.cpp
index 8e615a9db7c..22eae549c39 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PsSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PsSpecialHandler.cpp
@@ -27,11 +27,13 @@
#include "FileFinder.h"
#include "Message.h"
#include "PSPattern.h"
+#include "PSPreviewFilter.h"
#include "PsSpecialHandler.h"
#include "SpecialActions.h"
#include "XMLNode.h"
#include "XMLString.h"
+
using namespace std;
@@ -43,13 +45,13 @@ static inline double str2double (const string &str) {
}
-PsSpecialHandler::PsSpecialHandler () : _psi(this), _actions(0), _initialized(false), _xmlnode(0)
+PsSpecialHandler::PsSpecialHandler () : _psi(this), _actions(0), _previewFilter(_psi), _psSection(PS_NONE), _xmlnode(0)
{
}
PsSpecialHandler::~PsSpecialHandler () {
- _psi.setActions(0); // ensure no further PS actions are performed
+ _psi.setActions(0); // ensure no further PS actions are performed
for (map<int, PSPattern*>::iterator it=_patterns.begin(); it != _patterns.end(); ++it)
delete it->second;
}
@@ -58,8 +60,8 @@ PsSpecialHandler::~PsSpecialHandler () {
/** Initializes the PostScript handler. It's called by the first use of process(). The
* deferred initialization speeds up the conversion of DVI files that doesn't contain
* PS specials. */
-void PsSpecialHandler::initialize (SpecialActions *actions) {
- if (!_initialized) {
+void PsSpecialHandler::initialize () {
+ if (_psSection == PS_NONE) {
// initial values of graphics state
_linewidth = 1;
_linecap = _linejoin = 0;
@@ -71,26 +73,50 @@ void PsSpecialHandler::initialize (SpecialActions *actions) {
// execute dvips prologue/header files
const char *headers[] = {"tex.pro", "texps.pro", "special.pro", /*"color.pro",*/ 0};
- for (const char **p=headers; *p; ++p) {
- if (const char *path = FileFinder::lookup(*p, false)) {
- ifstream ifs(path);
- _psi.execute(ifs);
- }
- else
- Message::wstream(true) << "PostScript header file " << *p << " not found\n";
+ for (const char **p=headers; *p; ++p)
+ processHeaderFile(*p);
+ _psSection = PS_HEADERS; // allow to process header specials now
+ }
+}
+
+
+void PsSpecialHandler::processHeaderFile (const char *name) {
+ if (const char *path = FileFinder::lookup(name, false)) {
+ ifstream ifs(path);
+ _psi.execute(string("%%BeginProcSet: ")+name+" 0 0\n", false);
+ _psi.execute(ifs, false);
+ _psi.execute("%%EndProcSet\n", false);
+ }
+ else
+ Message::wstream(true) << "PostScript header file " << name << " not found\n";
+}
+
+
+void PsSpecialHandler::enterBodySection () {
+ if (_psSection == PS_HEADERS) {
+ _psSection = PS_BODY; // don't process any PS header code
+ ostringstream oss;
+ // process collected header code
+ if (!_headerCode.empty()) {
+ oss << "\nTeXDict begin @defspecial " << _headerCode << "\n@fedspecial end";
+ _headerCode.clear();
}
// push dictionary "TeXDict" with dvips definitions on dictionary stack
// and initialize basic dvips PostScript variables
- ostringstream oss;
- oss << " TeXDict begin 0 0 1000 72 72 () @start "
- " 0 0 moveto ";
- if (actions) {
+ oss << "\nTeXDict begin 0 0 1000 72 72 () @start 0 0 moveto ";
+ if (_actions) {
float r, g, b;
- actions->getColor().getRGB(r, g, b);
+ _actions->getColor().getRGB(r, g, b);
oss << r << ' ' << g << ' ' << b << " setrgbcolor ";
}
- _psi.execute(oss.str());
- _initialized = true;
+ _psi.execute(oss.str(), false);
+ // Check for information generated by preview.sty. If the tightpage options
+ // was set, don't execute the bop-hook but allow the PS filter to read
+ // the bbox data present at the beginning of the page.
+ _psi.setFilter(&_previewFilter);
+ _previewFilter.activate();
+ if (!_previewFilter.tightpage())
+ _psi.execute("userdict/bop-hook known{bop-hook}if\n", false);
}
}
@@ -119,15 +145,19 @@ static void exec_and_syncpos (PSInterpreter &psi, istream &is, const DPair &pos,
psi.execute(is);
psi.execute("\nquerypos "); // retrieve current PS position (stored in 'pos')
const double pt = 72.27/72.0; // bp -> pt
- actions->setX(pos.x()*pt);
- actions->setY(pos.y()*pt);
+ if (actions) {
+ actions->setX(pos.x()*pt);
+ actions->setY(pos.y()*pt);
+ }
}
+
bool PsSpecialHandler::process (const char *prefix, istream &is, SpecialActions *actions) {
- if (!_initialized)
- initialize(actions);
_actions = actions;
+ initialize();
+ if (_psSection != PS_BODY && *prefix != '!' && strcmp(prefix, "header=") != 0)
+ enterBodySection();
if (*prefix == '"') {
// read and execute literal PostScript code (isolated by a wrapping save/restore pair)
@@ -137,21 +167,18 @@ bool PsSpecialHandler::process (const char *prefix, istream &is, SpecialActions
_psi.execute("\n@endspecial ");
}
else if (*prefix == '!') {
- // execute literal PostScript header
- _psi.execute("\nTeXDict begin @defspecial ");
- _psi.execute(is);
- _psi.execute("\n@fedspecial end ");
+ if (_psSection == PS_HEADERS) {
+ _headerCode += "\n";
+ _headerCode += string(istreambuf_iterator<char>(is), istreambuf_iterator<char>());
+ }
}
else if (strcmp(prefix, "header=") == 0) {
- // read and execute PS header files
- string fname;
- is >> fname;
- if (const char *path = FileFinder::lookup(fname, false)) {
- ifstream ifs(path);
- _psi.execute(ifs);
+ if (_psSection == PS_HEADERS) {
+ // read and execute PS header file
+ string fname;
+ is >> fname;
+ processHeaderFile(fname.c_str());
}
- else
- Message::estream(true) << "PS header file '" << fname << "' not found";
}
else if (strcmp(prefix, "psfile=") == 0 || strcmp(prefix, "PSfile=") == 0) {
if (_actions) {
@@ -163,7 +190,8 @@ bool PsSpecialHandler::process (const char *prefix, istream &is, SpecialActions
}
}
else if (strcmp(prefix, "ps::") == 0) {
- _actions->finishLine(); // reset DVI position on next DVI command
+ if (_actions)
+ _actions->finishLine(); // reset DVI position on next DVI command
if (is.peek() == '[') {
// collect characters inside the brackets
string code;
@@ -189,7 +217,8 @@ bool PsSpecialHandler::process (const char *prefix, istream &is, SpecialActions
}
}
else { // ps: ...
- _actions->finishLine();
+ if (_actions)
+ _actions->finishLine();
moveToDVIPos();
StreamInputReader in(is);
if (in.check(" plotfile ")) { // ps: plotfile fname
@@ -297,6 +326,61 @@ void PsSpecialHandler::psfile (const string &fname, const map<string,string> &at
}
}
+
+/** Apply transformation to width, height, and depth set by preview package.
+ * @param[in] matrix transformation matrix to apply
+ * @param[out] w width
+ * @param[out] h height
+ * @param[out] d depth
+ * @return true if the baseline is still horizontal after the transformation */
+static bool transform_box_extents (const Matrix &matrix, double &w, double &h, double &d) {
+ DPair shift = matrix*DPair(0,0); // the translation component of the matrix
+ DPair ex = matrix*DPair(1,0)-shift;
+ DPair ey = matrix*DPair(0,1)-shift;
+ if (ex.y() != 0 && ey.x() != 0) // rotation != mod 90 degrees?
+ return false; // => non-horizontal baseline, can't compute meaningful extents
+
+ if (ex.y() == 0) // horizontal scaling or skewing?
+ w *= fabs(ex.x());
+ if (ey.x()==0 || ex.y()==0) { // vertical scaling?
+ if (ey.y() < 0) swap(h, d);
+ if (double sy = fabs(ey.y())/ey.length()) {
+ h *= fabs(ey.y()/sy);
+ d *= fabs(ey.y()/sy);
+ }
+ else
+ h = d = 0;
+ }
+ return true;
+}
+
+
+void PsSpecialHandler::dviEndPage (unsigned) {
+ BoundingBox bbox;
+ if (_previewFilter.getBoundingBox(bbox)) {
+ double w = _previewFilter.width();
+ double h = _previewFilter.height();
+ double d = _previewFilter.depth();
+ bool horiz_baseline = true;
+ if (_actions) {
+ _actions->bbox() = bbox;
+ // apply page transformations to box extents
+ Matrix pagetrans;
+ _actions->getPageTransform(pagetrans);
+ horiz_baseline = transform_box_extents(pagetrans, w, h, d);
+ _actions->bbox().lock();
+ }
+ Message::mstream() << "\napplying bounding box set by preview package (version " << _previewFilter.version() << ")\n";
+ if (horiz_baseline)
+ Message::mstream() << "width=" << XMLString(w) << "pt, " "height=" << XMLString(h) << "pt, " "depth=" << XMLString(d) << "pt\n";
+ else
+ Message::mstream() << "can't determine height, width, and depth due to non-horizontal baseline\n";
+ }
+ // close dictionary TeXDict and execute end-hook if defined
+ if (_psSection == PS_BODY)
+ _psi.execute("\nend userdict/end-hook known{end-hook}if ");
+}
+
///////////////////////////////////////////////////////
void PsSpecialHandler::gsave (vector<double> &p) {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PsSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PsSpecialHandler.h
index afb9b3cfc36..fcdede1da7a 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/PsSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/PsSpecialHandler.h
@@ -29,12 +29,13 @@
#include "PSInterpreter.h"
#include "SpecialHandler.h"
#include "PSPattern.h"
+#include "PSPreviewFilter.h"
class PSPattern;
class XMLElementNode;
-class PsSpecialHandler : public SpecialHandler, protected PSActions
+class PsSpecialHandler : public SpecialHandler, public DVIEndPageListener, protected PSActions
{
typedef GraphicPath<double> Path;
@@ -61,6 +62,8 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions
std::stack<Entry> _stack;
};
+ enum PsSection {PS_NONE, PS_HEADERS, PS_BODY};
+
public:
PsSpecialHandler ();
~PsSpecialHandler ();
@@ -68,11 +71,15 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions
const char* info () const {return "dvips PostScript specials";}
const char** prefixes () const;
bool process (const char *prefix, std::istream &is, SpecialActions *actions);
+ void setDviScaleFactor (double dvi2pt) {_previewFilter.setDviScaleFactor(dvi2pt);}
+ void enterBodySection ();
protected:
- void initialize (SpecialActions *actions);
+ void initialize ();
void moveToDVIPos ();
+ void processHeaderFile (const char *fname);
void psfile (const std::string &fname, const std::map<std::string,std::string> &attr);
+ void dviEndPage (unsigned pageno);
/// scale given value by current PS scale factors
double scale (double v) const {return v*(_sx*_cos*_cos + _sy*(1-_cos*_cos));}
@@ -118,9 +125,11 @@ class PsSpecialHandler : public SpecialHandler, protected PSActions
private:
PSInterpreter _psi;
SpecialActions *_actions;
- bool _initialized;
+ PSPreviewFilter _previewFilter; ///< filter to extract information generated by the preview package
+ PsSection _psSection; ///< current section processed (nothing yet, headers, or body specials)
XMLElementNode *_xmlnode; ///< if != 0, created SVG elements are appended to this node
XMLElementNode *_savenode; ///< pointer to temporaryly store _xmlnode
+ std::string _headerCode; ///< collected literal PS header code
Path _path;
DPair _currentpoint; ///< current PS position in bp units
double _sx, _sy; ///< horizontal and vertical scale factors retrieved by operator "applyscalevals"
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGOutputBase.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGOutputBase.h
index f53815c0a28..f53815c0a28 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGOutputBase.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGOutputBase.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGTree.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGTree.cpp
index 8d0719234ca..a0e434a093c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGTree.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGTree.cpp
@@ -26,7 +26,6 @@
#include "FontManager.h"
#include "SVGTree.h"
#include "XMLDocument.h"
-#include "XMLDocTypeNode.h"
#include "XMLNode.h"
#include "XMLString.h"
@@ -54,8 +53,6 @@ void SVGTree::reset () {
_root->addAttribute("xmlns", "http://www.w3.org/2000/svg");
_root->addAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
_doc.setRootNode(_root);
- _doc.append(new XMLDocTypeNode("svg", "PUBLIC",
- "\"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\""));
_page = _text = _span = _defs = 0;
}
@@ -375,4 +372,4 @@ void SVGTree::popContextElement () {
_pageContainerStack.pop();
_text = _span = 0; // ensure the creation of a new text element for the following characters added
}
-} \ No newline at end of file
+}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGTree.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGTree.h
index 0aa5f46499b..0aa5f46499b 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SVGTree.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SVGTree.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SignalHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SignalHandler.cpp
index ffcd66165e0..ffcd66165e0 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SignalHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SignalHandler.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SignalHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SignalHandler.h
index e7473f567d8..e7473f567d8 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SignalHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SignalHandler.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialActions.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialActions.h
index 81d57662df8..a3cbafeefe3 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialActions.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialActions.h
@@ -33,15 +33,16 @@ class XMLElementNode;
struct SpecialActions
{
virtual ~SpecialActions () {}
- virtual double getX() const =0;
- virtual double getY() const =0;
- virtual void setX(double x) =0;
- virtual void setY(double y) =0;
+ virtual double getX () const =0;
+ virtual double getY () const =0;
+ virtual void setX (double x) =0;
+ virtual void setY (double y) =0;
virtual void finishLine () =0;
virtual void setColor (const Color &color) =0;
virtual Color getColor () const =0;
virtual void setMatrix (const Matrix &m) =0;
virtual const Matrix& getMatrix () const =0;
+ virtual void getPageTransform (Matrix &matrix) const =0;
virtual void setBgColor (const Color &color) =0;
virtual void appendToPage (XMLNode *node) =0;
virtual void appendToDefs (XMLNode *node) =0;
@@ -59,16 +60,17 @@ struct SpecialActions
class SpecialEmptyActions : public SpecialActions
{
public:
- double getX() const {return 0;}
- double getY() const {return 0;}
- void setX(double x) {}
- void setY(double y) {}
+ double getX () const {return 0;}
+ double getY () const {return 0;}
+ void setX (double x) {}
+ void setY (double y) {}
void finishLine () {}
void setColor (const Color &color) {}
void setBgColor (const Color &color) {}
- Color getColor () const {return 0;}
+ Color getColor () const {return Color::BLACK;}
void setMatrix (const Matrix &m) {}
const Matrix& getMatrix () const {return _matrix;}
+ void getPageTransform (Matrix &matrix) const {}
void appendToPage (XMLNode *node) {}
void appendToDefs (XMLNode *node) {}
void prependToPage (XMLNode *node) {}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialHandler.h
index 81aaf67eb7a..0883b4cf326 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialHandler.h
@@ -58,6 +58,7 @@ struct SpecialHandler
virtual const char** prefixes () const=0;
virtual const char* info () const=0;
virtual const char* name () const=0;
+ virtual void setDviScaleFactor (double dvi2pt) {}
virtual bool process (const char *prefix, std::istream &is, SpecialActions *actions)=0;
};
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialManager.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialManager.cpp
index 72c2a353b61..9b96d87c6a1 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialManager.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialManager.cpp
@@ -21,7 +21,9 @@
#include <iomanip>
#include <sstream>
#include "SpecialActions.h"
+#include "SpecialHandler.h"
#include "SpecialManager.h"
+#include "PsSpecialHandler.h"
#include "macros.h"
using namespace std;
@@ -95,31 +97,45 @@ SpecialHandler* SpecialManager::findHandler (const string &prefix) const {
}
+static string extract_prefix (istream &is) {
+ int c;
+ string prefix;
+ while (isalnum(c=is.get()))
+ prefix += c;
+ if (ispunct(c)) // also add seperation character to identifying prefix
+ prefix += c;
+ if (prefix == "ps:" && is.peek() == ':')
+ prefix += is.get();
+ return prefix;
+}
+
+
/** Executes a special command.
* @param[in] special the special expression
+ * @param[in] dvi2pt factor to convert DVI units to TeX points
* @param[in] actions actions the special handlers can perform
* @param[in] listener object that wants to be notified about the processing state
* @return true if the special could be processed successfully
* @throw SpecialException in case of errors during special processing */
-bool SpecialManager::process (const string &special, SpecialActions *actions, Listener *listener) const {
+bool SpecialManager::process (const string &special, double dvi2pt, SpecialActions *actions, Listener *listener) const {
istringstream iss(special);
- string prefix;
- int c;
- while (isalnum(c=iss.get()))
- prefix += c;
- if (ispunct(c)) // also add seperation character to identifying prefix
- prefix += c;
- if (prefix == "ps:" && iss.peek() == ':')
- prefix += iss.get();
+ string prefix = extract_prefix(iss);
+ bool success=false;
if (SpecialHandler *handler = findHandler(prefix)) {
if (listener)
listener->beginSpecial(prefix.c_str());
- bool ret = handler->process(prefix.c_str(), iss, actions);
+ handler->setDviScaleFactor(dvi2pt);
+ success = handler->process(prefix.c_str(), iss, actions);
if (listener)
listener->endSpecial(prefix.c_str());
- return ret;
}
- return false;
+ return success;
+}
+
+
+void SpecialManager::leavePSHeaderSection () const {
+ if (PsSpecialHandler *pshandler = dynamic_cast<PsSpecialHandler*>(findHandler("!")))
+ pshandler->enterBodySection();
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialManager.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialManager.h
index 54b6df5dcd0..fc609569ce7 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/SpecialManager.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/SpecialManager.h
@@ -51,10 +51,11 @@ class SpecialManager
void registerHandler (SpecialHandler *handler);
void registerHandlers (SpecialHandler **handlers, const char *ignorelist);
void unregisterHandlers ();
- bool process (const std::string &special, SpecialActions *actions, Listener *listener=0) const;
+ bool process (const std::string &special, double dvi2pt, SpecialActions *actions, Listener *listener=0) const;
void notifyEndPage (unsigned pageno) const;
void notifyPositionChange (double x, double y) const;
void writeHandlerInfo (std::ostream &os) const;
+ void leavePSHeaderSection () const;
protected:
SpecialManager (const SpecialManager &) {}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamReader.cpp
index 6e726e4016e..6e726e4016e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamReader.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamReader.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamReader.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamReader.h
index 3bb25dacca9..3bb25dacca9 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamReader.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamReader.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamWriter.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamWriter.cpp
index bdd378f9993..bdd378f9993 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamWriter.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamWriter.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamWriter.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamWriter.h
index 6217800dae6..6217800dae6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/StreamWriter.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/StreamWriter.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Subfont.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Subfont.cpp
index aa552d029f6..aa552d029f6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Subfont.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Subfont.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Subfont.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Subfont.h
index b099bc76897..b099bc76897 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Subfont.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Subfont.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/System.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/System.cpp
index 40ee98a130c..40ee98a130c 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/System.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/System.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/System.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/System.h
index 775d6358dd7..775d6358dd7 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/System.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/System.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TFM.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TFM.cpp
index 596ed52e7ca..596ed52e7ca 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TFM.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TFM.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TFM.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TFM.h
index 09fe68f6019..954a619fdbf 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TFM.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TFM.h
@@ -24,13 +24,13 @@
#include <istream>
#include <string>
#include <vector>
-#include "FontMetric.h"
+#include "FontMetrics.h"
#include "types.h"
#include "StreamReader.h"
class StreamReader;
-class TFM : public FontMetric
+class TFM : public FontMetrics
{
public:
// TFM (const char *fname);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Terminal.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Terminal.cpp
index 82c91d575be..82c91d575be 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Terminal.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Terminal.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Terminal.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Terminal.h
index 0a876272c91..0a876272c91 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/Terminal.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/Terminal.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TpicSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TpicSpecialHandler.cpp
index f44b89277b7..f44b89277b7 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TpicSpecialHandler.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TpicSpecialHandler.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TpicSpecialHandler.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TpicSpecialHandler.h
index e055e2e0a69..e055e2e0a69 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/TpicSpecialHandler.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/TpicSpecialHandler.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFActions.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFActions.h
index ba25639b337..ba25639b337 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFActions.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFActions.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFReader.cpp
index 5980a63054a..5980a63054a 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFReader.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFReader.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFReader.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFReader.h
index 25689dec2c8..25689dec2c8 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VFReader.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VFReader.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VectorStream.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VectorStream.h
index e57dad43ad1..e57dad43ad1 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/VectorStream.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/VectorStream.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocument.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLDocument.cpp
index 5b6e3b1354f..6844ecb9e60 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocument.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLDocument.cpp
@@ -64,7 +64,7 @@ void XMLDocument::setRootNode (XMLElementNode *root) {
ostream& XMLDocument::write (ostream &os) const {
if (_rootElement) { // no root element => no output
- os << "<?xml version='1.0' encoding='ISO-8859-1'?>\n";
+ os << "<?xml version='1.0'?>\n";
FORALL(_nodes, list<XMLNode*>::const_iterator, i)
(*i)->write(os);
_rootElement->write(os);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocument.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLDocument.h
index 31cf9dea303..31cf9dea303 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLDocument.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLDocument.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLNode.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLNode.cpp
index d69b4a9b049..d69b4a9b049 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLNode.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLNode.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLNode.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLNode.h
index 324bea068aa..324bea068aa 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLNode.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLNode.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLString.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLString.cpp
index 326eaf89bdf..9175c068269 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLString.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLString.cpp
@@ -23,13 +23,14 @@
#include <iomanip>
#include <sstream>
#include "macros.h"
+#include "types.h"
#include "XMLString.h"
using namespace std;
int XMLString::DECIMAL_PLACES = 0;
-static string translate (unsigned c) {
+static string translate (UInt32 c) {
switch (c) {
case '<' : return "&lt;";
case '&' : return "&amp;";
@@ -40,7 +41,7 @@ static string translate (unsigned c) {
if (c >= 32 && c <= 126)
oss << char(c);
else
- oss <<"&#" << unsigned(c) << ';';
+ oss <<"&#" << UInt32(c) << ';';
return oss.str();
}
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLString.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLString.h
index b1496b4a503..b1496b4a503 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/XMLString.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/XMLString.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/dvisvgm.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/dvisvgm.cpp
index 8a60e6b31f7..cc3304e8125 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/dvisvgm.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/dvisvgm.cpp
@@ -291,7 +291,7 @@ static void print_version (bool extended) {
if (extended) {
if (strlen(TARGET_SYSTEM) > 0)
oss << " (" TARGET_SYSTEM ")";
- oss << "\n" << string(oss.str().length()-1, '-') << "\n"
+ oss << "\n" << string(oss.str().length(), '-') << "\n"
"freetype: " << FontEngine::version() << "\n";
string gsver;
@@ -391,10 +391,8 @@ int main (int argc, char *argv[]) {
PhysicalFont::KEEP_TEMP_FILES = args.keep_given();
PhysicalFont::METAFONT_MAG = args.mag_arg();
XMLString::DECIMAL_PLACES = max(0, min(6, args.precision_arg()));
- HtmlSpecialHandler::LINK_MARKER =
- args.linkmark_arg() == "line" ? HtmlSpecialHandler::LM_LINE :
- args.linkmark_arg() == "box" ? HtmlSpecialHandler::LM_BOX : HtmlSpecialHandler::LM_NONE;
-
+ if (!HtmlSpecialHandler::setLinkMarker(args.linkmark_arg()))
+ Message::wstream(true) << "invalid argument '"+args.linkmark_arg()+"' supplied for option --linkmark\n";
double start_time = System::time();
string inputfile = ensure_suffix(args.file(0), args.eps_given() ? "eps" : "dvi");
ifstream ifs(inputfile.c_str(), ios_base::binary|ios_base::in);
@@ -416,7 +414,7 @@ int main (int argc, char *argv[]) {
DVIToSVG dvi2svg(ifs, out);
const char *ignore_specials = args.no_specials_given() ? (args.no_specials_arg().empty() ? "*" : args.no_specials_arg().c_str()) : 0;
dvi2svg.setProcessSpecials(ignore_specials, true);
- dvi2svg.setTransformation(get_transformation_string(args));
+ dvi2svg.setPageTransformation(get_transformation_string(args));
dvi2svg.setPageSize(args.bbox_arg());
init_fontmap(args);
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/gzstream.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/gzstream.cpp
index 2893c299891..2893c299891 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/gzstream.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/gzstream.cpp
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/gzstream.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/gzstream.h
index 60f38c4fac7..60f38c4fac7 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/gzstream.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/gzstream.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/iapi.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/iapi.h
index 8e29d938d03..8e29d938d03 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/iapi.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/iapi.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/ierrors.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/ierrors.h
index 3184341177e..3184341177e 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/ierrors.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/ierrors.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/macros.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/macros.h
index 8935b9babe9..8935b9babe9 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/macros.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/macros.h
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/options.xml b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/options.xml
index ea0a6f6db95..ea0a6f6db95 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/options.xml
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/options.xml
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.4/src/psdefs.cpp b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/psdefs.cpp
new file mode 100644
index 00000000000..9742ca1cd7a
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/psdefs.cpp
@@ -0,0 +1,83 @@
+/*************************************************************************
+** psdefs.cpp **
+** **
+** This file is part of dvisvgm -- the DVI to SVG converter **
+** Copyright (C) 2005-2013 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 **
+** published by the Free Software Foundation; either version 3 of **
+** the License, or (at your option) any later version. **
+** **
+** This program is distributed in the hope that it will be useful, but **
+** WITHOUT ANY WARRANTY; without even the implied warranty of **
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
+** GNU General Public License for more details. **
+** **
+** You should have received a copy of the GNU General Public License **
+** along with this program; if not, see <http://www.gnu.org/licenses/>. **
+*************************************************************************/
+
+#include "PSInterpreter.h"
+
+const char *PSInterpreter::PSDEFS =
+"3 dict dup begin/Install{matrix setmatrix}def/HWResolution[72 72]def/PageSize[10"
+"000 10000]def end setpagedevice/@dodraw true store/@patcnt 0 store/@SD systemdic"
+"t def/@UD userdict def true setglobal @SD/:save @SD/save get put @SD/:restore @S"
+"D/restore get put @SD/:gsave @SD/gsave get put @SD/:grestore @SD/grestore get pu"
+"t @SD/:grestoreall @SD/grestoreall 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/s"
+"how get put @SD/.setopacityalpha known not{@SD/.setopacityalpha{pop}put}if @SD/p"
+"rseq{-1 1{-1 roll =only( )print}for(\\n)print}put @SD/prcmd{( )exch(\\ndvi.)3{pr"
+"int}repeat prseq}put @SD/cvxall{{cvx}forall}put @SD/defpr{[exch[/copy @SD]cvxall"
+" 5 -1 roll dup 6 1 roll[/get/exec]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}st"
+"opped{$error/newerror false put}{2(querypos)prcmd}ifelse}put @SD/applyscalevals{"
+"1 0 transform 0 0 transform 3 -1 roll sub dup mul 3 1 roll sub dup mul add sqrt "
+"0 1 transform 0 0 transform 3 -1 roll sub dup mul 3 1 roll sub dup mul add sqrt "
+"1 0 transform dup mul exch dup dup mul 3 -1 roll add sqrt div 3(applyscalevals)p"
+"rcmd}put @SD/prpath{{2(moveto)prcmd}{2(lineto)prcmd}{6(curveto)prcmd}{0(closepat"
+"h)prcmd}pathforall}put @SD/charpath{/@dodraw false store :charpath/@dodraw true "
+"store}put @SD/show{@dodraw{dup :gsave currentpoint newpath moveto true charpath "
+"eofill :grestore :show}if}put @SD/stroke{@dodraw{0(newpath)prcmd prpath 0(stroke"
+")prcmd newpath}{:stroke}ifelse}put @SD/fill{@dodraw{0(newpath)prcmd prpath 0(fil"
+"l)prcmd newpath}{:fill}ifelse}put @SD/eofill{@dodraw{0(newpath)prcmd prpath 0(eo"
+"fill)prcmd newpath}{:eofill}ifelse}put @SD/clip{:clip 0(newpath)prcmd prpath 0(c"
+"lip)prcmd}put @SD/eoclip{:eoclip 0(newpath)prcmd prpath 0(eoclip)prcmd}put @SD/b"
+"op{pop pop}put/@rect{4 -2 roll moveto 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 rlineto neg 0 exch rlineto}{exch dup 0 rlineto exch 0"
+" exch rlineto neg 0 rlineto}ifelse closepath}bind def @SD/rectclip{newpath dup t"
+"ype/arraytype eq{aload length 4 idiv{@rectcc}repeat}{@rectcc}ifelse clip newpath"
+"}put @SD/rectfill{gsave newpath dup type/arraytype eq{aload length 4 idiv{@rectc"
+"c}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 setglobal @SD readonly pop/initclip 0 defpr/sysexec{@SD exch get exec}def"
+"/adddot{dup length 1 add string dup 0 46 put dup 3 -1 roll 1 exch putinterval}de"
+"f/setlinewidth{dup/setlinewidth sysexec applyscalevals 1(setlinewidth)prcmd}def/"
+"setlinecap 1 defpr/setlinejoin 1 defpr/setmiterlimit 1 defpr/setdash{mark 3 1 ro"
+"ll 2 copy/setdash sysexec applyscalevals exch aload length 1 add -1 roll countto"
+"mark(setdash)prcmd pop}def/setgstate{currentlinewidth 1(setlinewidth)prcmd curre"
+"ntlinecap 1(setlinecap)prcmd currentlinejoin 1(setlinejoin)prcmd currentmiterlim"
+"it 1(setmiterlimit)prcmd currentrgbcolor 3(setrgbcolor)prcmd 6 array currentmatr"
+"ix aload pop 6(setmatrix)prcmd currentdash mark 3 1 roll exch aload length 1 add"
+" -1 roll counttomark(setdash)prcmd pop}def/save{@UD begin/@saveID vmstatus pop p"
+"op def end :save @saveID 1(save)prcmd}def/restore{:restore setgstate @UD/@saveID"
+" known{@UD begin @saveID end}{0}ifelse 1(restore)prcmd}def/gsave 0 defpr/grestor"
+"e{:grestore setgstate 0(grestore)prcmd}def/grestoreall{:grestoreall setstate 0(g"
+"restoreall)prcmd}def/rotate{dup type/arraytype ne{dup 1(rotate)prcmd}if/rotate s"
+"ysexec}def/scale{dup type/arraytype ne{2 copy 2(scale)prcmd}if/scale sysexec}def"
+"/translate{dup type/arraytype ne{2 copy 2(translate)prcmd}if/translate sysexec}d"
+"ef/setmatrix{dup/setmatrix sysexec aload pop 6(setmatrix)prcmd}def/initmatrix{ma"
+"trix setmatrix}def/concat{matrix currentmatrix matrix concatmatrix setmatrix}def"
+"/makepattern{gsave <</mx 3 -1 roll >> begin dup/XUID[1000000 @patcnt]put mx/make"
+"pattern sysexec dup dup begin PatternType @patcnt BBox aload pop XStep YStep Pai"
+"ntType mx aload pop 15(makepattern)prcmd newpath matrix setmatrix PaintProc 0 1("
+"makepattern)prcmd end/@patcnt @patcnt 1 add store end grestore}def/setpattern{be"
+"gin PatternType 1 eq{PaintType 1 eq{XUID aload pop exch pop 1}{:gsave[currentcol"
+"orspace aload length -1 roll pop]setcolorspace/setcolor sysexec XUID aload pop e"
+"xch pop currentrgbcolor :grestore 4}ifelse(setpattern)prcmd}{/setpattern sysexec"
+"}ifelse end}def/setcolor{dup type/dicttype eq{setpattern}{/setcolor sysexec}ifel"
+"se}def/setgray 1 defpr/setcmykcolor 4 defpr/sethsbcolor 3 defpr/setrgbcolor 3 de"
+"fpr/.setopacityalpha{dup/.setopacityalpha sysexec 1(setopacityalpha)prcmd}def ";
diff --git a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/types.h b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/types.h
index c22d0e1bf47..c22d0e1bf47 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-1.3/src/types.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-1.4/src/types.h
diff --git a/Build/source/texk/dvisvgm/version.ac b/Build/source/texk/dvisvgm/version.ac
index 1793998a023..b0bfbb79f62 100644
--- a/Build/source/texk/dvisvgm/version.ac
+++ b/Build/source/texk/dvisvgm/version.ac
@@ -8,4 +8,4 @@ dnl
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current dvisvgm version
-m4_define([dvisvgm_version], [1.3])
+m4_define([dvisvgm_version], [1.4])