diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-27 13:55:44 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-02-27 13:55:44 +0000 |
commit | 47ce3271b417e6d0a8fcbbbe94bd9060290e5032 (patch) | |
tree | c6da726176d1271ff0fe608db0b51b52fb4870f8 | |
parent | e8c2792ffc88bff8519581351d6349a84d81bebe (diff) |
dvisvgm 1.15
git-svn-id: svn://tug.org/texlive/trunk@39886 c570f23f-e606-0410-a88d-b1316a301751
71 files changed, 620 insertions, 364 deletions
diff --git a/Build/source/texk/README b/Build/source/texk/README index fbd47537c14..a4e9a99bb9f 100644 --- a/Build/source/texk/README +++ b/Build/source/texk/README @@ -59,7 +59,7 @@ dvipos - ? dvipsk - maintained here, by us -dvisvgm 1.14.2 - checked 20jan16 +dvisvgm 1.15 - checked 27feb16 http://dvisvgm.bplaced.net/Downloads gregorio 4.1.0-rc2 - checked 25feb16 diff --git a/Build/source/texk/dvisvgm/ChangeLog b/Build/source/texk/dvisvgm/ChangeLog index 7e537680144..55c9571cb40 100644 --- a/Build/source/texk/dvisvgm/ChangeLog +++ b/Build/source/texk/dvisvgm/ChangeLog @@ -1,3 +1,8 @@ +2016-02-27 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * Imported release 1.15 + * version.ac: Adapted. + 2016-01-20 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * Imported release 1.14.2 diff --git a/Build/source/texk/dvisvgm/configure b/Build/source/texk/dvisvgm/configure index 85f1fdcce5f..de076fdb750 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.14.2. +# Generated by GNU Autoconf 2.69 for dvisvgm (TeX Live) 1.15. # # Report bugs to <tex-k@tug.org>. # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='dvisvgm (TeX Live)' PACKAGE_TARNAME='dvisvgm--tex-live-' -PACKAGE_VERSION='1.14.2' -PACKAGE_STRING='dvisvgm (TeX Live) 1.14.2' +PACKAGE_VERSION='1.15' +PACKAGE_STRING='dvisvgm (TeX Live) 1.15' PACKAGE_BUGREPORT='tex-k@tug.org' PACKAGE_URL='' @@ -1372,7 +1372,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dvisvgm (TeX Live) 1.14.2 to adapt to many kinds of systems. +\`configure' configures dvisvgm (TeX Live) 1.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1443,7 +1443,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dvisvgm (TeX Live) 1.14.2:";; + short | recursive ) echo "Configuration of dvisvgm (TeX Live) 1.15:";; esac cat <<\_ACEOF @@ -1583,7 +1583,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dvisvgm (TeX Live) configure 1.14.2 +dvisvgm (TeX Live) configure 1.15 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2451,7 +2451,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dvisvgm (TeX Live) $as_me 1.14.2, which was +It was created by dvisvgm (TeX Live) $as_me 1.15, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -8137,7 +8137,7 @@ fi # Define the identity of the package. PACKAGE='dvisvgm--tex-live-' - VERSION='1.14.2' + VERSION='1.15' cat >>confdefs.h <<_ACEOF @@ -18321,7 +18321,7 @@ Usage: $0 [OPTIONS] Report bugs to <bug-libtool@gnu.org>." lt_cl_version="\ -dvisvgm (TeX Live) config.lt 1.14.2 +dvisvgm (TeX Live) config.lt 1.15 configured by $0, generated by GNU Autoconf 2.69. Copyright (C) 2011 Free Software Foundation, Inc. @@ -20684,7 +20684,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by dvisvgm (TeX Live) $as_me 1.14.2, which was +This file was extended by dvisvgm (TeX Live) $as_me 1.15, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20750,7 +20750,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -dvisvgm (TeX Live) config.status 1.14.2 +dvisvgm (TeX Live) config.status 1.15 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 228c230668a..c282058b168 100644 --- a/Build/source/texk/dvisvgm/configure.ac +++ b/Build/source/texk/dvisvgm/configure.ac @@ -8,7 +8,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl dnl ********************************************************************* dnl -dnl Adapted for TeX Live from dvisvgm-0.8.7/configure.ac +dnl Adapted for TeX Live from dvisvgm-src/configure.ac dnl Copyright (C) 2005-2009 Martin Gieseking <martin.gieseking@uos.de> dnl dnl ********************************************************************* diff --git a/Build/source/texk/dvisvgm/dvisvgm-PATCHES/ChangeLog b/Build/source/texk/dvisvgm/dvisvgm-PATCHES/ChangeLog index 2560022a69e..f6ce18fbbc6 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-PATCHES/ChangeLog +++ b/Build/source/texk/dvisvgm/dvisvgm-PATCHES/ChangeLog @@ -1,3 +1,7 @@ +2016-02-27 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * Import release 1.15 + 2016-01-20 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * Import release 1.14.2 diff --git a/Build/source/texk/dvisvgm/dvisvgm-PATCHES/TL-Changes b/Build/source/texk/dvisvgm/dvisvgm-PATCHES/TL-Changes index fb6f32467a9..4c1b9ba2415 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-PATCHES/TL-Changes +++ b/Build/source/texk/dvisvgm/dvisvgm-PATCHES/TL-Changes @@ -1,4 +1,4 @@ -Changes applied to the dvisvgm-1.14.2 tree as obtained from: +Changes applied to the dvisvgm-1.15 tree as obtained from: http://dvisvgm.bplaced.net/Downloads Removed: diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog b/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog index 6719ef61320..fd37d4d9f83 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog +++ b/Build/source/texk/dvisvgm/dvisvgm-src/ChangeLog @@ -1,3 +1,135 @@ +2016-02-27 Martin Gieseking <martin.gieseking@uos.de> + + * NEWS: + updated NEWS + +2016-02-26 Martin Gieseking <martin.gieseking@uos.de> + + * .travis.yml, configure.ac, src/Doxyfile: + set version to 1.15 + + * src/FileFinder.cpp, src/FilePath.cpp, src/FileSystem.cpp, + src/FileSystem.h, src/Font.cpp, src/MetafontWrapper.cpp, src/dvisvgm.cpp: + changed string parameters of FileSystem functions to type std::string + + * src/Font.cpp, src/Unicode.cpp, src/Unicode.h, tests/UnicodeTest.cpp: + renamed Unicode::psNameToCodepoint() to Unicode::aglNameToCodepoint + + * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h, + src/Font.cpp, src/Font.h, src/SVGTree.cpp, src/SVGTree.h, + src/dvisvgm.cpp, src/options.xml: + added option --comments (adds comments with additional information to + the SVG file + +2016-02-23 Martin Gieseking <martin.gieseking@uos.de> + + * configure.ac, src/FileFinder.cpp, src/FileFinder.h, + tests/FileFinderTest.cpp, tests/GFGlyphTracerTest.cpp, + tests/GFReaderTest.cpp, tests/JFMReaderTest.cpp, tests/Makefile.am, + tests/TFMReaderTest.cpp, tests/cidjmgr0-h.tfm, tests/cmr10.600gf, + tests/cmr10.tfm, tests/create-makefile, tests/data/Makefile.am, + tests/data/cidjmgr0-h.tfm, tests/data/cmr10.600gf, tests/data/cmr10.tfm, + tests/data/dvipdfm_test.map, tests/data/dvips_test.map, + tests/data/frktest-nf-cmp.svg, tests/data/frktest-wf-cmp.svg, + tests/data/frktest.dvi, tests/data/sample-nf-cmp.svg, + tests/data/sample-wf-cmp.svg, tests/data/sample.dvi, + tests/data/sample.sfd, tests/dvipdfm_test.map, tests/dvips_test.map, + tests/frktest-nf-cmp.svg, tests/frktest-wf-cmp.svg, tests/frktest.dvi, + tests/sample-nf-cmp.svg, tests/sample-wf-cmp.svg, tests/sample.dvi, + tests/sample.sfd: + moved test data files to subfolder + + * src/MetafontWrapper.cpp, src/Process.cpp: + avoid reading Metafont logfiles to extract the GF filename + + * src/FontEngine.cpp: + reworded error messages of class FontEngine + +2016-02-22 Martin Gieseking <martin.gieseking@uos.de> + + * src/FontEngine.cpp, src/FontEngine.h: + removed redundant code from class FontEngine + + * src/XMLNode.cpp, tests/DvisvgmSpecialTest.cpp: + improved DvisvgmSpecialTest + + * src/CmdLineParserBase.cpp, src/CmdLineParserBase.h, + tests/CommandLineTest.cpp: + minor improvements of class CommandLineTest + +2016-02-05 Martin Gieseking <martin.gieseking@uos.de> + + * src/PsSpecialHandler.cpp: + don't remove clipping paths that consist of single moveto commands only + +2016-02-01 Martin Gieseking <martin.gieseking@uos.de> + + * src/Bitmap.cpp, src/BoundingBox.cpp, src/CMap.cpp, src/CMapManager.cpp, + src/Calculator.cpp, src/CommandLine.cpp, src/DVIReader.cpp, + src/DVIToSVG.cpp, src/DVIToSVG.h, src/DVIToSVGActions.cpp, + src/Directory.cpp, src/Directory.h, src/EPSToSVG.cpp, src/EncFile.cpp, + src/FileFinder.cpp, src/Font.cpp, src/FontCache.h, src/FontEngine.cpp, + src/FontManager.cpp, src/FontMap.cpp, src/FontMetrics.cpp, + src/GFGlyphTracer.cpp, src/GFReader.cpp, src/GFTracer.cpp, + src/HtmlSpecialHandler.cpp, src/InputReader.cpp, src/MapLine.cpp, + src/MetafontWrapper.cpp, src/PSInterpreter.cpp, + src/PdfSpecialHandler.cpp, src/Process.cpp, src/PsSpecialHandler.cpp, + src/SVGTree.cpp, src/SpecialManager.cpp, src/StreamReader.cpp, + src/StreamWriter.cpp, src/Subfont.cpp, src/TFM.cpp, + src/TensorProductPatch.cpp, src/TpicSpecialHandler.cpp, src/VFReader.cpp, + src/XMLDocument.cpp, src/dvisvgm.cpp, tests/XMLStringTest.cpp: + minor code cleanup (removed redundant includes, added casts) + +2016-01-21 Martin Gieseking <martin.gieseking@uos.de> + + * src/JFM.h, tests/JFMReaderTest.cpp, tests/Makefile.am, + tests/TFMReaderTest.cpp, tests/cidjmgr0-h.tfm, tests/cmr10.tfm, + tests/create-makefile: + added tests for the TFM and JFM classes + + * m4/ax_code_coverage.m4: + updated m4 code coverage script to latest version + +2016-01-19 Martin Gieseking <martin.gieseking@uos.de> + + * NEWS, README.md: + updated NEWS + + * .travis.yml, configure.ac, src/Doxyfile: + set version to 1.14.2 + + * src/GraphicsPath.h, tests/GraphicsPathTest.cpp: + fixed access of invalid iterator + +2016-01-18 Martin Gieseking <martin.gieseking@uos.de> + + * tests/Makefile.am, tests/create-makefile, tests/genhashcheck.py: + added test to check the validity of the char name hashes used in + Unicode.cpp + + * src/dvisvgm.cpp, xxHash/xxhash.c, xxHash/xxhash.h: + updated xxHash to version 0.5.0 + + * doc/db2html.xsl: + updated links to Bootstrap and Font Awesome in stylesheet db2html.xsl + +2016-01-15 Martin Gieseking <martin.gieseking@uos.de> + + * src/BgColorSpecialHandler.cpp, src/ColorSpecialHandler.cpp, + src/ColorSpecialHandler.h, tests/ColorSpecialTest.cpp: + removed check for 'background' special from ColorSpecialHandler + +2016-01-13 Martin Gieseking <martin.gieseking@uos.de> + + * src/BgColorSpecialHandler.cpp, src/BgColorSpecialHandler.h, + src/ColorSpecialHandler.cpp, src/ColorSpecialHandler.h, src/DVIToSVG.cpp, + src/SpecialHandler.h, src/SpecialManager.cpp, src/SpecialManager.h: + corrected handling of background color special across DVI pages + + * src/DVIReader.h, src/FontStyle.h, src/SVGTree.cpp, + src/TriangularPatch.cpp: + updated/fixed some comments + 2016-01-05 Martin Gieseking <martin.gieseking@uos.de> * NEWS: @@ -250,11 +382,6 @@ * src/Process.cpp, src/Process.h: fixed invalid access to freed string memory -2015-10-06 Martin Gieseking <martin.gieseking@uos.de> - - * doc/dvisvgm.txt.in: - minor improvements of the manual page - 2015-09-21 Martin Gieseking <martin.gieseking@uos.de> * NEWS, README, README.md: @@ -519,9 +646,9 @@ * doc/dvisvgm.txt.in: minor additions and formatting changes of the manpage - * doc/dvisvgm.txt.in, src/SVGOutput.cpp, src/SVGOutput.h, - tests/Makefile.am, tests/SVGOutputTest.cpp, tests/create-makefile: - added width specifiers and exression evaluation to --output patterns + * src/DVIToSVG.cpp, src/EPSToSVG.cpp, src/Makefile.am, src/SVGOutput.cpp, + src/SVGOutput.h, src/SVGOutputBase.h, src/dvisvgm.cpp: + moved class SVGOutput to separate compilation unit 2015-02-19 Martin Gieseking <martin.gieseking@uos.de> @@ -547,11 +674,6 @@ * src/TpicSpecialHandler.cpp: use constant M_PI rather than computing PI locally -2015-02-17 Martin Gieseking <martin.gieseking@uos.de> - - * README, README.md: - updated README and README.md - 2015-01-21 Martin Gieseking <martin.gieseking@uos.de> * src/TensorProductPatch.cpp, src/TriangularPatch.cpp: @@ -867,10 +989,8 @@ Breaks standard things * src/XMLDocument.cpp, src/XMLDocument.h, src/XMLNode.cpp, src/XMLNode.h: removed unused emit() methods from XML classes -2014-08-06 Martin Gieseking <martin.gieseking@uos.de> - - * README.md: - minor fixes to README.md + * src/dvisvgm.cpp: + removed old code that moved cache files to new location 2014-07-31 Martin Gieseking <martin.gieseking@uos.de> @@ -1512,10 +1632,10 @@ Breaks standard things replaced local std::map tables used in Font classes with new class CharMap -2013-08-22 Martin Gieseking <martin.gieseking@uos.de> +2013-08-23 Martin Gieseking <martin.gieseking@uos.de> - * src/XMLString.cpp: - replace very small floating point numbers by 0 + * src/SVGTree.cpp: + appended px unit to font-size attributes in style section 2013-08-20 Martin Gieseking <martin.gieseking@uos.de> @@ -1818,8 +1938,9 @@ Breaks standard things src/VFReader.cpp: added missing member initializations to some classes - * src/DVIToSVG.cpp, src/EPSToSVG.cpp, src/dvisvgm.cpp: - avoid output of empty parentheses if TARGET_SYSTEM is not set + * doc/dvisvgm.txt.in, src/CmdLineParserBase.cpp, src/CommandLine.cpp, + src/options.dtd, src/options.xml: + added information about 'dvisvgm -E' to usage line 2013-04-20 Martin Gieseking <martin.gieseking@uos.de> @@ -1912,11 +2033,21 @@ Breaks standard things added methods to lookup attribute values and selected descendant XML nodes + * src/XMLNode.cpp, src/XMLNode.h: + added virtual constructor XMLNode::clone() + 2013-02-19 Martin Gieseking <martin.gieseking@uos.de> * src/FilePath.cpp: adapt path separators on Windows systems to get the correct output path + * doc/dvisvgm.txt.in, src/CommandLine.cpp, src/CommandLine.h, + src/DVIToSVG.cpp, src/DVIToSVG.h, src/EPSFile.cpp, src/EPSFile.h, + src/EPSToSVG.cpp, src/EPSToSVG.h, src/Makefile.am, + src/PsSpecialHandler.cpp, src/SVGOutputBase.h, src/dvisvgm.cpp, + src/options.xml: + add option to directly convert EPS files to SVG + * src/PSInterpreter.cpp, src/PSInterpreter.h: added PSInterpreter::limit() to limit the number of bytes to be processed @@ -1933,15 +2064,6 @@ Breaks standard things src/CommandLine.cpp, src/CommandLine.h, src/dvisvgm.cpp, src/options.xml: added optional parameter to option --help to specify output format -2013-02-06 Martin Gieseking <martin.gieseking@uos.de> - - * doc/dvisvgm.txt.in, src/BoundingBox.cpp, src/CommandLine.cpp, - src/CommandLine.h, src/EmSpecialHandler.cpp, src/GraphicPath.h, - src/Matrix.cpp, src/PsSpecialHandler.cpp, src/TpicSpecialHandler.cpp, - src/XMLString.cpp, src/XMLString.h, src/dvisvgm.cpp, src/options.xml: - added option --precision to set the number of decimal places applied to - attribute values - 2013-01-30 Martin Gieseking <martin.gieseking@uos.de> * src/CommandLine.cpp: @@ -2178,11 +2300,6 @@ Breaks standard things tests/StreamInputBufferTest.cpp: some refactorings of class InputReader; added InputReader::find() -2012-10-24 Martin Gieseking <martin.gieseking@uos.de> - - * src/DVIToSVG.cpp, src/DVIToSVG.h, src/dvisvgm.cpp: - don't show warning about disabled PS support in list of special handlers - 2012-09-27 Martin Gieseking <martin.gieseking@uos.de> * doc/Makefile.am: @@ -2199,19 +2316,21 @@ Breaks standard things * src/PsSpecialHandler.cpp, src/PsSpecialHandler.h: removed Ghostscript info from ps entry in list of special handlers - * src/DVIToSVG.cpp: - show warning if processing of PS specials is disabled +2012-09-19 Martin Gieseking <martin.gieseking@uos.de> + + * src/psdefs.ps, src/psdefs.psc: + ignore dvips bop operators that might be present in PS specials + +2012-09-17 Martin Gieseking <martin.gieseking@uos.de> + + * src/StreamReader.cpp: + fixed reading invalid number of string characters 2012-06-06 Martin Gieseking <martin.gieseking@uos.de> * src/gfprint.mak: fixed bugs in gfprint, and added gfprint.mak for easier builds -2012-04-17 Martin Gieseking <martin.gieseking@uos.de> - - * doc/Makefile.am: - keep manpage when calling 'make clean' or 'make distclean' - 2012-04-04 Martin Gieseking <martin.gieseking@uos.de> * src/DVIToSVGActions.cpp, src/SVGTree.cpp, src/SVGTree.h, @@ -2266,15 +2385,6 @@ Breaks standard things * README: updated information about bug reporting -2012-01-26 Martin Gieseking <martin.gieseking@uos.de> - - * src/CmdLineParserBase.h, src/DVIActions.h, src/DVIReader.h, - src/DVIToSVGActions.h, src/FontEngine.h, src/FontManager.h, - src/MetafontWrapper.h, src/SVGTree.h, src/SpecialActions.h, - src/SpecialHandler.h, src/SpecialManager.h, src/TFM.h, src/VFReader.h: - adapt forward declarations of classes and structs to their corresponding - definition (SF bug #3480013) - 2012-01-09 Martin Gieseking <martin.gieseking@uos.de> * src/TpicSpecialHandler.cpp: @@ -3124,6 +3234,10 @@ Breaks standard things src/SVGFontEmitter.cpp, src/SVGFontEmitter.h: removed class Glyph and incorporated its functionality into Font class + * src/Font.h, src/FontEncoding.cpp, src/FontEncoding.h, + src/FontManager.cpp, src/FontManager.h, src/SVGFontEmitter.cpp: + moved method encoding() from class FontManager to class FontEncoding + 2010-02-05 Martin Gieseking <martin.gieseking@uos.de> * src/DVIToSVG.cpp: @@ -3351,10 +3465,10 @@ Breaks standard things * src/GraphicPath.h, src/PsSpecialHandler.cpp: PS handler: replace zero-length paths by dots -2009-10-29 Martin Gieseking <martin.gieseking@uos.de> +2009-10-25 Martin Gieseking <martin.gieseking@uos.de> - * src/DVIToSVGActions.cpp, src/Font.cpp, src/Font.h: - fixed positioning of italic characters + * src/DvisvgmSpecialHandler.cpp: + added macro {?nl} to dvisvgm:raw evaluator 2009-10-18 Martin Gieseking <martin.gieseking@uos.de> @@ -3519,25 +3633,25 @@ Breaks standard things * NEWS, src/PsSpecialHandler.cpp: fixed another positioning bug reported by John Bowman - * src/PsSpecialHandler.cpp: - convert PS path coordinated to TeX point units - 2009-10-04 Martin Gieseking <martin.gieseking@uos.de> + * src/Makefile.old, src/Makefile.orig: + renamed the old original Makefile + * src/GraphicPath.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h: corrected positioning bug introduced with previous PS positioning fix + * src/DVIReader.cpp, src/DVIReader.h, src/DVIToSVGActions.cpp, + src/DVIToSVGActions.h, src/PsSpecialHandler.cpp, src/PsSpecialHandler.h, + src/SpecialActions.h, src/psdefs.ps, src/psdefs.psc: + fixed positioning bug reported by John Bowman + 2009-10-02 Martin Gieseking <martin.gieseking@uos.de> * doc/Makefile.am, doc/dvisvgm.txt.in: generate pdf manpage directly with groff; adapted manpage source to work with latest asciidoc -2009-10-01 Martin Gieseking <martin.gieseking@uos.de> - - * doc/Makefile.am, doc/dvisvgm.txt.in: - replaced backticks in manpage by apostrophes; updated date on homepage - 2009-09-30 Martin Gieseking <martin.gieseking@uos.de> * Makefile.am, configure.ac, fedora/dvisvgm.spec, src/Doxyfile: @@ -3549,13 +3663,17 @@ Breaks standard things * doc/dvisvgm.txt.in: added dvisvgm:raw example to man page + * src/DvisvgmSpecialHandler.cpp: + added optional depth parameter to special dvisvgm:raw + 2009-09-17 Martin Gieseking <martin.gieseking@uos.de> * doc/dvisvgm.txt.in: minor changes of the documentation - * fedora/dvisvgm.spec: - updated spec file and fixed typo on website + * doc/dvisvgm.txt.in: + corrected info about --verbosity in manual page (reported by John + Bowman) * src/PsSpecialHandler.h: increased the default linewidth to 0.5 @@ -3652,14 +3770,21 @@ Breaks standard things src/SpecialManager.cpp, src/SpecialManager.h: PS prologue files referenced in first page are now always loaded + * fedora/dvisvgm-0.8.1-potrace.patch, fedora/dvisvgm-gs.patch, + fedora/dvisvgm-potrace.patch, fedora/dvisvgm.spec: + updated Fedora files + * configure.ac, fedora/dvisvgm.spec, src/Ghostscript.cpp, src/Ghostscript.h, src/Makefile.am: improved Ghostscript and potrace linking checks to simplify usage of external devel files - * fedora/dvisvgm-0.8.1-potrace.patch, fedora/dvisvgm-gs.patch, - fedora/dvisvgm-potrace.patch, fedora/dvisvgm.spec: - updated Fedora files +2009-08-25 Martin Gieseking <martin.gieseking@uos.de> + + * configure.ac, src/DVIToSVGActions.cpp, src/Ghostscript.cpp, + src/Ghostscript.h: + added configuration method to directly bind the Ghostscript shared + library 2009-08-24 Martin Gieseking <martin.gieseking@uos.de> @@ -4044,10 +4169,10 @@ Breaks standard things 2009-02-25 Martin Gieseking <martin.gieseking@uos.de> - * src/DVIToSVGActions.cpp, src/DVIToSVGActions.h, - src/DvisvgmSpecialHandler.cpp, src/EmSpecialHandler.cpp, - src/SpecialActions.h, src/TpicSpecialHandler.cpp: - renamed appendInPage() to appendToPage + * configure.ac, doc/Makefile.am, doc/caution.png, doc/dvisvgm.1.in, + doc/dvisvgm.txt, doc/note.png: + replaced manually written dvisvgm.1.in by an asciidoc file + (dvisvgm.txt.in) 2009-02-24 Martin Gieseking <martin.gieseking@uos.de> @@ -4107,9 +4232,14 @@ Breaks standard things 2009-02-17 Martin Gieseking <martin.gieseking@uos.de> - * src/DVIReader.cpp: - made DVICommand local to executeCommand, removed unnecessary if - statement + * src/BoundingBox.cpp, src/ColorSpecialHandler.cpp, + src/ColorSpecialHandler.h, src/DVIToSVGActions.cpp, src/FontGlyph.cpp, + src/InputBuffer.cpp, src/InputBuffer.h, src/Makefile.am, src/Pair.h, + src/SpecialActions.h, src/SpecialColorHandler.cpp, + src/SpecialColorHandler.h, src/SpecialEmHandler.cpp, + src/SpecialEmHandler.h, src/TransformationMatrix.cpp, + src/tests/ColorSpecialTest.h: + added skeleton of em special handler; doesn't work yet 2009-02-15 Martin Gieseking <martin.gieseking@uos.de> diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS index e0ac3632d8b..477ef3c460b 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/NEWS +++ b/Build/source/texk/dvisvgm/dvisvgm-src/NEWS @@ -1,3 +1,9 @@ +dvisvgm-1.15 (2016-02-27) +- added option --comments to add additional information to the SVG file +- fixed a clipping bug in the PostScript handler +- some code improvements and refactorings +- moved test data files to a separate folder + dvisvgm-1.14.2 (2016-01-20) - fixed handling of background color specials (now they affect all succeeding pages until the next change) - fixed a potential memory issue caused by accessing an invalid iterator diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac index 2c1843e327e..8148f83b3c2 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac +++ b/Build/source/texk/dvisvgm/dvisvgm-src/configure.ac @@ -4,8 +4,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([dvisvgm],[1.14.2],[martin.gieseking@uos.de]) -DATE="January 2016" +AC_INIT([dvisvgm],[1.15],[martin.gieseking@uos.de]) +DATE="February 2016" AC_CONFIG_SRCDIR(src) AC_CONFIG_HEADER(config.h) AC_CONFIG_MACRO_DIR([m4]) @@ -171,6 +171,14 @@ AS_IF([ test "$enable_code_coverage" = "yes" ], [ AC_SUBST(DATE) AC_SUBST(AM_CPPFLAGS) AC_SUBST(AM_LDFLAGS) -AC_CONFIG_FILES([Makefile clipper/Makefile xxHash/Makefile src/Makefile tests/Makefile doc/dvisvgm.txt doc/Makefile]) +AC_CONFIG_FILES([ + Makefile + clipper/Makefile + xxHash/Makefile + src/Makefile + tests/Makefile + tests/data/Makefile + doc/dvisvgm.txt + doc/Makefile]) AC_OUTPUT diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 index 7ff07f0015f..e66b5e96daa 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 +++ b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 @@ -2,12 +2,12 @@ .\" Title: dvisvgm .\" Author: Martin Gieseking <martin.gieseking@uos.de> .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 01/20/2016 +.\" Date: 02/27/2016 .\" Manual: dvisvgm Manual -.\" Source: dvisvgm 1.14.2 +.\" Source: dvisvgm 1.15 .\" Language: English .\" -.TH "DVISVGM" "1" "01/20/2016" "dvisvgm 1\&.14\&.2" "dvisvgm Manual" +.TH "DVISVGM" "1" "02/27/2016" "dvisvgm 1\&.15" "dvisvgm Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -221,6 +221,11 @@ and \fB\-\-colornames\fR\&. All colors without an SVG color name will still be represented by RGB values\&. .RE .PP +\fB\-\-comments\fR +.RS 4 +Adds comments with further information about selected data to the SVG file\&. Currently, only font elements and font CSS rules related to native fonts are annotated\&. +.RE +.PP \fB\-E, \-\-eps\fR .RS 4 If this option is given, dvisvgm does not expect a DVI but an EPS input file, and tries to convert it to SVG\&. In order to do so, a single diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in index c16d147a2bc..2142fdfc4bd 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in +++ b/Build/source/texk/dvisvgm/dvisvgm-src/doc/dvisvgm.txt.in @@ -168,6 +168,9 @@ and +darkblue+) for a limited number of predefined colors. In order to apply the rather than their RGB values, call dvisvgm with option *--colornames*. All colors without an SVG color name will still be represented by RGB values. +*--comments*:: +Adds comments with further information about selected data to the SVG file. Currently, only +font elements and font CSS rules related to native fonts are annotated. *-E, --eps*:: If this option is given, dvisvgm does not expect a DVI but an EPS input file, and tries to convert diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/m4/ax_code_coverage.m4 b/Build/source/texk/dvisvgm/dvisvgm-src/m4/ax_code_coverage.m4 index 2751459c1d1..93777675c7a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/m4/ax_code_coverage.m4 +++ b/Build/source/texk/dvisvgm/dvisvgm-src/m4/ax_code_coverage.m4 @@ -8,14 +8,15 @@ # # DESCRIPTION # -# Defines CODE_COVERAGE_CFLAGS and CODE_COVERAGE_LDFLAGS which should be -# included in the CFLAGS and LIBS/LDFLAGS variables of every build target -# (program or library) which should be built with code coverage support. -# Also defines CODE_COVERAGE_RULES which should be substituted in your -# Makefile; and $enable_code_coverage which can be used in subsequent -# configure output. CODE_COVERAGE_ENABLED is defined and substituted, and -# corresponds to the value of the --enable-code-coverage option, which -# defaults to being disabled. +# Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS and +# CODE_COVERAGE_LDFLAGS which should be included in the CPPFLAGS, CFLAGS +# and LIBS/LDFLAGS variables of every build target (program or library) +# which should be built with code coverage support. Also defines +# CODE_COVERAGE_RULES which should be substituted in your Makefile; and +# $enable_code_coverage which can be used in subsequent configure output. +# CODE_COVERAGE_ENABLED is defined and substituted, and corresponds to the +# value of the --enable-code-coverage option, which defaults to being +# disabled. # # Test also for gcov program and create GCOV variable that could be # substituted. @@ -33,6 +34,7 @@ # # @CODE_COVERAGE_RULES@ # my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ... +# my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... # # This results in a "check-code-coverage" rule being added to any @@ -67,7 +69,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -#serial 5 +#serial 9 AC_DEFUN([AX_CODE_COVERAGE],[ dnl Check for --enable-code-coverage @@ -104,7 +106,7 @@ AC_DEFUN([AX_CODE_COVERAGE],[ ]) # List of supported lcov versions. - lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11" + lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" AC_CHECK_PROG([LCOV], [lcov], [lcov]) AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) @@ -137,9 +139,11 @@ AC_DEFUN([AX_CODE_COVERAGE],[ ]) dnl Build the code coverage flags + CODE_COVERAGE_CPPFLAGS="-DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_LDFLAGS="-lgcov" + AC_SUBST([CODE_COVERAGE_CPPFLAGS]) AC_SUBST([CODE_COVERAGE_CFLAGS]) AC_SUBST([CODE_COVERAGE_LDFLAGS]) ]) @@ -179,6 +183,17 @@ CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) CODE_COVERAGE_GENHTML_OPTIONS ?= CODE_COVERAGE_IGNORE_PATTERN ?= +code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) +code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ + $(CODE_COVERAGE_OUTPUT_FILE); +code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) +code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ + $(CODE_COVERAGE_IGNORE_PATTERN); +code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) +code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) +code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); code_coverage_quiet = $(code_coverage_quiet_$(V)) code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) code_coverage_quiet_0 = --quiet @@ -186,8 +201,8 @@ code_coverage_quiet_0 = --quiet # Use recursive makes in order to ignore errors during check check-code-coverage: ifeq ($(CODE_COVERAGE_ENABLED),yes) - -$(MAKE) $(AM_MAKEFLAGS) -k check - $(MAKE) $(AM_MAKEFLAGS) code-coverage-capture + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture else @echo "Need to reconfigure with --enable-code-coverage" endif @@ -195,10 +210,10 @@ endif # Capture code coverage data code-coverage-capture: code-coverage-capture-hook ifeq ($(CODE_COVERAGE_ENABLED),yes) - $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS) - $(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) --directory $(CODE_COVERAGE_DIRECTORY) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) --prefix $(CODE_COVERAGE_DIRECTORY) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" else @echo "Need to reconfigure with --enable-code-coverage" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Bitmap.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Bitmap.cpp index e83ff8b8ee9..ad8a915c318 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Bitmap.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Bitmap.cpp @@ -21,7 +21,6 @@ #include <config.h> #include <algorithm> #include <cstdlib> -#include <iostream> #include <limits> #include "Bitmap.h" #include "macros.h" @@ -86,7 +85,7 @@ void Bitmap::forAllPixels (Callback &data) const { UInt8 byte = _bytes[row*_bpr+col]; int x; for (int b=7; (b >= 0) && ((x = 8*col+(7-b)) < _cols); b--) - data.pixel(x, row, byte & (1 << b), *this); + data.pixel(x, row, bool(byte & (1 << b)), *this); } } data.finish(); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/BoundingBox.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/BoundingBox.cpp index 6caa29554c3..eca7142dbf0 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/BoundingBox.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/BoundingBox.cpp @@ -21,7 +21,6 @@ #include <config.h> #include <algorithm> #include <sstream> -#include <string> #include "BoundingBox.h" #include "Matrix.h" #include "XMLNode.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.cpp index 4b7e8ec5811..ba536de75d7 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMap.cpp @@ -21,12 +21,9 @@ #include <config.h> #include <algorithm> #include <sstream> -#include <set> -#include <vector> #include "CMap.h" #include "CMapManager.h" #include "FileFinder.h" -#include "InputReader.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp index 57e469c4cd9..2f360d7331d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CMapManager.cpp @@ -23,7 +23,6 @@ #include "CMap.h" #include "CMapManager.h" #include "CMapReader.h" -#include "Font.h" #include "FileFinder.h" #include "Message.h" @@ -121,7 +120,7 @@ const CMap* CMapManager::findCompatibleBaseFontMap (const PhysicalFont *font, co vector<CharMapID> charmapIDs; font->collectCharMapIDs(charmapIDs); - const bool is_unicode_map = dynamic_cast<const UnicodeCMap*>(cmap); + const bool is_unicode_map = bool(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 diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Calculator.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Calculator.cpp index ecd996953ac..3e82161f387 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Calculator.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Calculator.cpp @@ -31,9 +31,6 @@ const char NUMBER = 1; const char NAME = 2; -#include <iostream> - - /** Evaluates a given arithmetic expression and returns its value. * The evaluator is implemented as a recursive descent parser. * @param[in] is reads expression from this stream diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.cpp index f15318f9c26..e6d11c102a4 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.cpp @@ -344,18 +344,26 @@ static bool cmp_long (const char *line1, const char *line2) { } +static void write_line (const char *str) { + fputs(str, stdout); +} + + /** Prints the help text to stdout. * @param[in] mode format of help text */ -void CmdLineParserBase::help (int mode) const { +void CmdLineParserBase::help (int mode, void (*out)(const char*)) const { size_t numlines; const char **lines = helplines(&numlines); + if (out == 0) + out = write_line; if (mode == 0) { // list options with section headers for (size_t i=0; i < numlines; i++) { switch (*lines[i]) { - case 's': fputc('\n', stdout); break; // section header - case 'o': fputs(" ", stdout); break; // option info + case 's': out("\n"); break; // section header + case 'o': out(" "); break; // option info } - puts(lines[i]+1); + out(lines[i]+1); + out("\n"); } } else { @@ -363,9 +371,10 @@ void CmdLineParserBase::help (int mode) const { sort(linevec.begin(), linevec.end(), mode == 1 ? cmp_short : cmp_long); for (vector<const char*>::iterator it=linevec.begin(); it != linevec.end(); ++it) { if (**it != 's') { // skip section headers - puts(*it+1); + out(*it+1); + out("\n"); if (**it == 'd') - puts("\nOptions:"); + out("\nOptions:\n"); } } } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.h index 5eaa189250f..0052f3423ac 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CmdLineParserBase.h @@ -65,7 +65,7 @@ class CmdLineParserBase public: virtual void parse (int argc, char **argv, bool printErrors=true); - virtual void help (int mode=0) const; + virtual void help (int mode=0, void (*out)(const char*)=0) const; virtual int numFiles () const {return _files.size();} virtual const char* file (size_t n) {return n < _files.size() ? _files[n].c_str() : 0;} // virtual void status () const; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.cpp index 1d53201a694..ba052631c8d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.cpp @@ -21,6 +21,7 @@ const CmdLineParserBase::Option CommandLine::_options[] = { #endif {'\0', "color", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_color)}, {'\0', "colornames", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_colornames)}, + {'\0', "comments", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_comments)}, #if !defined(DISABLE_GS) {'E', "eps", ARG_NONE, new OptionHandlerImpl<CommandLine>(&CommandLine::handle_eps)}, #endif @@ -81,6 +82,7 @@ void CommandLine::init () { #endif _color_given = false; _colornames_given = false; + _comments_given = false; #if !defined(DISABLE_GS) _eps_given = false; #endif @@ -172,6 +174,7 @@ const char** CommandLine::helplines (size_t *numlines) const { "o-j, --clipjoin compute intersection of clipping paths", #endif "o --colornames prefer color names to RGB values if possible", + "o --comments add comments with additional information", #if !defined(DISABLE_GS) "o --grad-overlap create operlapping color gradient segments", #endif @@ -243,6 +246,10 @@ void CommandLine::handle_colornames (InputReader &ir, const Option &opt, bool lo _colornames_given = true; } +void CommandLine::handle_comments (InputReader &ir, const Option &opt, bool longopt) { + _comments_given = true; +} + #if !defined(DISABLE_GS) void CommandLine::handle_eps (InputReader &ir, const Option &opt, bool longopt) { _eps_given = true; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.h index 5de9c9f55a2..68ea640a942 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/CommandLine.h @@ -24,6 +24,7 @@ class CommandLine : public CmdLineParserBase #endif bool color_given () const {return _color_given;} bool colornames_given () const {return _colornames_given;} + bool comments_given () const {return _comments_given;} #if !defined(DISABLE_GS) bool eps_given () const {return _eps_given;} #endif @@ -99,6 +100,7 @@ class CommandLine : public CmdLineParserBase #endif void handle_color (InputReader &ir, const Option &opt, bool longopt); void handle_colornames (InputReader &ir, const Option &opt, bool longopt); + void handle_comments (InputReader &ir, const Option &opt, bool longopt); #if !defined(DISABLE_GS) void handle_eps (InputReader &ir, const Option &opt, bool longopt); #endif @@ -153,6 +155,7 @@ class CommandLine : public CmdLineParserBase #endif bool _color_given; bool _colornames_given; + bool _comments_given; #if !defined(DISABLE_GS) bool _eps_given; #endif diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp index 7b3509ffba8..ab76eb80bd6 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIReader.cpp @@ -22,18 +22,14 @@ #include <algorithm> #include <cstdarg> #include <fstream> -#include <iostream> #include <sstream> #include "Color.h" #include "DVIActions.h" #include "DVIReader.h" #include "Font.h" #include "FontManager.h" -#include "Message.h" #include "SignalHandler.h" #include "VectorStream.h" -#include "macros.h" -#include "types.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp index f93a1a49c81..5582eb59989 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.cpp @@ -29,12 +29,9 @@ #include "DVIToSVGActions.h" #include "Font.h" #include "FontManager.h" -#include "FileFinder.h" #include "GlyphTracerMessages.h" #include "InputBuffer.h" #include "InputReader.h" -#include "Matrix.h" -#include "Message.h" #include "PageRanges.h" #include "PageSize.h" #include "SVGOutput.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h index 2264404707a..deb8d1c4039 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVG.h @@ -21,7 +21,6 @@ #ifndef DVISVGM_DVITOSVG_H #define DVISVGM_DVITOSVG_H -#include <iostream> #include <string> #include <utility> #include "DVIReader.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp index c2f3f35c5de..ba0539767b7 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/DVIToSVGActions.cpp @@ -27,10 +27,7 @@ #include "Font.h" #include "FontManager.h" #include "GlyphTracerMessages.h" -#include "SpecialManager.h" #include "System.h" -#include "XMLNode.h" -#include "XMLString.h" using namespace std; @@ -114,7 +111,6 @@ void DVIToSVGActions::setChar (double x, double y, unsigned c, bool vertical, co GlyphTracerMessages callback(fontname != font->name(), false); fontname = font->name(); - BoundingBox charbox; GlyphMetrics metrics; font->getGlyphMetrics(c, vertical, metrics); const PhysicalFont* pf = dynamic_cast<const PhysicalFont*>(font); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.cpp index 572c6128d3a..1a878568cae 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.cpp @@ -37,8 +37,8 @@ Directory::Directory () { firstread = true; memset(&fileData, 0, sizeof(WIN32_FIND_DATA)); #else - dir = 0; - dirent = 0; + _dir = 0; + _dirent = 0; #endif } @@ -49,8 +49,8 @@ Directory::Directory (string dirname) { firstread = true; memset(&fileData, 0, sizeof(WIN32_FIND_DATA)); #else - dir = 0; - dirent = 0; + _dir = 0; + _dirent = 0; #endif open(dirname); } @@ -71,8 +71,8 @@ bool Directory::open (string dname) { handle = FindFirstFile(dname.c_str(), &fileData); return handle != INVALID_HANDLE_VALUE; #else - dir = opendir(_dirname.c_str()); - return dir; + _dir = opendir(_dirname.c_str()); + return bool(_dir); #endif } @@ -81,7 +81,7 @@ void Directory::close () { #ifdef __WIN32__ FindClose(handle); #else - closedir(dir); + closedir(_dir); #endif } @@ -106,22 +106,22 @@ const char* Directory::read (EntryType type) { handle = INVALID_HANDLE_VALUE; return 0; #else - if (!dir) + if (!_dir) return 0; - while ((dirent = readdir(dir))) { - string path = string(_dirname) + "/" + dirent->d_name; + while ((_dirent = readdir(_dir))) { + string path = string(_dirname) + "/" + _dirent->d_name; struct stat stats; if (stat(path.c_str(), &stats) == 0) { if (S_ISDIR(stats.st_mode)) { if (type == ET_FILE_OR_DIR || type == ET_DIR) - return dirent->d_name; + return _dirent->d_name; } else if (type == ET_FILE_OR_DIR || type == ET_FILE) - return dirent->d_name; + return _dirent->d_name; } } - closedir(dir); - dir = 0; + closedir(_dir); + _dir = 0; return 0; #endif } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.h index e2a99123ceb..8e317eb5240 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Directory.h @@ -48,8 +48,8 @@ class Directory HANDLE handle; WIN32_FIND_DATA fileData; #else - DIR *dir; - struct dirent *dirent; + DIR *_dir; + struct dirent *_dirent; #endif }; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp index d12327cf9f3..05392bb6473 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/EPSToSVG.cpp @@ -20,7 +20,6 @@ #include <config.h> #include <fstream> -#include <istream> #include <sstream> #include "EPSFile.h" #include "EPSToSVG.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/EncFile.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/EncFile.cpp index 625aac257de..705230a016c 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/EncFile.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/EncFile.cpp @@ -22,7 +22,6 @@ #include <fstream> #include "Font.h" #include "EncFile.h" -#include "FontMap.h" #include "InputBuffer.h" #include "InputReader.h" #include "FileFinder.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp index a72bd1fa3a1..8caae75275a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.cpp @@ -37,7 +37,7 @@ #include <cstdlib> #include <fstream> #include <map> -#include <string> +#include <set> #include "FileFinder.h" #include "FileSystem.h" #include "FontMap.h" @@ -48,6 +48,7 @@ static bool _initialized = false; static bool _mktex_enabled = false; +static std::set<std::string> _additional_dirs; // --------------------------------------------------- @@ -66,6 +67,7 @@ void FileFinder::init (const char *argv0, const char *progname, bool enable_mkte return; _mktex_enabled = enable_mktexmf; + addLookupDir("."); // always lookup files in the current working directory #ifdef MIKTEX miktex = new MiKTeXCom; #else @@ -123,6 +125,11 @@ std::string FileFinder::version () { } +void FileFinder::addLookupDir (const std::string &path) { + _additional_dirs.insert(path); +} + + /** 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 @@ -133,10 +140,16 @@ static const char* find_file (const std::string &fname, const char *ftype) { return 0; static std::string buf; - // try to lookup the file in the current working directory - buf = FileSystem::getcwd()+"/"+fname; - if (FileSystem::exists(buf.c_str())) - return buf.c_str(); + // try to lookup the file in the additionally specified directories + for (std::set<std::string>::iterator it=_additional_dirs.begin(); it != _additional_dirs.end(); ++it) { + if (it->at(0) == '/') + buf.clear(); + else + buf = FileSystem::getcwd()+"/"; + buf += (*it) + "/" + fname; + if (FileSystem::exists(buf)) + return buf.c_str(); + } std::string ext; if (ftype) @@ -152,7 +165,7 @@ static const char* find_file (const std::string &fname, const char *ftype) { if (ext == "dll" || ext == "exe") { // lookup dll and exe files in the MiKTeX bin directory first buf = miktex->getBinDir() + "/" + fname; - if (FileSystem::exists(buf.c_str())) + if (FileSystem::exists(buf)) return buf.c_str(); } else if (ext == "cmap") { @@ -175,7 +188,7 @@ static const char* find_file (const std::string &fname, const char *ftype) { // lookup exe files in directory where dvisvgm is located if (const char *path = kpse_var_value("SELFAUTOLOC")) { buf = std::string(path) + "/" + fname; - return FileSystem::exists(buf.c_str()) ? buf.c_str() : 0; + return FileSystem::exists(buf) ? buf.c_str() : 0; } return 0; } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.h index 64e55d0a7fb..ec9cc1f549d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileFinder.h @@ -28,6 +28,7 @@ struct FileFinder static void init (const char *argv0, const char *progname, bool enable_mktexmf); static void finish (); static std::string version (); + static void addLookupDir (const std::string &path); 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);} }; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FilePath.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FilePath.cpp index 96da36017c3..a01cf28bb64 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FilePath.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FilePath.cpp @@ -54,7 +54,7 @@ static char adapt_current_path (string &path, char target_drive) { if (target_drive == 0) target_drive = current_drive; if (path.empty() || path[0] != '/') { - if (FileSystem::chdir((string(1, target_drive) + ":").c_str())) { + if (FileSystem::chdir(string(1, target_drive) + ":")) { path.insert(0, FileSystem::getcwd()+"/"); strip_drive_letter(path); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp index a2512403b1b..0d3f04277bd 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.cpp @@ -115,13 +115,13 @@ string FileSystem::getcwd () { /** Changes the work directory. * @param[in] dir path to new work directory * @return true on success */ -bool FileSystem::chdir (const char *dir) { +bool FileSystem::chdir (const std::string &dirname) { bool success = false; - if (dir) { + if (const char *cdirname = dirname.c_str()) { #ifdef __WIN32__ - success = (_chdir(dir) == 0); + success = (_chdir(cdirname) == 0); #else - success = (chdir(dir) == 0); + success = (chdir(cdirname) == 0); #endif } return success; @@ -155,24 +155,24 @@ const char* FileSystem::userdir () { /** Private wrapper function for mkdir: creates a single folder. * @param[in] dir folder name * @return true on success */ -static bool s_mkdir (const char *dir) { +static bool s_mkdir (const string &dirname) { bool success = true; - if (!FileSystem::exists(dir)) { + if (!FileSystem::exists(dirname)) { #ifdef __WIN32__ - success = (_mkdir(dir) == 0); + success = (_mkdir(dirname.c_str()) == 0); #else - success = (mkdir(dir, 0776) == 0); + success = (mkdir(dirname.c_str(), 0775) == 0); #endif } return success; } -static bool inline s_rmdir (const char *dir) { +static bool inline s_rmdir (const string &dirname) { #ifdef __WIN32__ - return (_rmdir(dir) == 0); + return (_rmdir(dirname.c_str()) == 0); #else - return (rmdir(dir) == 0); + return (rmdir(dirname.c_str()) == 0); #endif } @@ -192,14 +192,14 @@ static string trim (const string &str) { * the parent folders are also created. * @param[in] dir single folder name or path to folder * @return true if folder(s) could be created */ -bool FileSystem::mkdir (const char *dir) { +bool FileSystem::mkdir (const string &dirname) { bool success = false; - if (dir) { + if (const char *cdirname = dirname.c_str()) { success = true; - const string dirstr = adaptPathSeperators(trim(dir)); + const string dirstr = adaptPathSeperators(trim(cdirname)); for (size_t pos=1; success && (pos = dirstr.find('/', pos)) != string::npos; pos++) - success &= s_mkdir(dirstr.substr(0, pos).c_str()); - success &= s_mkdir(dirstr.c_str()); + success &= s_mkdir(dirstr.substr(0, pos)); + success &= s_mkdir(dirstr); } return success; } @@ -208,23 +208,23 @@ bool FileSystem::mkdir (const char *dir) { /** Removes a directory and its contents. * @param[in] dirname path to directory * @return true on success */ -bool FileSystem::rmdir (const char *dirname) { +bool FileSystem::rmdir (const string &dirname) { bool ok = false; - if (dirname && isDirectory(dirname)) { + if (isDirectory(dirname)) { ok = true; #ifdef __WIN32__ - string pattern = string(dirname) + "/*"; + string pattern = dirname + "/*"; WIN32_FIND_DATA data; HANDLE h = FindFirstFile(pattern.c_str(), &data); bool ready = (h == INVALID_HANDLE_VALUE); while (!ready && ok) { const char *fname = data.cFileName; - string path = string(dirname) + "/" + fname; - if (isDirectory(path.c_str())) { + string path = dirname + "/" + fname; + if (isDirectory(path)) { if (strcmp(fname, ".") != 0 && strcmp(fname, "..") != 0) - ok = rmdir(path.c_str()) && s_rmdir(path.c_str()); + ok = rmdir(path) && s_rmdir(path); } - else if (isFile(path.c_str())) + else if (isFile(path)) ok = remove(path); else ok = false; @@ -232,16 +232,16 @@ bool FileSystem::rmdir (const char *dirname) { } FindClose(h); #else - if (DIR *dir = opendir(dirname)) { + if (DIR *dir = opendir(dirname.c_str())) { struct dirent *ent; while ((ent = readdir(dir)) && ok) { const char *fname = ent->d_name; string path = string(fname) + "/" + fname; - if (isDirectory(path.c_str())) { + if (isDirectory(path)) { if (strcmp(fname, ".") != 0 && strcmp(fname, "..") != 0) - ok = rmdir(path.c_str()) && s_rmdir(path.c_str()); + ok = rmdir(path) && s_rmdir(path); } - else if (isFile(path.c_str())) + else if (isFile(path)) ok = remove(path); else ok = false; @@ -256,42 +256,46 @@ bool FileSystem::rmdir (const char *dirname) { /** Checks if a file or directory exits. */ -bool FileSystem::exists (const char *fname) { - if (!fname) - return false; +bool FileSystem::exists (const string &fname) { + if (const char *cfname = fname.c_str()) { + #ifdef __WIN32__ - return GetFileAttributes(fname) != INVALID_FILE_ATTRIBUTES; + return GetFileAttributes(cfname) != INVALID_FILE_ATTRIBUTES; #else - struct stat attr; - return stat(fname, &attr) == 0; + struct stat attr; + return stat(cfname, &attr) == 0; #endif + } + return false; } /** Returns true if 'fname' references a directory. */ -bool FileSystem::isDirectory (const char *fname) { - if (!fname) - return false; +bool FileSystem::isDirectory (const string &fname) { + if (const char *cfname = fname.c_str()) { #ifdef __WIN32__ - return GetFileAttributes(fname) & FILE_ATTRIBUTE_DIRECTORY; + return GetFileAttributes(cfname) & FILE_ATTRIBUTE_DIRECTORY; #else - struct stat attr; - return stat(fname, &attr) == 0 && S_ISDIR(attr.st_mode); + struct stat attr; + return stat(cfname, &attr) == 0 && S_ISDIR(attr.st_mode); #endif + } + return false; } /** Returns true if 'fname' references a file. */ -bool FileSystem::isFile (const char *fname) { - if (!fname) - return false; +bool FileSystem::isFile (const string &fname) { + if (const char *cfname = fname.c_str()) { #ifdef __WIN32__ - ifstream ifs(fname); - return (bool)ifs; + ifstream ifs(cfname); + return (bool)ifs; #else - struct stat attr; - return stat(fname, &attr) == 0 && S_ISREG(attr.st_mode); + struct stat attr; + return stat(cfname, &attr) == 0 && S_ISREG(attr.st_mode); #endif + } + return false; } @@ -305,7 +309,7 @@ int FileSystem::collect (const char *dirname, vector<string> &entries) { while (!ready) { string fname = data.cFileName; string path = string(dirname)+"/"+fname; - string typechar = isFile(path.c_str()) ? "f" : isDirectory(path.c_str()) ? "d" : "?"; + string typechar = isFile(path) ? "f" : isDirectory(path) ? "d" : "?"; if (fname != "." && fname != "..") entries.push_back(typechar+fname); ready = !FindNextFile(h, &data); @@ -317,7 +321,7 @@ int FileSystem::collect (const char *dirname, vector<string> &entries) { while ((ent = readdir(dir))) { string fname = ent->d_name; string path = string(dirname)+"/"+fname; - string typechar = isFile(path.c_str()) ? "f" : isDirectory(path.c_str()) ? "d" : "?"; + string typechar = isFile(path) ? "f" : isDirectory(path) ? "d" : "?"; if (fname != "." && fname != "..") entries.push_back(typechar+fname); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.h index 3bfe43665d2..4e36653f1fd 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FileSystem.h @@ -33,13 +33,13 @@ struct FileSystem static UInt64 filesize (const std::string &fname); static std::string adaptPathSeperators (std::string path); static std::string getcwd (); - static bool chdir (const char *dir); - static bool exists (const char *file); - static bool mkdir (const char *dir); - static bool rmdir (const char *fname); + static bool chdir (const std::string &dir); + static bool exists (const std::string &fname); + static bool mkdir (const std::string &dirname); + static bool rmdir (const std::string &dirname); static int collect (const char *dirname, std::vector<std::string> &entries); - static bool isDirectory (const char *fname); - static bool isFile (const char *fname); + static bool isDirectory (const std::string &fname); + static bool isFile (const std::string &fname); static const char* userdir (); static const char* DEVNULL; static const char PATHSEP; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.cpp index cea0968c689..af1c8d4c9b1 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.cpp @@ -20,26 +20,19 @@ #include <config.h> #include <cstdlib> -#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 "GFGlyphTracer.h" -#include "Glyph.h" #include "Message.h" #include "MetafontWrapper.h" -#include "TFM.h" -#include "VFReader.h" #include "SignalHandler.h" #include "Subfont.h" #include "SVGTree.h" #include "Unicode.h" -#include "macros.h" using namespace std; @@ -307,6 +300,25 @@ int PhysicalFont::descent () const { } +std::string PhysicalFont::familyName () const { + if (type() == MF) + return ""; + FontEngine::instance().setFont(*this); + const char *family = FontEngine::instance().getFamilyName(); + return family ? family : ""; +} + + +std::string PhysicalFont::styleName () const { + if (type() == MF) + return ""; + FontEngine::instance().setFont(*this); + const char *style = FontEngine::instance().getStyleName(); + return style ? style : ""; +} + + + /** 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 @@ -510,7 +522,7 @@ UInt32 PhysicalFontImpl::unicode (UInt32 c) const { // try to get the Unicode point from the character name string glyphname = glyphName(c); UInt32 codepoint; - if (!glyphname.empty() && (codepoint = Unicode::psNameToCodepoint(glyphname)) != 0) + if (!glyphname.empty() && (codepoint = Unicode::aglNameToCodepoint(glyphname)) != 0) return codepoint; if (c <= 0x1900) // does character code c fit into Private Use Zone U+E000? return 0xe000+c; @@ -538,7 +550,7 @@ void PhysicalFontImpl::tidy () const { if (type() == MF) { const char *ext[] = {"gf", "tfm", "log", 0}; for (const char **p=ext; *p; ++p) { - if (FileSystem::exists((name()+"."+(*p)).c_str())) + if (FileSystem::exists(name()+"."+(*p))) FileSystem::remove(name()+"."+(*p)); } } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.h index 8d3d5d08c19..f4d828eb977 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Font.h @@ -123,6 +123,8 @@ class PhysicalFont : public virtual Font virtual bool getExactGlyphBox (int c, GlyphMetrics &metrics, bool vertical, GFGlyphTracer::Callback *cb=0) const; virtual bool isCIDFont () const; virtual int hAdvance () const; + virtual std::string familyName () const; + virtual std::string styleName () const; virtual double hAdvance (int c) const; virtual double vAdvance (int c) const; std::string glyphName (int c) const; @@ -324,6 +326,7 @@ class NativeFontImpl : public NativeFont const Font* uniqueFont () const {return this;} const char* path () const {return _path.c_str();} int fontIndex() const {return _fontIndex;} + std::string fontFamily () const; bool findAndAssignBaseFontMap (); CharMapID getCharMapID () const {return CharMapID::NONE;} Character decodeChar (UInt32 c) const; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.h index ed1d07c6de9..3fea7db79af 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontCache.h @@ -21,7 +21,6 @@ #ifndef DVISVGM_FONTCACHE_H #define DVISVGM_FONTCACHE_H -#include <iostream> #include <string> #include <map> #include "types.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.cpp index 0565a34470e..1e446a6b811 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.cpp @@ -19,7 +19,6 @@ *************************************************************************/ #include <config.h> -#include <iostream> #include <sstream> #include <ft2build.h> #include FT_ADVANCES_H @@ -53,17 +52,16 @@ static inline FT_Fixed to_16dot16 (int val) { FontEngine::FontEngine () : _currentFace(0), _currentFont(0) { _currentChar = _currentGlyphIndex = 0; - _horDeviceRes = _vertDeviceRes = 300; if (FT_Init_FreeType(&_library)) - Message::estream(true) << "FontEngine: error initializing FreeType library\n"; + Message::estream(true) << "failed to initialize FreeType library\n"; } FontEngine::~FontEngine () { if (_currentFace && FT_Done_Face(_currentFace)) - Message::estream(true) << "FontEngine: error removing glyph\n"; + Message::estream(true) << "failed to release font\n"; if (FT_Done_FreeType(_library)) - Message::estream(true) << "FontEngine: error removing FreeType library\n"; + Message::estream(true) << "failed to release FreeType library\n"; } @@ -84,21 +82,15 @@ string FontEngine::version () { } -void FontEngine::setDeviceResolution (int x, int y) { - _horDeviceRes = x; - _vertDeviceRes = y; -} - - /** Sets the font to be used. * @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, const CharMapID &charMapID) { if (_currentFace && FT_Done_Face(_currentFace)) - Message::estream(true) << "FontEngine: error removing font\n"; + Message::estream(true) << "failed to release font\n"; if (FT_New_Face(_library, fname.c_str(), fontindex, &_currentFace)) { - Message::estream(true) << "FontEngine: error reading file " << fname << '\n'; + Message::estream(true) << "can't read font file " << fname << '\n'; return false; } if (charMapID.valid()) @@ -396,7 +388,7 @@ static bool trace_outline (FT_Face face, const Font *font, int index, Glyph &gly FT_Outline_Decompose(&outline, &funcs, &glyph); return true; } - Message::wstream(true) << "FontEngine: can't trace outline, no font face selected\n"; + Message::wstream(true) << "can't trace outline (no font selected)\n"; return false; } @@ -409,8 +401,5 @@ 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 (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; + return trace_outline(_currentFace, _currentFont, charIndex(c), glyph, scale); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.h index 8cacb1526fd..a5edea81879 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontEngine.h @@ -43,7 +43,6 @@ class FontEngine ~FontEngine (); static FontEngine& instance (); static std::string version (); - void setDeviceResolution (int x, int y); bool setFont (const Font &font); bool isCIDFont() const; bool traceOutline (const Character &c, Glyph &glyph, bool scale=true) const; @@ -75,7 +74,6 @@ class FontEngine int charIndex (const Character &c) const; private: - int _horDeviceRes, _vertDeviceRes; mutable unsigned int _currentChar, _currentGlyphIndex; FT_Face _currentFace; FT_Library _library; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontManager.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontManager.cpp index 8834fa20996..91e61fba3b8 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontManager.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontManager.cpp @@ -26,11 +26,9 @@ #include "CMap.h" #include "Font.h" #include "FontManager.h" -#include "FontMap.h" #include "FileFinder.h" #include "FileSystem.h" #include "Message.h" -#include "macros.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp index 5d42c8f185c..0698e71121f 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMap.cpp @@ -21,7 +21,6 @@ #include <config.h> #include <cstring> #include <fstream> -#include <iostream> #include <limits> #include <vector> #include "CMap.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMetrics.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMetrics.cpp index bba7645488d..c50d010802c 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMetrics.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/FontMetrics.cpp @@ -23,7 +23,6 @@ #include "FileFinder.h" #include "FontMetrics.h" #include "JFM.h" -#include "TFM.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp index fdfe71af80e..6e70e55327a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFGlyphTracer.cpp @@ -20,7 +20,6 @@ #include <config.h> #include "GFGlyphTracer.h" -#include "Pair.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFReader.cpp index 5b852ed11d1..d305431d5b4 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFReader.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFReader.cpp @@ -19,10 +19,8 @@ *************************************************************************/ #include <config.h> -#include <iostream> #include <sstream> #include "GFReader.h" -#include "macros.h" #include "SignalHandler.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFTracer.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFTracer.cpp index 9e3ce57f2cd..d18741ba82d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/GFTracer.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/GFTracer.cpp @@ -19,9 +19,7 @@ *************************************************************************/ #include <config.h> -#include <iostream> #include <fstream> -#include <sstream> #include "GFTracer.h" #include "Glyph.h" #include "Message.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/HtmlSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/HtmlSpecialHandler.cpp index 595e8ab79e1..55ca1e5a46f 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/HtmlSpecialHandler.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/HtmlSpecialHandler.cpp @@ -25,7 +25,6 @@ #include "InputReader.h" #include "Message.h" #include "SVGTree.h" -#include "XMLNode.h" using namespace std; @@ -57,7 +56,7 @@ void HtmlSpecialHandler::preprocess (const char *prefix, istream &is, SpecialAct void HtmlSpecialHandler::preprocessNameAnchor (const string &name) { NamedAnchors::iterator it = _namedAnchors.find(name); if (it == _namedAnchors.end()) { // anchor completely undefined? - int id = _namedAnchors.size()+1; + int id = static_cast<int>(_namedAnchors.size())+1; _namedAnchors[name] = NamedAnchor(_actions->getCurrentPageNumber(), id, 0); } else if (it->second.id < 0) { // anchor referenced but not defined yet? @@ -77,7 +76,7 @@ void HtmlSpecialHandler::preprocessHrefAnchor (const string &uri) { if (it != _namedAnchors.end()) // anchor already defined? it->second.referenced = true; else { - int id = _namedAnchors.size()+1; + int id = static_cast<int>(_namedAnchors.size())+1; _namedAnchors[name] = NamedAnchor(0, -id, 0, true); } } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/InputReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/InputReader.cpp index 493dd311b30..46107532f68 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/InputReader.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/InputReader.cpp @@ -107,7 +107,7 @@ int InputReader::compare (const char *s, bool consume) { bool InputReader::parseInt (int &val, bool accept_sign) { val = 0; int fac=1; - char sign; // explicitly given sign + int sign; // explicitly given sign if (accept_sign && ((sign = peek()) == '+' || sign == '-')) { if (isdigit(peek(1))) { get(); // skip sign @@ -143,7 +143,7 @@ bool InputReader::parseInt (int base, int &val) { const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz"; const char maxdigit = digits[base-1]; - char c; + int c; if (!isalnum(c = tolower(peek())) || c > maxdigit) return false; @@ -167,7 +167,7 @@ char InputReader::parseDouble (double &val) { int int_part=0; bool is_float = false; skipSpace(); - char sign = peek(); + int sign = peek(); if (parseInt(int_part)) { // match [+-]?[0-9]+\.? if (peek() == '.') { get(); @@ -179,7 +179,6 @@ char InputReader::parseDouble (double &val) { } } else { // match [+-]?\. - char sign; // explicitly given sign if ((sign = peek()) == '+' || sign == '-') { // match [+-]?\.[0-9] if (peek(1) != '.' || !isdigit(peek(2))) return 0; @@ -199,7 +198,7 @@ char InputReader::parseDouble (double &val) { frac_part += (get()-'0')/u; val = (int_part + frac_part) * fac; // parse exponent - char c; + int c; if (tolower(peek()) == 'e' && (isdigit(c=peek(1)) || ((c == '+' || c == '-') && isdigit(peek(2))))) { get(); // skip 'e' int exp; @@ -245,7 +244,7 @@ string InputReader::getWord () { char InputReader::getPunct () { skipSpace(); if (ispunct(peek())) - return get(); + return char(get()); return 0; } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.h index 413b77ab83e..42e4deb3dd8 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/JFM.h @@ -30,6 +30,8 @@ class JFM : public TFM public: JFM (std::istream &is); bool verticalLayout () const {return _vertical;} + UInt16 minChar () const {return _minchar;} + UInt16 maxChar () const {return static_cast<UInt16>(_minchar+_charTypeTable.size()-1);} protected: void readTables (StreamReader &sr, int nt, int nw, int nh, int nd, int ni); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/MapLine.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/MapLine.cpp index a8352d502dc..e972dd55ad3 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/MapLine.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/MapLine.cpp @@ -169,7 +169,7 @@ void MapLine::parseDVIPDFMLine (InputReader &ir) { ir.skipSpace(); while (ir.peek() == '-') { ir.get(); - char option = ir.get(); + int option = ir.get(); if (!isprint(option)) throw MapLineException("option character expected"); ir.skipSpace(); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp index d59a04bd444..e60a66d1cb6 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/MetafontWrapper.cpp @@ -28,8 +28,7 @@ #include "Message.h" #include "MetafontWrapper.h" #include "Process.h" -#include "SignalHandler.h" -#include "macros.h" +#include "XMLString.h" using namespace std; @@ -65,35 +64,36 @@ bool MetafontWrapper::call (const string &mode, double mag) { const char *cmd = "mf"; #endif ostringstream oss; - oss << "\"\\mode=" << mode << ";" - "mag:=" << mag << ";" - "batchmode;" - "input " << _fontname << "\""; + oss << "\"\\mode=" << mode << ";" // set MF mode, e.g. 'proof', 'ljfour' or 'localfont' + "mode_setup;" // initialize MF variables + "mag:=" << mag << ";" // set magnification factor + "show pixels_per_inch*mag;" // print character resolution to stdout + "batchmode;" // don't halt on errors and don't print informational messages + "input " << _fontname << "\""; // load font description Message::mstream(false, Message::MC_STATE) << "\nrunning Metafont for " << _fontname << '\n'; Process mf_process(cmd, oss.str().c_str()); - mf_process.run(); - - // try to read Metafont's logfile and get name of created GF file - ifstream ifs((_fontname+".log").c_str()); - if (ifs) { - char buf[128]; - while (ifs) { - ifs.getline(buf, 128); - string line = buf; - if (line.substr(0, 15) == "! Interruption.") - SignalHandler::instance().trigger(true); - if (line.substr(0, 17) == "Output written on") { - size_t pos = line.find("gf ", 18+_fontname.length()); - if (pos != string::npos) { - string gfname = line.substr(18, pos-16); // GF filename found - FileSystem::rename(gfname, _fontname+".gf"); - } - break; - } + string mf_messages; + mf_process.run(&mf_messages); + + // get resolution value from stdout created by above MF command + char buf[256]; + istringstream iss(mf_messages); + int resolution = 0; + while (iss) { + iss.getline(buf, sizeof(buf)); + string line = buf; + if (line.substr(0, 3) == ">> ") { + resolution = atoi(line.substr(3).c_str()); + break; } } - ifstream gf((_fontname+".gf").c_str()); - return (bool)gf; + // compose expected name of GF file (see Metafont Book, p. 324) + string gfname = _fontname + "."; + if (resolution > 0) + gfname += XMLString(resolution); + gfname += "gf"; + FileSystem::rename(gfname, _fontname+".gf"); // remove resolution from filename + return FileSystem::exists(_fontname+".gf"); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/PSInterpreter.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/PSInterpreter.cpp index dba47987bce..77da4520bec 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/PSInterpreter.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/PSInterpreter.cpp @@ -21,7 +21,6 @@ #include <config.h> #include <cstring> #include <fstream> -#include <iostream> #include <sstream> #include "FileFinder.h" #include "InputReader.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/PdfSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/PdfSpecialHandler.cpp index 9829776bf77..ee278d10f05 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/PdfSpecialHandler.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/PdfSpecialHandler.cpp @@ -45,7 +45,7 @@ bool PdfSpecialHandler::process (const char *prefix, istream &is, SpecialActions // read mode selector ('+', '-', or '=') char modechar = '+'; // default mode (append if new, do not replace existing mapping) if (strchr("=+-", ir.peek())) // leading modifier given? - modechar = ir.get(); + modechar = char(ir.get()); else if (!_maplineProcessed) { // no modifier given? // remove default map entries if this is the first mapline/mapfile special called FontMap::instance().clear(); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp index ed81588b695..59bc21e7cf8 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Process.cpp @@ -151,41 +151,55 @@ bool Process::run (string *out) { close_handle(devnull); return exitcode == 0; #else + int pipefd[2]; + pipe(pipefd); pid_t pid = fork(); if (pid == 0) { // child process - if (!out) { - int devnull = open(FileSystem::DEVNULL, O_WRONLY); - if (devnull >= 0) { - dup2(devnull, STDOUT_FILENO); - dup2(devnull, STDERR_FILENO); - close(devnull); - } - } + dup2(pipefd[1], STDOUT_FILENO); // redirect stdout to the pipe + dup2(pipefd[1], STDERR_FILENO); // redirect stderr to the pipe + close(pipefd[0]); + close(pipefd[1]); + vector<const char*> params; params.push_back(_cmd.c_str()); string paramstr = _paramstr; // private copy to be changed by split_paramstr() split_paramstr(paramstr, params); - params.push_back(0); // trailing NULL marks end + params.push_back(0); // trailing NULL marks end of parameter list execvp(_cmd.c_str(), const_cast<char* const*>(¶ms[0])); exit(1); } - if (pid > 0) { // main process - int status; + close(pipefd[1]); + bool ok = false; + if (pid > 0) { // parent process for (;;) { + if (out) { + // + out->clear(); + char buf[512]; + ssize_t len; + while ((len = read(pipefd[0], buf, sizeof(buf)-1)) > 0) { + buf[len] = 0; + *out += string(buf); + } + } + int status; waitpid(pid, &status, WNOHANG); - if (WIFEXITED(status)) // child process exited normally - return WEXITSTATUS(status) == 0; - + if (WIFEXITED(status)) { // child process exited normally + ok = (WEXITSTATUS(status) == 0); + break; + } try { SignalHandler::instance().check(); } catch (SignalException &e) { // caught ctrl-c + close(pipefd[0]); kill(pid, SIGKILL); throw; } } } - return false; + close(pipefd[0]); + return ok; #endif } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp index 27d515a8364..7f909ba17b5 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/PsSpecialHandler.cpp @@ -21,12 +21,10 @@ #include <config.h> #include <cmath> #include <fstream> -#include <iostream> #include <memory> #include <sstream> #include "EPSFile.h" #include "FileFinder.h" -#include "Ghostscript.h" #include "Message.h" #include "PathClipper.h" #include "PSPattern.h" @@ -35,9 +33,6 @@ #include "SpecialActions.h" #include "SVGTree.h" #include "TensorProductPatch.h" -#include "VectorIterator.h" -#include "XMLNode.h" -#include "XMLString.h" #include "TriangularPatch.h" @@ -396,7 +391,6 @@ void PsSpecialHandler::dviEndPage (unsigned) { double w = max(0.0, _previewFilter.width()); double h = max(0.0, _previewFilter.height()); double d = max(0.0, _previewFilter.depth()); - bool isBaselineHorizontal = true; if (_actions && (_actions->getBBoxFormatString() == "preview" || _actions->getBBoxFormatString() == "min")) { if (_actions->getBBoxFormatString() == "preview") { _actions->bbox() = bbox; @@ -426,7 +420,7 @@ void PsSpecialHandler::dviEndPage (unsigned) { // apply page transformations to box extents Matrix pagetrans; _actions->getPageTransform(pagetrans); - isBaselineHorizontal = transform_box_extents(pagetrans, w, h, d); + bool isBaselineHorizontal = transform_box_extents(pagetrans, w, h, d); _actions->bbox().lock(); if (isBaselineHorizontal) { @@ -722,7 +716,7 @@ void PsSpecialHandler::makepattern (vector<double> &p) { * 1-3: (optional) RGB values for uncolored tiling patterns * further parameters depend on the pattern type */ void PsSpecialHandler::setpattern (vector<double> &p) { - int pattern_id = p[0]; + int pattern_id = static_cast<int>(p[0]); Color color; if (p.size() == 4) color.setRGB(p[1], p[2], p[3]); @@ -775,7 +769,6 @@ void PsSpecialHandler::clip (vector<double>&, bool evenodd) { * @param[in] evenodd true: use even-odd fill algorithm, false: use nonzero fill algorithm */ void PsSpecialHandler::clip (Path &path, bool evenodd) { // when this method is called, _path contains the clipping path - _path.removeRedundantCommands(); if (path.empty() || !_actions) return; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.cpp index 0d8310748ee..752b5c1346d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.cpp @@ -21,7 +21,6 @@ #include <config.h> #include <algorithm> #include <sstream> -#include <string> #include "BoundingBox.h" #include "DependencyGraph.h" #include "DVIToSVG.h" @@ -41,6 +40,7 @@ bool SVGTree::USE_FONTS=true; bool SVGTree::CREATE_USE_ELEMENTS=false; bool SVGTree::RELATIVE_PATH_CMDS=false; bool SVGTree::MERGE_CHARS=true; +bool SVGTree::ADD_COMMENTS=false; double SVGTree::ZOOM_FACTOR=1.0; @@ -336,6 +336,23 @@ static XMLElementNode* createGlyphNode (int c, const PhysicalFont &font, GFGlyph } +static string font_info (const Font &font) { + ostringstream oss; + if (const NativeFont *nf = dynamic_cast<const NativeFont*>(&font)) { + oss << nf->familyName() << ' ' << nf->styleName() << "; " << nf->filename(); + if (nf->style()) { + if (nf->style()->bold != 0) + oss << ", bold:" << XMLString(nf->style()->bold) << "pt"; + if (nf->style()->extend != 1) + oss << ", extent:" << XMLString(nf->style()->extend); + if (nf->style()->slant != 0) + oss << ", slant:" << XMLString(nf->style()->slant); + } + } + return oss.str(); +} + + void SVGTree::appendFontStyles (const set<const Font*> &fonts) { if (CREATE_STYLE && USE_FONTS && !fonts.empty() && _defs) { XMLElementNode *styleNode = new XMLElementNode("style"); @@ -354,7 +371,13 @@ void SVGTree::appendFontStyles (const set<const Font*> &fonts) { << ";font-size:" << XMLString(it->second->scaledSize()) << "px"; if (it->second->color() != Color::BLACK) style << ";fill:" << it->second->color().svgColorString(); - style << "}\n"; + style << '}'; + if (ADD_COMMENTS) { + string info = font_info(*it->second); + if (!info.empty()) + style << " /* " << info << " */"; + } + style << '\n'; } XMLCDataNode *cdata = new XMLCDataNode(style.str()); styleNode->append(cdata); @@ -371,6 +394,11 @@ void SVGTree::append (const PhysicalFont &font, const set<int> &chars, GFGlyphTr return; if (USE_FONTS) { + if (ADD_COMMENTS) { + string info = font_info(font); + if (!info.empty()) + appendToDefs(new XMLCommentNode(string(" font: ")+info+" ")); + } XMLElementNode *fontNode = new XMLElementNode("font"); string fontname = font.name(); fontNode->addAttribute("id", fontname); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.h index 29667d4745e..0afc57988fb 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SVGTree.h @@ -90,10 +90,11 @@ class SVGTree public: static bool USE_FONTS; ///< if true, create font references and don't draw paths directly - static bool CREATE_STYLE; ///< use style elements and class attributes to reference fonts? + static bool CREATE_STYLE; ///< use style elements and class attributes to reference fonts? static bool CREATE_USE_ELEMENTS; ///< allow generation of <use/> elements? static bool RELATIVE_PATH_CMDS; ///< relative path commands rather than absolute ones? static bool MERGE_CHARS; ///< whether to merge chars with common properties into the same <text> tag + static bool ADD_COMMENTS; ///< add comments with additional information static double ZOOM_FACTOR; ///< factor applied to width/height attribute protected: diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialManager.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialManager.cpp index 6abec223167..76e300773af 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialManager.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/SpecialManager.cpp @@ -25,7 +25,6 @@ #include "SpecialHandler.h" #include "SpecialManager.h" #include "PsSpecialHandler.h" -#include "macros.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp index 7e7ba4d08cd..f15023f58da 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamReader.cpp @@ -39,7 +39,7 @@ istream& StreamReader::replaceStream (istream &in) { UInt32 StreamReader::readUnsigned (int bytes) { UInt32 ret = 0; for (bytes--; bytes >= 0 && !_is->eof(); bytes--) { - UInt32 b = _is->get(); + UInt32 b = UInt32(_is->get()); ret |= b << (8*bytes); } return ret; @@ -61,7 +61,7 @@ UInt32 StreamReader::readUnsigned (int bytes, CRC32 &crc32) { * @param[in] bytes number of bytes to read (max. 4) * @return read integer */ Int32 StreamReader::readSigned (int bytes) { - Int32 ret = _is->get(); + Int32 ret = Int32(_is->get()); if (ret & 128) // negative value? ret |= 0xffffff00; for (bytes-=2; bytes >= 0 && !_is->eof(); bytes--) @@ -76,7 +76,7 @@ Int32 StreamReader::readSigned (int bytes) { * @return read integer */ Int32 StreamReader::readSigned (int bytes, CRC32 &crc32) { Int32 ret = readSigned(bytes); - crc32.update(ret, bytes); + crc32.update(UInt32(ret), bytes); return ret; } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamWriter.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamWriter.cpp index 7ab1846b6e8..5b50b33673a 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamWriter.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/StreamWriter.cpp @@ -30,7 +30,7 @@ using namespace std; * @param[in] n number of bytes to be considered */ void StreamWriter::writeUnsigned (UInt32 val, int n) { for (n--; n >= 0; n--) - _os.put((val >> (8*n)) & 0xff); + _os.put(char((val >> (8*n)) & 0xff)); } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Subfont.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Subfont.cpp index 762ab8b65d7..8b125ac5ef9 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Subfont.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Subfont.cpp @@ -24,15 +24,16 @@ #include <fstream> #include <limits> #include "FileFinder.h" -#include "Subfont.h" #include "Message.h" +#include "Subfont.h" + using namespace std; // helper functions static int skip_mapping_data (istream &is); -static bool scan_line (const char *line, int lineno, UInt16 *mapping, const string &fname, int &pos); +static bool scan_line (const char *line, int lineno, UInt16 *mapping, const string &fname, long &pos); /** Constructs a new SubfontDefinition object. @@ -105,7 +106,7 @@ Subfont* SubfontDefinition::subfont (const string &id) const { int SubfontDefinition::subfonts (vector<Subfont*> &sfs) const { for (ConstIterator it=_subfonts.begin(); it != _subfonts.end(); ++it) sfs.push_back(it->second); - return sfs.size(); + return int(sfs.size()); } ////////////////////////////////////////////////////////////////////// @@ -153,7 +154,7 @@ bool Subfont::read () { // build mapping array _mapping = new UInt16[256]; memset(_mapping, 0, 256*sizeof(UInt16)); - int pos=0; + long pos=0; char buf[1024]; bool complete=false; while (!complete) { @@ -210,7 +211,7 @@ static int skip_mapping_data (istream &is) { * @param[in] fname name of the mapfile being scanned * @param[in,out] offset position/index of next mapping value * @return true if the line is the last one the current mapping sequence, i.e. the line doesn't end with a backslash */ -static bool scan_line (const char *line, int lineno, UInt16 *mapping, const string &fname, int &offset) { +static bool scan_line (const char *line, int lineno, UInt16 *mapping, const string &fname, long &offset) { const char *p=line; char *q; for (; *p && isspace(*p); p++); @@ -222,7 +223,7 @@ static bool scan_line (const char *line, int lineno, UInt16 *mapping, const stri } else { long val1 = strtol(p, &q, 0); // first value of range - long val2; // last value of range + long val2 = -1; // last value of range ostringstream oss; // output stream for exception messages switch (*q) { case ':': diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/TFM.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/TFM.cpp index 5c492f01217..dbb8658069e 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/TFM.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/TFM.cpp @@ -19,7 +19,6 @@ *************************************************************************/ #include <config.h> -#include <iostream> #include <fstream> #include <vector> #include "FileFinder.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/TensorProductPatch.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/TensorProductPatch.cpp index a5ded129648..e3eb030d58d 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/TensorProductPatch.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/TensorProductPatch.cpp @@ -18,7 +18,6 @@ ** along with this program; if not, see <http://www.gnu.org/licenses/>. ** *************************************************************************/ -#include <iostream> #include <valarray> #include "TensorProductPatch.h" diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp index 6d1402976c3..4992209449f 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/TpicSpecialHandler.cpp @@ -30,9 +30,7 @@ #include "SpecialActions.h" #include "SVGTree.h" #include "TpicSpecialHandler.h" -#include "XMLNode.h" -#include "XMLString.h" -#include "types.h" + using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.cpp index 8292981e55d..ec62a41dd96 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.cpp @@ -19,6 +19,7 @@ *************************************************************************/ #include <xxhash.h> +#include <cctype> #include <cstddef> #include "Unicode.h" @@ -113,8 +114,8 @@ string Unicode::utf8 (Int32 c) { /* The following table provides a compact mapping from PostScript character names * to Unicode points. Instead of using the character names directly it maps the * hash values (xxhash32) of the names to the corresponding code points. - * The character mapping is derived from - * http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt and + * The character mapping is derived from the Adobe Glyph List (AGL): + * https://github.com/adobe-type-tools/agl-aglfn * http://tug.ctan.org/macros/latex/contrib/pdfx/glyphtounicode-cmr.tex */ static struct Hash2Unicode { UInt32 hash; @@ -4533,11 +4534,50 @@ static struct Hash2Unicode { }; -/** Returns the Unicode point for a given PostScript character name. - * @param psname PostScript name of the character to look up +#if 0 +/** Tries to extract the codepoint from character names like "uni1234" or "u1234". + * Valid names must match ^u(ni)?[0-9A-F]{4,}(\..*)?$. + * @param[in] psname character name + * @return the extracted codepoint or 0 on failure */ +static Int32 name_as_codepoint (const string &name) { + int offset=1; + if (name.length() >= 7 && name.substr(0, 3) == "uni") + offset = 3; + else if (name.length() < 5 || name[0] != 'u') + return 0; + + Int32 cp=0; + for (string::const_iterator it=name.begin()+offset; it != name.end() && *it != '.'; ++it) { + if (!isdigit(*it) && (*it < 'A' || *it > 'F')) + return 0; + cp = (cp*16) + (*it - (isdigit(*it) ? '0' : 'A')); + } + return cp; +} + + +static const char* get_suffix (const string &name) { + static const char *suffixes[] = { + "small", "swash", "superior", "inferior", "numerator", "denominator", "oldstyle", + "display", "text", "big", "bigg", "Big", "Bigg", 0 + }; + size_t pos = name.rfind('.'); + if (pos != string::npos) { + string suffix = name.substr(pos+1); + for (const char **p=suffixes; *p; p++) + if (suffix == *p) + return *p; + } + return 0; +} +#endif + + +/** Returns the Unicode point for a given AGL character name. + * @param name AGL name of the character to look up * @return codepoint of the character */ -Int32 Unicode::psNameToCodepoint (const string &psname) { - UInt32 hash = XXH32(&psname[0], psname.length(), 0); +Int32 Unicode::aglNameToCodepoint (const string &name) { + UInt32 hash = XXH32(&name[0], name.length(), 0); int left=0; int right=sizeof(hash2unicode)/sizeof(Hash2Unicode)-1; while (left <= right) { diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.h b/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.h index 4dd790c1b28..8b25b4193c1 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.h +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/Unicode.h @@ -29,7 +29,7 @@ struct Unicode static bool isValidCodepoint (UInt32 code); static UInt32 charToCodepoint (UInt32 c); static std::string utf8 (Int32 c); - static Int32 psNameToCodepoint (const std::string &psname); + static Int32 aglNameToCodepoint (const std::string &name); }; #endif diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/VFReader.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/VFReader.cpp index 9f023d527de..286f0513a55 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/VFReader.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/VFReader.cpp @@ -23,7 +23,6 @@ #include "Font.h" #include "VFActions.h" #include "VFReader.h" -#include "macros.h" using namespace std; diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLDocument.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLDocument.cpp index b2131b5f3f9..33ad5f645ef 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLDocument.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLDocument.cpp @@ -19,7 +19,6 @@ *************************************************************************/ #include <config.h> -#include "macros.h" #include "XMLDocument.h" using namespace std; @@ -47,8 +46,8 @@ void XMLDocument::clear () { void XMLDocument::append (XMLNode *node) { if (!node) return; - XMLElementNode *newRoot = dynamic_cast<XMLElementNode*>(node); - if (newRoot) { // there can only be one root element node in the document + if (XMLElementNode *newRoot = dynamic_cast<XMLElementNode*>(node)) { + // there can only be one root element node in the document delete _rootElement; // so if there is already one... _rootElement = newRoot; // ...we replace it } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp index ff62055e924..c8beab36bb5 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/XMLNode.cpp @@ -21,6 +21,7 @@ #include <config.h> #include <map> #include <list> +#include <sstream> #include "macros.h" #include "XMLNode.h" #include "XMLString.h" @@ -215,10 +216,17 @@ const char* XMLElementNode::getAttributeValue(const std::string& name) const { ////////////////////// void XMLTextNode::append (XMLNode *node) { + if (!node) + return; if (XMLTextNode *tn = dynamic_cast<XMLTextNode*>(node)) append(tn); - else + else { + // append text representation of the node + ostringstream oss; + node->write(oss); + append(XMLString(oss.str())); delete node; + } } diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp b/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp index 073b5bd2045..a3bb950f07e 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/dvisvgm.cpp @@ -23,7 +23,6 @@ #include <fstream> #include <iostream> #include <sstream> -#include <string> #include <xxhash.h> #include "gzstream.h" #include "CommandLine.h" @@ -31,21 +30,15 @@ #include "DVIToSVGActions.h" #include "EPSToSVG.h" #include "FileFinder.h" -#include "FilePath.h" #include "FileSystem.h" #include "Font.h" -#include "FontCache.h" #include "FontEngine.h" -#include "FontMap.h" #include "Ghostscript.h" #include "HtmlSpecialHandler.h" -#include "InputReader.h" -#include "Message.h" #include "PageSize.h" #include "PSInterpreter.h" #include "PsSpecialHandler.h" #include "SignalHandler.h" -#include "SpecialManager.h" #include "SVGOutput.h" #include "System.h" @@ -114,15 +107,15 @@ static bool set_cache_dir (const CommandLine &args) { if (args.cache_given() && !args.cache_arg().empty()) { if (args.cache_arg() == "none") PhysicalFont::CACHE_PATH = 0; - else if (FileSystem::exists(args.cache_arg().c_str())) + else if (FileSystem::exists(args.cache_arg())) PhysicalFont::CACHE_PATH = args.cache_arg().c_str(); else Message::wstream(true) << "cache directory '" << args.cache_arg() << "' does not exist (caching disabled)\n"; } else if (const char *userdir = FileSystem::userdir()) { static string cachepath = userdir + string("/.dvisvgm/cache"); - if (!FileSystem::exists(cachepath.c_str())) - FileSystem::mkdir(cachepath.c_str()); + if (!FileSystem::exists(cachepath)) + FileSystem::mkdir(cachepath); PhysicalFont::CACHE_PATH = cachepath.c_str(); } if (args.cache_given() && args.cache_arg().empty()) { @@ -266,6 +259,7 @@ int main (int argc, char *argv[]) { SVGTree::ZOOM_FACTOR = args.zoom_arg(); SVGTree::RELATIVE_PATH_CMDS = args.relative_given(); SVGTree::MERGE_CHARS = !args.no_merge_given(); + SVGTree::ADD_COMMENTS = args.comments_given(); DVIToSVG::TRACE_MODE = args.trace_all_given() ? (args.trace_all_arg() ? 'a' : 'm') : 0; Message::LEVEL = args.verbosity_arg(); PhysicalFont::EXACT_BBOX = args.exact_given(); diff --git a/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml b/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml index d24d0fdfa61..ecc4b08d8c5 100644 --- a/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml +++ b/Build/source/texk/dvisvgm/dvisvgm-src/src/options.xml @@ -52,6 +52,9 @@ <option long="colornames"> <description>prefer color names to RGB values if possible</description> </option> + <option long="comments"> + <description>add comments with additional information</description> + </option> <option long="grad-overlap" if="!defined(DISABLE_GS)"> <description>create operlapping color gradient segments</description> </option> diff --git a/Build/source/texk/dvisvgm/version.ac b/Build/source/texk/dvisvgm/version.ac index 96f2d344095..22e5f8a5d2a 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.14.2]) +m4_define([dvisvgm_version], [1.15]) |