pdftex[814] branches/stable/source: sync from tl19 release (version

commits+karl at tug.org commits+karl at tug.org
Thu May 30 18:25:32 CEST 2019


Revision: 814
          http://tug.org/svn/pdftex?view=revision&revision=814
Author:   karl
Date:     2019-05-30 18:25:31 +0200 (Thu, 30 May 2019)
Log Message:
-----------
sync from tl19 release (version 1.40.20), tl r50899

Revision Links:
--------------
    http://tug.org/svn/pdftex?view=revision&revision=50899

Modified Paths:
--------------
    branches/stable/source/Makefile
    branches/stable/source/src/Makefile.in
    branches/stable/source/src/build-aux/config.guess
    branches/stable/source/src/build-aux/config.sub
    branches/stable/source/src/build-aux/missing
    branches/stable/source/src/build-aux/test-driver
    branches/stable/source/src/build-aux/texinfo.tex
    branches/stable/source/src/build-aux/ylwrap
    branches/stable/source/src/configure
    branches/stable/source/src/doc/build-tools.txt
    branches/stable/source/src/doc/tlbuild-incl/install-tl.texi
    branches/stable/source/src/doc/tlbuild.info
    branches/stable/source/src/doc/tlbuild.texi
    branches/stable/source/src/libs/README
    branches/stable/source/src/libs/configure
    branches/stable/source/src/libs/libpng/ChangeLog
    branches/stable/source/src/libs/libpng/Makefile.am
    branches/stable/source/src/libs/libpng/Makefile.in
    branches/stable/source/src/libs/xpdf/ChangeLog
    branches/stable/source/src/libs/xpdf/Makefile.am
    branches/stable/source/src/libs/xpdf/Makefile.in
    branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog
    branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes
    branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched
    branches/stable/source/src/libs/xpdf/configure
    branches/stable/source/src/libs/xpdf/version.ac
    branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE
    branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES
    branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL
    branches/stable/source/src/libs/xpdf/xpdf-src/README
    branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPath.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashScreen.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashTypes.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/AcroForm.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Annot.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFontTables.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CMakeLists.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Catalog.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Decrypt.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Dict.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Function.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Gfx.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JPXStream.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Lexer.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/NameToUnicodeTable.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UTF8.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/config.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdffonts.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfimages.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftopng.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftops.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
    branches/stable/source/src/m4/ChangeLog
    branches/stable/source/src/m4/kpse-freetype2-flags.m4
    branches/stable/source/src/m4/kpse-luajit-flags.m4
    branches/stable/source/src/m4/kpse-win32.m4
    branches/stable/source/src/tardate.ac
    branches/stable/source/src/texk/README
    branches/stable/source/src/texk/configure
    branches/stable/source/src/texk/kpathsea/ChangeLog
    branches/stable/source/src/texk/kpathsea/NEWS
    branches/stable/source/src/texk/kpathsea/c-auto.in
    branches/stable/source/src/texk/kpathsea/configure
    branches/stable/source/src/texk/kpathsea/doc/kpathsea.info
    branches/stable/source/src/texk/kpathsea/doc/kpathsea.texi
    branches/stable/source/src/texk/kpathsea/kpsewhich.c
    branches/stable/source/src/texk/kpathsea/texmf.cnf
    branches/stable/source/src/texk/kpathsea/variable.h
    branches/stable/source/src/texk/kpathsea/version.ac
    branches/stable/source/src/texk/kpathsea/win32/ChangeLog
    branches/stable/source/src/texk/kpathsea/win32/mktexlsr.c
    branches/stable/source/src/texk/kpathsea/win32/mktexpk.c
    branches/stable/source/src/texk/kpathsea/win32/mktextfm.c
    branches/stable/source/src/texk/kpathsea/win32/mktexupdmain.c
    branches/stable/source/src/texk/tests/TeXLive/TLConfig.pm
    branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm
    branches/stable/source/src/texk/web2c/ChangeLog
    branches/stable/source/src/texk/web2c/Makefile.in
    branches/stable/source/src/texk/web2c/NEWS
    branches/stable/source/src/texk/web2c/ac/web2c.ac
    branches/stable/source/src/texk/web2c/c-auto.in
    branches/stable/source/src/texk/web2c/configure
    branches/stable/source/src/texk/web2c/configure.ac
    branches/stable/source/src/texk/web2c/ctangleboot.cin
    branches/stable/source/src/texk/web2c/cwebboot.cin
    branches/stable/source/src/texk/web2c/cwebdir/ChangeLog
    branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.ch
    branches/stable/source/src/texk/web2c/cwebdir/comm-w2c.h
    branches/stable/source/src/texk/web2c/cwebdir/ctang-w2c.ch
    branches/stable/source/src/texk/web2c/cwebdir/ctwill-w2c.ch
    branches/stable/source/src/texk/web2c/cwebdir/cweav-w2c.ch
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/c++1xlib.w
    branches/stable/source/src/texk/web2c/cwebdir/po/cweb-tl.pot
    branches/stable/source/src/texk/web2c/cwebdir/po/cweb.pot
    branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb-tl.po
    branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb.po
    branches/stable/source/src/texk/web2c/cwebdir/po/de/web2c-help.po
    branches/stable/source/src/texk/web2c/cwebdir/po/it/cweb.po
    branches/stable/source/src/texk/web2c/cwebdir/po/web2c-help.pot
    branches/stable/source/src/texk/web2c/cwebdir/twinx.w
    branches/stable/source/src/texk/web2c/doc/web2c.info
    branches/stable/source/src/texk/web2c/doc/web2c.texi
    branches/stable/source/src/texk/web2c/help.h
    branches/stable/source/src/texk/web2c/lib/ChangeLog
    branches/stable/source/src/texk/web2c/lib/openclose.c
    branches/stable/source/src/texk/web2c/lib/texmfmp.c
    branches/stable/source/src/texk/web2c/man/Makefile.in
    branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
    branches/stable/source/src/texk/web2c/pdftexdir/NEWS
    branches/stable/source/src/texk/web2c/pdftexdir/epdf.c
    branches/stable/source/src/texk/web2c/web2c/configure
    branches/stable/source/src/utils/README
    branches/stable/source/src/utils/configure
    branches/stable/source/src/version.ac

Added Paths:
-----------
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/cweb_ecma94.w
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/cweb_hp8.w
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/cweb_mac8.w
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/cweb_pc850.w
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/cweb_ecma94.sty
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/cweb_hp8.sty
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/cweb_mac8.sty
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/cweb_pc850.sty
    branches/stable/source/src/texk/web2c/pdftexdir/pdftoepdf-poppler0.75.0.cc

Removed Paths:
-------------
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/ecma94.w
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/hp8.w
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/mac8.w
    branches/stable/source/src/texk/web2c/cwebdir/cwebinputs/pc850.w
    branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb-tl.mo
    branches/stable/source/src/texk/web2c/cwebdir/po/de/cweb.mo
    branches/stable/source/src/texk/web2c/cwebdir/po/de/web2c-help.mo
    branches/stable/source/src/texk/web2c/cwebdir/po/it/cweb.mo
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/ecma94.sty
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/hp8.sty
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/mac8.sty
    branches/stable/source/src/texk/web2c/cwebdir/texinputs/pc850.sty

Modified: branches/stable/source/Makefile
===================================================================
--- branches/stable/source/Makefile	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/Makefile	2019-05-30 16:25:31 UTC (rev 814)
@@ -36,6 +36,7 @@
 
 syncreal:
 	./sync-pdftex.sh --real | tee /tmp/pdfsync.out # read trailing info!
+	$(MAKE) svnstatus
 
 # The idea is to run this, do the needed svn adds and svn removes,
 # then (if something fails, which usually happens), deal with it, then

Modified: branches/stable/source/src/Makefile.in
===================================================================
--- branches/stable/source/src/Makefile.in	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/Makefile.in	2019-05-30 16:25:31 UTC (rev 814)
@@ -492,7 +492,7 @@
 recurse_this = 
 recurse_top = 
 
-# $Id: Makefile.in 49640 2019-01-08 18:57:53Z karl $
+# $Id: recurse.am 43261 2017-02-17 22:37:44Z karl $
 #
 # Requires $(recurse_this) and $(recurse_top).
 # Uses CONF_SUBDIRS and MAKE_SUBDIRS (set by kpse-setup.m4).

Modified: branches/stable/source/src/build-aux/config.guess
===================================================================
--- branches/stable/source/src/build-aux/config.guess	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/build-aux/config.guess	2019-05-30 16:25:31 UTC (rev 814)
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2019 Free Software Foundation, Inc.
 
-timestamp='2019-01-03'
+timestamp='2019-03-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -385,20 +385,7 @@
 	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	set_cc_for_build
-	SUN_ARCH=sparc
-	# If there is a compiler, see if it is configured for 64-bit objects.
-	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-	    if (echo '#ifdef __sparcv9'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		grep IS_64BIT_ARCH >/dev/null
-	    then
-		SUN_ARCH=sparcv9
-	    fi
-	fi
-	echo "$SUN_ARCH"-sun-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
 	echo i386-pc-auroraux"$UNAME_RELEASE"
@@ -998,22 +985,50 @@
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	set_cc_for_build
+	IS_GLIBC=0
+	test x"${LIBC}" = xgnu && IS_GLIBC=1
 	sed 's/^	//' << EOF > "$dummy.c"
 	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
+	#undef mips
+	#undef mipsel
+	#undef mips64
+	#undef mips64el
+	#if ${IS_GLIBC} && defined(_ABI64)
+	LIBCABI=gnuabi64
+	#else
+	#if ${IS_GLIBC} && defined(_ABIN32)
+	LIBCABI=gnuabin32
+	#else
+	LIBCABI=${LIBC}
+	#endif
+	#endif
+
+	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa64r6
+	#else
+	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa32r6
+	#else
+	#if defined(__mips64)
+	CPU=mips64
+	#else
+	CPU=mips
+	#endif
+	#endif
+	#endif
+
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
+	MIPS_ENDIAN=el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
+	MIPS_ENDIAN=
 	#else
-	CPU=
+	MIPS_ENDIAN=
 	#endif
 	#endif
 EOF
-	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
-	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
 	;;
     mips64el:Linux:*:*)
 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -1126,7 +1141,7 @@
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
+	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
@@ -1446,6 +1461,130 @@
 	exit ;;
 esac
 
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+  "4"
+#else
+  ""
+#endif
+  ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+  struct utsname un;
+
+  uname(&un);
+  if (strncmp(un.version, "V2", 2) == 0) {
+    printf ("i386-sequent-ptx2\n"); exit (0);
+  }
+  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+    printf ("i386-sequent-ptx1\n"); exit (0);
+  }
+  printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+  printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+  printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) /* >= ULTRIX4 */
+  printf ("mips-dec-ultrix4\n"); exit (0);
+#else
+#if defined(ULTRIX3) || defined(ultrix3) || defined(SIGLOST)
+  printf ("mips-dec-ultrix3\n"); exit (0);
+#endif
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
 echo "$0: unable to guess system type" >&2
 
 case "$UNAME_MACHINE:$UNAME_SYSTEM" in

Modified: branches/stable/source/src/build-aux/config.sub
===================================================================
--- branches/stable/source/src/build-aux/config.sub	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/build-aux/config.sub	2019-05-30 16:25:31 UTC (rev 814)
@@ -822,7 +822,9 @@
 		cpu=m68k
 		vendor=next
 		case $os in
-		    nextstep* )
+		    openstep*)
+		        ;;
+		    nextstep*)
 			;;
 		    ns2*)
 		      os=nextstep2

Modified: branches/stable/source/src/build-aux/missing
===================================================================
--- branches/stable/source/src/build-aux/missing	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/build-aux/missing	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@
   exit $st
 fi
 
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
 
 program_details ()
 {
@@ -207,7 +207,7 @@
 exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"

Modified: branches/stable/source/src/build-aux/test-driver
===================================================================
--- branches/stable/source/src/build-aux/test-driver	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/build-aux/test-driver	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -140,7 +140,7 @@
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"

Modified: branches/stable/source/src/build-aux/texinfo.tex
===================================================================
--- branches/stable/source/src/build-aux/texinfo.tex	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/build-aux/texinfo.tex	2019-05-30 16:25:31 UTC (rev 814)
@@ -3,10 +3,10 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2019-01-03-15}
+\def\texinfoversion{2019-03-03.15}
 
 %
-% Copyright 1985, 1986, 1988, 1990-2018 Free Software Foundation, Inc.
+% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc.
 %
 % This texinfo.tex file is free software: you can redistribute it and/or
 % modify it under the terms of the GNU General Public License as
@@ -258,8 +258,8 @@
 
 % \domark is called twice inside \chapmacro, to add one
 % mark before the section break, and one after.
-%   In the second call \prevchapterdefs is the same as \lastchapterdefs,
-% and \prevsectiondefs is the same as \lastsectiondefs.
+%   In the second call \prevchapterdefs is the same as \currentchapterdefs,
+% and \prevsectiondefs is the same as \currentsectiondefs.
 %   Then if the page is not broken at the mark, some of the previous
 % section appears on the page, and we can get the name of this section
 % from \firstmark for @everyheadingmarks top.
@@ -267,11 +267,11 @@
 %
 % See page 260 of The TeXbook.
 \def\domark{%
-  \toks0=\expandafter{\lastchapterdefs}%
-  \toks2=\expandafter{\lastsectiondefs}%
+  \toks0=\expandafter{\currentchapterdefs}%
+  \toks2=\expandafter{\currentsectiondefs}%
   \toks4=\expandafter{\prevchapterdefs}%
   \toks6=\expandafter{\prevsectiondefs}%
-  \toks8=\expandafter{\lastcolordefs}%
+  \toks8=\expandafter{\currentcolordefs}%
   \mark{%
                    \the\toks0 \the\toks2  % 0: marks for @everyheadingmarks top
       \noexpand\or \the\toks4 \the\toks6  % 1: for @everyheadingmarks bottom
@@ -288,19 +288,19 @@
 % @setcolor (or @url, or @link, etc.) between @contents and the very
 % first @chapter.
 \def\gettopheadingmarks{%
-  \ifcase0\topmark\fi
+  \ifcase0\the\savedtopmark\fi
   \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
 }
 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
-\def\getcolormarks{\ifcase2\topmark\fi}
+\def\getcolormarks{\ifcase2\the\savedtopmark\fi}
 
 % Avoid "undefined control sequence" errors.
-\def\lastchapterdefs{}
-\def\lastsectiondefs{}
-\def\lastsection{}
+\def\currentchapterdefs{}
+\def\currentsectiondefs{}
+\def\currentsection{}
 \def\prevchapterdefs{}
 \def\prevsectiondefs{}
-\def\lastcolordefs{}
+\def\currentcolordefs{}
 
 % Margin to add to right of even pages, to left of odd pages.
 \newdimen\bindingoffset
@@ -310,11 +310,35 @@
 % Main output routine.
 %
 \chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
+\newtoks\defaultoutput
+\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
+\output=\expandafter{\the\defaultoutput}
 
 \newbox\headlinebox
 \newbox\footlinebox
 
+% When outputting the double column layout for indices, an output routine
+% is run several times, which hides the original value of \topmark.  This
+% can lead to a page heading being output and duplicating the chapter heading
+% of the index.  Hence, save the contents of \topmark at the beginning of
+% the output routine.  The saved contents are valid until we actually
+% \shipout a page.
+%
+% (We used to run a short output routine to actually set \topmark and 
+% \firstmark to the right values, but if this was called with an empty page 
+% containing whatsits for writing index entries, the whatsits would be thrown 
+% away and the index auxiliary file would remain empty.)
+%
+\newtoks\savedtopmark
+\newif\iftopmarksaved
+\topmarksavedtrue
+\def\savetopmark{%
+  \iftopmarksaved\else
+    \global\savedtopmark=\expandafter{\topmark}%
+    \global\topmarksavedtrue
+  \fi
+}
+
 % \onepageout takes a vbox as an argument.
 % \shipout a vbox for a single page, adding an optional header, footer
 % and footnote.  This also causes index entries for this page to be written
@@ -326,23 +350,17 @@
   \ifodd\pageno  \advance\hoffset by \bindingoffset
   \else \advance\hoffset by -\bindingoffset\fi
   %
-  % Common context changes for both heading and footing.
-  % Do this outside of the \shipout so @code etc. will be expanded in
-  % the headline as they should be, not taken literally (outputting ''code).
-  \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
-  %
   % Retrieve the information for the headings from the marks in the page,
   % and call Plain TeX's \makeheadline and \makefootline, which use the
   % values in \headline and \footline.
   %
   % This is used to check if we are on the first page of a chapter.
-  \ifcase1\topmark\fi
+  \ifcase1\the\savedtopmark\fi
   \let\prevchaptername\thischaptername
   \ifcase0\firstmark\fi
   \let\curchaptername\thischaptername
   %
   \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
-  \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
   %
   \ifx\curchaptername\prevchaptername
     \let\thischapterheading\thischapter
@@ -353,7 +371,14 @@
     \def\thischapterheading{}%
   \fi
   %
+  % Common context changes for both heading and footing.
+  % Do this outside of the \shipout so @code etc. will be expanded in
+  % the headline as they should be, not taken literally (outputting ''code).
+  \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
+  %
   \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
+  %
+  \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
   \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
   %
   {%
@@ -384,8 +409,9 @@
         \unvbox\footlinebox
       \fi
       %
-    }% end of \shipout\vbox
-  }% end of group with \indexdummies
+    }%
+  }%
+  \global\topmarksavedfalse
   \advancepageno
   \ifnum\outputpenalty>-20000 \else\dosupereject\fi
 }
@@ -1161,7 +1187,7 @@
   % Set color, and create a mark which defines \thiscolor accordingly,
   % so that \makeheadline knows which color to restore.
   \def\setcolor#1{%
-    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+    \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
     \domark
     \pdfsetcolor{#1}%
   }
@@ -1169,7 +1195,7 @@
   \def\maincolor{\rgbBlack}
   \pdfsetcolor{\maincolor}
   \edef\thiscolor{\maincolor}
-  \def\lastcolordefs{}
+  \def\currentcolordefs{}
   %
   \def\makefootline{%
     \baselineskip24pt
@@ -1547,7 +1573,7 @@
   % Set color, and create a mark which defines \thiscolor accordingly,
   % so that \makeheadline knows which color to restore.
   \def\setcolor#1{%
-    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+    \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
     \domark
     \pdfsetcolor{#1}%
   }
@@ -1555,7 +1581,7 @@
   \def\maincolor{\rgbBlack}
   \pdfsetcolor{\maincolor}
   \edef\thiscolor{\maincolor}
-  \def\lastcolordefs{}
+  \def\currentcolordefs{}
   %
   \def\makefootline{%
     \baselineskip24pt
@@ -3032,32 +3058,24 @@
   \global\def/{\normalslash}
 }
 
-% we put a little stretch before and after the breakable chars, to help
-% line breaking of long url's.  The unequal skips make look better in
-% cmtt at least, especially for dots.
-\def\urefprestretchamount{.13em}
-\def\urefpoststretchamount{.1em}
-\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
-\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
-%
-\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
-\def\urefcodedot{\urefprestretch .\urefpoststretch}
-\def\urefcodehash{\urefprestretch \#\urefpoststretch}
-\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeamp{\urefprebreak \&\urefpostbreak}
+\def\urefcodedot{\urefprebreak .\urefpostbreak}
+\def\urefcodehash{\urefprebreak \#\urefpostbreak}
+\def\urefcodequest{\urefprebreak ?\urefpostbreak}
 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
 {
   \catcode`\/=\active
   \global\def\urefcodeslashfinish{%
-    \urefprestretch \slashChar
+    \urefprebreak \slashChar
     % Allow line break only after the final / in a sequence of
     % slashes, to avoid line break between the slashes in http://.
-    \ifx\next/\else \urefpoststretch \fi
+    \ifx\next/\else \urefpostbreak \fi
   }
 }
 
-% One more complication: by default we'll break after the special
-% characters, but some people like to break before the special chars, so
-% allow that.  Also allow no breaking at all, for manual control.
+% By default we'll break after the special characters, but some people like to 
+% break before the special chars, so allow that.  Also allow no breaking at 
+% all, for manual control.
 % 
 \parseargdef\urefbreakstyle{%
   \def\txiarg{#1}%
@@ -3064,9 +3082,9 @@
   \ifx\txiarg\wordnone
     \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
   \else\ifx\txiarg\wordbefore
-    \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+    \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
   \else\ifx\txiarg\wordafter
-    \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
   \else
     \errhelp = \EMsimple
     \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
@@ -3076,6 +3094,14 @@
 \def\wordbefore{before}
 \def\wordnone{none}
 
+% Allow a ragged right output to aid breaking long URL's.  Putting stretch in 
+% between characters of the URL doesn't look good.
+\def\urefallowbreak{%
+  \hskip 0pt plus 1fil\relax
+  \allowbreak
+  \hskip 0pt plus -1fil\relax
+}
+
 \urefbreakstyle after
 
 % @url synonym for @uref, since that's how everyone uses it.
@@ -5198,34 +5224,16 @@
 
 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
 
-% Most index entries go through here, but \dosubind is the general case.
 % #1 is the index name, #2 is the entry text.
-\def\doind#1#2{\dosubind{#1}{#2}{}}
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-% TODO: Two-level index?  Operation index?
-
-% Workhorse for all indexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% empty if called from \doind, as we usually are (the main exception
-% is with most defuns, which call us directly).
-%
-\def\dosubind#1#2#3{%
+\def\doind#1#2{%
   \iflinks
   {%
+    %
     \requireopenindexfile{#1}%
-    % Store the main index entry text (including the third arg).
-    \toks0 = {#2}%
-    % If third arg is present, precede it with a space.
-    \def\thirdarg{#3}%
-    \ifx\thirdarg\empty \else
-      \toks0 = \expandafter{\the\toks0 \space #3}%
-    \fi
-    %
     \edef\writeto{\csname#1indfile\endcsname}%
     %
-    \safewhatsit\dosubindwrite
+    \def\indextext{#2}%
+    \safewhatsit\doindwrite
   }%
   \fi
 }
@@ -5254,14 +5262,7 @@
   @gdef at useindexbackslash{@def\{{@indexbackslash}}}
 }
 
-% Definition for writing index entry text.
-\def\sortas#1{\ignorespaces}%
-
-% Definition for writing index entry sort key.  Should occur at the at
-% the beginning of the index entry, like
-%     @cindex @sortas{september} \september
-% The \ignorespaces takes care of following space, but there's no way
-% to remove space before it.
+% Definition for writing index entry sort key.
 {
 \catcode`\-=13
 \gdef\indexwritesortas{%
@@ -5272,10 +5273,71 @@
   \xdef\indexsortkey{#1}\endgroup}
 }
 
+% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
+%   * Set \bracedtext to "{aaa}{bbb}"
+%   * Set \fullindexsortkey to "aaa @subentry ZZZ"
+%
+\def\splitindexentry#1{%
+  \gdef\fullindexsortkey{}%
+  \xdef\bracedtext{}%
+  \def\sep{}%
+  \expandafter\doindexsegment#1\subentry\finish\subentry
+}
 
+% append the results from the next segment
+\def\doindexsegment#1\subentry{%
+  \def\segment{#1}%
+  \ifx\segment\isfinish
+  \else
+    %
+    % Fully expand the segment, throwing away any @sortas directives, and 
+    % trim spaces.
+    \def\sortas##1{}%
+    \edef\trimmed{\segment}%
+    \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+    %
+    \xdef\bracedtext{\bracedtext{\trimmed}}%
+    %
+    % Get the string to sort by.  Process the segment with all
+    % font commands turned off.
+    \bgroup
+      \let\sortas\indexwritesortas
+      \indexnofonts
+      % The braces around the commands are recognized by texindex.
+      \def\lbracechar{{\indexlbrace}}%
+      \def\rbracechar{{\indexrbrace}}%
+      \let\{=\lbracechar
+      \let\}=\rbracechar
+      %
+      \let\indexsortkey\empty
+      % Execute the segment and throw away the typeset output.  This executes
+      % any @sortas commands in this segment.
+      \setbox\dummybox = \hbox{\segment}%
+      \ifx\indexsortkey\empty{%
+        \indexnonalnumdisappear
+        \xdef\trimmed{\segment}%
+        \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+        \xdef\indexsortkey{\trimmed}%
+        \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
+      }\fi
+      %
+      % Append to \fullindexsortkey.
+      \edef\tmp{\gdef\noexpand\fullindexsortkey{%
+                  \fullindexsortkey\sep\indexsortkey}}%
+      \tmp
+    \egroup
+    \def\sep{\subentry}%
+    %
+    \expandafter\doindexsegment
+  \fi
+}
+\def\isfinish{\finish}%
+
+\let\subentry\relax
+
 % Write the entry in \toks0 to the index file.
 %
-\def\dosubindwrite{%
+\def\doindwrite{%
   % Put the index entry in the margin if desired.
   \ifx\SETmarginindex\relax\else
     \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
@@ -5285,25 +5347,10 @@
   \indexdummies % Must do this here, since \bf, etc expand at this stage
   \useindexbackslash % \indexbackslash isn't defined now so it will be output 
                      % as is; and it will print as backslash.
-  % The braces around \indexbrace are recognized by texindex.
   %
-  % Get the string to sort by, by processing the index entry with all
-  % font commands turned off.
-  {\indexnofonts
-   \def\lbracechar{{\indexlbrace}}%
-   \def\rbracechar{{\indexrbrace}}%
-   \let\{=\lbracechar
-   \let\}=\rbracechar
-   \indexnonalnumdisappear
-   \xdef\indexsortkey{}%
-   \let\sortas=\indexwritesortas
-   \edef\temp{\the\toks0}%
-   \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
-   \ifx\indexsortkey\empty
-     \xdef\indexsortkey{\temp}%
-     \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
-   \fi
-  }%
+  % Split the entry into primary entry and any subentries, and get the index 
+  % sort key.
+  \splitindexentry\indextext
   %
   % Set up the complete index entry, with both the sort key and
   % the original text, including any font commands.  We write
@@ -5310,9 +5357,10 @@
   % three arguments to \entry to the .?? file (four in the
   % subentry case), texindex reduces to two when writing the .??s
   % sorted result.
+  %
   \edef\temp{%
     \write\writeto{%
-      \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
+      \string\entry{\fullindexsortkey}{\noexpand\folio}\bracedtext}%
   }%
   \temp
 }
@@ -5418,11 +5466,6 @@
 \def\tindex {\tpindex}
 \def\pindex {\pgindex}
 
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
 % Define the macros used in formatting output of the sorted index material.
 
 % @printindex causes a particular index (the ??s file) to get printed.
@@ -5793,28 +5836,6 @@
 \newbox\partialpage
 \newdimen\doublecolumnhsize
 
-% Use inside an output routine to save \topmark and \firstmark
-\def\savemarks{%
-  \global\savedtopmark=\expandafter{\topmark }%
-  \global\savedfirstmark=\expandafter{\firstmark }%
-}
-\newtoks\savedtopmark
-\newtoks\savedfirstmark
-
-% Set \topmark and \firstmark for next time \output runs.
-% Can't be run from withinside \output (because any material
-% added while an output routine is active, including 
-% penalties, is saved for after it finishes).  The page so far
-% should be empty, otherwise what's on it will be thrown away.
-\def\restoremarks{%
-  \mark{\the\savedtopmark}%
-  \bgroup\output = {%
-    \setbox\dummybox=\box\PAGE
-  }abc\eject\egroup
-  % "abc" because output routine doesn't fire for a completely empty page.
-  \mark{\the\savedfirstmark}%
-}
-
 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
   % If not much space left on page, start a new page.
   \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
@@ -5821,6 +5842,7 @@
   %
   % Grab any single-column material above us.
   \output = {%
+    \savetopmark
     %
     % Here is a possibility not foreseen in manmac: if we accumulate a
     % whole lot of material, we might end up calling this \output
@@ -5838,16 +5860,9 @@
       \unvbox\PAGE
       \kern-\topskip \kern\baselineskip
     }%
-    \savemarks
   }%
   \eject % run that output routine to set \partialpage
-  \restoremarks
   %
-  % We recover the two marks that the last output routine saved in order
-  % to propagate the information in marks added around a chapter heading,
-  % which could be otherwise be lost by the time the final page is output.
-  %
-  %
   % Use the double-column output routine for subsequent pages.
   \output = {\doublecolumnout}%
   %
@@ -5872,7 +5887,9 @@
     \divide\doublecolumnhsize by 2
   \hsize = \doublecolumnhsize
   %
-  % Double the \vsize as well.
+  % Get the available space for the double columns -- the normal
+  % (undoubled) page height minus any material left over from the
+  % previous page.
   \advance\vsize by -\ht\partialpage
   \vsize = 2\vsize
   %
@@ -5885,10 +5902,8 @@
 %
 \def\doublecolumnout{%
   %
+  \savetopmark
   \splittopskip=\topskip \splitmaxdepth=\maxdepth
-  % Get the available space for the double columns -- the normal
-  % (undoubled) page height minus any material left over from the
-  % previous page.
   \dimen@ = \vsize
   \divide\dimen@ by 2
   %
@@ -5895,7 +5910,7 @@
   % box0 will be the left-hand column, box2 the right.
   \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
   \global\advance\vsize by 2\ht\partialpage
-  \onepageout\pagesofar
+  \onepageout\pagesofar % empty except for the first time we are called
   \unvbox\PAGE
   \penalty\outputpenalty
 }
@@ -5943,7 +5958,7 @@
   %
   \output = {%
     % Split the last of the double-column material.
-    \savemarks
+    \savetopmark
     \balancecolumns
   }%
   \eject % call the \output just set
@@ -5951,10 +5966,9 @@
     % Having called \balancecolumns once, we do not
     % want to call it again.  Therefore, reset \output to its normal
     % definition right away.
-    \global\output = {\onepageout{\pagecontents\PAGE}}%
+    \global\output=\expandafter{\the\defaultoutput}
     %
     \endgroup % started in \begindoublecolumns
-    \restoremarks
     % Leave the double-column material on the current page, no automatic
     % page break.
     \box\balancedcolumns
@@ -5978,13 +5992,14 @@
 \def\balancecolumns{%
   \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
   \dimen@ = \ht0
-  \advance\dimen@ by \topskip
-  \advance\dimen@ by-\baselineskip
-  \ifdim\dimen@<5\baselineskip
+  \ifdim\dimen@<7\baselineskip
     % Don't split a short final column in two.
     \setbox2=\vbox{}%
     \global\setbox\balancedcolumns=\vbox{\pagesofar}%
   \else
+    % double the leading vertical space
+    \advance\dimen@ by \topskip
+    \advance\dimen@ by-\baselineskip
     \divide\dimen@ by 2 % target to split to
     \dimen at ii = \dimen@
     \splittopskip = \topskip
@@ -6468,27 +6483,22 @@
   \expandafter\ifx\thisenv\titlepage\else
     \checkenv{}% chapters, etc., should not start inside an environment.
   \fi
-  % FIXME: \chapmacro is currently called from inside \titlepage when
-  % \setcontentsaftertitlepage to print the "Table of Contents" heading, but
-  % this should probably be done by \sectionheading with an option to print
-  % in chapter size.
-  %
   % Insert the first mark before the heading break (see notes for \domark).
-  \let\prevchapterdefs=\lastchapterdefs
-  \let\prevsectiondefs=\lastsectiondefs
-  \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+  \let\prevchapterdefs=\currentchapterdefs
+  \let\prevsectiondefs=\currentsectiondefs
+  \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
                         \gdef\thissection{}}%
   %
   \def\temptype{#2}%
   \ifx\temptype\Ynothingkeyword
-    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+    \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                           \gdef\thischapter{\thischaptername}}%
   \else\ifx\temptype\Yomitfromtockeyword
-    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+    \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                           \gdef\thischapter{}}%
   \else\ifx\temptype\Yappendixkeyword
     \toks0={#1}%
-    \xdef\lastchapterdefs{%
+    \xdef\currentchapterdefs{%
       \gdef\noexpand\thischaptername{\the\toks0}%
       \gdef\noexpand\thischapternum{\appendixletter}%
       % \noexpand\putwordAppendix avoids expanding indigestible
@@ -6499,7 +6509,7 @@
     }%
   \else
     \toks0={#1}%
-    \xdef\lastchapterdefs{%
+    \xdef\currentchapterdefs{%
       \gdef\noexpand\thischaptername{\the\toks0}%
       \gdef\noexpand\thischapternum{\the\chapno}%
       % \noexpand\putwordChapter avoids expanding indigestible
@@ -6519,8 +6529,8 @@
   %
   % Now the second mark, after the heading break.  No break points
   % between here and the heading.
-  \let\prevchapterdefs=\lastchapterdefs
-  \let\prevsectiondefs=\lastsectiondefs
+  \let\prevchapterdefs=\currentchapterdefs
+  \let\prevsectiondefs=\currentsectiondefs
   \domark
   %
   {%
@@ -6527,10 +6537,10 @@
     \chapfonts \rm
     \let\footnote=\errfootnoteheading % give better error message
     %
-    % Have to define \lastsection before calling \donoderef, because the
+    % Have to define \currentsection before calling \donoderef, because the
     % xref code eventually uses it.  On the other hand, it has to be called
     % after \pchapsepmacro, or the headline will change too soon.
-    \gdef\lastsection{#1}%
+    \gdef\currentsection{#1}%
     %
     % Only insert the separating space if we have a chapter/appendix
     % number, and don't print the unnumbered ``number''.
@@ -6619,10 +6629,10 @@
     \csname #2fonts\endcsname \rm
     %
     % Insert first mark before the heading break (see notes for \domark).
-    \let\prevsectiondefs=\lastsectiondefs
+    \let\prevsectiondefs=\currentsectiondefs
     \ifx\temptype\Ynothingkeyword
       \ifx\sectionlevel\seckeyword
-        \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+        \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
                               \gdef\thissection{\thissectionname}}%
       \fi
     \else\ifx\temptype\Yomitfromtockeyword
@@ -6630,7 +6640,7 @@
     \else\ifx\temptype\Yappendixkeyword
       \ifx\sectionlevel\seckeyword
         \toks0={#1}%
-        \xdef\lastsectiondefs{%
+        \xdef\currentsectiondefs{%
           \gdef\noexpand\thissectionname{\the\toks0}%
           \gdef\noexpand\thissectionnum{#4}%
           % \noexpand\putwordSection avoids expanding indigestible
@@ -6643,7 +6653,7 @@
     \else
       \ifx\sectionlevel\seckeyword
         \toks0={#1}%
-        \xdef\lastsectiondefs{%
+        \xdef\currentsectiondefs{%
           \gdef\noexpand\thissectionname{\the\toks0}%
           \gdef\noexpand\thissectionnum{#4}%
           % \noexpand\putwordSection avoids expanding indigestible
@@ -6669,7 +6679,7 @@
     %
     % Now the second mark, after the heading break.  No break points
     % between here and the heading.
-    \global\let\prevsectiondefs=\lastsectiondefs
+    \global\let\prevsectiondefs=\currentsectiondefs
     \domark
     %
     % Only insert the space after the number if we have a section number.
@@ -6676,10 +6686,10 @@
     \ifx\temptype\Ynothingkeyword
       \setbox0 = \hbox{}%
       \def\toctype{unn}%
-      \gdef\lastsection{#1}%
+      \gdef\currentsection{#1}%
     \else\ifx\temptype\Yomitfromtockeyword
       % for @headings -- no section number, don't include in toc,
-      % and don't redefine \lastsection.
+      % and don't redefine \currentsection.
       \setbox0 = \hbox{}%
       \def\toctype{omit}%
       \let\sectionlevel=\empty
@@ -6686,11 +6696,11 @@
     \else\ifx\temptype\Yappendixkeyword
       \setbox0 = \hbox{#4\enspace}%
       \def\toctype{app}%
-      \gdef\lastsection{#1}%
+      \gdef\currentsection{#1}%
     \else
       \setbox0 = \hbox{#4\enspace}%
       \def\toctype{num}%
-      \gdef\lastsection{#1}%
+      \gdef\currentsection{#1}%
     \fi\fi\fi
     %
     % Write the toc entry (before \donoderef).  See comments in \chapmacro.
@@ -7347,13 +7357,9 @@
 
 
 % @raggedright does more-or-less normal line breaking but no right
-% justification.  From plain.tex.  Don't stretch around special
-% characters in urls in this environment, since the stretch at the right
-% should be enough.
+% justification.  From plain.tex.
 \envdef\raggedright{%
   \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
-  \def\urefprestretchamount{0pt}%
-  \def\urefpoststretchamount{0pt}%
 }
 \let\Eraggedright\par
 
@@ -7515,7 +7521,7 @@
   \nonfillstart
   \tt % easiest (and conventionally used) font for verbatim
   % The \leavevmode here is for blank lines.  Otherwise, we would
-  % never \starttabox and the \egroup would end verbatim mode.
+  % never \starttabbox and the \egroup would end verbatim mode.
   \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
   \tabexpand
   \setupmarkupstyle{verbatim}%
@@ -7578,9 +7584,12 @@
   {%
     \makevalueexpandable
     \setupverbatim
-    \indexnofonts       % Allow `@@' and other weird things in file names.
-    \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
-    \input #1
+    {%
+      \indexnofonts       % Allow `@@' and other weird things in file names.
+      \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+      \edef\tmp{\noexpand\input #1 }
+      \expandafter
+    }\tmp
     \afterenvbreak
   }%
 }
@@ -7725,6 +7734,21 @@
   \fi\fi
 }
 
+% \dosubind {index}{topic}{subtopic}
+%
+% If SUBTOPIC is present, precede it with a space, and call \doind.
+% (At some time during the 20th century, this made a two-level entry in an 
+% index such as the operation index.  Nobody seemed to notice the change in 
+% behaviour though.)
+\def\dosubind#1#2#3{%
+  \def\thirdarg{#3}%
+  \ifx\thirdarg\empty
+    \doind{#1}{#2}%
+  \else
+    \doind{#1}{#2\space#3}%
+  \fi
+}
+
 % Untyped functions:
 
 % @deffn category name args
@@ -7739,7 +7763,6 @@
 % \deffngeneral {subind}category name args
 %
 \def\deffngeneral#1#2 #3 #4\endheader{%
-  % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
   \dosubind{fn}{\code{#3}}{#1}%
   \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
 }
@@ -8751,7 +8774,7 @@
 
 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
 % anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name taken from \lastsection,
+% 1) NAME-title - the current sectioning name taken from \currentsection,
 %                 or the anchor name.
 % 2) NAME-snt   - section number and type, passed as the SNT arg, or
 %                 empty for anchors.
@@ -8773,7 +8796,7 @@
 	\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
 	  ##1}{##2}}% these are parameters of \writexrdef
       }%
-      \toks0 = \expandafter{\lastsection}%
+      \toks0 = \expandafter{\currentsection}%
       \immediate \writexrdef{title}{\the\toks0 }%
       \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
       \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
@@ -9571,13 +9594,13 @@
       \global\advance\floatno by 1
       %
       {%
-        % This magic value for \lastsection is output by \setref as the
+        % This magic value for \currentsection is output by \setref as the
         % XREFLABEL-title value.  \xrefX uses it to distinguish float
         % labels (which have a completely different output format) from
         % node and anchor labels.  And \xrdef uses it to construct the
         % lists of floats.
         %
-        \edef\lastsection{\floatmagic=\safefloattype}%
+        \edef\currentsection{\floatmagic=\safefloattype}%
         \setref{\floatlabel}{Yfloat}%
       }%
     \fi
@@ -9700,7 +9723,7 @@
 
 % #1 is the control sequence we are passed; we expand into a conditional
 % which is true if #1 represents a float ref.  That is, the magic
-% \lastsection value which we \setref above.
+% \currentsection value which we \setref above.
 %
 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
 %
@@ -11188,7 +11211,8 @@
    \relax
 }
 
-% define all Unicode characters we know about, for the sake of @U.
+% Define all Unicode characters we know about.  This makes UTF-8 the default
+% input encoding and allows @U to work.
 \iftxinativeunicodecapable
   \nativeunicodechardefsatu
 \else
@@ -11195,14 +11219,6 @@
   \utfeightchardefs
 \fi
 
-
-% Make non-ASCII characters printable again for compatibility with
-% existing Texinfo documents that may use them, even without declaring a
-% document encoding.
-%
-\setnonasciicharscatcode \other
-
-
 \message{formatting,}
 
 \newdimen\defaultparindent \defaultparindent = 15pt

Modified: branches/stable/source/src/build-aux/ylwrap
===================================================================
--- branches/stable/source/src/build-aux/ylwrap	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/build-aux/ylwrap	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
 #
 # Written by Tom Tromey <tromey at cygnus.com>.
 #
@@ -18,7 +18,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -239,7 +239,7 @@
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"

Modified: branches/stable/source/src/configure
===================================================================
--- branches/stable/source/src/configure	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/configure	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for TeX Live 2018-04-14.
+# Generated by GNU Autoconf 2.69 for TeX Live 2019-04-07.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='TeX Live'
 PACKAGE_TARNAME='tex-live'
-PACKAGE_VERSION='2018-04-14'
-PACKAGE_STRING='TeX Live 2018-04-14'
+PACKAGE_VERSION='2019-04-07'
+PACKAGE_STRING='TeX Live 2019-04-07'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -823,7 +823,6 @@
 enable_pdftex
 enable_pdftex_synctex
 enable_luatex
-enable_luatex53
 enable_luajittex
 enable_mp
 enable_pmp
@@ -1503,7 +1502,7 @@
   # 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 TeX Live 2018-04-14 to adapt to many kinds of systems.
+\`configure' configures TeX Live 2019-04-07 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1577,7 +1576,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of TeX Live 2018-04-14:";;
+     short | recursive ) echo "Configuration of TeX Live 2019-04-07:";;
    esac
   cat <<\_ACEOF
 
@@ -1631,7 +1630,6 @@
   --disable-pdftex          do not compile and install pdfTeX
   --disable-pdftex-synctex    build pdfTeX without SyncTeX support
   --disable-luatex          do not compile and install LuaTeX
-  --disable-luatex53        do not compile and install LuaTeX53
   --disable-luajittex       do not compile and install LuaJITTeX
   --disable-mp              do not compile and install MetaPost
   --disable-pmp             do not compile and install pMetaPost
@@ -1887,7 +1885,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-TeX Live configure 2018-04-14
+TeX Live configure 2019-04-07
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2664,7 +2662,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by TeX Live $as_me 2018-04-14, which was
+It was created by TeX Live $as_me 2019-04-07, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -4377,7 +4375,8 @@
     ;;
 esac
 
-## utils/xindy/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xindy/
+# $Id: withenable.ac 49993 2019-02-10 19:14:27Z karl $
+# utils/xindy/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xindy/
 ## configure options and TL libraries required for xindy
 # Check whether --enable-xindy was given.
 if test "${enable_xindy+set}" = set; then :
@@ -4384,24 +4383,15 @@
   enableval=$enable_xindy;
 fi
 case $enable_xindy in #(
-  yes) :
-    if test "x$cross_compiling" = xyes; then :
-  as_fn_error $? "Unable to cross compile xindy" "$LINENO" 5
-fi ;; #(
-  no) :
+  yes|no) :
      ;; #(
   *) :
-    if test "x$cross_compiling" = xyes; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Cross compiling -> \`--disable-xindy'" >&5
-$as_echo "$as_me: Cross compiling -> \`--disable-xindy'" >&6;}
-            enable_xindy=no
-            ac_configure_args="$ac_configure_args '--disable-xindy'"
-          else
+
    enable_xindy=no
      { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-xindy=$enable_xindy'" >&5
 $as_echo "$as_me: Assuming \`--enable-xindy=$enable_xindy'" >&6;}
      ac_configure_args="$ac_configure_args '--enable-xindy=$enable_xindy'"
-   fi ;;
+    ;;
 esac
 
 ## utils/xindy/ac/xindy.ac: configure.ac fragment for the TeX Live subdirectory utils/xindy/
@@ -4499,7 +4489,8 @@
   need_zlib=yes
 }
 
-## texk/web2c/ac/web2c.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
+# $Id: web2c.ac 50341 2019-03-11 22:04:24Z karl $
+# texk/web2c/ac/web2c.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
 ## configure options for TeX and MF
 
 # Check whether --with-banner-add was given.
@@ -4674,22 +4665,6 @@
 test "x$enable_web2c:$enable_luatex" = xyes:yes && {
   need_libpng=yes
   need_zziplib=yes
-  need_lua52=yes
-}
-# Check whether --enable-luatex53 was given.
-if test "${enable_luatex53+set}" = set; then :
-  enableval=$enable_luatex53;
-fi
-case $enable_luatex53 in #(
-  yes | no) :
-     ;; #(
-  *) :
-    enable_luatex53=yes ;;
-esac
-
-test "x$enable_web2c:$enable_luatex53" = xyes:yes && {
-  need_libpng=yes
-  need_zziplib=yes
   need_lua53=yes
 }
 # Check whether --enable-luajittex was given.
@@ -4826,7 +4801,7 @@
 esac
 
 test "x$enable_web2c:$enable_mflua" = xyes:yes && {
-  need_lua52=yes
+  need_lua53=yes
 }
 # Check whether --enable-mfluajit was given.
 if test "${enable_mfluajit+set}" = set; then :
@@ -10776,7 +10751,7 @@
 
 # Define the identity of the package.
  PACKAGE='tex-live'
- VERSION='2018-04-14'
+ VERSION='2019-04-07'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -21332,9 +21307,103 @@
 else
   FT2_CONFIG="$ac_cv_prog_FT2_CONFIG"
 fi
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PKG_CONFIG"; then
+  ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_PKG_CONFIG"; then
+  ac_ct_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_PKG_CONFIG"; then
+  ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5
+$as_echo "$ac_ct_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_PKG_CONFIG" = x; then
+    PKG_CONFIG="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_ct_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
+fi
 if $FT2_CONFIG --ftversion >/dev/null 2>&1; then
   FREETYPE2_INCLUDES=`$FT2_CONFIG --cflags`
   FREETYPE2_LIBS=`$FT2_CONFIG --libs`
+elif $PKG_CONFIG --libs freetype2 >/dev/null 2>&1; then
+  FREETYPE2_INCLUDES=`$PKG_CONFIG --cflags freetype2`
+  FREETYPE2_LIBS=`$PKG_CONFIG --libs freetype2`
 elif test "x$need_freetype2:$with_system_freetype2" = xyes:yes; then
   as_fn_error $? "did not find freetype-config required for system freetype2 library" "$LINENO" 5
 fi
@@ -22805,7 +22874,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by TeX Live $as_me 2018-04-14, which was
+This file was extended by TeX Live $as_me 2019-04-07, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -22862,7 +22931,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-TeX Live config.status 2018-04-14
+TeX Live config.status 2019-04-07
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -24819,11 +24888,11 @@
 test "x$srcdir" = x. || msg_compiling="$msg_compiling
       from sources in $kpse_src"
 { $as_echo "$as_me:${as_lineno-$LINENO}: result:
-** Configuration summary for $PACKAGE_STRING (2019/dev$with_banner_add):
+** Configuration summary for $PACKAGE_STRING (2019$with_banner_add):
 
    $msg_compiling" >&5
 $as_echo "
-** Configuration summary for $PACKAGE_STRING (2019/dev$with_banner_add):
+** Configuration summary for $PACKAGE_STRING (2019$with_banner_add):
 
    $msg_compiling" >&6; }
 case $kpse_src$kpse_bld in

Modified: branches/stable/source/src/doc/build-tools.txt
===================================================================
--- branches/stable/source/src/doc/build-tools.txt	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/doc/build-tools.txt	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,7 +1,7 @@
 autoconf (GNU Autoconf) 2.69
 automake (GNU automake) 1.16.1
-bison (GNU Bison) 3.2.4
+bison (GNU Bison) 3.3.1
 flex 2.6.0
 ltmain.sh (GNU libtool) 2.4.6
 m4 (GNU M4) 1.4.18
-makeinfo (GNU texinfo) 6.5
+makeinfo (GNU texinfo) 6.6

Modified: branches/stable/source/src/doc/tlbuild-incl/install-tl.texi
===================================================================
--- branches/stable/source/src/doc/tlbuild-incl/install-tl.texi	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/doc/tlbuild-incl/install-tl.texi	2019-05-30 16:25:31 UTC (rev 814)
@@ -194,7 +194,7 @@
 usual, but at the end all files from @emph{path} are copied over to
 @code{bin/custom/} under your installation directory and this @code{bin/custom/}
 directory is what will be added to the path for the post-install
-actions.  To install multiple custom binary sets, manully rename
+actions.  To install multiple custom binary sets, manually rename
 @code{custom} before doing each.
 
 For more information on custom binaries, see

Modified: branches/stable/source/src/doc/tlbuild.info
===================================================================
--- branches/stable/source/src/doc/tlbuild.info	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/doc/tlbuild.info	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,9 +1,9 @@
-This is tlbuild.info, produced by makeinfo version 6.5 from
+This is tlbuild.info, produced by makeinfo version 6.6 from
 tlbuild.texi.
 
 This file documents the TeX Live build system and more.
 
-Copyright (C) 2016-2018 Karl Berry.
+Copyright (C) 2016-2019 Karl Berry.
 Copyright (C) 2013-2015 Karl Berry & Peter Breitenlohner.
 
    Permission is granted to make and distribute verbatim copies of this
@@ -33,7 +33,7 @@
 
 File: tlbuild.info,  Node: Top,  Next: Introduction,  Up: (dir)
 
-Building TeX Live (2018)
+Building TeX Live (2019)
 ************************
 
 For an overview of this manual, *note Introduction::.
@@ -59,7 +59,7 @@
 1 Introduction
 **************
 
-This manual (dated August 2018) corresponds to the TeX Live 2018
+This manual (dated February 2019) corresponds to the TeX Live 2019
 release.
 
    This manual is aimed at system installers and programmers, and
@@ -67,38 +67,39 @@
 sources.  It is also available as plain text files in the source tree:
 'source/README.*'.
 
-   The 'source/README' file in the TL source tree provides the
+   The main 'source/README' file in the TL source tree provides
 maximally-terse information for doing a build, and portability
 information for different systems, along with
 'source/doc/README.solaris'.
 
    For information on acquiring the TL sources, see
-<http://tug.org/texlive/svn>.
+<https://tug.org/texlive/svn>.  The canonical source repository uses
+Subversion, and we have no plans to change this.
 
    This manual does not duplicate the information found in other TL
 documentation resources, such as:
 
-   * The TeX Live web pages: <http://tug.org/texlive>.
+   * The TeX Live web pages: <https://tug.org/texlive>.
 
    * The web page describing how to build the binaries which are
-     distributed with TeX Live: <http://tug.org/texlive/build.html>.
+     distributed with TeX Live: <https://tug.org/texlive/build.html>.
 
-   * The TeX Live user manual: <http://tug.org/texlive/doc.html>, or run
-     'texdoc texlive'.
+   * The TeX Live user manual: <https://tug.org/texlive/doc.html>, or
+     run 'texdoc texlive'.
 
    * Other TeX-related Texinfo manuals (*note (web2c)::, *note
-     (kpathsea)::, etc.): <http://tug.org/texinfohtml/>, or check the
+     (kpathsea)::, etc.): <https://tug.org/texinfohtml/>, or check the
      'TeX' category in the GNU Info system.
 
    * Package documentation:
-     <http://tug.org/texlive/Contents/live/doc.html>, or the 'doc.html'
+     <https://tug.org/texlive/Contents/live/doc.html>, or the 'doc.html'
      file at the top level of the installed TL.
 
    As an exception, the full documentation for 'install-tl' and 'tlmgr'
-is included here, just because it is convenient to do so.  The same text
-is available online (linked from <http://tug.org/texlive/doc.html>, or
-by invoking the program with '--help' (or look at the end of the
-source).
+is included here as appendices, simply because it is easy to do so.  The
+same text is available online (linked from
+<https://tug.org/texlive/doc.html>, or by invoking the program with
+'--help' (or look at the end of the source).
 
 
 File: tlbuild.info,  Node: Overview of build system,  Next: Prerequisites,  Prev: Introduction,  Up: Top
@@ -106,10 +107,10 @@
 2 Overview of build system
 **************************
 
-The TeX Live build system was redesigned in 2009, consistently using
-Autoconf, Automake, and Libtool.  Thus
+The TeX Live build system was redesigned in 2009 to consistently use
+Autoconf, Automake, and Libtool.  Thus, running
    'configure && make && make check && make install'
-or the basically-equivalent top-level 'Build' script suffice to build
+or the essentially-equivalent top-level 'Build' script suffices to build
 and install the TL programs.  The 'make check' clause performs various
 tests of the generated programs--not strictly required but strongly
 recommended.  Running 'configure --help' will display a comprehensive
@@ -135,7 +136,7 @@
 and properties, such as required libraries, whether an installed
 (system) version of a library can be used, 'configure' options to be
 seen at the top level, and more.  An explicit list of all available
-modules is kept in only one central place, namely 'm4/kpse-pkgs.m4'.
+modules is kept in a single central place: 'm4/kpse-pkgs.m4'.
 
    A second, related goal is to configure and build each library before
 configuring any other (program or library) module which uses that
@@ -148,8 +149,8 @@
 source tree and document any modifications of that source.
 
    All this is for the sake of simplifying both upgrading of modules and
-integrating new modules into the TL build system.  (Not to say that
-either task is trivial.)
+integrating new modules into the TL build system.  (Despite all efforts,
+neither task is easy.)
 
 
 File: tlbuild.info,  Node: Prerequisites,  Next: Building,  Prev: Overview of build system,  Up: Top
@@ -158,21 +159,22 @@
 ***************
 
 Overall, building the TeX Live programs, when using all libraries from
-the TL source tree, requires only C and C++ compilers and GNU 'make'.
-(If 'make' from your 'PATH' is not GNU make, you can set 'MAKE' in the
-environment to whatever is necessary.)
+the TL source tree, requires C and C++11 compilers and GNU 'make'.  If
+'make' from your 'PATH' is not GNU make, you can set the 'MAKE'
+environment variable to whatever is necessary.
 
    GNU 'make' is required only because of some third-party libraries,
 notably FreeType; all the TL-maintained directories (and
-Automake/Autoconf output in general) should work with any reasonable
-'make'.
+Automake/Autoconf output in general) work with any reasonable 'make'.
 
+   A C++11 compiler is similarly required because of the third-party
+libraries ICU and Poppler; the program 'dvisvgm' also requires C++11.
+It is possible to build everything else with older compilers;
+<https://tug.org/texlive/custom-bin.html> links to a build script for
+doing this.
+
    However, a few programs in the tree have additional requirements:
 
-'dvisvgm'
-     requires a C++11 compiler, such as gcc 4.8.1 (or later) or clang
-     3.3 (or later).
-
 'web2c'
      requires 'perl' for some tests run by 'make check'.
 
@@ -186,8 +188,9 @@
      MacOSX only, the 'ApplicationServices' and 'Cocoa' frameworks.
 
 'xindy'
-     requires GNU 'clisp' and in addition 'perl', 'latex', and
-     'pdflatex' to build the rules and/or documentation.
+     requires GNU 'clisp', 'libsigsegv', and 'libiconv'; additionally,
+     to build the rules and/or documentation: 'perl', 'latex', and
+     'pdflatex'
 
 Lacking the required tools, building these programs must avoided, e.g.,
 'configure --without-x --disable-xetex --disable-xindy'
@@ -196,7 +199,7 @@
 expect:
 
    * Modification of any '.y' or '.l' source files requires 'bison' or
-     'flex' to updatete the corresponding C sources.
+     'flex' to update the corresponding C sources.
 
    * Modification of the sources for '.info' files requires 'makeinfo'.
 
@@ -203,7 +206,10 @@
    * Modification of any part of the build system (M4 macros,
      'configure.ac', 'Makefile.am', or their fragments) requires GNU M4,
      GNU Autoconf, GNU Automake, and GNU Libtool to update the generated
-     files.  *Note Build system tools::.
+     files.  Furthermore, to reliably reproduce the build files, the
+     original GNU releases of these tools must be used, not any distro
+     packaging of them.  *Note Build system tools::, for more
+     discussion.
 
    If you haven't modified any source files, and infrastructure tools
 such as 'autoconf' or 'makeinfo' are still being run, check your
@@ -211,11 +217,6 @@
 Subversion configuration (*note Build system tools::).  Barring buggy
 commits, no infrastructure tools are needed to do a normal build.
 
-   As an example, on Debian systems the necessary build dependencies can
-be installed via:
-
-     apt-get install libfontconfig-dev libx11-dev libxmu-dev libxaw7-dev
-
 
 File: tlbuild.info,  Node: Building,  Next: Installing,  Prev: Prerequisites,  Up: Top
 
@@ -224,26 +225,27 @@
 
 The top-level 'Build' script is intended to simplify building the
 binaries distributed with TeX Live itself--we call this the "native" TL
-build.  It configures and makes everything in a subdirectory of the main
-build tree (default 'Work/'), installs everything in another
-subdirectory (default 'inst/'), and finally runs 'make check'.  The
-exact directory and command names can be specified via environment
-variables and a few leading options.  All remaining arguments
-(assignments or options) are passed to the 'configure' script.  Please
-take a look at the './Build' source file itself for more information; it
+build.  It runs 'configure && make world', which builds everything in a
+subdirectory of the main source tree (default 'Work/'), installs
+everything in another subdirectory (default 'inst/'), and finally runs
+'make check'.  The exact directory and command names can be specified
+via environment variables and a few leading options.  All remaining
+arguments (assignments or options) are passed to the 'configure' script.
+Please take a look at the './Build' source file for more information; it
 is a straightforward shell script.
 
    An alternative, and the one we will mainly discuss here, is to run
-'configure' and 'make' oneself in a suitable empty subdirectory.
-Building in the source directory itself is not supported (sorry).
+'configure' and 'make' in a suitable empty subdirectory.  Building in
+the source directory itself is not supported (sorry).
 
 * Menu:
 
-* Build iteration::     What 'configure' and 'make' do.
+* Build iteration::     What 'configure' and 'make' do in TL.
 * Build problems::      If the build fails.
 * Build in parallel::   Simultaneous 'make' processes.
 * Build distribution::  Making a distribution tarball.
 * Build one package::   Example of working on just one program.
+* Build one engine::    Example of building just one TeX engine.
 * Cross compilation::   Building on host X for target Y.
 
 
@@ -254,10 +256,10 @@
 
 Running the top-level 'configure' script configures the top level and
 the subdirectories 'libs', 'utils', and 'texk'.  Running 'make' at the
-top-level first iterates over all TeX-specific libraries, and then runs
-'make' in 'libs', 'utils', and 'texk' to iterate over all generic
-libraries, utility programs, and TeX-specific programs.  These
-iterations consist of two steps:
+top level first iterates over the TeX-specific libraries, and then runs
+'make' in 'libs', 'utils', and 'texk' to iterate over the generic
+libraries, utility programs, and TeX-specific programs, respectively.
+These iterations consist of two steps:
 
   1. For each library or program module not yet configured, run
      'configure', adding the configure option '--disable-build' if the
@@ -268,8 +270,8 @@
      'check' to run tests, 'install', etc.
 
    Running the top-level 'make' a second time iterates again over all
-the library and program modules, but finds (should find) nothing to be
-done unless some source files have been modified.
+the library and program modules, and finds (should find) nothing to be
+done.
 
 
 File: tlbuild.info,  Node: Build problems,  Next: Build in parallel,  Prev: Build iteration,  Up: Building
@@ -277,10 +279,11 @@
 4.2 Build problems
 ==================
 
-If configuring or building a module fails, you should first find and fix
-the problem, then perhaps remove the subdirectory for that module from
-the build tree, and finally rerun the top level 'make' (or 'Build' with
-'--no-clean' as its first argument).
+If configuring or building a module fails, you should first try to find
+and fix the problem.  Failing that, a possible workaround is to remove
+the subdirectory for that module from the build tree (so 'configure'
+won't try to run there, and finally rerun the top level 'make' (or
+'./Build' '--no-clean').
 
 
 File: tlbuild.info,  Node: Build in parallel,  Next: Build distribution,  Prev: Build problems,  Up: Building
@@ -289,13 +292,13 @@
 =====================
 
 The TL build system carefully formulates dependencies as well as 'make'
-rules when a tool (such as 'tangle', 'ctangle', or 'convert') creates
+rules when a tool (such as 'tangle', 'ctangle', and 'convert') creates
 several output files.  This allows for parallel builds ('make -j N' with
 N>1 or even 'make -j') that can considerably speed up the TL build.
 
-   Incidentally, a noticeable speed-up can also be (independently)
-gained by using a configure cache file, i.e., with the option '-C'
-(recommended).
+   Incidentally, a noticeable speed-up can be independently gained by
+using a configure cache file, i.e., specifying the 'configure' option
+'-C' (recommended).
 
 
 File: tlbuild.info,  Node: Build distribution,  Next: Build one package,  Prev: Build in parallel,  Up: Building
@@ -310,10 +313,11 @@
 
    This is useful for checking consistency of the source tree and
 Makefiles, but the result is not a complete or even usable TeX system,
-since all the support files are lacking; *note Installing::.
+since all the support files are lacking; *note Installing::.  We do not
+actually distribute any such tarball, and have no plans to do so.
 
 
-File: tlbuild.info,  Node: Build one package,  Next: Cross compilation,  Prev: Build distribution,  Up: Building
+File: tlbuild.info,  Node: Build one package,  Next: Build one engine,  Prev: Build distribution,  Up: Building
 
 4.5 Build one package
 =====================
@@ -322,15 +326,15 @@
 '--disable-all-pkgs' (*note --disable-all-pkgs::).  Then all program and
 library modules are configured but none are made.  However, the
 'Makefile's still contain all build rules and dependencies and can be
-invoked to build an individual program or library and causes to first
-build any required libraries.
+invoked to build an individual program or library, first building any
+required libraries.
 
    This "build-on-demand" procedure is used, e.g., in the upstream
-LuaTeX repository to build LuaTeX, essentially from a subset of the
-complete TeX Live tree.  Similarly, when, e.g., building the original
+LuaTeX repository to build LuaTeX, from a subset of the complete
+TeX Live source tree.  As another example, when building the original
 e-TeX has been disabled (as it is by default), one can run 'make etex'
 (or 'make etex.exe') in 'texk/web2c/' to build e-TeX (although there is
-no comparably simple way to install e-TeX).
+no comparably simple way to _install_ e-TeX).
 
    If you want to work on a single program within the TL sources, this
 is the recommended way to do it.  Here is an example from start to
@@ -338,7 +342,7 @@
 
      mkdir mydir && cd mydir  # new working directory
 
-     # Get sources (<http://tug.org/texlive/svn>), e.g.:
+     # Get sources (<https://tug.org/texlive/svn>), e.g.:
      rsync -a --delete --exclude=.svn --exclude=Work \
            tug.org::tldevsrc/Build/source/ .
 
@@ -347,28 +351,30 @@
 
      # Do the configure:
      ../configure --disable-all-pkgs --enable-dvipdfm-x \
-       -C CFLAGS=-g CXXFLAGS=-g >&outc
+       -C CFLAGS=-g CXXFLAGS=-g >&outc || echo fail
 
      # Do the make:
-     make >&outm
+     make >&outm || echo fail
 
      # Test:
      cd texk/dvipdfm-x
      make check
 
-   Then you modify source files in 'mydir/texk/dvipdfm-x' and rerun
-'make' in 'mydir/Work/texk/dvipdfm-x' to rebuild (that build directory
-is where the binaries end up).
+   Then you can modify source files in 'mydir/texk/dvipdfm-x' and rerun
+'make' in 'mydir/Work/texk/dvipdfm-x' to rebuild; that build directory
+is where the binary ends up and where you can run a debugger, etc.
 
    The second line of the 'configure' invocation shows examples of extra
 things you likely want to specify if you intend to hack the sources (and
-not just build binaries): the '-C' speeds up 'configure', and the
-'CFLAGS' and 'CXXFLAGS' settings eliminate compiler optimization for
-debugging purposes.
+not just build binaries): the '-C' speeds 'configure' by enabling a
+cache file, and the 'CFLAGS' and 'CXXFLAGS' settings eliminate compiler
+optimization for debugging purposes.
 
-   Of course, one should actually look at the output and check that
+   Of course, you need to actually look at the output and check that
 things are working.  There are many 'configure' options you can tweak as
-desired; check the output from 'configure --help'.
+desired; check the output from 'configure --help'.  It is also a good
+idea to run 'make check' after making any changes, to ensure that
+whatever tests have been written still pass.
 
    Finally, the above retrieves the entire TL source tree (several
 hundred megabytes).  It is natural to ask if this is really necessary.
@@ -376,12 +382,13 @@
 do so.  If you cut down the source tree, you must also give additional
 'configure' flags to individually disable using system versions of
 libraries, or the intricacies of the dependencies (such as 'teckit'
-requiring 'zlib') will have undesired side effects.  For an example, see
-the 'build-pdftex.sh' script in the 'pdftex' development source (details
-at <http://pdftex.org>), which is indeed a cut-down TL source tree.
+requiring 'zlib') will have undesired side effects.  For an example of
+this approach, see the 'build-pdftex.sh' script in the 'pdftex'
+development source (details at <http://pdftex.org>), which is indeed
+such a cut-down TL source tree.
 
    Even with '--disable-all-pkgs', dependencies will be checked.  For
-instance, if a non-MacOSX system does not have 'fontconfig', XeTeX
+instance, if a (non-MacOSX) system does not have 'fontconfig', XeTeX
 cannot be built (*note Prerequisites::) and 'configure' will terminate.
 To proceed without such dependencies, specify '--enable-missing' also.
 
@@ -391,9 +398,34 @@
 'CXX', and 'OBJCXX'.
 
 
-File: tlbuild.info,  Node: Cross compilation,  Prev: Build one package,  Up: Building
+File: tlbuild.info,  Node: Build one engine,  Next: Cross compilation,  Prev: Build one package,  Up: Building
 
-4.6 Cross compilation
+4.6 Build one engine
+====================
+
+Unfortunately, there is one common case where the steps in the preceding
+section to build one package (*note Build one package::) do not suffice:
+wanting to build one, or a subset, of the TeX engines (or other Web2c
+programs).
+
+   The simplest way to do this is to disable everything and then
+explicitly specify what to make.  For example, to build only LuaTeX:
+
+     ./configure --disable-all-pkgs  # or ./Build
+     cd Work/texk/web2c              # build directory
+     make luatex                     # specify target
+
+   This works because the 'make' automatically runs 'configure' as
+necessary for the dependencies and target.  Furthermore, the source tree
+can be cut down to just what is needed for the given engine (as the
+separate pdfTeX and LuaTeX source repositories do).
+
+   We hope to improve the situation in the future.  Patches are welcome.
+
+
+File: tlbuild.info,  Node: Cross compilation,  Prev: Build one engine,  Up: Building
+
+4.7 Cross compilation
 =====================
 
 In a cross compilation a "build" system is used to create binaries to be
@@ -426,7 +458,7 @@
 
 File: tlbuild.info,  Node: Cross configuring,  Next: Cross problems,  Up: Cross compilation
 
-4.6.1 Cross configuring
+4.7.1 Cross configuring
 -----------------------
 
 In a standard cross compilation, binaries for the host system cannot
@@ -475,7 +507,7 @@
 
 File: tlbuild.info,  Node: Cross problems,  Prev: Cross configuring,  Up: Cross compilation
 
-4.6.2 Cross problems
+4.7.2 Cross problems
 --------------------
 
 The fact that binaries for the host system cannot be executed on the
@@ -501,12 +533,12 @@
    This approach would also be possible for the tools such as 'tangle'
 used in the module 'texk/web2c' to build the WEB programs, but that
 would require first building a native 'kpathsea' library.  To avoid this
-complication, cross compilation of the WEB or CWEB programs requires
+complication, cross compilation of programs written in (C)WEB requires
 sufficiently recent installed versions of 'tangle', 'ctangle',
 'otangle', and 'tie'.
 
    Building 'xindy' requires running the host system 'clisp' binary,
-thus cross compilation is not possible.
+thus cross compilation is painful, but possible.
 
 
 File: tlbuild.info,  Node: Installing,  Next: Layout and infrastructure,  Prev: Building,  Up: Top
@@ -522,10 +554,10 @@
 the source tree.
 
    These support files are maintained completely independently and are
-not present in the source tree.  The best basis for dealing with them is
-the TeX Live (plain text) database in 'Master/tlpkg/texlive.tlpdb',
+not present in the TL source tree.  The best basis for dealing with them
+is the TeX Live (plain text) database in 'Master/tlpkg/texlive.tlpdb',
 and/or the TeX Live installer, 'install-tl'.  More information is under
-'Master/tlpkg' and at <http://tug.org/texlive/distro.html>.
+'Master/tlpkg' and at <https://tug.org/texlive/distro.html>.
 
 * Menu:
 
@@ -546,7 +578,7 @@
 'INFODIR'.
 
    The values of these directories are determined by 'configure' and can
-be specified explictly as options such as '--prefix=PREFIX' or
+be specified explicitly as options such as '--prefix=PREFIX' or
 '--bindir=BINDIR'; otherwise, they are given by their usual Autoconf
 defaults:
 
@@ -573,7 +605,7 @@
 The top-level 'configure' script displays all these installation paths.
 
    For the native TL build, the 'Build' script leaves the binaries in
-'./inst/bin/STD-PLATFORM-NAME'.  The new binaries are not directly
+'./inst/bin/STD-SYSTEM-TRIPLET'.  The new binaries are not directly
 usable from that location; they need to be copied to
 'Master/bin/TL-PLATFORM'.  The other files and directories that end up
 in './inst/' are ignored.
@@ -593,8 +625,9 @@
 'DATAROOTDIR/texmf-dist/scripts'; for Unix-like systems a symbolic link
 is made in 'BINDIR'.  For example, a symlink points from 'BINDIR/ps2eps'
 to 'DATAROOTDIR/texmf-dist/scripts/ps2eps/ps2eps.pl'.  For Windows, a
-standard wrapper binary (e.g., 'BINDIR/ps2eps.exe') serves the same
-purpose.  (The source for the wrapper is in 'texk/texlive/w32_wrapper'.)
+standard wrapper binary (copied to, e.g., 'BINDIR/ps2eps.exe') serves
+the same purpose.  The source for the wrapper is in
+'texk/texlive/w32_wrapper'.
 
    One reason for this is to avoid having many copies of the same
 script; a more important reason is that it guarantees the scripts will
@@ -604,9 +637,9 @@
 to be as close as possible to what is in the TL distribution.  At
 present, there are a few exceptions--Asymptote, Biber, Xindy--and each
 one creates considerable extra work.  We don't want to add more.  (See
-<http://tug.org/texlive/build.html> for information about building those
-exceptions, as well as the 'xz' and 'wget' programs that are used in the
-TL infrastructure.)
+<https://tug.org/texlive/build.html> for information about building
+those exceptions, as well as the 'xz' and 'wget' programs that are used
+in the TL infrastructure.)
 
 
 File: tlbuild.info,  Node: Distro builds,  Prev: Linked scripts,  Up: Installing
@@ -620,12 +653,12 @@
 operating system distribution.
 
    The native TL distribution uses shared libraries only when absolutely
-necessary ('libc', 'libm', X11 libraries, and 'libfontconfig').
-However, a distro typically wants to use as many shared libraries as
+necessary ('libc', 'libm', X11 libraries, and 'libfontconfig').  In
+contrast, a distro typically wants to use as many shared libraries as
 possible from elsewhere on the system, including TeX-specific libraries
 such as 'libkpathsea' (even though Kpathsea has never officially been
-released as a shared library, but we digress).  In addition, the
-installation paths will, in general, be completely different.
+released as a shared library).  In addition, the installation paths
+will, in general, be completely different.
 
    Here are the 'configure' options that distro builds are likely to
 find most relevant:
@@ -646,8 +679,8 @@
      Do not build the static versions of the TeX-specific libraries.
 
 '--with-system-LIB'
-     Use system versions for as many libraries LIB as possible.
-     'configure --help' will give you the list of possibilities.
+     Look for and use a system version of the library LIB.  'configure
+     --help' will give you the list of possibilities.
 
 '--with-LIB-includes=DIR'
 '--with-LIB-libdir=DIR'
@@ -666,7 +699,7 @@
 (*note Installing::), and many other issues, such as font maps,
 languages, and formats, independently of the build.  Norbert Preining
 has written a detailed article on adapting TL for distros:
-<http://tug.org/TUGboat/tb34-3/tb108preining-distro.pdf>.  (If the
+<https://tug.org/TUGboat/tb34-3/tb108preining-distro.pdf>.  (If the
 article needs updating in the future, perhaps we will merge it into this
 document.)
 
@@ -688,7 +721,7 @@
 * Autoconf macros::         TL-specific Autoconf macros.
 * Library modules::         Handling libraries, with examples.
 * Program modules::         Handling programs, with examples.
-* Extending TeX Live::      Adding a new module.
+* Extending TeX Live::         Adding a new module.
 
 
 File: tlbuild.info,  Node: Build system tools,  Next: Top-level directories,  Up: Layout and infrastructure
@@ -696,8 +729,8 @@
 6.1 Build system tools
 ======================
 
-As mentioned above (*note Prerequisites::), a normal build requires very
-little.  On the other hand, if you want to modify the TeX Live
+As mentioned above (*note Prerequisites::), a normal build has few
+requirements.  On the other hand, if you want to modify the TeX Live
 infrastructure sources, such as 'configure.ac' or 'Makefile.am' files,
 you will need to have several additional tools installed.
 
@@ -712,11 +745,11 @@
 
      autoconf (GNU Autoconf) 2.69
      automake (GNU automake) 1.16.1
-     bison (GNU Bison) 3.2.4
+     bison (GNU Bison) 3.3.1
      flex 2.6.0
      ltmain.sh (GNU libtool) 2.4.6
      m4 (GNU M4) 1.4.18
-     makeinfo (GNU texinfo) 6.5
+     makeinfo (GNU texinfo) 6.6
 
    These versions should be used to update the generated files (e.g.,
 'configure' or 'Makefile.in') in all or parts of the TL tree after their
@@ -724,16 +757,21 @@
 top-level 'reautoconf' script or implicitly by using the configure
 option '--enable-maintainer-mode'.
 
+   It has often turned out that the bison and flex versions are not
+critical; however, the autotools versions are.  If you don't have the
+given versions, get them before modifying the build infrastructure.
+
    The files in the Subversion repository (see
-<http://tug.org/texlive/svn>) are all up to date, but unfortunately this
-may not be reflected by their timestamps.  (For starters, be sure to set
-'use-commit-times=yes' in '~/.subversion/config' or the equivalent.)
+<https://tug.org/texlive/svn>) are all up to date (barring bugs).  For
+this to be reflected by their timestamps in your checkout, be sure to
+set 'use-commit-times=yes' in '~/.subversion/config' or the equivalent.
 
-   To avoid unnecessary runs of 'bison', 'flex', or 'makeinfo' it may be
-necessary to 'touch' the generated ('.c', '.h', or '.info') files.  With
-'--enable-maintainer-mode' it may also be necessary to 'touch' first
-'aclocal.m4', then 'configure' and 'config.h.in' (or 'c-auto.in'), and
-finally all 'Makefile.in' files.  Perhaps 'make -t' will help.
+   If timestamps are wrong, you may also be able to avoid unnecessary
+runs of 'bison', 'flex', or 'makeinfo' with 'touch' of the generated
+('.c', '.h', or '.info') files.  With '--enable-maintainer-mode' it may
+also be necessary to 'touch' first 'aclocal.m4', then 'configure' and
+'config.h.in' (or 'c-auto.in'), and finally all 'Makefile.in' files.
+Perhaps 'make -t' will help.
 
 
 File: tlbuild.info,  Node: Top-level directories,  Next: Autoconf macros,  Prev: Build system tools,  Up: Layout and infrastructure
@@ -767,22 +805,18 @@
 
    The top-level 'build-aux/' directory contains the common files
 'compile', 'config.guess', 'config.sub', 'depcomp', etc. used by most
-packages.  These are from the GNU Gnulib sources
-(<http://www.gnu.org/software/gnulib>), which in turn synchronizes with
-the appropriate ultimate upstream repository.  There are, however,
-independent copies in, e.g., 'libs/freetype2/freetype-*/builds/unix/',
-and a few other places.  The 'reautoconf' script does not touch those,
-but a TL cron job keeps them in sync (nightly).
+packages.  These are taken from the GNU Gnulib sources
+(<https://www.gnu.org/software/gnulib>), which in turn synchronizes with
+any ultimate upstream repository.  There are independent copies of some
+of these in a few other places, e.g.,
+'libs/freetype2/freetype-*/builds/unix/'.  The 'reautoconf' script does
+not touch those, but a TL cron job keeps them in sync (nightly).
 
-   The directory 'extra/' contains things which are not part of the TL
-build, but are present just for (someone's) convenience, e.g., is
-'epstopdf' development source is here.
-
    When the top-level './Build' script is used to build TL, two more two
 more top-level directories appear: 'Work/' for the build tree, and
 'inst/' for the install tree (from 'make install').  These names (and
 everything else about 'Build''s operation) can be changed by setting
-environment variables before running it; see the script file.
+environment variables before running it; see the script source.
 
 
 File: tlbuild.info,  Node: Autoconf macros,  Next: Library modules,  Prev: Top-level directories,  Up: Layout and infrastructure
@@ -790,11 +824,12 @@
 6.3 Autoconf macros
 ===================
 
-Here we describe some of the Autoconf macros used in several modules-not
-a complete list, by any means.  These general macros are supplemented by
-module-specific macros in directories such as 'texk/dvipng/m4/'; some of
-those are described in *note Library modules:: and *note Program
-modules::.
+Here we describe a few of the Autoconf macros used in several
+modules--many more are defined in the sources; see the top-level 'm4/'
+directory.  These general macros are supplemented by module-specific
+macros in directories such as 'texk/dvipng/m4/'; some of those are
+described in following sections (*note Library modules:: and *note
+Program modules::).
 
 * Menu:
 
@@ -827,8 +862,8 @@
         'LT_INIT([win32-dll])'
         'AC_SYS_LARGEFILE'
         'AC_FUNC_FSEEKO'
-     and check for frequently used functions, headers, types, and
-     structures.  This is used for TeX-specific modules.
+     along with checks for frequently used functions, headers, types,
+     and structures.  This is used for TeX-specific modules.
 
 
 File: tlbuild.info,  Node: Macros for programs,  Next: Macros for compilers,  Prev: General setup macros,  Up: Autoconf macros
@@ -839,11 +874,11 @@
 Macros for program checks:
 
  -- Macro: KPSE_CHECK_LATEX
-     Set 'LATEX' to the name of the first of 'latex', 'elatex', or
-     'lambda' which exists in 'PATH', or to 'no' if none of them exists.
-     Call 'AC_SUBST' for 'LATEX'.  The result of this test can be
-     overridden by setting the 'LATEX' environment variable or the cache
-     variable 'ac_cv_prog_LATEX'.
+     Set 'LATEX' to the first of 'latex', 'elatex', or 'lambda' which
+     exists in 'PATH', or to 'no' if none of them exists.  Call
+     'AC_SUBST' for 'LATEX'.  The result of this test can be overridden
+     by setting the 'LATEX' environment variable or the cache variable
+     'ac_cv_prog_LATEX'.
 
  -- Macro: KPSE_CHECK_PDFLATEX
      Check for 'pdflatex' in 'PATH' and set 'PDFLATEX'.
@@ -866,8 +901,8 @@
      When using the (Objective) C/C++ compiler, set
      'WARNING_[OBJ]C[XX]FLAGS' to suitable warning flags (depending on
      the value given to or implied for '--enable-compiler-warnings').
-     Call 'AC_SUBST' for them.  At the moment this only works for GNU
-     compilers, but could be extended to others if necessary.
+     Call 'AC_SUBST' for them.  At present this assumes GNU compiler
+     warning options, but could be extended to others if necessary.
 
      This macro caches its results in the 'kpse_cv_warning_cflags', ...
      variables.
@@ -875,9 +910,9 @@
  -- Macro: KPSE_COMPILER_VISIBILITY
      When using the C or C++ compiler, try to set
      'VISIBILITY_C[XX]FLAGS' to flags to hide external symbols.  Call
-     'AC_SUBST' for this variable.  At the moment this only tests for
-     the compiler option '-fvisibility=hidden', but that could be
-     extended with more checks if necessary.
+     'AC_SUBST' for this variable.  At present this only tests for the
+     compiler option '-fvisibility=hidden', but could be extended if
+     necessary.
 
      This macro caches its results in the 'kpse_cv_visibility_cflags' or
      'kpse_cv_visibility_cxxflags' variable.
@@ -885,8 +920,7 @@
  -- Macro: KPSE_CXX_HACK
      Provide the configure option '--enable-cxx-runtime-hack'.  If
      enabled and when using 'g++', try to statically link with
-     'libstdc++', somewhat improving portability of the resulting
-     binary.
+     'libstdc++', notably improving portability of the resulting binary.
 
      This macro caches its result in the 'kpse_cv_cxx_hack' variable.
 
@@ -915,11 +949,13 @@
  -- Macro: KPSE_LIBPNG_FLAGS
      Provide the configure option '--with-system-libpng'.  Set and
      'AC_SUBST' 'make' variables for modules using this library (either
-     an installed version or from the TeX Live tree): 'LIBPNG_INCLUDES'
-     for use in 'CPPFLAGS', 'LIBPNG_LIBS' for use in 'LDADD',
-     'LIBPNG_DEPEND' for use as dependency, and 'LIBPNG_RULE' defining
-     'make' rules to rebuild the library.
+     an installed version or from the TeX Live tree):
 
+     'LIBPNG_INCLUDES'   for use in 'CPPFLAGS',
+     'LIBPNG_LIBS'       for use in 'LDADD',
+     'LIBPNG_DEPEND'     for use as a Makefile dependency,
+     'LIBPNG_RULE'       for the 'make' rules to rebuild the library.
+
  -- Macro: KPSE_ADD_FLAGS (NAME)
      Temporarily extend 'CPPFLAGS' and 'LIBS' with the values required
      for the library module 'NAME'.
@@ -942,7 +978,7 @@
      ## Rebuild libpng
      @LIBPNG_RULE@
 
-   If it was necessary to examine whether certain 'zlib' or 'libpng'
+   If it were necessary to examine whether certain 'zlib' or 'libpng'
 features were available, 'configure.ac' should be continued this way:
      KPSE_ADD_FLAGS([zlib])
      ... # tests for 'zlib' features, if any
@@ -960,10 +996,10 @@
 due to the lack of symbolic links.
 
  -- Macro: KPSE_CHECK_WIN32
-     Check if compiling for a Windows system.  The result is 'no' for
-     Unix-like systems (including Cygwin), 'mingw32' for Windows with
-     GCC, or 'native' for Windows with MSVC. The result is cached in the
-     'kpse_cv_have_win32' variable.
+     Check if compiling for a Windows system.  The result is either 'no'
+     for Unix-like systems (including Cygwin), 'mingw32' for Windows
+     with GCC, or 'native' for Windows with MSVC. The result is cached
+     in the 'kpse_cv_have_win32' variable.
 
  -- Macro: KPSE_COND_WIN32
      Call 'KPSE_CHECK_WIN32' and define the Automake conditional 'WIN32'
@@ -982,7 +1018,7 @@
      Linked scripts::).
 
  -- Macro: KPSE_WIN32_CALL
-     Call 'KPSE_COND_WIN32', check if the file
+     Call 'KPSE_COND_WIN32' and check if the file
      'texk/texlive/w32_wrapper/callexe.c' exists; if it does, create a
      symlink in the build tree.  Compiling 'callexe.c' with
      '-DEXEPROG='"FOO.exe"'' and installing 'callexe.exe' as 'BAR.exe'
@@ -1012,14 +1048,14 @@
 6.4.1 The 'png' library in 'libs/libpng'
 ----------------------------------------
 
-This generic library uses the source tree in, e.g., the subdirectory
-'libpng-src/' with all modifications for TL recorded in 'TLpatches/*'.
+The "generic" 'png' library uses the source tree in the subdirectory
+'libpng-src/', with all modifications for TL recorded in 'TLpatches/*'.
 The 'configure.ac' fragment 'ac/withenable.ac' contains
 
      KPSE_WITH_LIB([libpng], [zlib])
 
-specifying the module name, and indicating the dependency on 'zlib'.  A
-third literal argument 'tree' would specify that the library from the
+to specify the module name and indicate the dependency on 'zlib'.  A
+third literal argument ''tree'' would specify that the library from the
 TeX Live tree cannot be replaced by a system version.  That not being
 the case here, a second fragment 'ac/libpng.ac' contains
 
@@ -1037,27 +1073,30 @@
        return 0; }
 
 which Autoconf uses to verify the usability of a system version with C
-code.  The analogous macro 'KPSE_TRY_LIBXX' would check using C++ code.
-These fragments are included by 'configure.ac' at the top level.
+code.  The analogous macro 'KPSE_TRY_LIBXX' would check using C++.
+These fragments are included by the 'configure.ac' at the top level of
+TL ('Build/source/configure.ac').
 
-   For this library, among many other modules, a proxy build system for
-TL is used ('configure.ac', 'Makefile.am', and 'include/Makefile.am'),
-ignoring the distributed one.  Consequently, a few generated files and
-auxiliary scripts are removed from the distributed source tree.  The
-public headers 'png.h', 'pngconf.h', and 'pnglibconf.h' are "installed"
-(as symlinks) under 'include/' in the build tree exactly as they are for
-a system version under, e.g., '/usr/include/'.
+   For this library, like many other modules, a proxy build system for
+TL is used, consisting of our own 'configure.ac', 'Makefile.am',
+'include/Makefile.am'; the distributed build system is not used.
+(Consequently, a few generated files and auxiliary scripts are removed
+from the distributed source tree.)
 
+   The public headers 'png.h', 'pngconf.h', and 'pnglibconf.h' are
+"installed" (as symlinks) under 'include/' in the build tree exactly as
+they are for a system version under, e.g., '/usr/include/'.
+
    The module is supplemented by the file 'm4/kpse-libpng-flags.m4' that
 defines the M4 macro 'KPSE_LIBPNG_FLAGS' used by all modules depending
 on this library in their 'configure.ac' to generate the 'make' variables
 'LIBPNG_INCLUDES' for use in 'CPPFLAGS', 'LIBPNG_LIBS' for use in
-'LDADD', 'LIBPNG_DEPEND' for use as dependencies, and 'LIBPNG_RULE'
-defining 'make' rules to rebuild the library.
+'LDADD', 'LIBPNG_DEPEND' for use as dependencies, and 'LIBPNG_RULE' for
+the 'make' rules to rebuild the library.
 
    'm4/kpse-libpng-flags.m4' also supplies the configure option
-'--with-system-libpng' and uses 'pkg-config' to determine the flags
-required for the system library.
+'--with-system-libpng', which then uses 'pkg-config' to determine the
+flags required for the system library.
 
 
 File: tlbuild.info,  Node: zlib library,  Next: freetype library,  Prev: png library,  Up: Library modules
@@ -1077,12 +1116,16 @@
 6.4.3 The 'freetype' library in 'libs/freetype2'
 ------------------------------------------------
 
-This module uses a wrapper build system with an almost trivial
-'configure.ac' and with a 'Makefile.am' that invokes 'configure' and
-'make' for the distributed source, followed by 'make install' with the
-build tree as destination.  The flags required for the system library
-are obtained through 'freetype-config'.
+This module uses a wrapper build system.  In contrast to the proxy build
+described earlier, the wrapper build has an almost trivial
+'configure.ac' and a 'Makefile.am' which invokes the 'configure' and
+'make' in the distributed source, followed by 'make install' with the TL
+build tree as destination.  In other words, this actually uses the build
+system provided by upstream (possibly patched).
 
+   The flags required for the system library are obtained through
+'freetype-config'.
+
 
 File: tlbuild.info,  Node: kpathsea library,  Prev: freetype library,  Up: Library modules
 
@@ -1090,26 +1133,26 @@
 -----------------------------------------------
 
 This is one of the TeX-specific libraries that are maintained as part of
-TeX Live (*note (kpathsea)::).  Despite being a core part of the TeX
-system, it is not a terribly special case in the infrastructure.  The
-TeX libraries are Libtool libraries (static and/or shared) and are
-installed by 'make install' together with the programs.  They are,
-however, not part of the TL DVD as distributed by TeX user groups, and
-have never been officially released for standalone use.
+TeX Live (*note (kpathsea)::); the other is 'ptexenc'.  These TeX
+libraries are Libtool libraries (static and/or shared) and are installed
+by 'make install' together with the programs.  They are, however, not
+part of the TL DVD as distributed by TeX user groups, and have never
+been officially released for standalone use.
 
-   It is possible, and perhaps even useful for distro builds (*note
-Distro builds::), to specify the configure option
-'--with-system-kpathsea' in order to use a system version of the
-library.  Programs outside the TL tree should use 'pkg-config' for the
-required flags.
+   It is possible, and probably useful for distro builds (*note Distro
+builds::), to specify the configure option '--with-system-kpathsea' in
+order to use a system version of the library.  Programs outside the TL
+tree should use 'pkg-config' for the required flags.
 
-   In addition to 'ac/withenable.ac' and 'ac/kpathsea.ac' there is a
-third fragment 'ac/mktex.ac' included by both 'ac/withenable.ac' and
-'configure.ac' that supplies configure options such as
-'--enable-mktextfm-default', which determine the compile time default of
-whether or not to run 'mktextfm' to generate a missing '.tfm' file.  In
-any case, however, the command line options '-mktex=tfm' or
-'-no-mktex=tfm' for the TeX-like engines override this default.
+   In addition to 'kpathsea/ac/withenable.ac' and
+'kpathsea/ac/kpathsea.ac' here there is a third fragment
+'kpathsea.ac/mktex.ac', included by both 'withenable.ac' and
+'configure.ac', which supplies configure options such as
+'--enable-mktextfm-default'.  These determine the compile time default
+of whether or not to run 'mktextfm' (and similar) to generate a missing
+'.tfm' (or whatever) file.  In any case, however, the command line
+options '-mktex=tfm' or '-no-mktex=tfm' for the TeX-like engines
+override this default.
 
 
 File: tlbuild.info,  Node: Program modules,  Next: Extending TeX Live,  Prev: Library modules,  Up: Layout and infrastructure
@@ -1133,10 +1176,10 @@
 6.5.1 The 't1utils' package in 'utils/t1utils'
 ----------------------------------------------
 
-Once again we use the distributed source tree 't1utils-src' with
-modifications documented in 'TLpatches/*' and a proxy build system
-consisting of 'configure.ac' and 'Makefile.am'.  The fragment
-'ac/withenable.ac' contains
+Here we use the distributed source tree 't1utils-src' with modifications
+documented in 'TLpatches/*' and a proxy build system consisting of
+'configure.ac' and 'Makefile.am'.  The fragment 'ac/withenable.ac'
+contains
 
      KPSE_ENABLE_PROG([t1utils])
 
@@ -1150,24 +1193,25 @@
 ------------------------------------------
 
 This module uses the distributed source tree 'xindy-src/' with
-modifications documented in 'TLpatches/*', a proxy 'configure.ac', and a
-wrapper 'Makefile.am' that descends into 'xindy-src'.  The 'xindy' build
-requires a 'make' that supports a 'VPATH' build, can handle all targets,
-and do not refer to '${top_srcdir}' or '${top_builddir}'.  The fragment
-'ac/withenable.ac' contains
+modifications documented in 'TLpatches/*', and a wrapper 'configure.ac'
+and 'Makefile.am' that descends into 'xindy-src'.
 
-     KPSE_ENABLE_PROG([xindy], , [disable native])
+   The 'xindy' build requires a 'make' that supports a 'VPATH' build,
+can handle all targets, and do not refer to '${top_srcdir}' or
+'${top_builddir}'.  The fragment 'xindy/ac/withenable.ac' contains
+
+     KPSE_ENABLE_PROG([xindy], , [disable])
      m4_include(kpse_TL[utils/xindy/ac/xindy.ac])
      m4_include(kpse_TL[utils/xindy/ac/clisp.ac])
 
 where 'disable' in the third argument indicates that 'xindy' is only
 built if explicitly enabled by the user with 'configure --enable-xindy'
-(the need for 'clisp' is too painful to require by default), and
-'native' disallows cross compilation.  The additional fragments
-'ac/xindy.ac' and 'ac/clisp.ac' specify more 'configure' options to be
-seen at the top level with 'ac/xindy.ac' also included by
-'configure.ac'.
+(the need for 'clisp' makes it too painful to enable by default).
 
+   The additional fragments 'ac/xindy.ac' and 'ac/clisp.ac' specify more
+'configure' options to be seen at the top level, with 'ac/xindy.ac' also
+included by 'configure.ac'.
+
 
 File: tlbuild.info,  Node: xdvik package,  Next: asymptote,  Prev: xindy package,  Up: Program modules
 
@@ -1175,23 +1219,23 @@
 -----------------------------------------
 
 This package is maintained as part of the TeX Live tree with sources in
-its top level directory and the subdirectory 'gui'.  The fragment
-'ac/withenable.ac' contains
+its own directory ('texk/xdvik/').  The fragment
+'xdvik/ac/withenable.ac' contains
 
      dnl extra_dirs = texk/xdvik/squeeze
      KPSE_ENABLE_PROG([xdvik], [kpathsea freetype2], [x])
      m4_include(kpse_TL[texk/xdvik/ac/xdvik.ac])
 
-thus specifying the dependency on the 'kpathsea', 'freetype', and X11
+thus specifying dependencies on the 'kpathsea', 'freetype', and X11
 libraries.  The M4 comment (following 'dnl') signals the subsidiary
 'squeeze/configure.ac'.  This is needed because the main executable
 'xdvi-bin' (to be installed as, e.g., 'xdvi-xaw') is for the 'host'
 system whereas the auxiliary program 'squeeze/squeeze' has to run on the
-'build' system and in a cross compilation they differ.
+'build' system; in a cross compilation, these differ.
 
    The additional fragment 'ac/xdvik.ac' is also included by
 'configure.ac' and supplies the configure option '--with-xdvi-x-toolkit'
-also seen at the top-level.
+also seen at the top level.
 
 
 File: tlbuild.info,  Node: asymptote,  Prev: xdvik package,  Up: Program modules
@@ -1202,7 +1246,8 @@
 This subdirectory contains the sources for 'asy' and 'xasy' but due to
 its complexity and prerequisites (e.g., OpenGL) it is not part of the TL
 build system.  These programs must be built and installed independently,
-but are included on the TL DVD together with their support files.
+but are included on the TL DVD together with their support files.  See
+<https://tug.org/build.html#asymptote>.
 
 
 File: tlbuild.info,  Node: Extending TeX Live,  Prev: Program modules,  Up: Layout and infrastructure
@@ -1214,11 +1259,11 @@
 TL build system.
 
    In any case, a new package directory 'foo' should contain the
-original sources, as modified for TL, in 'foo/foo-src', and the changes
-should be documented in 'foo/TLpatches/*'; changes should also be
-submitted upstream whenever reasonable, of course.  In addition, 'foo/'
+original sources, modified only with changes necessary for TL, in
+'foo/foo-src'.  The changes should be documented in 'foo/TLpatches/*',
+and also be submitted upstream whenever reasonable.  In addition, 'foo/'
 will need the usual Automake build-related files ('configure.ac',
-'Makefile.am', etc.  Please keep a 'ChangeLog' for all TL changes.
+'Makefile.am', etc.  Please maintain 'foo/ChangeLog' for all TL changes.
 
 * Menu:
 
@@ -1247,25 +1292,25 @@
 
   1. a list of required libraries from the TL tree;
 
-  2. a list of options ('disable' if this module is not to be built
+  2. a list of options: 'disable' if this module is not to be built
      without the configure option '--enable-PROG', 'native' if cross
      compilation is not possible, 'x' if the program requires X11
-     libraries);
+     libraries;
 
   3. a comment added to the help text for the 'configure' option
      '--enable-PROG' or '--disable-PROG'.
 
-   If the module requires specific configure options to be seen at the
+   If the module requires specific 'configure' options to be seen at the
 top level, they should be defined in an additional fragment 'ac/PROG.ac'
 included from 'ac/withenable.ac' and 'configure.ac'.
 
    Usually, the new program is maintained somewhere outside of TeX Live.
-In that case, we put the upstream sources into a subdirectory 'PROG-src'
-(e.g., 'utils/newprog/newprog-src').  We do not run 'configure' in this
-original '...-src' directory, only in our own directory, but we do
-compile using the source files in '...-src'.
+In that case, as above, we put the upstream sources into a subdirectory
+'PROG-src' (e.g., 'utils/newprog/newprog-src').  We do not typically run
+'configure' in this original '...-src' directory, but only in our own
+directory; but we do compile using the source files in '...-src'.
 
-   So, these are the files that we must generally create:
+   So, to summarize the files that we must (usually) create:
 
 'ac/withenable.ac'
      The 'KPSE_ENABLE_PROG' call just explained.
@@ -1290,10 +1335,11 @@
      Record all TL-specific changes, now and in the future.
 
    Then, run GNU 'autoreconf' in the new directory (*note Build system
-tools::).  After that works, 'svn add' the necessary files, notably
-'Makefile.in aclocal.m4 configure', and 'svn:ignore' the Automake cache
-'autom4te.cache'.  (This is so people checking out the TL source tree do
-not have to run any autotools, but can simply run 'configure'.)
+tools::).  After that works, 'svn add' the necessary files, including
+the generated 'Makefile.in aclocal.m4 configure', and 'svn:ignore' the
+Automake cache 'autom4te.cache'.  (This is so people checking out the TL
+source tree do not have to run any autotools, but can simply run
+'configure'.)
 
    Then, run the TL tool 'reautoconf' in the top-level TL 'source/'
 directory, to incorporate the new program into the build tree.
@@ -1312,7 +1358,7 @@
 
 A generic library module in a subdirectory 'libs/LIB' must not depend on
 TeX-specific libraries, by definition.  It is included by adding its
-name 'LIB' to the M4 list 'kpse_libs_pkgs' in 'm4/kpse-pkgs.m4'--before
+name 'LIB' to the M4 macro 'kpse_libs_pkgs' in 'm4/kpse-pkgs.m4'--before
 any other libraries from the TeX Live tree on which it depends.
 
    As with program modules, the subdirectory 'libs/LIB' must contain the
@@ -1320,9 +1366,9 @@
 programs) and a fragment 'ac/withenable.ac' that contains the M4 macro
 'KPSE_WITH_LIB' defined in 'm4/kpse-setup.m4' with 'LIB' as the
 mandatory first argument and two optional arguments: a list of required
-libraries from the TL tree, and a list of options (currently there is
-only one: specify 'tree' if this library cannot be replaced by a system
-version).
+libraries from the TL tree, and a list of options: for libraries,
+currently there is only one--specify 'tree' if this library cannot be
+replaced by a system version.
 
    If a system version can be used, a second fragment 'ac/LIB.ac' is
 needed, containing the M4 macro 'KPSE_TRY_LIB' (or 'KPSE_TRY_LIBXX')
@@ -1341,7 +1387,7 @@
    If a system library is allowed, 'KPSE_LIB_FLAGS' also provides the
 configure option '--with-system-LIB' and uses the additional M4 macro
 'KPSE_LIB_SYSTEM_FLAGS' to generate the 'make' variables for a system
-library.  Furthermore the definition of the M4 macro
+library.  In addition, the definition of the M4 macro
 'KPSE_ALL_SYSTEM_FLAGS' in 'm4/kpse-pkgs.m4' must be extended by the
 line:
    'AC_REQUIRE([KPSE_LIB_SYSTEM_FLAGS])'
@@ -1357,8 +1403,8 @@
 from the TL tree.  It is included in the same general ways as a generic
 library (see the previous section), with these modifications:
 
-   * The library name 'LIB' is added to the M4 list 'kpse_texlibs_pkgs'
-     also in 'm4/kpse-pkgs.m4'.
+   * The library name 'LIB' is added to the M4 macro
+     'kpse_texlibs_pkgs', which is also in 'm4/kpse-pkgs.m4'.
 
    * The fragment 'ac/withenable.ac' must use 'KPSE_WITH_TEXLIB'.
 
@@ -1376,17 +1422,17 @@
 few important module-specific ones, whereas, e.g.,
    'texk/lcdf-typetools/configure --help'
 also displays the 'lcdf-typetools' specific options, which are not shown
-at the top-level.
+at the top level.
 
    The help text also mentions several influential environment
-variables, but for TeX Live it is better to specify them as assigments
+variables, but for TeX Live it is better to specify them as assignments
 on the command line.
 
    The './Build' script used to make the binaries shipped with TeX Live
 invokes the top-level 'configure' with a few additional options (*note
 Building::).  The defaults discussed below are those for the actual
-'configure' script; invoking 'configure' via './Build' may yield
-different results.
+'configure' script; invoking 'configure' via './Build' yields different
+results.
 
    Defaults for most options are set at the top level and propagated
 explicitly to all subdirectories.  Options specified on the command line
@@ -1434,15 +1480,14 @@
 are explicitly disabled), and enforces '--disable-shared'.
 
    If building TL for a GNU/Linux or other distribution, this should be
-disabled and system versions of most libraries would be used (*note
-Distro builds::).  This may fail without GNU 'make', but will be tried
-regardless.
+disabled and system versions of most libraries should be used (*note
+Distro builds::).
 
    A related option, '--enable-texlive-build', is automatically passed
 to all subdirectories (and cannot be disabled).  Subdirectories that can
 also be built independently from the TL tree (such as 'utils/xindy' and
-'texk/dvipng') can use this option, e.g., to choose TL-specific
-installation paths.
+'texk/dvipng') but cooperate with TL can use this option to enable
+TL-specific adaptations, such as installation paths.
 
 
 File: tlbuild.info,  Node: --prefix --bindir ...,  Next: --disable-largefile,  Prev: --disable-native-texlive-build,  Up: Global configure options
@@ -1463,9 +1508,10 @@
 7.1.3 '--disable-largefile'
 ---------------------------
 
-Omit large file support (LFS), needed on most 32-bit Unix systems for
-files with 2GB or more.  Regardless of this, the size of 'DVI' and 'GF'
-files must always be <2GB, due to the file format specifications.
+Omit large file support (LFS), which is needed on most 32-bit Unix
+systems for files with 2GB or more.  Regardless of this option, the size
+of 'DVI' and 'GF' files must always be <2GB, due to the file format
+specifications.
 
    With LFS, there is no fixed limit on the size of PDF files created by
 'pdftex' or PostScript files created by 'dvips'.  The size of PDF images
@@ -1488,16 +1534,13 @@
 7.1.5 '--enable-compiler-warnings='LEVEL
 ----------------------------------------
 
-Enable various levels of compiler warnings for (Objective) C and C++:
-the LEVEL value can be one of: 'no min yes max all'.  The default is
-'yes' in 'maintainer-mode' (see below) and 'min' otherwise.  This option
-defines 'WARNING_[OBJ]C[XX]FLAGS' but these flags are not used in all
-library and program modules.  Using them should help to resolve
-portability problems.
+Enable various levels of compiler warnings for C, C++, and/or
+Objective C: the LEVEL value can be one of: 'no min yes max all'.  The
+default is 'yes' in 'maintainer-mode' (see below) and 'min' otherwise.
+This option defines the variables 'WARNING_[OBJ]C[XX]FLAGS', but these
+variables are not consistently used in all library and program modules.
+At present, these warning flags assume options from the GNU compilers.
 
-   At present, these warning flags are only defined for the GNU
-compilers but flags for other compilers could be added when needed.
-
 
 File: tlbuild.info,  Node: --enable-cxx-runtime-hack,  Next: --enable-maintainer-mode,  Prev: --enable-compiler-warnings=LEVEL,  Up: Global configure options
 
@@ -1504,9 +1547,9 @@
 7.1.6 '--enable-cxx-runtime-hack'
 ---------------------------------
 
-If enabled (as it is for the native TL build) and when using 'g++', try
-to statically link with 'libstdc++', somewhat improving portability of
-the resulting binary.  *Note Macros for compilers::.
+If enabled (as it is for the native TL build), when using 'g++', try to
+statically link with 'libstdc++', thus improving portability of the
+resulting binary.  *Note Macros for compilers::.
 
 
 File: tlbuild.info,  Node: --enable-maintainer-mode,  Next: --enable-multiplatform,  Prev: --enable-cxx-runtime-hack,  Up: Global configure options
@@ -1526,11 +1569,12 @@
 7.1.8 '--enable-multiplatform'
 ------------------------------
 
-If enabled and '--bindir=DIR' or '--libdir=DIR' are not specified,
-install executables and libraries in per-platform subdirectories of
-'EPREFIX/bin' and 'EPREFIX/lib' where EPREFIX is the value given or
-implied for 'exec_prefix'.  In any case, the values for 'bindir' and
-'libdir' are automatically propagated to all subdirectories.
+If enabled (as it is for the native TL build) and '--bindir=DIR' or
+'--libdir=DIR' are not specified, install executables and libraries in
+per-platform subdirectories of 'EPREFIX/bin' and 'EPREFIX/lib' where
+EPREFIX is the value given or implied for 'exec_prefix'.  In any case,
+the values for 'bindir' and 'libdir' are automatically propagated to all
+subdirectories.
 
 
 File: tlbuild.info,  Node: --enable-shared,  Next: --enable-silent-rules,  Prev: --enable-multiplatform,  Up: Global configure options
@@ -1549,9 +1593,9 @@
 ------------------------------
 
 Enable the use of less verbose build rules.  When using GNU 'make' (or
-another 'make' implementation supporting nested variable expansions),
-you can specify 'V=1' on the 'make' command line to get more verbosity,
-or 'V=0' to get less, regardless of this option.
+any 'make' implementation supporting nested variable expansions), you
+can specify 'V=1' on the 'make' command line to get more verbosity, or
+'V=0' to get less, regardless of this option.
 
 
 File: tlbuild.info,  Node: --without-ln-s,  Next: --without-x,  Prev: --enable-silent-rules,  Up: Global configure options
@@ -1561,7 +1605,7 @@
 
 Required when using a system without a working 'ln -s' to build binaries
 for a Unix-like system.  However, 'make install' will not create
-anything useful and might even fail.
+anything useful, and might fail.
 
 
 File: tlbuild.info,  Node: --without-x,  Prev: --without-ln-s,  Up: Global configure options
@@ -1597,7 +1641,7 @@
 7.2.1 '--enable-PROG', '--disable-PROG'
 ---------------------------------------
 
-Do or do not build and install the program(s) of the module 'PROG'.
+Do or do not build and install the program(s) of module 'PROG'.
 
 
 File: tlbuild.info,  Node: --disable-all-pkgs,  Next: Configure options for texk/web2c,  Prev: --enable-PROG --disable-PROG,  Up: Program-specific configure options
@@ -1610,10 +1654,7 @@
 program, which is specified with an additional '--enable' option, e.g.,
 '--enable-dvipdfm-x'.  It's still simplest to check out and configure
 the whole source tree, but at least only the program you are interested
-in, and its dependencies, are built.  The 'configure' will generally
-take less than a minute with everything disabled.  (It is a good idea to
-run 'make check' after doing this, and after making any changes, to
-ensure that whatever tests have been written still pass.)
+in, and its dependencies, are built.  *Note Build one package::.
 
    Without this option, all modules are built except those that are
 explicitly disabled or specify 'disable' in their 'ac/withenable.ac'
@@ -1626,13 +1667,13 @@
 ----------------------------------------
 
 '--with-banner-add=STR'
-Add 'STR' to the default version string ('TeX Live YEAR' or 'Web2C
-YEAR') appended to banner lines.  This is ignored for a native TL build,
-but distro builds should specify, e.g., '/SOMEDISTRO'.
+Add 'STR' to the default version string (which is ''TeX Live YEAR'' or
+''Web2C YEAR'') appended to banner lines.  This is ignored for a native
+TL build, but distro builds should specify, e.g., '/SOMEDISTRO'.
 
 '--with-editor=CMD'
-Specify the command 'CMD' to invoke from the 'e' option of TeX-like
-engines, replacing the default 'vi +%d '%s'' for Unix or 'texworks
+Specify the command 'CMD' to invoke from the 'e' option of TeX and
+friends, replacing the default 'vi +%d '%s'' for Unix or 'texworks
 --position=%d "%s"' for Windows.
 
 '--with-fontconfig-includes=DIR', '--with-fontconfig-libdir=DIR'
@@ -1661,8 +1702,8 @@
 (defaults are defined in the fragment 'texk/web2c/ac/web2c.ac').
 
 '--disable-web-progs'
-Do not build the core WEB programs 'bibtex', ..., 'weave'.  Useful if,
-e.g., you only want to (re)build some engines.
+Do not build the original WEB programs 'bibtex', ..., 'weave'.  Useful
+if, e.g., you only want to (re)build some engines.
 
 '--enable-auto-core'
 This option causes TeX and Metafont to produce a core dump when a
@@ -1675,12 +1716,12 @@
 'libexpat'.
 
 '--enable-*win'
-Include various types of other window support for Metafont (EPSF output,
-'mftalk', old terminals, ...).
+Include various types of non-X window support for Metafont (EPSF output,
+'mftalk', old graphics terminals, ...).
 
 '--enable-tex-synctex', '--disable-etex-synctex', ...
 Build the TeX engines with or without 'SyncTeX' support; ignored for a
-native TeX Live build, defaults are again defined in
+native TeX Live build.  Defaults are defined in
 'texk/web2c/ac/web2c.ac'.
 
 '--disable-synctex'
@@ -1715,7 +1756,7 @@
 'dvipdfmx', with backward-compatible (very slightly different) behavior.
 
 '--disable-dvipdfmx'
-Do not build the 'dvipdfmx' program with the 'dvipdfm' symlink.
+Do not build the 'dvipdfmx' program or make the 'dvipdfm' symlink.
 
 '--disable-xdvipdfmx'
 Do not build the 'xdvipdfmx' program.
@@ -1729,8 +1770,8 @@
 '--with-system-libgs'
 Build 'dvisvgm' using installed Ghostscript ('gs') headers and library
 (not allowed for a native TL build).  The default is to load the 'gs'
-library at runtime if possible, or otherwise disable support for
-PostScript specials.
+library at runtime if possible, else to disable support for PostScript
+specials.
 
 '--without-libgs'
 Build 'dvisvgm' without PostScript support at all.  Because the dynamic
@@ -1757,7 +1798,7 @@
 ----------------------------------------
 
 '--with-gs=FILENAME'
-Hardwire the location of Ghostscript ('gs').
+Hardwire the location of Ghostscript ('gs') as called by Xdvik.
 
 '--with-xdvi-x-toolkit=KIT'
 Use toolkit 'KIT' for 'xdvik', one of: 'motif xaw xaw3d neXtaw'.  The
@@ -1764,8 +1805,8 @@
 default is 'motif' if available, else 'xaw'.
 
 '--enable-xi2-scrolling'
-Use XInput 2.1 "smooth scrolling" if available.  (default: yes, except
-for a native TL build).
+Use XInput 2.1 "smooth scrolling" if available (default: yes, except for
+a native TL build).
 
 
 File: tlbuild.info,  Node: Configure options for utils/xindy,  Prev: Configure options for texk/xdvik,  Up: Program-specific configure options
@@ -1782,13 +1823,12 @@
 native TL build).
 
 '--with-clisp-runtime=FILENAME'
-Specifies the Full path for the CLISP runtime file ('lisp.run' or
+Specifies the full path for the Clisp runtime file ('lisp.run' or
 'lisp.exe') to be installed.  When specified as 'default' (the default
-for a native TL build) the path is determined by the CLISP executable;
+for a native TL build) the path is determined by the Clisp executable;
 the value 'system' (not allowed for a native TL build, but the default
-for a non-native one) indicates that 'xindy' will use the installed
-version of 'clisp' (which must be identical to the one used to build
-'xindy').
+otherwise) indicates that 'xindy' will use the installed version of
+'clisp' (which must be identical to the one used to build 'xindy').
 
 
 File: tlbuild.info,  Node: Library-specific configure options,  Next: Variables for configure,  Prev: Program-specific configure options,  Up: Configure options
@@ -1804,7 +1844,7 @@
    Use an installed (system) version of the library 'LIB'; this option
 exists for most libraries, but is not allowed for a native TL build.
 Using a system version implies also using the system versions of all
-libraries (if any) that LIB depends on.
+libraries that LIB depends on.
 
    For many libraries '--with-LIB-includes=DIR' and
 '--with-LIB-libdir=DIR' can specify non-standard search locations;
@@ -1825,7 +1865,8 @@
 --------------------------------------
 
 '--enable-CMD-default', '--disable-CMD-default'
-Determine the compile time default whether or not to run CMD, one of:
+Determine the compile time default for whether or not to run CMD, which
+is one of:
 'mkocp'
      (Omega compiled translation process file)
 'mkofm'
@@ -1842,7 +1883,7 @@
      (TFM file)
 
 to generate the specified type of file dynamically.  The default can be
-overridden by the user in any case.
+overridden by the user in any case (*note kpathsea library::).
 
 
 File: tlbuild.info,  Node: Configure options for system poppler,  Prev: Configure options for kpathsea,  Up: Library-specific configure options
@@ -1850,10 +1891,9 @@
 7.3.2 Configure options for system 'poppler'
 --------------------------------------------
 
-Building LuaTeX (or LuaJITTeX) and XeTeX requires 'poppler', either from
-the TL tree or system headers and library.  Building pdfTeX requires
-either 'xpdf' from the TeX Live tree or system 'poppler' headers and
-library.
+Building XeTeX requires 'poppler', either from the TL tree or system
+headers and library.  Building pdfTeX requires either 'xpdf' from the
+TeX Live tree or system 'poppler' headers and library.
 
 '--with-system-poppler'
 Use a system version (0.18 or newer) of 'poppler' for LuaTeX (or
@@ -1860,9 +1900,8 @@
 LuaJITTeX) and XeTeX, and use 'pkg-config' to obtain the required flags.
 
 '--with-system-xpdf'
-Use a system version (0.12 or better) of 'poppler' (and 'pkg-config')
-for pdfTeX instead of 'xpdf' from the TL tree.  *Note
---disable-largefile::.
+Use a system version (0.12 or newer) of 'poppler' (and 'pkg-config') for
+pdfTeX instead of 'xpdf' from the TL tree.  *Note --disable-largefile::.
 
 
 File: tlbuild.info,  Node: Variables for configure,  Prev: Library-specific configure options,  Up: Configure options
@@ -1879,7 +1918,7 @@
 'CPPFLAGS'
      And plenty more.  As usual with Autoconf, these variables specify
      the name (or full path) of compilers, preprocessor flags, and
-     similar.  *Note autoconf: (GNU Autoconf)Preset Output Variables.
+     similar.  *Note (autoconf)Preset Output Variables::.
 
 'CLISP'
      Name (or full path) of the 'clisp' executable, used to build
@@ -1891,7 +1930,7 @@
      These specify the name (or path) for the 'freetype-config',
      'icu-config', and 'pkg-config' commands used to determine the flags
      required for system versions of 'libfreetype', the ICU libraries,
-     or many other libraries.
+     and other libraries, respectively.
 
 'KPSEWHICH'
      Name (or path) of an installed 'kpsewhich' binary, used by 'make
@@ -1920,9 +1959,9 @@
 considerable efforts into that direction we are still far from that goal
 and there are reasons that we may never fully reach it.  Below are some
 rules about declarations of functions or variables and the use of
-'const'.  These rules should be applied to most of the TeX Live tree,
-the exception being code that is maintained independently and whose
-maintainers don't want to accept patches.
+'const'.  These rules should be applied to the code maintained in the
+TeX Live tree and for other packages whose maintainers are willing to
+accept patches.
 
 * Menu:
 
@@ -1943,7 +1982,7 @@
 standard (including 'void' in the declaration of C functions with no
 parameters).  On the other hand, TL is built for a wide variety of
 systems, not all of which support the C99 standard.  Therefore using C99
-features should be avoided if that can easily be done.  In particular C
+features should be avoided if that can easily be done.  In particular, C
 code must not contain declarations after statements or C++-style
 comments.
 
@@ -1952,7 +1991,7 @@
 For example, the module 'texk/chktex' uses the C99 function 'stpcpy()'
 that may or may not be available on a particular system.  It uses
 'AC_CHECK_DECLS([stpcpy])' in 'configure.ac' to test this, and provides
-the perhaps slightly less efficient alternative
+a perhaps less efficient alternative (in the file 'Utility.h'):
 
      #if !(defined HAVE_DECL_STPCPY && HAVE_DECL_STPCPY)
      static inline char *stpcpy(char *dest, const char *src)
@@ -1961,13 +2000,11 @@
      }
      #endif
 
-in the file 'Utility.h'.
-
 Static functions
 ................
 
 Functions used in only one file should be declared 'static'; they
-require no prototype except as forward declaration.
+require no prototype except in forward declarations.
 
 Extern functions
 ................
@@ -2011,8 +2048,8 @@
    Getting all 'const' qualifiers right can get quite involved but can
 almost always be done.  There are only a couple notable exceptions: the
 X11 headers are full of declarations that ought to use 'const' but do
-not, and the same is true to some extent for 'libfreetype' (but,
-thankfully, not for 'zlib' nowadays).
+not; at one time, 'libfreetype' also did not fully specify 'const', but
+this has not been checked recently.
 
 What must be avoided with 'const'
 .................................
@@ -2019,8 +2056,8 @@
 
 The GCC compiler warnings "assignment discards qualifiers..." and
 analogous warnings for "initialization", "passing arg", or "return" must
-be strenously avoided in our own code.  The only exception is when they
-are caused by X11 headers or macros or other third party code.
+be strenuously avoided in our own code.  The only exception is when they
+are caused by X11 declarations or other third party code.
 
 What should be avoided with 'const'
 ...................................
@@ -2037,10 +2074,9 @@
 9 Continuous integration
 ************************
 
-Overview: the sources of TeX Live are subjected to continuous
-integration testing on Travis-CI
-(<https://travis-ci.org/TeX-Live/texlive-source>) via a git-svn mirror
-of the sources that is pushed to Github
+The TeX Live sources are subjected to continuous integration testing on
+Travis-CI (<https://travis-ci.org/TeX-Live/texlive-source>) via a
+git-svn mirror of the sources that is pushed to Github
 (<https://github.com/TeX-Live/texlive-source>).  The git-svn mirror is
 updated (currently) at 30 minute intervals, and only the last commit
 pushed is tested on Travis-CI.
@@ -2057,39 +2093,40 @@
 9.1 Transfer from Subversion to Github
 ======================================
 
-git-svn (<https://git-scm.com/docs/git-svn>) is used to check out the
-subtree 'Build/source' of the Subversion repository.  The author index
-file used is not maintained in either Git or Subversion but can be
-provided on request.
+The git-svn program (<https://git-scm.com/docs/git-svn>) is used to
+check out the subtree 'Build/source' of the canonical Subversion
+repository.  The author index file used is not maintained in either Git
+or Subversion but can be provided on request.
 
    The initial checkout was done by invoking
-     git svn --authors-file usermap clone svn://USER@tug.org/texlive/trunk/Build/source
+     git svn --authors-file usermap clone \
+       svn://USER@tug.org/texlive/trunk/Build/source
 
 where the 'usermap' file maps Subversion user names to name and emails
-of the authors.  If no user account at <tug.org> is available, anonymous
-checkout is possible, too:
-     git svn --authors-file usermap clone svn://tug.org/texlive/trunk/Build/source
+of the authors.  Anonymous checkout is also possible:
+     git svn --authors-file usermap clone \
+       svn://tug.org/texlive/trunk/Build/source
 
    In the following, we will use _admin_ to refer to a user who has
 read/write access to the TeX Live subversion repository, and is also an
-administrator of the 'TeX-Live' Team on Github.  The above initial
+administrator of the ''TeX-Live'' team at Github.  The above initial
 checkout has been carried out by _admin_ on the server 'texlive.info'.
 
-   On Github (<https://github.com>), a new git repository named
-'texlive-source' was created by _admin_ within the 'TeX-Live'
-"organization" (<https://github.com/TeX-Live>).  The remote was added to
-the checkout with 'git remote add origin
-git at github.com:TeX-Live/texlive-source.git'.
+   On Github, a new git repository named 'texlive-source' was created by
+_admin_ within the 'TeX-Live' "organization"
+(<https://github.com/TeX-Live>).  The remote was added to the checkout
+with 'git remote add origin git at github.com:TeX-Live/texlive-source.git'.
 
    To automate the update on Github, a new ssh key was generated and
 added to the 'texlive-source' repository on Github as deployment key.
-This way pushes using this key can only go to the 'texlive-source'
+Thus, pushes using this key can only go to the 'texlive-source'
 repository and not anywhere else.
 
    The usage of 'git-svn' requires a strict discipline to keep a linear
 history in the master branch.  Since we are aiming at a pure mirror
-facility, we have decided to further restrict the 'master' branch of the
-'texlive-source' repository on Github to changes by _admin_.
+facility on Github, we have decided to further restrict the 'master'
+branch of the 'texlive-source' repository on Github to changes by
+_admin_.
 
    This setup allows other developers to branch off 'master' and push
 their branches to the Github repository, but all updates need to come
@@ -2106,7 +2143,7 @@
 minute which essentially runs 'git svn rebase' and 'git push' in the
 'master' branch of the checkout.  The first command fetches the changes
 from the Subversion repository and updates the 'master' branch with
-them, the second one pushes changes (if available) to Github.
+them, and the second pushes changes (if any) to Github.
 
 
 File: tlbuild.info,  Node: CI testing on Travis-CI,  Prev: Automatic update of the Git mirror,  Up: Continuous integration
@@ -2116,7 +2153,7 @@
 
 The 'source' tree of TeX Live contains a top-level file '.travis.yml'
 which controls the automatic testing on Travis-CI. _admin_ has
-registered to Travis-CI and allowed access to the Github's 'TeX-Live'
+registered with Travis-CI and allowed access to the Github's 'TeX-Live'
 organization's 'texlive-source' repository.  The default settings are to
 build the last commit of each push.  No further action is necessary on
 Travis-CI.
@@ -2326,7 +2363,7 @@
      _path_ are copied over to 'bin/custom/' under your installation
      directory and this 'bin/custom/' directory is what will be added to
      the path for the post-install actions.  To install multiple custom
-     binary sets, manully rename 'custom' before doing each.
+     binary sets, manually rename 'custom' before doing each.
 
      For more information on custom binaries, see
      <http://tug.org/texlive/custom-bin.html>.  For general information
@@ -5046,8 +5083,8 @@
 * --enable-maintainer-mode:              Build system tools.   (line 28)
 * --enable-maintainer-mode <1>:          --enable-maintainer-mode.
                                                                (line  6)
-* --enable-missing to ignore dependencies: Build one package.  (line 68)
-* --enable-mktextfm-default:             kpathsea library.     (line 20)
+* --enable-missing to ignore dependencies: Build one package.  (line 71)
+* --enable-mktextfm-default:             kpathsea library.     (line 18)
 * --enable-multiplatform:                --enable-multiplatform.
                                                                (line  6)
 * --enable-PROG:                         --enable-PROG --disable-PROG.
@@ -5058,7 +5095,7 @@
 * --enable-tex-synctex:                  Configure options for texk/web2c.
                                                                (line 59)
 * --enable-texlive-build:                --disable-native-texlive-build.
-                                                               (line 16)
+                                                               (line 15)
 * --enable-xi2-scrolling:                Configure options for texk/xdvik.
                                                                (line 13)
 * --enable-xindy-docs:                   Configure options for utils/xindy.
@@ -5087,7 +5124,7 @@
                                                                (line 16)
 * --with-libgs-includes, -libdir:        Configure options for texk/dvisvgm.
                                                                (line 17)
-* --with-system-kpathsea:                kpathsea library.     (line 14)
+* --with-system-kpathsea:                kpathsea library.     (line 13)
 * --with-system-LIB:                     Adding a new generic library module.
                                                                (line 34)
 * --with-system-LIB <1>:                 Library-specific configure options.
@@ -5107,8 +5144,6 @@
 * --without-x:                           --without-x.          (line  6)
 * -C configure option:                   Build in parallel.    (line 11)
 * -j make option:                        Build in parallel.    (line  6)
-* .travis.yml:                           CI testing on Travis-CI.
-                                                               (line  6)
 * adapting TeX Live for distros:         Distro builds.        (line 54)
 * adding a new generic library:          Adding a new generic library module.
                                                                (line  6)
@@ -5122,8 +5157,8 @@
 * ANSI C:                                Declarations and definitions.
                                                                (line  6)
 * ApplicationServices Mac framework, required by xetex: Prerequisites.
-                                                               (line 31)
-* asymptote:                             Linked scripts.       (line 22)
+                                                               (line 32)
+* asymptote:                             Linked scripts.       (line 23)
 * asymptote <1>:                         asymptote.            (line  6)
 * Autoconf:                              Overview of build system.
                                                                (line  6)
@@ -5130,7 +5165,7 @@
 * autoconf macros:                       Autoconf macros.      (line  6)
 * Automake:                              Overview of build system.
                                                                (line  6)
-* biber:                                 Linked scripts.       (line 22)
+* biber:                                 Linked scripts.       (line 23)
 * bibtex-x:                              Configure options for texk/bibtex-x.
                                                                (line  6)
 * bibtex8:                               Configure options for texk/bibtex-x.
@@ -5141,6 +5176,7 @@
 * build directory, required:             Building.             (line 17)
 * build iteration:                       Build iteration.      (line  6)
 * build on demand:                       Build one package.    (line  6)
+* build one engine:                      Build one engine.     (line  6)
 * build one package:                     Build one package.    (line  6)
 * build problems:                        Build problems.       (line  6)
 * Build script:                          Building.             (line  6)
@@ -5152,7 +5188,7 @@
 * building:                              Building.             (line  6)
 * building a distribution:               Build distribution.   (line  6)
 * building in parallel:                  Build in parallel.    (line  6)
-* C++11, required by dvisvgm:            Prerequisites.        (line 19)
+* C++11, required:                       Prerequisites.        (line 15)
 * C, ANSI, required:                     Declarations and definitions.
                                                                (line  6)
 * C99, avoided:                          Declarations and definitions.
@@ -5162,12 +5198,10 @@
 * callexe.c:                             Macros for Windows.   (line 32)
 * CC:                                    Variables for configure.
                                                                (line 10)
-* CC=C-COMPILER:                         Build one package.    (line 73)
+* CC=C-COMPILER:                         Build one package.    (line 76)
 * CC_BUILD:                              Cross problems.       (line 13)
 * chktex:                                Declarations and definitions.
                                                                (line 18)
-* ci:                                    Continuous integration.
-                                                               (line  6)
 * clisp:                                 Variables for configure.
                                                                (line 18)
 * CLISP:                                 Variables for configure.
@@ -5174,10 +5208,10 @@
                                                                (line 17)
 * CLISP <1>:                             Configure options for utils/xindy.
                                                                (line 14)
-* clisp, required by xindy:              Prerequisites.        (line 35)
-* Cocoa Mac framework, required by xetex: Prerequisites.       (line 31)
+* clisp, required by xindy:              Prerequisites.        (line 36)
+* Cocoa Mac framework, required by xetex: Prerequisites.       (line 32)
 * coding conventions:                    Coding conventions.   (line  6)
-* compilers, C and C++:                  Prerequisites.        (line  6)
+* compilers, C and C++11:                Prerequisites.        (line  6)
 * config.guess, config.sub, ...:         Top-level directories.
                                                                (line 30)
 * configure options:                     Configure options.    (line  6)
@@ -5221,10 +5255,11 @@
 * ctangle:                               Cross problems.       (line 26)
 * CXX:                                   Variables for configure.
                                                                (line 11)
-* CXX=C++-COMPILER:                      Build one package.    (line 73)
-* Debian installation of build prerequisites: Prerequisites.   (line 60)
+* CXX=C++-COMPILER:                      Build one package.    (line 76)
 * declarations and definitions, in source code: Declarations and definitions.
                                                                (line  6)
+* declarations before statements, avoiding: Declarations and definitions.
+                                                               (line  6)
 * dependencies, with several output files: Build in parallel.  (line  6)
 * DESTDIR:                               --prefix --bindir ....
                                                                (line  9)
@@ -5236,36 +5271,39 @@
 * dist and distcheck targets for make:   Build distribution.   (line  6)
 * distribution tarball, making:          Build distribution.   (line  6)
 * distro, building for:                  Distro builds.        (line  6)
+* dvipdfm-x:                             Configure options for texk/dvipdfm-x.
+                                                               (line  6)
 * dvipdfmx:                              Configure options for texk/dvipdfm-x.
                                                                (line  6)
 * dvisvgm:                               Configure options for texk/dvisvgm.
                                                                (line  6)
-* dvisvgm requirement for C++11:         Prerequisites.        (line 19)
+* engine, building one:                  Build one engine.     (line  6)
 * environment variables, for configure:  Configure options.    (line 16)
 * exec_prefix:                           --enable-multiplatform.
                                                                (line  6)
 * extending TeX Live:                    Extending TeX Live.   (line  6)
 * extern functions:                      Declarations and definitions.
-                                                               (line 43)
-* extra/ top-level directory:            Top-level directories.
-                                                               (line 39)
+                                                               (line 41)
 * failure to build:                      Build problems.       (line  6)
-* ffcall, required by xindy:             Prerequisites.        (line 35)
 * flags, macros for library and header:  Macros for library and header flags.
                                                                (line  6)
-* fontconfig library, required by xetex: Prerequisites.        (line 31)
+* fontconfig library, required by xetex: Prerequisites.        (line 32)
 * FreeType:                              Prerequisites.        (line 11)
 * freetype cross compiling:              Cross problems.       (line 13)
 * freetype library:                      freetype library.     (line  6)
-* freetype-config:                       freetype library.     (line  6)
+* freetype-config:                       freetype library.     (line 13)
 * freetype-config <1>:                   Variables for configure.
                                                                (line 24)
 * FT2_CONFIG:                            Variables for configure.
                                                                (line 21)
-* gcc, default compilers:                Build one package.    (line 73)
+* gcc, default compilers:                Build one package.    (line 76)
 * general setup macros:                  General setup macros. (line  6)
 * generic library module, adding:        Adding a new generic library module.
                                                                (line  6)
+* Ghostscript location for Xdvik:        Configure options for texk/xdvik.
+                                                               (line  6)
+* git-svn:                               Transfer from Subversion to Github.
+                                                               (line  6)
 * global configure options:              Global configure options.
                                                                (line  6)
 * gmake, required:                       Prerequisites.        (line 11)
@@ -5283,7 +5321,7 @@
                                                                (line 22)
 * infrastructure, tools needed for:      Build system tools.   (line  6)
 * inst/ top-level directory:             Top-level directories.
-                                                               (line 43)
+                                                               (line 39)
 * install-tl, TeX Live installer:        Installing.           (line  8)
 * installation directories:              Installation directories.
                                                                (line  6)
@@ -5294,8 +5332,8 @@
 * iteration through sources, by configure and make: Build iteration.
                                                                (line  6)
 * kpathsea library:                      kpathsea library.     (line  6)
-* kpathsea.ac:                           kpathsea library.     (line 20)
-* kpse-libpng-flags.m4:                  png library.          (line 43)
+* kpathsea.ac:                           kpathsea library.     (line 18)
+* kpse-libpng-flags.m4:                  png library.          (line 46)
 * kpse-pkgs.m4:                          Overview of build system.
                                                                (line 30)
 * kpse-zlib-flags.m4:                    zlib library.         (line  6)
@@ -5304,7 +5342,7 @@
 * KPSEWHICH:                             Variables for configure.
                                                                (line 29)
 * KPSE_ADD_FLAGS:                        Macros for library and header flags.
-                                                               (line 18)
+                                                               (line 20)
 * KPSE_ALL_SYSTEM_FLAGS:                 Adding a new generic library module.
                                                                (line 34)
 * KPSE_BASIC:                            General setup macros. (line  8)
@@ -5318,7 +5356,7 @@
 * KPSE_COND_MINGW32:                     Macros for Windows.   (line 19)
 * KPSE_COND_WIN32:                       Macros for Windows.   (line 15)
 * KPSE_COND_WIN32_WRAP:                  Macros for Windows.   (line 24)
-* kpse_cv_cxx_hack:                      Macros for compilers. (line 34)
+* kpse_cv_cxx_hack:                      Macros for compilers. (line 33)
 * kpse_cv_have_win32:                    Macros for Windows.   (line 10)
 * kpse_cv_visibility_c[xx]flags:         Macros for compilers. (line 25)
 * kpse_cv_warning_cflags:                Macros for compilers. (line 15)
@@ -5328,7 +5366,7 @@
 * KPSE_LARGEFILE:                        Macros for libraries. (line  8)
 * KPSE_LIBPNG_FLAGS:                     Macros for library and header flags.
                                                                (line 10)
-* KPSE_LIBPNG_FLAGS <1>:                 png library.          (line 43)
+* KPSE_LIBPNG_FLAGS <1>:                 png library.          (line 46)
 * kpse_libs_pkgs:                        Adding a new generic library module.
                                                                (line  6)
 * KPSE_LIB_FLAGS:                        Macros for library and header flags.
@@ -5339,7 +5377,7 @@
                                                                (line 34)
 * KPSE_PROG_LEX:                         Macros for programs.  (line 21)
 * KPSE_RESTORE_FLAGS:                    Macros for library and header flags.
-                                                               (line 22)
+                                                               (line 24)
 * kpse_texk_pkgs:                        Adding a new program module.
                                                                (line  6)
 * kpse_texlibs_pkgs:                     Adding a new TeX-specific library module.
@@ -5363,6 +5401,10 @@
 * layout of sources:                     Layout and infrastructure.
                                                                (line  6)
 * LFS (large file support):              --disable-largefile.  (line  6)
+* libexpat, dependency of libfontconfig: Configure options for texk/web2c.
+                                                               (line 50)
+* libfontconfig, hack for avoiding linking dependencies: Configure options for texk/web2c.
+                                                               (line 50)
 * libfreetype:                           Variables for configure.
                                                                (line 24)
 * libfreetype, and const:                Const.                (line 21)
@@ -5374,6 +5416,7 @@
 * library modules:                       Library modules.      (line  6)
 * library-specific configure options:    Library-specific configure options.
                                                                (line  6)
+* libsigsegv, required by xindy:         Prerequisites.        (line 36)
 * libstc++, statically linking:          Macros for compilers. (line 29)
 * Libtool:                               Overview of build system.
                                                                (line  6)
@@ -5398,19 +5441,22 @@
 * macros, general setup:                 General setup macros. (line  6)
 * MAKE:                                  Variables for configure.
                                                                (line 33)
-* make -t:                               Build system tools.   (line 39)
+* make -t:                               Build system tools.   (line 43)
+* make rules, verbose vs. silent:        --enable-silent-rules.
+                                                               (line  6)
 * mf-nowin:                              Configure options for texk/web2c.
                                                                (line 34)
 * mingw32:                               Cross configuring.    (line 27)
 * MINGW32, Automake conditional:         Macros for Windows.   (line 20)
-* mktex.ac:                              kpathsea library.     (line 20)
-* mktextfm:                              kpathsea library.     (line 20)
+* mktex.ac:                              kpathsea library.     (line 18)
+* mktextfm:                              kpathsea library.     (line 18)
 * modules, for libraries:                Library modules.      (line  6)
 * modules, for programs:                 Program modules.      (line  6)
 * motif:                                 Configure options for texk/xdvik.
                                                                (line  9)
 * native cross compilation:              Cross compilation.    (line 10)
-* OBJCXX=OBJC-COMPILER:                  Build one package.    (line 73)
+* OBJCXX=OBJC-COMPILER:                  Build one package.    (line 76)
+* one engine, building:                  Build one engine.     (line  6)
 * one package, building:                 Build one package.    (line  6)
 * OpenGL, required for Asymptote:        asymptote.            (line  6)
 * operating system distribution, building for: Distro builds.  (line  6)
@@ -5419,12 +5465,12 @@
 * parallel build:                        Build in parallel.    (line  6)
 * paths, for installation:               Installation directories.
                                                                (line  6)
-* PDF files, size of:                    --disable-largefile.  (line 10)
+* PDF files, size of:                    --disable-largefile.  (line 11)
 * PDFLATEX:                              Variables for configure.
                                                                (line 41)
 * PERL:                                  Variables for configure.
                                                                (line 39)
-* perl, required by web2c, etc.:         Prerequisites.        (line 23)
+* perl, required by web2c, etc.:         Prerequisites.        (line 24)
 * PKG_CONFIG:                            Variables for configure.
                                                                (line 23)
 * plain.tex, not in source tree:         Installing.           (line  8)
@@ -5431,7 +5477,7 @@
 * png library:                           png library.          (line  6)
 * poppler:                               Configure options for system poppler.
                                                                (line  6)
-* PostScript files, size of:             --disable-largefile.  (line 10)
+* PostScript files, size of:             --disable-largefile.  (line 11)
 * Preining, Norbert:                     Distro builds.        (line 54)
 * preloaded binaries:                    Configure options for texk/web2c.
                                                                (line 45)
@@ -5442,18 +5488,19 @@
 * program modules:                       Program modules.      (line  6)
 * program-specific configure options:    Program-specific configure options.
                                                                (line  6)
+* proxy build system:                    png library.          (line 36)
 * reautoconf:                            Build system tools.   (line 28)
 * requirements for building:             Prerequisites.        (line  6)
 * runscript.exe:                         Macros for Windows.   (line 25)
 * scripts, linked and not maintained:    Linked scripts.       (line  6)
-* scrolling:                             Configure options for texk/xdvik.
+* scrolling, smooth:                     Configure options for texk/xdvik.
                                                                (line 13)
 * SED:                                   Variables for configure.
                                                                (line 34)
 * setup macros, general:                 General setup macros. (line  6)
 * shared libraries, using vs. avoiding:  Distro builds.        (line 11)
-* size of PDF and PS files:              --disable-largefile.  (line 10)
-* size of source tree:                   Build one package.    (line 58)
+* size of PDF and PS files:              --disable-largefile.  (line 11)
+* size of source tree:                   Build one package.    (line 60)
 * source code declarations:              Declarations and definitions.
                                                                (line  6)
 * source directory building, not supported: Building.          (line 17)
@@ -5462,11 +5509,11 @@
 * squeeze:                               Cross problems.       (line 13)
 * squeeze/configure.ac:                  xdvik package.        (line 14)
 * static functions:                      Declarations and definitions.
-                                                               (line 37)
+                                                               (line 35)
 * static linking for C++:                Macros for compilers. (line 29)
 * stpcpy:                                Declarations and definitions.
                                                                (line 18)
-* Subversion repository:                 Build system tools.   (line 34)
+* Subversion repository:                 Build system tools.   (line 38)
 * support files, separate from build:    Installing.           (line  8)
 * symlinks, used for scripts:            Linked scripts.       (line  6)
 * synctex:                               Configure options for texk/web2c.
@@ -5482,17 +5529,19 @@
                                                                (line  6)
 * texlive.tlpdb, TeX Live database:      Installing.           (line  8)
 * tie:                                   Cross problems.       (line 26)
-* timestamps, in repository:             Build system tools.   (line 34)
+* timestamps, in repository:             Build system tools.   (line 38)
 * tools, for building:                   Build system tools.   (line  6)
 * top-level directories:                 Top-level directories.
                                                                (line  6)
-* touching files to avoid rerunning:     Build system tools.   (line 39)
+* touching files to avoid rerunning:     Build system tools.   (line 43)
 * Travis-CI:                             Continuous integration.
                                                                (line  6)
-* type cast, avoiding:                   Const.                (line 38)
-* use-commit-times, Subversion:          Build system tools.   (line 34)
+* travis.yml:                            CI testing on Travis-CI.
+                                                               (line  6)
+* type cast from const, avoiding:        Const.                (line 38)
+* use-commit-times, Subversion:          Build system tools.   (line 38)
 * variable declarations, in source code: Declarations and definitions.
-                                                               (line 54)
+                                                               (line 52)
 * variables for configure:               Variables for configure.
                                                                (line  6)
 * warning, discards qualifiers:          Const.                (line 30)
@@ -5500,7 +5549,7 @@
 * web2c program:                         Cross problems.       (line 13)
 * web2c.ac:                              Configure options for texk/web2c.
                                                                (line 37)
-* wget:                                  Linked scripts.       (line 22)
+* wget:                                  Linked scripts.       (line 23)
 * WIN32, Automake conditional:           Macros for Windows.   (line 16)
 * WIN32_WRAP, Automake conditional:      Macros for Windows.   (line 25)
 * Windows, invoking scripts on:          Linked scripts.       (line  6)
@@ -5508,12 +5557,13 @@
 * withenable.ac, for new modules:        Adding a new program module.
                                                                (line 14)
 * Work/ top-level directory:             Top-level directories.
-                                                               (line 43)
+                                                               (line 39)
 * wrapper binary for scripts on Windows: Linked scripts.       (line  6)
+* wrapper build system:                  freetype library.     (line  6)
 * X toolkit:                             Configure options for texk/web2c.
                                                                (line 22)
+* X11 development, required by X clients: Prerequisites.       (line 28)
 * X11 headers, and const:                Const.                (line 21)
-* X11, required by X clients:            Prerequisites.        (line 27)
 * xasy:                                  asymptote.            (line  6)
 * xaw:                                   Configure options for texk/xdvik.
                                                                (line  9)
@@ -5522,11 +5572,11 @@
                                                                (line  6)
 * xdvipdfmx:                             Configure options for texk/dvipdfm-x.
                                                                (line  6)
-* xindy:                                 Linked scripts.       (line 22)
+* xindy:                                 Linked scripts.       (line 23)
 * xindy <1>:                             xindy package.        (line  6)
 * xindy <2>:                             Configure options for utils/xindy.
                                                                (line  6)
-* xindy cross compiling impossible:      Cross problems.       (line 33)
+* xindy cross compiling requires clisp:  Cross problems.       (line 33)
 * XInput:                                Configure options for texk/xdvik.
                                                                (line 13)
 * Xlib:                                  Configure options for texk/web2c.
@@ -5533,7 +5583,7 @@
                                                                (line 22)
 * xpdf as library:                       Configure options for system poppler.
                                                                (line  6)
-* xz:                                    Linked scripts.       (line 22)
+* xz:                                    Linked scripts.       (line 23)
 * zlib library:                          zlib library.         (line  6)
 
 
@@ -5541,368 +5591,369 @@
 Tag Table:
 Node: Top1208
 Node: Introduction2118
-Node: Overview of build system3839
-Node: Prerequisites5882
-Node: Building8280
-Node: Build iteration9585
-Node: Build problems10657
-Node: Build in parallel11060
-Node: Build distribution11652
-Node: Build one package12223
-Node: Cross compilation15626
-Node: Cross configuring16907
-Node: Cross problems18584
-Node: Installing20235
-Node: Installation directories21251
-Node: Linked scripts23067
-Node: Distro builds24548
-Node: Layout and infrastructure26938
-Node: Build system tools27766
-Node: Top-level directories29777
-Node: Autoconf macros32191
-Node: General setup macros32892
-Node: Macros for programs33759
-Node: Macros for compilers34571
-Node: Macros for libraries36005
-Node: Macros for library and header flags36431
-Node: Macros for Windows38311
-Node: Library modules39888
-Node: png library40377
-Node: zlib library42651
-Node: freetype library43166
-Node: kpathsea library43694
-Node: Program modules45093
-Node: t1utils package45521
-Node: xindy package46072
-Node: xdvik package47222
-Node: asymptote48295
-Node: Extending TeX Live48746
-Node: Adding a new program module49523
-Node: Adding a new generic library module52818
-Node: Adding a new TeX-specific library module55031
-Node: Configure options55718
-Node: Global configure options57101
-Node: --disable-native-texlive-build57643
-Node: --prefix --bindir ...58633
-Node: --disable-largefile59173
-Node: --disable-missing59858
-Node: --enable-compiler-warnings=LEVEL60259
-Node: --enable-cxx-runtime-hack60998
-Node: --enable-maintainer-mode61425
-Node: --enable-multiplatform61954
-Node: --enable-shared62492
-Node: --enable-silent-rules62863
-Node: --without-ln-s63319
-Node: --without-x63670
-Node: Program-specific configure options63858
-Node: --enable-PROG --disable-PROG64501
-Node: --disable-all-pkgs64778
-Node: Configure options for texk/web2c65764
-Node: Configure options for texk/bibtex-x68282
-Node: Configure options for texk/dvipdfm-x68825
-Node: Configure options for texk/dvisvgm69598
-Node: Configure options for texk/texlive70484
-Node: Configure options for texk/xdvik70905
-Node: Configure options for utils/xindy71509
-Node: Library-specific configure options72410
-Node: Configure options for kpathsea73421
-Node: Configure options for system poppler74130
-Node: Variables for configure74921
-Node: Coding conventions76349
-Node: Declarations and definitions77088
-Node: Const79270
-Node: Continuous integration81133
-Node: Transfer from Subversion to Github81787
-Node: Automatic update of the Git mirror83969
-Node: CI testing on Travis-CI84557
-Node: install-tl85237
-Node: install-tl NAME85606
-Node: install-tl SYNOPSIS85764
-Node: install-tl DESCRIPTION86022
-Node: install-tl REFERENCES87089
-Node: install-tl OPTIONS87615
-Ref: install-tl *-gui* [[=]_module_]87956
-Ref: install-tl text88166
-Ref: install-tl wizard88289
-Ref: install-tl perltk88443
-Ref: install-tl *-no-gui*88874
-Ref: install-tl *-lang* _llcode_88955
-Ref: install-tl *-repository* _url|path_89642
-Ref: install-tl *-select-repository*91522
-Ref: install-tl *-all-options*91958
-Ref: install-tl *-custom-bin* _path_92213
-Ref: install-tl *-debug-translation*93044
-Ref: install-tl *-force-platform* _platform_93263
-Ref: install-tl *-help*, *--help*, *-?*93507
-Ref: install-tl *-in-place*93914
-Ref: install-tl *-init-from-profile* _profile_file_94459
-Ref: install-tl *-logfile* _file_94679
-Ref: install-tl *-no-cls*95030
-Ref: install-tl *-non-admin*95164
-Ref: install-tl *-persistent-downloads*95269
-Ref: install-tl *-no-persistent-downloads*95297
-Ref: install-tl *-no-verify-downloads*95915
-Ref: install-tl *-portable*96276
-Ref: install-tl *-print-platform*96415
-Ref: install-tl *-profile* _profile_file_96613
-Ref: install-tl *-q*96793
-Ref: install-tl *-scheme* _scheme_96855
-Ref: install-tl *-v*97329
-Ref: install-tl *-version*, *--version*97484
-Node: install-tl PROFILES97615
-Ref: install-tl instopt_adjustpath (default 0 on Unix, 1 on Windows)100265
-Ref: install-tl instopt_adjustrepo (default 1)100341
-Ref: install-tl instopt_letter (default 0)100478
-Ref: install-tl instopt_portable (default 0)100569
-Ref: install-tl instopt_write18_restricted (default 1)100665
-Node: install-tl ENVIRONMENT VARIABLES101984
-Ref: install-tl TEXLIVE_INSTALL_ENV_NOCHECK102375
-Ref: install-tl TEXLIVE_INSTALL_NO_CONTEXT_CACHE102577
-Ref: install-tl TEXLIVE_INSTALL_NO_WELCOME102687
-Ref: install-tl TEXLIVE_INSTALL_PREFIX102808
-Ref: install-tl TEXLIVE_INSTALL_TEXDIR102834
-Ref: install-tl TEXLIVE_INSTALL_TEXMFCONFIG102865
-Ref: install-tl TEXLIVE_INSTALL_TEXMFVAR102893
-Ref: install-tl TEXLIVE_INSTALL_TEXMFHOME102922
-Ref: install-tl TEXLIVE_INSTALL_TEXMFLOCAL102952
-Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSCONFIG102986
-Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSVAR103017
-Ref: install-tl NOPERLDOC103388
-Node: install-tl AUTHORS AND COPYRIGHT103452
-Node: tlmgr103868
-Node: tlmgr NAME104321
-Node: tlmgr SYNOPSIS104453
-Node: tlmgr DESCRIPTION104643
-Node: tlmgr EXAMPLES105739
-Ref: tlmgr tlmgr option repository ctan105990
-Ref: tlmgr tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet106062
-Ref: tlmgr tlmgr update --list106514
-Ref: tlmgr tlmgr update --all106607
-Ref: tlmgr tlmgr info _what_106764
-Node: tlmgr OPTIONS107026
-Ref: tlmgr *--repository* _url|path_107546
-Ref: tlmgr *--gui* [_action_]108271
-Ref: tlmgr *--gui-lang* _llcode_108678
-Ref: tlmgr *--debug-translation*109361
-Ref: tlmgr *--machine-readable*109564
-Ref: tlmgr *--no-execute-actions*109832
-Ref: tlmgr *--package-logfile* _file_110025
-Ref: tlmgr *--pause*110279
-Ref: tlmgr *--persistent-downloads*110434
-Ref: tlmgr *--no-persistent-downloads*110462
-Ref: tlmgr *--pin-file*110956
-Ref: tlmgr *--usermode*111174
-Ref: tlmgr *--usertree* _dir_111294
-Ref: tlmgr *--verify-repo=[none|main|all]*111420
-Node: tlmgr ACTIONS112319
-Node: tlmgr help113171
-Node: tlmgr version113647
-Node: tlmgr backup113910
-Ref: tlmgr *backup [_option_...] --all*114081
-Ref: tlmgr *backup [_option_...] _pkg_...*114114
-Ref: tlmgr *--backupdir* _directory_114969
-Ref: tlmgr *--all*115186
-Ref: tlmgr *--clean*[=_N_]115438
-Ref: tlmgr *--dry-run*115765
-Node: tlmgr candidates _pkg_115895
-Node: tlmgr check [_option_...] [files|depends|executes|runfiles|all]116241
-Ref: tlmgr *files*116614
-Ref: tlmgr *depends*116749
-Ref: tlmgr *executes*117091
-Ref: tlmgr *runfiles*117209
-Ref: tlmgr *--use-svn*117330
-Node: tlmgr conf117447
-Ref: tlmgr *conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]]*117726
-Ref: tlmgr *conf auxtrees [--conffile _file_] [show|add|delete] [_value_]*117790
-Node: tlmgr dump-tlpdb [_option_...] [--json]120135
-Ref: tlmgr *--local*120568
-Ref: tlmgr *--remote*120607
-Ref: tlmgr *--json*120645
-Node: tlmgr generate121216
-Ref: tlmgr *generate [_option_...] language*121412
-Ref: tlmgr *generate [_option_...] language.dat*121451
-Ref: tlmgr *generate [_option_...] language.def*121490
-Ref: tlmgr *generate [_option_...] language.dat.lua*121533
-Ref: tlmgr *--dest* _output_file_123859
-Ref: tlmgr *--localcfg* _local_conf_file_124435
-Ref: tlmgr *--rebuild-sys*124558
-Node: tlmgr gui125373
-Node: tlmgr info125551
-Ref: tlmgr *info [_option_...] _pkg_...*125713
-Ref: tlmgr *info [_option_...] collections*125747
-Ref: tlmgr *info [_option_...] schemes*125777
-Ref: tlmgr *--list*127307
-Ref: tlmgr *--only-installed*127621
-Ref: tlmgr *--data item1,item2,...*127820
-Ref: tlmgr *--json* 1128401
-Node: tlmgr init-usertree128784
-Node: tlmgr install [_option_...] _pkg_...129165
-Ref: tlmgr *--dry-run* 1129675
-Ref: tlmgr *--file*129792
-Ref: tlmgr *--force*130014
-Ref: tlmgr *--no-depends*130234
-Ref: tlmgr *--no-depends-at-all*130393
-Ref: tlmgr *--reinstall*130793
-Ref: tlmgr *--with-doc*131171
-Ref: tlmgr *--with-src*131184
-Node: tlmgr key131706
-Ref: tlmgr *key list*131864
-Ref: tlmgr *key add _file_*131882
-Ref: tlmgr *key remove _keyid_*131904
-Node: tlmgr list132499
-Node: tlmgr option132661
-Ref: tlmgr *option [--json] [show]*132816
-Ref: tlmgr *option [--json] showall*132842
-Ref: tlmgr *option _key_ [_value_]*132868
-Node: tlmgr paper137265
-Ref: tlmgr *paper [a4|letter]*137414
-Ref: tlmgr *[xdvi|pdftex|dvips|dvipdfmx|context|psutils] paper [_papersize_|--list]*137488
-Ref: tlmgr *paper --json*137503
-Node: tlmgr path138718
-Ref: tlmgr *path [--w32mode=user|admin] add*138879
-Ref: tlmgr *path [--w32mode=user|admin] remove*138916
-Node: tlmgr pinning140256
-Ref: tlmgr pinning show140497
-Ref: tlmgr pinning add _repo_ _pkgglob_...140570
-Ref: tlmgr pinning remove _repo_ _pkgglob_...140689
-Ref: tlmgr pinning remove _repo_ --all140842
-Node: tlmgr platform140896
-Ref: tlmgr *platform list|add|remove _platform_...*141082
-Ref: tlmgr *platform set _platform_*141109
-Ref: tlmgr *platform set auto*141130
-Ref: tlmgr *--dry-run* 2142016
-Node: tlmgr postaction142135
-Ref: tlmgr *postaction [_option_...] install [shortcut|fileassoc|script] [_pkg_...]*142365
-Ref: tlmgr *postaction [_option_...] remove [shortcut|fileassoc|script] [_pkg_...]*142439
-Ref: tlmgr *--w32mode=[user|admin]*142754
-Ref: tlmgr *--fileassocmode=[1|2]*143170
-Ref: tlmgr *--all* 1143455
-Node: tlmgr print-platform143510
-Node: tlmgr print-platform-info143841
-Node: tlmgr remove [_option_...] _pkg_...144141
-Ref: tlmgr *--all* 2144625
-Ref: tlmgr *--backup*144735
-Ref: tlmgr *--backupdir* _directory_ 1144761
-Ref: tlmgr *--no-depends* 1145166
-Ref: tlmgr *--no-depends-at-all* 1145228
-Ref: tlmgr *--force* 1145331
-Ref: tlmgr *--dry-run* 3145804
-Node: tlmgr repository145911
-Ref: tlmgr *repository list*146099
-Ref: tlmgr *repository list _path|tag_*146129
-Ref: tlmgr *repository add _path_ [_tag_]*146162
-Ref: tlmgr *repository remove _path|tag_*146194
-Ref: tlmgr *repository set _path_[#_tag_] [_path_[#_tag_] ...]*146248
-Node: tlmgr restore147301
-Ref: tlmgr *restore [_option_...] _pkg_ [_rev_]*147480
-Ref: tlmgr *restore [_option_...] --all*147510
-Ref: tlmgr *--all* 3148210
-Ref: tlmgr *--backupdir* _directory_ 2148424
-Ref: tlmgr *--dry-run* 4148605
-Ref: tlmgr *--force* 2148737
-Ref: tlmgr *--json* 2148783
-Node: tlmgr search149110
-Ref: tlmgr *search [_option_...] _what_*149274
-Ref: tlmgr *search [_option_...] --file _what_*149311
-Ref: tlmgr *search [_option_...] --all _what_*149347
-Ref: tlmgr *--file* 1149567
-Ref: tlmgr *--all* 4149629
-Ref: tlmgr *--global*149718
-Ref: tlmgr *--word*149845
-Node: tlmgr shell150160
-Ref: tlmgr protocol150895
-Ref: tlmgr help 1150959
-Ref: tlmgr version 1151012
-Ref: tlmgr quit, end, bye, byebye, EOF151080
-Ref: tlmgr restart151101
-Ref: tlmgr load [local|remote]151224
-Ref: tlmgr save151294
-Ref: tlmgr get [_var_] =item set [_var_ [_val_]]151417
-Node: tlmgr show152018
-Node: tlmgr uninstall152185
-Node: tlmgr update [_option_...] [_pkg_...]152415
-Ref: tlmgr *--all* 5152786
-Ref: tlmgr *--self*154527
-Ref: tlmgr *--dry-run* 5155291
-Ref: tlmgr *--list* [_pkg_]155468
-Ref: tlmgr *--exclude* _pkg_156157
-Ref: tlmgr *--no-auto-remove* [_pkg_...]156957
-Ref: tlmgr *--no-auto-install* [_pkg_...]157408
-Ref: tlmgr *--reinstall-forcibly-removed*158064
-Ref: tlmgr *--backup* 1158599
-Ref: tlmgr *--backupdir* _directory_ 3158625
-Ref: tlmgr *--no-depends* 2159791
-Ref: tlmgr *--no-depends-at-all* 2159994
-Ref: tlmgr *--force* 3160097
-Node: tlmgr CONFIGURATION FILE FOR TLMGR160912
-Ref: tlmgr auto-remove, value 0 or 1 (default 1), same as command-line option.161925
-Ref: tlmgr gui-expertmode, value 0 or 1 (default 1). This switches between the full GUI and a simplified GUI with only the most common settings.162062
-Ref: tlmgr gui-lang _llcode_, with a language code value as with the command-line option.162144
-Ref: tlmgr no-checksums, value 0 or 1 (default 0, see below).162198
-Ref: tlmgr persistent-downloads, value 0 or 1 (default 1), same as command-line option.162278
-Ref: tlmgr require-verification, value 0 or 1 (default 0), same as command-line option.162358
-Ref: tlmgr update-exclude, value: comma-separated list of packages (no space allowed). Same as the command line option --exclude for the action update.162506
-Ref: tlmgr verify-downloads, value 0 or 1 (default 1), same as command-line option.162582
-Ref: tlmgr allowed-actions _action1_ [,_action_,...] The value is a comma-separated list of tlmgr actions which are allowed to be executed when tlmgr is invoked in system mode (that is, without --usermode).162851
-Node: tlmgr CRYPTOGRAPHIC VERIFICATION163937
-Node: tlmgr Configuration of GnuPG invocation166086
-Node: tlmgr USER MODE166724
-Node: tlmgr User mode install169570
-Node: tlmgr User mode backup, restore, remove, update170714
-Node: tlmgr User mode generate, option, paper171156
-Node: tlmgr MULTIPLE REPOSITORIES171532
-Node: tlmgr Pinning173261
-Node: tlmgr GUI FOR TLMGR175236
-Node: tlmgr Main display176576
-Node: tlmgr Display configuration area176828
-Ref: tlmgr Status177189
-Ref: tlmgr Category177353
-Ref: tlmgr Match177539
-Ref: tlmgr Selection177720
-Ref: tlmgr Display configuration buttons177924
-Node: tlmgr Package list area178107
-Ref: tlmgr a checkbox178691
-Ref: tlmgr package name178827
-Ref: tlmgr local revision (and version)178926
-Ref: tlmgr remote revision (and version)179301
-Ref: tlmgr short description179598
-Node: tlmgr Main display action buttons179643
-Ref: tlmgr Update all installed179909
-Ref: tlmgr Update180281
-Ref: tlmgr Install180331
-Ref: tlmgr Remove180517
-Ref: tlmgr Backup180695
-Node: tlmgr Menu bar180852
-Ref: tlmgr tlmgr menu181075
-Ref: tlmgr Options menu181383
-Ref: tlmgr Actions menu182466
-Ref: tlmgr Help menu182894
-Node: tlmgr GUI options183027
-Ref: tlmgr -background _color_183273
-Ref: tlmgr -font " _fontname_ _fontsize_ "183338
-Ref: tlmgr -foreground _color_183496
-Ref: tlmgr -geometry _geomspec_183548
-Ref: tlmgr -xrm _xresource_183740
-Node: tlmgr MACHINE-READABLE OUTPUT184008
-Node: tlmgr Machine-readable update and install output184818
-Ref: tlmgr location-url _location_186094
-Ref: tlmgr total-bytes _count_186310
-Ref: tlmgr _pkgname_186720
-Ref: tlmgr _status_186930
-Ref: tlmgr d187008
-Ref: tlmgr f187068
-Ref: tlmgr u187247
-Ref: tlmgr r187293
-Ref: tlmgr a187416
-Ref: tlmgr i187594
-Ref: tlmgr I187713
-Ref: tlmgr _localrev_187815
-Ref: tlmgr _serverrev_187922
-Ref: tlmgr _size_188034
-Ref: tlmgr _runtime_188203
-Ref: tlmgr _esttot_188273
-Node: tlmgr Machine-readable option output188306
-Node: tlmgr AUTHORS AND COPYRIGHT188818
-Node: Index189217
+Node: Overview of build system3946
+Node: Prerequisites5997
+Node: Building8616
+Node: Build iteration10002
+Node: Build problems11043
+Node: Build in parallel11497
+Node: Build distribution12101
+Node: Build one package12749
+Node: Build one engine16384
+Node: Cross compilation17399
+Node: Cross configuring18679
+Node: Cross problems20356
+Node: Installing22018
+Node: Installation directories23038
+Node: Linked scripts24856
+Node: Distro builds26347
+Node: Layout and infrastructure28723
+Node: Build system tools29554
+Node: Top-level directories31800
+Node: Autoconf macros34036
+Node: General setup macros34798
+Node: Macros for programs35673
+Node: Macros for compilers36474
+Node: Macros for libraries37882
+Node: Macros for library and header flags38308
+Node: Macros for Windows40219
+Node: Library modules41806
+Node: png library42295
+Node: zlib library44643
+Node: freetype library45158
+Node: kpathsea library45854
+Node: Program modules47233
+Node: t1utils package47661
+Node: xindy package48206
+Node: xdvik package49320
+Node: asymptote50379
+Node: Extending TeX Live50875
+Node: Adding a new program module51658
+Node: Adding a new generic library module54997
+Node: Adding a new TeX-specific library module57226
+Node: Configure options57924
+Node: Global configure options59305
+Node: --disable-native-texlive-build59847
+Node: --prefix --bindir ...60809
+Node: --disable-largefile61349
+Node: --disable-missing62050
+Node: --enable-compiler-warnings=LEVEL62451
+Node: --enable-cxx-runtime-hack63107
+Node: --enable-maintainer-mode63527
+Node: --enable-multiplatform64056
+Node: --enable-shared64629
+Node: --enable-silent-rules65000
+Node: --without-ln-s65452
+Node: --without-x65799
+Node: Program-specific configure options65987
+Node: --enable-PROG --disable-PROG66630
+Node: --disable-all-pkgs66903
+Node: Configure options for texk/web2c67686
+Node: Configure options for texk/bibtex-x70224
+Node: Configure options for texk/dvipdfm-x70767
+Node: Configure options for texk/dvisvgm71543
+Node: Configure options for texk/texlive72424
+Node: Configure options for texk/xdvik72845
+Node: Configure options for utils/xindy73466
+Node: Library-specific configure options74356
+Node: Configure options for kpathsea75358
+Node: Configure options for system poppler76107
+Node: Variables for configure76871
+Node: Coding conventions78297
+Node: Declarations and definitions79012
+Node: Const81186
+Node: Continuous integration83050
+Node: Transfer from Subversion to Github83691
+Node: Automatic update of the Git mirror85853
+Node: CI testing on Travis-CI86435
+Node: install-tl87117
+Node: install-tl NAME87486
+Node: install-tl SYNOPSIS87644
+Node: install-tl DESCRIPTION87902
+Node: install-tl REFERENCES88969
+Node: install-tl OPTIONS89495
+Ref: install-tl *-gui* [[=]_module_]89836
+Ref: install-tl text90046
+Ref: install-tl wizard90169
+Ref: install-tl perltk90323
+Ref: install-tl *-no-gui*90754
+Ref: install-tl *-lang* _llcode_90835
+Ref: install-tl *-repository* _url|path_91522
+Ref: install-tl *-select-repository*93402
+Ref: install-tl *-all-options*93838
+Ref: install-tl *-custom-bin* _path_94093
+Ref: install-tl *-debug-translation*94925
+Ref: install-tl *-force-platform* _platform_95144
+Ref: install-tl *-help*, *--help*, *-?*95388
+Ref: install-tl *-in-place*95795
+Ref: install-tl *-init-from-profile* _profile_file_96340
+Ref: install-tl *-logfile* _file_96560
+Ref: install-tl *-no-cls*96911
+Ref: install-tl *-non-admin*97045
+Ref: install-tl *-persistent-downloads*97150
+Ref: install-tl *-no-persistent-downloads*97178
+Ref: install-tl *-no-verify-downloads*97796
+Ref: install-tl *-portable*98157
+Ref: install-tl *-print-platform*98296
+Ref: install-tl *-profile* _profile_file_98494
+Ref: install-tl *-q*98674
+Ref: install-tl *-scheme* _scheme_98736
+Ref: install-tl *-v*99210
+Ref: install-tl *-version*, *--version*99365
+Node: install-tl PROFILES99496
+Ref: install-tl instopt_adjustpath (default 0 on Unix, 1 on Windows)102146
+Ref: install-tl instopt_adjustrepo (default 1)102222
+Ref: install-tl instopt_letter (default 0)102359
+Ref: install-tl instopt_portable (default 0)102450
+Ref: install-tl instopt_write18_restricted (default 1)102546
+Node: install-tl ENVIRONMENT VARIABLES103865
+Ref: install-tl TEXLIVE_INSTALL_ENV_NOCHECK104256
+Ref: install-tl TEXLIVE_INSTALL_NO_CONTEXT_CACHE104458
+Ref: install-tl TEXLIVE_INSTALL_NO_WELCOME104568
+Ref: install-tl TEXLIVE_INSTALL_PREFIX104689
+Ref: install-tl TEXLIVE_INSTALL_TEXDIR104715
+Ref: install-tl TEXLIVE_INSTALL_TEXMFCONFIG104746
+Ref: install-tl TEXLIVE_INSTALL_TEXMFVAR104774
+Ref: install-tl TEXLIVE_INSTALL_TEXMFHOME104803
+Ref: install-tl TEXLIVE_INSTALL_TEXMFLOCAL104833
+Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSCONFIG104867
+Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSVAR104898
+Ref: install-tl NOPERLDOC105269
+Node: install-tl AUTHORS AND COPYRIGHT105333
+Node: tlmgr105749
+Node: tlmgr NAME106202
+Node: tlmgr SYNOPSIS106334
+Node: tlmgr DESCRIPTION106524
+Node: tlmgr EXAMPLES107620
+Ref: tlmgr tlmgr option repository ctan107871
+Ref: tlmgr tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet107943
+Ref: tlmgr tlmgr update --list108395
+Ref: tlmgr tlmgr update --all108488
+Ref: tlmgr tlmgr info _what_108645
+Node: tlmgr OPTIONS108907
+Ref: tlmgr *--repository* _url|path_109427
+Ref: tlmgr *--gui* [_action_]110152
+Ref: tlmgr *--gui-lang* _llcode_110559
+Ref: tlmgr *--debug-translation*111242
+Ref: tlmgr *--machine-readable*111445
+Ref: tlmgr *--no-execute-actions*111713
+Ref: tlmgr *--package-logfile* _file_111906
+Ref: tlmgr *--pause*112160
+Ref: tlmgr *--persistent-downloads*112315
+Ref: tlmgr *--no-persistent-downloads*112343
+Ref: tlmgr *--pin-file*112837
+Ref: tlmgr *--usermode*113055
+Ref: tlmgr *--usertree* _dir_113175
+Ref: tlmgr *--verify-repo=[none|main|all]*113301
+Node: tlmgr ACTIONS114200
+Node: tlmgr help115052
+Node: tlmgr version115528
+Node: tlmgr backup115791
+Ref: tlmgr *backup [_option_...] --all*115962
+Ref: tlmgr *backup [_option_...] _pkg_...*115995
+Ref: tlmgr *--backupdir* _directory_116850
+Ref: tlmgr *--all*117067
+Ref: tlmgr *--clean*[=_N_]117319
+Ref: tlmgr *--dry-run*117646
+Node: tlmgr candidates _pkg_117776
+Node: tlmgr check [_option_...] [files|depends|executes|runfiles|all]118122
+Ref: tlmgr *files*118495
+Ref: tlmgr *depends*118630
+Ref: tlmgr *executes*118972
+Ref: tlmgr *runfiles*119090
+Ref: tlmgr *--use-svn*119211
+Node: tlmgr conf119328
+Ref: tlmgr *conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]]*119607
+Ref: tlmgr *conf auxtrees [--conffile _file_] [show|add|delete] [_value_]*119671
+Node: tlmgr dump-tlpdb [_option_...] [--json]122016
+Ref: tlmgr *--local*122449
+Ref: tlmgr *--remote*122488
+Ref: tlmgr *--json*122526
+Node: tlmgr generate123097
+Ref: tlmgr *generate [_option_...] language*123293
+Ref: tlmgr *generate [_option_...] language.dat*123332
+Ref: tlmgr *generate [_option_...] language.def*123371
+Ref: tlmgr *generate [_option_...] language.dat.lua*123414
+Ref: tlmgr *--dest* _output_file_125740
+Ref: tlmgr *--localcfg* _local_conf_file_126316
+Ref: tlmgr *--rebuild-sys*126439
+Node: tlmgr gui127254
+Node: tlmgr info127432
+Ref: tlmgr *info [_option_...] _pkg_...*127594
+Ref: tlmgr *info [_option_...] collections*127628
+Ref: tlmgr *info [_option_...] schemes*127658
+Ref: tlmgr *--list*129188
+Ref: tlmgr *--only-installed*129502
+Ref: tlmgr *--data item1,item2,...*129701
+Ref: tlmgr *--json* 1130282
+Node: tlmgr init-usertree130665
+Node: tlmgr install [_option_...] _pkg_...131046
+Ref: tlmgr *--dry-run* 1131556
+Ref: tlmgr *--file*131673
+Ref: tlmgr *--force*131895
+Ref: tlmgr *--no-depends*132115
+Ref: tlmgr *--no-depends-at-all*132274
+Ref: tlmgr *--reinstall*132674
+Ref: tlmgr *--with-doc*133052
+Ref: tlmgr *--with-src*133065
+Node: tlmgr key133587
+Ref: tlmgr *key list*133745
+Ref: tlmgr *key add _file_*133763
+Ref: tlmgr *key remove _keyid_*133785
+Node: tlmgr list134380
+Node: tlmgr option134542
+Ref: tlmgr *option [--json] [show]*134697
+Ref: tlmgr *option [--json] showall*134723
+Ref: tlmgr *option _key_ [_value_]*134749
+Node: tlmgr paper139146
+Ref: tlmgr *paper [a4|letter]*139295
+Ref: tlmgr *[xdvi|pdftex|dvips|dvipdfmx|context|psutils] paper [_papersize_|--list]*139369
+Ref: tlmgr *paper --json*139384
+Node: tlmgr path140599
+Ref: tlmgr *path [--w32mode=user|admin] add*140760
+Ref: tlmgr *path [--w32mode=user|admin] remove*140797
+Node: tlmgr pinning142137
+Ref: tlmgr pinning show142378
+Ref: tlmgr pinning add _repo_ _pkgglob_...142451
+Ref: tlmgr pinning remove _repo_ _pkgglob_...142570
+Ref: tlmgr pinning remove _repo_ --all142723
+Node: tlmgr platform142777
+Ref: tlmgr *platform list|add|remove _platform_...*142963
+Ref: tlmgr *platform set _platform_*142990
+Ref: tlmgr *platform set auto*143011
+Ref: tlmgr *--dry-run* 2143897
+Node: tlmgr postaction144016
+Ref: tlmgr *postaction [_option_...] install [shortcut|fileassoc|script] [_pkg_...]*144246
+Ref: tlmgr *postaction [_option_...] remove [shortcut|fileassoc|script] [_pkg_...]*144320
+Ref: tlmgr *--w32mode=[user|admin]*144635
+Ref: tlmgr *--fileassocmode=[1|2]*145051
+Ref: tlmgr *--all* 1145336
+Node: tlmgr print-platform145391
+Node: tlmgr print-platform-info145722
+Node: tlmgr remove [_option_...] _pkg_...146022
+Ref: tlmgr *--all* 2146506
+Ref: tlmgr *--backup*146616
+Ref: tlmgr *--backupdir* _directory_ 1146642
+Ref: tlmgr *--no-depends* 1147047
+Ref: tlmgr *--no-depends-at-all* 1147109
+Ref: tlmgr *--force* 1147212
+Ref: tlmgr *--dry-run* 3147685
+Node: tlmgr repository147792
+Ref: tlmgr *repository list*147980
+Ref: tlmgr *repository list _path|tag_*148010
+Ref: tlmgr *repository add _path_ [_tag_]*148043
+Ref: tlmgr *repository remove _path|tag_*148075
+Ref: tlmgr *repository set _path_[#_tag_] [_path_[#_tag_] ...]*148129
+Node: tlmgr restore149182
+Ref: tlmgr *restore [_option_...] _pkg_ [_rev_]*149361
+Ref: tlmgr *restore [_option_...] --all*149391
+Ref: tlmgr *--all* 3150091
+Ref: tlmgr *--backupdir* _directory_ 2150305
+Ref: tlmgr *--dry-run* 4150486
+Ref: tlmgr *--force* 2150618
+Ref: tlmgr *--json* 2150664
+Node: tlmgr search150991
+Ref: tlmgr *search [_option_...] _what_*151155
+Ref: tlmgr *search [_option_...] --file _what_*151192
+Ref: tlmgr *search [_option_...] --all _what_*151228
+Ref: tlmgr *--file* 1151448
+Ref: tlmgr *--all* 4151510
+Ref: tlmgr *--global*151599
+Ref: tlmgr *--word*151726
+Node: tlmgr shell152041
+Ref: tlmgr protocol152776
+Ref: tlmgr help 1152840
+Ref: tlmgr version 1152893
+Ref: tlmgr quit, end, bye, byebye, EOF152961
+Ref: tlmgr restart152982
+Ref: tlmgr load [local|remote]153105
+Ref: tlmgr save153175
+Ref: tlmgr get [_var_] =item set [_var_ [_val_]]153298
+Node: tlmgr show153899
+Node: tlmgr uninstall154066
+Node: tlmgr update [_option_...] [_pkg_...]154296
+Ref: tlmgr *--all* 5154667
+Ref: tlmgr *--self*156408
+Ref: tlmgr *--dry-run* 5157172
+Ref: tlmgr *--list* [_pkg_]157349
+Ref: tlmgr *--exclude* _pkg_158038
+Ref: tlmgr *--no-auto-remove* [_pkg_...]158838
+Ref: tlmgr *--no-auto-install* [_pkg_...]159289
+Ref: tlmgr *--reinstall-forcibly-removed*159945
+Ref: tlmgr *--backup* 1160480
+Ref: tlmgr *--backupdir* _directory_ 3160506
+Ref: tlmgr *--no-depends* 2161672
+Ref: tlmgr *--no-depends-at-all* 2161875
+Ref: tlmgr *--force* 3161978
+Node: tlmgr CONFIGURATION FILE FOR TLMGR162793
+Ref: tlmgr auto-remove, value 0 or 1 (default 1), same as command-line option.163806
+Ref: tlmgr gui-expertmode, value 0 or 1 (default 1). This switches between the full GUI and a simplified GUI with only the most common settings.163943
+Ref: tlmgr gui-lang _llcode_, with a language code value as with the command-line option.164025
+Ref: tlmgr no-checksums, value 0 or 1 (default 0, see below).164079
+Ref: tlmgr persistent-downloads, value 0 or 1 (default 1), same as command-line option.164159
+Ref: tlmgr require-verification, value 0 or 1 (default 0), same as command-line option.164239
+Ref: tlmgr update-exclude, value: comma-separated list of packages (no space allowed). Same as the command line option --exclude for the action update.164387
+Ref: tlmgr verify-downloads, value 0 or 1 (default 1), same as command-line option.164463
+Ref: tlmgr allowed-actions _action1_ [,_action_,...] The value is a comma-separated list of tlmgr actions which are allowed to be executed when tlmgr is invoked in system mode (that is, without --usermode).164732
+Node: tlmgr CRYPTOGRAPHIC VERIFICATION165818
+Node: tlmgr Configuration of GnuPG invocation167967
+Node: tlmgr USER MODE168605
+Node: tlmgr User mode install171451
+Node: tlmgr User mode backup, restore, remove, update172595
+Node: tlmgr User mode generate, option, paper173037
+Node: tlmgr MULTIPLE REPOSITORIES173413
+Node: tlmgr Pinning175142
+Node: tlmgr GUI FOR TLMGR177117
+Node: tlmgr Main display178457
+Node: tlmgr Display configuration area178709
+Ref: tlmgr Status179070
+Ref: tlmgr Category179234
+Ref: tlmgr Match179420
+Ref: tlmgr Selection179601
+Ref: tlmgr Display configuration buttons179805
+Node: tlmgr Package list area179988
+Ref: tlmgr a checkbox180572
+Ref: tlmgr package name180708
+Ref: tlmgr local revision (and version)180807
+Ref: tlmgr remote revision (and version)181182
+Ref: tlmgr short description181479
+Node: tlmgr Main display action buttons181524
+Ref: tlmgr Update all installed181790
+Ref: tlmgr Update182162
+Ref: tlmgr Install182212
+Ref: tlmgr Remove182398
+Ref: tlmgr Backup182576
+Node: tlmgr Menu bar182733
+Ref: tlmgr tlmgr menu182956
+Ref: tlmgr Options menu183264
+Ref: tlmgr Actions menu184347
+Ref: tlmgr Help menu184775
+Node: tlmgr GUI options184908
+Ref: tlmgr -background _color_185154
+Ref: tlmgr -font " _fontname_ _fontsize_ "185219
+Ref: tlmgr -foreground _color_185377
+Ref: tlmgr -geometry _geomspec_185429
+Ref: tlmgr -xrm _xresource_185621
+Node: tlmgr MACHINE-READABLE OUTPUT185889
+Node: tlmgr Machine-readable update and install output186699
+Ref: tlmgr location-url _location_187975
+Ref: tlmgr total-bytes _count_188191
+Ref: tlmgr _pkgname_188601
+Ref: tlmgr _status_188811
+Ref: tlmgr d188889
+Ref: tlmgr f188949
+Ref: tlmgr u189128
+Ref: tlmgr r189174
+Ref: tlmgr a189297
+Ref: tlmgr i189475
+Ref: tlmgr I189594
+Ref: tlmgr _localrev_189696
+Ref: tlmgr _serverrev_189803
+Ref: tlmgr _size_189915
+Ref: tlmgr _runtime_190084
+Ref: tlmgr _esttot_190154
+Node: tlmgr Machine-readable option output190187
+Node: tlmgr AUTHORS AND COPYRIGHT190699
+Node: Index191098
 
 End Tag Table

Modified: branches/stable/source/src/doc/tlbuild.texi
===================================================================
--- branches/stable/source/src/doc/tlbuild.texi	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/doc/tlbuild.texi	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
 \input texinfo
 @setfilename tlbuild.info
 
- at set version 2018
- at set month-year August 2018
+ at set version 2019
+ at set month-year February 2019
 
 @set mytitle Building @TeX{} Live (@value{version})
 @settitle @value{mytitle}
@@ -15,7 +15,7 @@
 This file documents the @TL{} build system and more.
 
 @noindent
-Copyright @copyright{} 2016--2018 Karl Berry.@*
+Copyright @copyright{} 2016--2019 Karl Berry.@*
 Copyright @copyright{} 2013--2015 Karl Berry & Peter Breitenlohner.
 
 Permission is granted to make and distribute verbatim copies of this
@@ -64,7 +64,7 @@
 @subtitle @value{month-year}
 @author Peter Breitenlohner
 @author Karl Berry
- at author @url{http://tug.org/texlive}
+ at author @url{https://tug.org/texlive}
 
 @page
 @vskip 0pt plus 1filll
@@ -110,42 +110,43 @@
 also available as plain text files in the source tree:
 @file{source/README.*}.
 
-The @file{source/README} file in the TL source tree provides the
+The main @file{source/README} file in the TL source tree provides
 maximally-terse information for doing a build, and portability
 information for different systems, along with
 @file{source/doc/README.solaris}.
 
 For information on acquiring the TL sources, see
- at url{http://tug.org/texlive/svn}.
+ at url{https://tug.org/texlive/svn}.  The canonical source repository
+uses Subversion, and we have no plans to change this.
 
 This manual does not duplicate the information found in other TL
 documentation resources, such as:
 
 @itemize
- at item The @TL{} web pages: @url{http://tug.org/texlive}.
+ at item The @TL{} web pages: @url{https://tug.org/texlive}.
 
 @item The web page describing how to build the binaries which 
-are distributed with @TL{}: @url{http://tug.org/texlive/build.html}.
+are distributed with @TL{}: @url{https://tug.org/texlive/build.html}.
 
- at item The @TL{} user manual: @url{http://tug.org/texlive/doc.html}, or
+ at item The @TL{} user manual: @url{https://tug.org/texlive/doc.html}, or
 run @code{texdoc texlive}.
 
 @item Other @TeX{}-related Texinfo manuals (@pxref{,,,web2c, Web2c},
 @ref{,,,kpathsea, Kpathsea}, etc.):
- at url{http://tug.org/texinfohtml/}, or check the @samp{TeX} category in
+ at url{https://tug.org/texinfohtml/}, or check the @samp{TeX} category in
 the GNU Info system.
 
 @item Package documentation:
- at url{http://tug.org/texlive/Contents/live/doc.html}, or the
+ at url{https://tug.org/texlive/Contents/live/doc.html}, or the
 @file{doc.html} file at the top level of the installed TL.
 
 @end itemize
 
 As an exception, the full documentation for @code{install-tl} and
- at code{tlmgr} is included here, just because it is convenient to do so.
-The same text is available online (linked from
- at url{http://tug.org/texlive/doc.html}, or by invoking the program with
- at samp{--help} (or look at the end of the source).
+ at code{tlmgr} is included here as appendices, simply because it is easy
+to do so.  The same text is available online (linked from
+ at url{https://tug.org/texlive/doc.html}, or by invoking the program
+with @samp{--help} (or look at the end of the source).
 
 
 @c The first word of the chapter/section title here is used to
@@ -160,10 +161,10 @@
 @cindex Automake
 @cindex Libtool
 @cindex tests, running
-The @TL{} build system was redesigned in 2009, consistently using
-Autoconf, Automake, and Libtool.  Thus@*@ @ @ @code{configure &&
-make && make check && make install}@*or the basically-equivalent
-top-level @code{Build} script suffice to build and install the TL
+The @TL{} build system was redesigned in 2009 to consistently use
+Autoconf, Automake, and Libtool.  Thus, running@*@ @ @ @code{configure
+&& make && make check && make install}@*or the essentially-equivalent
+top-level @code{Build} script suffices to build and install the TL
 programs.  The @code{make check} clause performs various tests of the
 generated programs---not strictly required but strongly recommended.
 Running @code{configure --help} will display a comprehensive list of
@@ -193,7 +194,7 @@
 and properties, such as required libraries, whether an installed
 (system) version of a library can be used, @code{configure} options to
 be seen at the top level, and more.  An explicit list of all available
-modules is kept in only one central place, namely @file{m4/kpse-pkgs.m4}.
+modules is kept in a single central place: @file{m4/kpse-pkgs.m4}.
 
 A second, related goal is to configure and build each library before
 configuring any other (program or library) module which uses that
@@ -206,8 +207,8 @@
 distributed source tree and document any modifications of that source.
 
 All this is for the sake of simplifying both upgrading of modules and
-integrating new modules into the TL build system.  (Not to say that
-either task is trivial.)
+integrating new modules into the TL build system.  (Despite all
+efforts, neither task is easy.)
 
 
 @node Prerequisites
@@ -216,11 +217,11 @@
 @cindex prerequisites for building
 @cindex requirements for building
 
- at cindex compilers, C and C++
+ at cindex compilers, C and C++11
 Overall, building the @TL{} programs, when using all libraries from
-the TL source tree, requires only C and C++ compilers and GNU
- at code{make}.  (If @code{make} from your @code{PATH} is not GNU make,
-you can set @code{MAKE} in the environment to whatever is necessary.)
+the TL source tree, requires C and C++11 compilers and GNU
+ at code{make}.  If @code{make} from your @code{PATH} is not GNU make,
+you can set the @code{MAKE} environment variable to whatever is necessary.
 
 @cindex GNU @code{make}, required
 @cindex @code{gmake}, required
@@ -227,18 +228,19 @@
 @cindex FreeType
 GNU @code{make} is required only because of some third-party
 libraries, notably FreeType; all the TL-maintained directories (and
-Automake/Autoconf output in general) should work with any reasonable
+Automake/Autoconf output in general) work with any reasonable
 @code{make}.
 
+ at cindex C++11, required
+A C++11 compiler is similarly required because of the third-party
+libraries ICU and Poppler; the program @code{dvisvgm} also requires
+C++11. It is possible to build everything else with older compilers;
+ at url{https://tug.org/texlive/custom-bin.html} links to a build script
+for doing this.
+
 However, a few programs in the tree have additional requirements:
 
 @table @file
- at item dvisvgm
- at cindex @code{dvisvgm} requirement for C++11
- at cindex C++11, required by @code{dvisvgm}
-requires a C++11 compiler, such as gcc 4.8.1 (or later) or clang 3.3
-(or later).
-
 @item web2c
 @cindex @code{perl}, required by @code{web2c}, etc.
 requires @code{perl} for some tests run by @code{make check}.
@@ -245,7 +247,7 @@
 
 @item xdvik
 @itemx xpdfopen
- at cindex X11, required by X clients
+ at cindex X11 development, required by X clients
 require X11 headers and libraries, often in ``development'' packages
 that are not installed by default.
 
@@ -259,9 +261,10 @@
 
 @item xindy
 @cindex @code{clisp}, required by @code{xindy}
- at cindex @code{ffcall}, required by @code{xindy}
-requires GNU @code{clisp} and in addition @code{perl}, @code{latex},
-and @code{pdflatex} to build the rules and/or documentation.
+ at cindex @code{libsigsegv}, required by @code{xindy}
+requires GNU @code{clisp}, @code{libsigsegv}, and @code{libiconv};
+additionally, to build the rules and/or documentation: @code{perl},
+ at code{latex}, and @code{pdflatex}
 
 @end table
 
@@ -274,7 +277,7 @@
 @itemize
 @item
 Modification of any @code{.y} or @code{.l} source files requires
- at file{bison} or @file{flex} to updatete the corresponding C sources.
+ at file{bison} or @file{flex} to update the corresponding C sources.
 
 @item
 Modification of the sources for @code{.info} files requires
@@ -284,7 +287,9 @@
 Modification of any part of the build system (M4 macros,
 @file{configure.ac}, @file{Makefile.am}, or their fragments) requires
 GNU M4, GNU Autoconf, GNU Automake, and GNU Libtool to update the
-generated files.  @xref{Build system tools}.
+generated files.  Furthermore, to reliably reproduce the build files,
+the original GNU releases of these tools must be used, not any distro
+packaging of them.  @xref{Build system tools}, for more discussion.
 
 @end itemize
 
@@ -295,15 +300,7 @@
 tools}).  Barring buggy commits, no infrastructure tools are needed to
 do a normal build.
 
- at cindex Debian installation of build prerequisites
-As an example, on Debian systems the necessary build dependencies can
-be installed via:
 
- at example
-apt-get install libfontconfig-dev libx11-dev libxmu-dev libxaw7-dev
- at end example
-
-
 @node Building
 @chapter Building
 
@@ -313,28 +310,29 @@
 @pindex Build @r{script}
 The top-level @file{Build} script is intended to simplify building the
 binaries distributed with @TL{} itself---we call this the ``native''
-TL build.  It configures and makes everything in a subdirectory of the
-main build tree (default @file{Work/}), installs everything in another
-subdirectory (default @file{inst/}), and finally runs @code{make
-check}.  The exact directory and command names can be specified via
-environment variables and a few leading options.  All remaining
-arguments (assignments or options) are passed to the @file{configure}
-script.  Please take a look at the @file{./Build} source file itself
-for more information; it is a straightforward shell script.
+TL build.  It runs @code{configure && make world}, which builds
+everything in a subdirectory of the main source tree (default
+ at file{Work/}), installs everything in another subdirectory (default
+ at file{inst/}), and finally runs @code{make check}.  The exact
+directory and command names can be specified via environment variables
+and a few leading options.  All remaining arguments (assignments or
+options) are passed to the @file{configure} script.  Please take a
+look at the @file{./Build} source file for more information; it is a
+straightforward shell script.
 
 @cindex source directory building, not supported
 @cindex build directory, required
 An alternative, and the one we will mainly discuss here, is to run
- at code{configure} and @code{make} oneself in a suitable empty
-subdirectory.  Building in the source directory itself is not
-supported (sorry).
+ at code{configure} and @code{make} in a suitable empty subdirectory.
+Building in the source directory itself is not supported (sorry).
 
 @menu
-* Build iteration::     What @code{configure} and @code{make} do.
+* Build iteration::     What @code{configure} and @code{make} do in TL.
 * Build problems::      If the build fails.
 * Build in parallel::   Simultaneous @code{make} processes.
 * Build distribution::  Making a distribution tarball.
 * Build one package::   Example of working on just one program.
+* Build one engine::    Example of building just one @TeX{} engine.
 * Cross compilation::   Building on host X for target Y.
 @end menu
 
@@ -347,10 +345,10 @@
 
 Running the top-level @file{configure} script configures the top level
 and the subdirectories @file{libs}, @file{utils}, and @file{texk}.
-Running @code{make} at the top-level first iterates over all
- at TeX{}-specific libraries, and then runs @code{make} in
- at file{libs}, @file{utils}, and @file{texk} to iterate over all generic
-libraries, utility programs, and @TeX{}-specific programs.  These
+Running @code{make} at the top level first iterates over the
+ at TeX{}-specific libraries, and then runs @code{make} in @file{libs},
+ at file{utils}, and @file{texk} to iterate over the generic libraries,
+utility programs, and @TeX{}-specific programs, respectively.  These
 iterations consist of two steps:
 
 @enumerate
@@ -368,8 +366,8 @@
 @end enumerate
 
 Running the top-level @code{make} a second time iterates again over
-all the library and program modules, but finds (should find) nothing
-to be done unless some source files have been modified.
+all the library and program modules, and finds (should find) nothing
+to be done.
 
 
 @node Build problems
@@ -379,10 +377,11 @@
 @cindex problems with build
 @cindex failure to build
 @vindex --no-clean Build @r{option}
-If configuring or building a module fails, you should first find and fix the
-problem, then perhaps remove the subdirectory for that module from the build
-tree, and finally rerun the top level @code{make} (or @file{Build} with
- at code{--no-clean} as its first argument).
+If configuring or building a module fails, you should first try to
+find and fix the problem.  Failing that, a possible workaround is to
+remove the subdirectory for that module from the build tree (so
+ at code{configure} won't try to run there, and finally rerun the top
+level @code{make} (or @file{./Build} @code{--no-clean}).
 
 
 @node Build in parallel
@@ -396,15 +395,15 @@
 @vindex -j make @r{option}
 The TL build system carefully formulates dependencies as well as
 @code{make} rules when a tool (such as @code{tangle}, @code{ctangle},
-or @code{convert}) creates several output files.  This allows for
+and @code{convert}) creates several output files.  This allows for
 parallel builds (@code{make -j @var{n}} with @math{@var{n}>1} or even
 @code{make -j}) that can considerably speed up the TL build.
 
 @cindex cache file, for @code{configure}
 @vindex -C configure @r{option}
-Incidentally, a noticeable speed-up can also be (independently) gained
-by using a configure cache file, i.e., with the option @code{-C}
-(recommended).
+Incidentally, a noticeable speed-up can be independently gained by
+using a configure cache file, i.e., specifying the @code{configure}
+option @code{-C} (recommended).
 
 
 @node Build distribution
@@ -422,6 +421,8 @@
 This is useful for checking consistency of the source tree and
 Makefiles, but the result is not a complete or even usable @TeX{}
 system, since all the support files are lacking; @pxref{Installing}.
+We do not actually distribute any such tarball, and have no plans to
+do so.
 
 
 @node Build one package
@@ -437,15 +438,15 @@
 Then all program and library modules are configured but none are made.
 However, the @file{Makefile}s still contain all build rules and
 dependencies and can be invoked to build an individual program or
-library and causes to first build any required libraries.
+library, first building any required libraries.
 
 This ``build-on-demand'' procedure is used, e.g., in the upstream
-Lua at TeX{} repository to build Lua at TeX{}, essentially from a subset of
-the complete @TL{} tree.  Similarly, when, e.g., building the original
+Lua at TeX{} repository to build Lua at TeX{}, from a subset of the complete
+ at TL{} source tree.  As another example, when building the original
 e- at TeX{} has been disabled (as it is by default), one can run
 @code{make etex} (or @code{make etex.exe}) in @file{texk/web2c/} to
-build e- at TeX{} (although there is no comparably simple way to install
-e- at TeX{}).
+build e- at TeX{} (although there is no comparably simple way to
+ at emph{install} e- at TeX{}).
 
 If you want to work on a single program within the TL sources, this is
 the recommended way to do it.  Here is an example from start to
@@ -454,7 +455,7 @@
 @example
 mkdir mydir && cd mydir  # new working directory
 
-# Get sources (@url{http://tug.org/texlive/svn}), e.g.:
+# Get sources (@url{https://tug.org/texlive/svn}), e.g.:
 rsync -a --delete --exclude=.svn --exclude=Work \
       tug.org::tldevsrc/Build/source/ .
 
@@ -463,10 +464,10 @@
 
 # Do the configure:
 ../configure --disable-all-pkgs --enable-dvipdfm-x \
-  -C CFLAGS=-g CXXFLAGS=-g >&outc
+  -C CFLAGS=-g CXXFLAGS=-g >&outc || echo fail
 
 # Do the make:
-make >&outm
+make >&outm || echo fail
 
 # Test:
 cd texk/dvipdfm-x
@@ -473,20 +474,25 @@
 make check
 @end example
 
-Then you modify source files in @file{mydir/texk/dvipdfm-x} and rerun
- at code{make} in @file{mydir/Work/texk/dvipdfm-x} to rebuild (that
-build directory is where the binaries end up).
+Then you can modify source files in @file{mydir/texk/dvipdfm-x} and
+rerun @code{make} in @file{mydir/Work/texk/dvipdfm-x} to rebuild; that
+build directory is where the binary ends up and where you can run a
+debugger, etc.
 
 The second line of the @code{configure} invocation shows examples of
 extra things you likely want to specify if you intend to hack the
-sources (and not just build binaries): the @code{-C} speeds up
- at code{configure}, and the @code{CFLAGS} and @code{CXXFLAGS} settings
-eliminate compiler optimization for debugging purposes.
+sources (and not just build binaries): the @code{-C} speeds
+ at code{configure} by enabling a cache file, and the @code{CFLAGS} and
+ at code{CXXFLAGS} settings eliminate compiler optimization for debugging
+purposes.
 
-Of course, one should actually look at the output and check that
+Of course, you need to actually look at the output and check that
 things are working.  There are many @code{configure} options you can
-tweak as desired; check the output from @code{configure --help}.
+tweak as desired; check the output from @code{configure --help}.  It
+is also a good idea to run @code{make check} after making any changes,
+to ensure that whatever tests have been written still pass.
 
+
 @cindex size of source tree
 Finally, the above retrieves the entire TL source tree (several
 hundred megabytes). It is natural to ask if this is really necessary.
@@ -495,16 +501,17 @@
 additional @code{configure} flags to individually disable using system
 versions of libraries, or the intricacies of the dependencies (such as
 @code{teckit} requiring @code{zlib}) will have undesired side effects.
-For an example, see the @code{build-pdftex.sh} script in the
- at code{pdftex} development source (details at @url{http://pdftex.org}),
-which is indeed a cut-down TL source tree.
+For an example of this approach, see the @code{build-pdftex.sh} script
+in the @code{pdftex} development source (details at
+ at url{http://pdftex.org}), which is indeed such a cut-down TL source
+tree.
 
 @vindex --enable-missing @r{to ignore dependencies}
 Even with @code{--disable-all-pkgs}, dependencies will be checked.
-For instance, if a non-MacOSX system does not have @code{fontconfig},
-Xe at TeX{} cannot be built (@pxref{Prerequisites}) and @code{configure}
-will terminate.  To proceed without such dependencies, specify
- at code{--enable-missing} also.
+For instance, if a (non-MacOSX) system does not have
+ at code{fontconfig}, Xe at TeX{} cannot be built (@pxref{Prerequisites})
+and @code{configure} will terminate.  To proceed without such
+dependencies, specify @code{--enable-missing} also.
 
 @vindex CC=@var{c-compiler}
 @vindex CXX=@var{c++-compiler}
@@ -515,6 +522,36 @@
 explicitly specify the compilers to be used with the environment
 variables @code{CC}, @code{CXX}, and @code{OBJCXX}.
 
+
+ at node Build one engine
+ at section Build one engine
+
+ at cindex build one engine
+ at cindex one engine, building
+ at cindex engine, building one
+
+Unfortunately, there is one common case where the steps in the
+preceding section to build one package (@pxref{Build one package}) do
+not suffice: wanting to build one, or a subset, of the @TeX{} engines
+(or other Web2c programs).
+
+The simplest way to do this is to disable everything and then
+explicitly specify what to make. For example, to build only Lua at TeX{}:
+
+ at example
+./configure --disable-all-pkgs  # or ./Build
+cd Work/texk/web2c              # build directory
+make luatex                     # specify target
+ at end example
+
+This works because the @code{make} automatically runs @code{configure}
+as necessary for the dependencies and target.  Furthermore, the source
+tree can be cut down to just what is needed for the given engine (as
+the separate pdf at TeX{} and Lua at TeX{} source repositories do).
+
+We hope to improve the situation in the future.  Patches are welcome.
+
+
 @node Cross compilation
 @section Cross compilation
 
@@ -655,13 +692,13 @@
 @file{tangle} used in the module @file{texk/web2c} to build the WEB
 programs, but that would require first building a native
 @code{kpathsea} library.  To avoid this complication, cross
-compilation of the WEB or CWEB programs requires sufficiently recent
+compilation of programs written in (C)WEB requires sufficiently recent
 installed versions of @file{tangle}, @file{ctangle}, @file{otangle},
 and @file{tie}.
 
- at cindex @code{xindy} cross compiling impossible
-Building @code{xindy} requires running the host system @file{clisp}
-binary, thus cross compilation is not possible.
+ at cindex @code{xindy} cross compiling requires @code{clisp}
+Building @code{xindy} requires running the host system @code{clisp}
+binary, thus cross compilation is painful, but possible.
 
 @node Installing
 @chapter Installing
@@ -680,11 +717,11 @@
 @file{plain.tex} is not in the source tree.
 
 These support files are maintained completely independently and are
-not present in the source tree.  The best basis for dealing with them
+not present in the TL source tree.  The best basis for dealing with them
 is the @TL{} (plain text) database in
 @file{Master/tlpkg/texlive.tlpdb}, and/or the @TL{} installer,
 @code{install-tl}.  More information is under @file{Master/tlpkg} and
-at @url{http://tug.org/texlive/distro.html}.
+at @url{https://tug.org/texlive/distro.html}.
 
 @menu
 * Installation directories::    The prefix, @code{bindir}, etc., directories.
@@ -708,7 +745,7 @@
 and Info files in @code{@var{infodir}}.
 
 The values of these directories are determined by @code{configure}
-and can be specified explictly as options such as
+and can be specified explicitly as options such as
 @code{--prefix=@var{prefix}} or @code{--bindir=@var{bindir}};
 otherwise, they are given by their usual Autoconf defaults:
 
@@ -747,7 +784,7 @@
 installation paths.
 
 For the native TL build, the @code{Build} script leaves the binaries
-in @file{./inst/bin/@var{std-platform-name}}.  The new binaries are
+in @file{./inst/bin/@var{std-system-triplet}}.  The new binaries are
 not directly usable from that location; they need to be copied to
 @file{Master/bin/@var{tl-platform}}.  The other files and directories
 that end up in @file{./inst/} are ignored.
@@ -772,9 +809,9 @@
 symbolic link is made in @code{@var{bindir}}.  For example, a symlink
 points from @code{@var{bindir}/ps2eps} to
 @code{@var{datarootdir}/texmf-dist/scripts/ps2eps/ps2eps.pl}.  For
-Windows, a standard wrapper binary (e.g.,
- at code{@var{bindir}/ps2eps.exe}) serves the same purpose.  (The source
-for the wrapper is in @file{texk/texlive/w32_wrapper}.)
+Windows, a standard wrapper binary (copied to, e.g.,
+ at code{@var{bindir}/ps2eps.exe}) serves the same purpose.  The source
+for the wrapper is in @file{texk/texlive/w32_wrapper}.
 
 One reason for this is to avoid having many copies of the same
 script; a more important reason is that it guarantees the scripts will
@@ -789,7 +826,7 @@
 the build to be as close as possible to what is in the TL
 distribution.  At present, there are a few exceptions---Asymptote,
 Biber, Xindy---and each one creates considerable extra work.  We don't
-want to add more.  (See @url{http://tug.org/texlive/build.html} for
+want to add more.  (See @url{https://tug.org/texlive/build.html} for
 information about building those exceptions, as well as the @code{xz}
 and @code{wget} programs that are used in the TL infrastructure.)
 
@@ -811,12 +848,12 @@
 @cindex shared libraries, using vs.@: avoiding
 The native TL distribution uses shared libraries only when absolutely
 necessary (@file{libc}, @file{libm}, X11 libraries, and
- at file{libfontconfig}).  However, a distro typically wants to use as
-many shared libraries as possible from elsewhere on the system,
+ at file{libfontconfig}).  In contrast, a distro typically wants to use
+as many shared libraries as possible from elsewhere on the system,
 including @TeX{}-specific libraries such as @file{libkpathsea} (even
 though Kpathsea has never officially been released as a shared
-library, but we digress).  In addition, the installation paths will,
-in general, be completely different.
+library).  In addition, the installation paths will, in general, be
+completely different.
 
 Here are the @code{configure} options that distro builds are likely to
 find most relevant:
@@ -838,7 +875,7 @@
 Do not build the static versions of the @TeX{}-specific libraries.
 
 @item --with-system- at var{lib}
-Use system versions for as many libraries @var{lib} as possible.
+Look for and use a system version of the library @var{lib}.
 @code{configure --help} will give you the list of possibilities.
 
 @item --with- at var{lib}-includes=@var{dir}
@@ -862,7 +899,7 @@
 (@pxref{Installing}), and many other issues, such as font maps,
 languages, and formats, independently of the build.  Norbert Preining
 has written a detailed article on adapting TL for distros:
- at url{http://tug.org/TUGboat/tb34-3/tb108preining-distro.pdf}.  (If the
+ at url{https://tug.org/TUGboat/tb34-3/tb108preining-distro.pdf}.  (If the
 article needs updating in the future, perhaps we will merge it into
 this document.)
 
@@ -885,7 +922,7 @@
 * Autoconf macros::         TL-specific Autoconf macros.
 * Library modules::         Handling libraries, with examples.
 * Program modules::         Handling programs, with examples.
-* Extending @TL{}::      Adding a new module.
+* Extending @TL{}::         Adding a new module.
 @end menu
 
 
@@ -896,8 +933,8 @@
 @cindex GNU tools, needed for building
 @cindex infrastructure, tools needed for
 
-As mentioned above (@pxref{Prerequisites}), a normal build requires
-very little.  On the other hand, if you want to modify the @TL{}
+As mentioned above (@pxref{Prerequisites}), a normal build has few
+requirements.  On the other hand, if you want to modify the @TL{}
 infrastructure sources, such as @file{configure.ac} or
 @file{Makefile.am} files, you will need to have several additional
 tools installed.
@@ -924,22 +961,27 @@
 explicitly with the top-level @code{reautoconf} script or implicitly
 by using the configure option @code{--enable-maintainer-mode}.
 
+It has often turned out that the bison and flex versions are not
+critical; however, the autotools versions are.  If you don't have the
+given versions, get them before modifying the build infrastructure.
+
 @cindex Subversion repository
 @cindex timestamps, in repository
 @vindex use-commit-times at r{, Subversion}
 The files in the Subversion repository (see
- at url{http://tug.org/texlive/svn}) are all up to date, but
-unfortunately this may not be reflected by their timestamps.  (For
-starters, be sure to set @file{use-commit-times=yes} in
- at file{~/.subversion/config} or the equivalent.)
+ at url{https://tug.org/texlive/svn}) are all up to date (barring
+bugs). For this to be reflected by their timestamps in your checkout,
+be sure to set @file{use-commit-times=yes} in
+ at file{~/.subversion/config} or the equivalent.
 
+
 @cindex touching files to avoid rerunning
 @pindex make -t
-To avoid unnecessary runs of @code{bison}, @code{flex}, or
- at code{makeinfo} it may be necessary to @code{touch} the generated
-(@file{.c}, @file{.h}, or @file{.info}) files.  With
- at code{--enable-maintainer-mode} it may also be necessary to
- at code{touch} first @file{aclocal.m4}, then @file{configure} and
+If timestamps are wrong, you may also be able to avoid unnecessary
+runs of @code{bison}, @code{flex}, or @code{makeinfo} with
+ at code{touch} of the generated (@file{.c}, @file{.h}, or @file{.info})
+files.  With @code{--enable-maintainer-mode} it may also be necessary
+to @code{touch} first @file{aclocal.m4}, then @file{configure} and
 @file{config.h.in} (or @file{c-auto.in}), and finally all
 @file{Makefile.in} files.  Perhaps @code{make -t} will help.
 
@@ -982,19 +1024,14 @@
 @cindex Gnulib, used for common files
 The top-level @file{build-aux/} directory contains the common files
 @file{compile}, @file{config.guess}, @file{config.sub},
- at file{depcomp}, etc.@ used by most packages.  These are from the GNU
-Gnulib sources (@url{http://www.gnu.org/software/gnulib}), which in
-turn synchronizes with the appropriate ultimate upstream repository.
-There are, however, independent copies in, e.g.,
- at file{libs/freetype2/freetype-*/builds/unix/}, and a few other places.
-The @code{reautoconf} script does not touch those, but a TL cron job
-keeps them in sync (nightly).
+ at file{depcomp}, etc.@ used by most packages.  These are taken from the
+GNU Gnulib sources (@url{https://www.gnu.org/software/gnulib}), which
+in turn synchronizes with any ultimate upstream repository.  There are
+independent copies of some of these in a few other places, e.g.,
+ at file{libs/freetype2/freetype-*/builds/unix/}.  The @code{reautoconf}
+script does not touch those, but a TL cron job keeps them in sync
+(nightly).
 
- at cindex @file{extra/} top-level directory
-The directory @file{extra/} contains things which are not part of the
-TL build, but are present just for (someone's) convenience, e.g.,
-is @file{epstopdf} development source is here.
-
 @cindex @file{Work/} top-level directory
 @cindex @file{inst/} top-level directory
 When the top-level @file{./Build} script is used to build TL, two more
@@ -1002,7 +1039,7 @@
 and @file{inst/} for the install tree (from @code{make install}).
 These names (and everything else about @file{Build}'s operation) can
 be changed by setting environment variables before running it; see the
-script file.
+script source.
 
 
 @node Autoconf macros
@@ -1026,11 +1063,12 @@
 @c @r{[}@var{\varname\} = @samp{\default\}@r{]}
 @c @end macro
 
-Here we describe some of the Autoconf macros used in several
-modules--not a complete list, by any means.  These general macros are
-supplemented by module-specific macros in directories such as
- at file{texk/dvipng/m4/}; some of those are described in @ref{Library
-modules} and @pxref{Program modules}.
+Here we describe a few of the Autoconf macros used in several
+modules---many more are defined in the sources; see the top-level
+ at code{m4/} directory.  These general macros are supplemented by
+module-specific macros in directories such as @file{texk/dvipng/m4/};
+some of those are described in following sections (@pxref{Library
+modules} and @ref{Program modules}).
 
 @menu
 * Setup:     General setup macros.
@@ -1060,7 +1098,7 @@
 @defmac KPSE_COMMON (@var{name}, @ovar{more-options})
 Like @code{KPSE_BASIC} but add:@*@ @ @ @code{LT_PREREQ([2.2.6])}@*@ @
 @ @code{LT_INIT([win32-dll])}@*@ @ @ @code{AC_SYS_LARGEFILE}@*@ @ @
- at code{AC_FUNC_FSEEKO}@*and check for frequently used functions,
+ at code{AC_FUNC_FSEEKO}@*along with checks for frequently used functions,
 headers, types, and structures.  This is used for @TeX{}-specific
 modules.
 @end defmac
@@ -1073,12 +1111,11 @@
 Macros for program checks:
 
 @defmac KPSE_CHECK_LATEX
-Set @code{LATEX} to the name of the first of @code{latex},
- at code{elatex}, or @code{lambda} which exists in @code{PATH}, or to
- at code{no} if none of them exists.  Call @code{AC_SUBST} for
- at code{LATEX}.  The result of this test can be overridden by setting
-the @code{LATEX} environment variable or the cache variable
- at code{ac_cv_prog_LATEX}.
+Set @code{LATEX} to the first of @code{latex}, @code{elatex}, or
+ at code{lambda} which exists in @code{PATH}, or to @code{no} if none of
+them exists.  Call @code{AC_SUBST} for @code{LATEX}.  The result of
+this test can be overridden by setting the @code{LATEX} environment
+variable or the cache variable @code{ac_cv_prog_LATEX}.
 @end defmac
 
 @defmac KPSE_CHECK_PDFLATEX
@@ -1107,8 +1144,8 @@
 When using the (Objective) C/C++ compiler, set
 @code{WARNING_[OBJ]C[XX]FLAGS} to suitable warning flags (depending on
 the value given to or implied for @code{--enable-compiler-warnings}).
-Call @code{AC_SUBST} for them.  At the moment this only works for GNU
-compilers, but could be extended to others if necessary.
+Call @code{AC_SUBST} for them.  At present this assumes GNU compiler
+warning options, but could be extended to others if necessary.
 
 @vindex kpse_cv_warning_cflags
 This macro caches its results in the @code{kpse_cv_warning_cflags},
@@ -1118,9 +1155,9 @@
 @defmac KPSE_COMPILER_VISIBILITY
 When using the C or C++ compiler, try to set
 @code{VISIBILITY_C[XX]FLAGS} to flags to hide external symbols.  Call
- at code{AC_SUBST} for this variable.  At the moment this only tests for
-the compiler option @code{-fvisibility=hidden}, but that could be
-extended with more checks if necessary.
+ at code{AC_SUBST} for this variable.  At present this only tests for
+the compiler option @code{-fvisibility=hidden}, but could be
+extended if necessary.
 
 @vindex kpse_cv_visibility_c[xx]flags
 This macro caches its results in the @code{kpse_cv_visibility_cflags}
@@ -1134,7 +1171,7 @@
 @pindex libstc++ at r{, statically linking}
 Provide the configure option @code{--enable-cxx-runtime-hack}.  If
 enabled and when using @code{g++}, try to statically link with
- at file{libstdc++}, somewhat improving portability of the resulting
+ at file{libstdc++}, notably improving portability of the resulting
 binary.
 
 @vindex kpse_cv_cxx_hack
@@ -1169,10 +1206,18 @@
 @defmac KPSE_LIBPNG_FLAGS
 Provide the configure option @code{--with-system-libpng}.  Set and
 @code{AC_SUBST} @code{make} variables for modules using this library (either
-an installed version or from the @TL{} tree): @code{LIBPNG_INCLUDES} for use
-in @code{CPPFLAGS}, @code{LIBPNG_LIBS} for use in @code{LDADD},
- at code{LIBPNG_DEPEND} for use as dependency, and @code{LIBPNG_RULE} defining
- at code{make} rules to rebuild the library.
+an installed version or from the @TL{} tree):
+
+ at multitable {@code{LIBPNG_INCLUDES}} {for the @code{make} rules to rebuild the library.}
+ at item @code{LIBPNG_INCLUDES}
+ at tab for use in @code{CPPFLAGS},
+ at item @code{LIBPNG_LIBS}
+ at tab for use in @code{LDADD},
+ at item @code{LIBPNG_DEPEND}
+ at tab for use as a Makefile dependency,
+ at item @code{LIBPNG_RULE}
+ at tab for the @code{make} rules to rebuild the library.
+ at end multitable
 @end defmac
 
 @defmac KPSE_ADD_FLAGS (@var{name})
@@ -1204,7 +1249,7 @@
 @@LIBPNG_RULE@@
 @end example
 
-If it was necessary to examine whether certain @file{zlib} or
+If it were necessary to examine whether certain @file{zlib} or
 @file{libpng} features were available, @file{configure.ac} should be
 continued this way:
 @example
@@ -1226,10 +1271,10 @@
 
 @defmac KPSE_CHECK_WIN32
 @vindex kpse_cv_have_win32
-Check if compiling for a Windows system.  The result is @code{no} for
-Unix-like systems (including Cygwin), @code{mingw32} for Windows with
-GCC, or @code{native} for Windows with MSVC.  The result is cached in
-the @code{kpse_cv_have_win32} variable.
+Check if compiling for a Windows system.  The result is either
+ at code{no} for Unix-like systems (including Cygwin), @code{mingw32} for
+Windows with GCC, or @code{native} for Windows with MSVC.  The result
+is cached in the @code{kpse_cv_have_win32} variable.
 @end defmac
 
 @defmac KPSE_COND_WIN32
@@ -1258,7 +1303,7 @@
 
 @defmac KPSE_WIN32_CALL
 @pindex callexe.c
-Call @code{KPSE_COND_WIN32}, check if the file
+Call @code{KPSE_COND_WIN32} and check if the file
 @file{texk/texlive/w32_wrapper/callexe.c} exists; if it does, create a
 symlink in the build tree.  Compiling @file{callexe.c} with
 @code{-DEXEPROG='"@var{foo}.exe"'} and installing @file{callexe.exe}
@@ -1288,9 +1333,9 @@
 
 @pindex png @r{library}
 @pindex libpng @r{library}
-This generic library uses the source tree in, e.g., the subdirectory
- at file{libpng-src/} with all modifications for TL recorded in
- at file{TLpatches/*}.  The @file{configure.ac} fragment
+The ``generic'' @code{png} library uses the source tree in the
+subdirectory @file{libpng-src/}, with all modifications for TL
+recorded in @file{TLpatches/*}.  The @file{configure.ac} fragment
 @file{ac/withenable.ac} contains
 
 @example
@@ -1297,8 +1342,8 @@
 KPSE_WITH_LIB([libpng], [zlib])
 @end example
 
- at noindent specifying the module name, and indicating the dependency on
- at code{zlib}.  A third literal argument @code{tree} would specify that
+ at noindent to specify the module name and indicate the dependency on
+ at code{zlib}.  A third literal argument `@code{tree}' would specify that
 the library from the @TL{} tree cannot be replaced by a system
 version.  That not being the case here, a second fragment
 @file{ac/libpng.ac} contains
@@ -1324,18 +1369,22 @@
 @findex KPSE_TRY_LIBXX
 @noindent which Autoconf uses to verify the usability of a system
 version with C code.  The analogous macro @code{KPSE_TRY_LIBXX} would
-check using C++ code.  These fragments are included by
- at file{configure.ac} at the top level.
+check using C++.  These fragments are included by the
+ at file{configure.ac} at the top level of TL
+(@code{Build/source/configure.ac}).
 
-For this library, among many other modules, a proxy build system for
-TL is used (@file{configure.ac}, @file{Makefile.am}, and
- at file{include/Makefile.am}), ignoring the distributed one.
-Consequently, a few generated files and auxiliary scripts are removed
-from the distributed source tree.  The public headers @file{png.h},
- at file{pngconf.h}, and @file{pnglibconf.h} are ``installed'' (as
-symlinks) under @file{include/} in the build tree exactly as they are
-for a system version under, e.g., @file{/usr/include/}.
+ at cindex proxy build system
+For this library, like many other modules, a proxy build system for TL
+is used, consisting of our own @file{configure.ac},
+ at file{Makefile.am}, @file{include/Makefile.am}; the distributed build
+system is not used.  (Consequently, a few generated files and
+auxiliary scripts are removed from the distributed source tree.)
 
+The public headers @file{png.h}, @file{pngconf.h}, and
+ at file{pnglibconf.h} are ``installed'' (as symlinks) under
+ at file{include/} in the build tree exactly as they are for a system
+version under, e.g., @file{/usr/include/}.
+
 @pindex kpse-libpng-flags.m4
 @vindex KPSE_LIBPNG_FLAGS
 The module is supplemented by the file @file{m4/kpse-libpng-flags.m4}
@@ -1344,11 +1393,11 @@
 @code{make} variables @code{LIBPNG_INCLUDES} for use in
 @code{CPPFLAGS}, @code{LIBPNG_LIBS} for use in @code{LDADD},
 @code{LIBPNG_DEPEND} for use as dependencies, and @code{LIBPNG_RULE}
-defining @code{make} rules to rebuild the library.
+for the @code{make} rules to rebuild the library.
 
 @file{m4/kpse-libpng-flags.m4} also supplies the configure option
- at code{--with-system-libpng} and uses @code{pkg-config} to determine
-the flags required for the system library.
+ at code{--with-system-libpng}, which then uses @code{pkg-config} to
+determine the flags required for the system library.
 
 
 @node @code{zlib} library
@@ -1369,13 +1418,18 @@
 @subsection The @code{freetype} library in @file{libs/freetype2}
 
 @pindex freetype @r{library}
+ at cindex wrapper build system
 
+This module uses a wrapper build system.  In contrast to the proxy
+build described earlier, the wrapper build has an almost trivial
+ at file{configure.ac} and a @file{Makefile.am} which invokes the
+ at code{configure} and @code{make} in the distributed source, followed
+by @code{make install} with the TL build tree as destination.  In
+other words, this actually uses the build system provided by upstream
+(possibly patched).
+
 @pindex freetype-config
-This module uses a wrapper build system with an almost trivial
- at file{configure.ac} and with a @file{Makefile.am} that invokes
- at code{configure} and @code{make} for the distributed source, followed
-by @code{make install} with the build tree as destination.  The flags
-required for the system library are obtained through
+The flags required for the system library are obtained through
 @code{freetype-config}.
 
 
@@ -1385,32 +1439,34 @@
 @pindex kpathsea @r{library}
 
 This is one of the @TeX{}-specific libraries that are maintained as
-part of @TL{} (@pxref{,,, kpathsea, Kpathsea}).  Despite being a core
-part of the @TeX{} system, it is not a terribly special case in the
-infrastructure.  The @TeX{} libraries are Libtool libraries (static
-and/or shared) and are installed by @code{make install} together with
-the programs.  They are, however, not part of the TL DVD as
-distributed by @TeX{} user groups, and have never been officially
-released for standalone use.
+part of @TL{} (@pxref{,,, kpathsea, Kpathsea
+ at r{(@url{tug.org/kpathsea})}}); the other is @code{ptexenc}.  These
+ at TeX{} libraries are Libtool libraries (static and/or shared) and are
+installed by @code{make install} together with the programs.  They
+are, however, not part of the TL DVD as distributed by @TeX{} user
+groups, and have never been officially released for standalone use.
 
 @pindex --with-system-kpathsea
-It is possible, and perhaps even useful for distro builds (@pxref{Distro
-builds}), to specify the configure option @code{--with-system-kpathsea} in
-order to use a system version of the library.  Programs outside the TL tree
-should use @code{pkg-config} for the required flags.
+It is possible, and probably useful for distro builds (@pxref{Distro
+builds}), to specify the configure option
+ at code{--with-system-kpathsea} in order to use a system version of the
+library.  Programs outside the TL tree should use @code{pkg-config}
+for the required flags.
 
 @pindex kpathsea.ac
 @pindex mktex.ac
 @vindex --enable-mktextfm-default
 @pindex mktextfm
-In addition to @file{ac/withenable.ac} and @file{ac/kpathsea.ac} there
-is a third fragment @file{ac/mktex.ac} included by both
- at file{ac/withenable.ac} and @file{configure.ac} that supplies
-configure options such as @code{--enable-mktextfm-default}, which
-determine the compile time default of whether or not to run
- at code{mktextfm} to generate a missing @file{.tfm} file.  In any case,
+In addition to @file{kpathsea/ac/withenable.ac} and
+ at file{kpathsea/ac/kpathsea.ac} here there is a third fragment
+ at file{kpathsea.ac/mktex.ac}, included by both @file{withenable.ac} and
+ at file{configure.ac}, which supplies configure options such as
+ at code{--enable-mktextfm-default}. These determine the compile time
+default of whether or not to run @code{mktextfm} (and similar) to
+generate a missing @file{.tfm} (or whatever) file.  In any case,
 however, the command line options @code{-mktex=tfm} or
- at code{-no-mktex=tfm} for the @TeX{}-like engines override this default.
+ at code{-no-mktex=tfm} for the @TeX{}-like engines override this
+default.
 
 
 @node Program modules
@@ -1434,10 +1490,10 @@
 
 @pindex t1utils @r{package}
 
-Once again we use the distributed source tree @file{t1utils-src}
-with modifications documented in @file{TLpatches/*} and
-a proxy build system consisting of @file{configure.ac} and
- at file{Makefile.am}.  The fragment @file{ac/withenable.ac} contains
+Here we use the distributed source tree @file{t1utils-src} with
+modifications documented in @file{TLpatches/*} and a proxy build
+system consisting of @file{configure.ac} and @file{Makefile.am}.  The
+fragment @file{ac/withenable.ac} contains
 
 @example
 KPSE_ENABLE_PROG([t1utils])
@@ -1453,15 +1509,17 @@
 @pindex xindy
 
 This module uses the distributed source tree @file{xindy-src/} with
-modifications documented in @file{TLpatches/*}, a proxy
- at file{configure.ac}, and a wrapper @file{Makefile.am} that descends
-into @file{xindy-src}.  The @code{xindy} build requires a @file{make}
-that supports a @code{VPATH} build, can handle all targets, and do not
-refer to @code{$@{top_srcdir@}} or @code{$@{top_builddir@}}.  The
-fragment @code{ac/withenable.ac} contains
+modifications documented in @file{TLpatches/*}, and a wrapper
+ at file{configure.ac} and @file{Makefile.am} that descends into
+ at file{xindy-src}.
 
+The @code{xindy} build requires a @file{make} that supports a
+ at code{VPATH} build, can handle all targets, and do not refer to
+ at code{$@{top_srcdir@}} or @code{$@{top_builddir@}}.  The fragment
+ at code{xindy/ac/withenable.ac} contains
+
 @example
-KPSE_ENABLE_PROG([xindy], , [disable native])
+KPSE_ENABLE_PROG([xindy], , [disable])
 m4_include(kpse_TL[utils/xindy/ac/xindy.ac])
 m4_include(kpse_TL[utils/xindy/ac/clisp.ac])
 @end example
@@ -1468,14 +1526,14 @@
 
 @noindent where @code{disable} in the third argument indicates that
 @code{xindy} is only built if explicitly enabled by the user with
- at code{configure --enable-xindy} (the need for @code{clisp} is too
-painful to require by default), and @code{native} disallows cross
-compilation.  The additional fragments @file{ac/xindy.ac} and
- at file{ac/clisp.ac} specify more @code{configure} options to be seen at
-the top level with @file{ac/xindy.ac} also included by
- at file{configure.ac}.
+ at code{configure --enable-xindy} (the need for @code{clisp} makes it
+too painful to enable by default).
 
+The additional fragments @file{ac/xindy.ac} and @file{ac/clisp.ac}
+specify more @code{configure} options to be seen at the top level,
+with @file{ac/xindy.ac} also included by @file{configure.ac}.
 
+
 @node @code{xdvik} package
 @subsection The @code{xdvik} package in @file{texk/xdvik}
 
@@ -1482,8 +1540,8 @@
 @pindex xdvik
 
 This package is maintained as part of the @TL{} tree with sources in
-its top level directory and the subdirectory @file{gui}.  The fragment
- at code{ac/withenable.ac} contains
+its own directory (@file{texk/xdvik/}).  The fragment
+ at code{xdvik/ac/withenable.ac} contains
 
 @example
 dnl extra_dirs = texk/xdvik/squeeze
@@ -1493,18 +1551,18 @@
 
 @pindex squeeze/configure.ac
 @cindex cross compilation, with host binary
- at noindent thus specifying the dependency on the @code{kpathsea},
+ at noindent thus specifying dependencies on the @code{kpathsea},
 @code{freetype}, and X11 libraries.  The M4 comment (following
 @code{dnl}) signals the subsidiary @file{squeeze/configure.ac}.  This
 is needed because the main executable @file{xdvi-bin} (to be installed
 as, e.g., @file{xdvi-xaw}) is for the @code{host} system whereas the
 auxiliary program @file{squeeze/squeeze} has to run on the
- at code{build} system and in a cross compilation they differ.
+ at code{build} system; in a cross compilation, these differ.
 
 @vindex --with-xdvi-x-toolkit
 The additional fragment @code{ac/xdvik.ac} is also included by
 @file{configure.ac} and supplies the configure option
- at code{--with-xdvi-x-toolkit} also seen at the top-level.
+ at code{--with-xdvi-x-toolkit} also seen at the top level.
 
 
 @node @code{asymptote}
@@ -1518,7 +1576,7 @@
 but due to its complexity and prerequisites (e.g., OpenGL) it is
 not part of the TL build system.  These programs must be built and
 installed independently, but are included on the TL DVD together with
-their support files.
+their support files.  See @url{https://tug.org/build.html#asymptote}.
 
 
 @node Extending @TL{}
@@ -1531,12 +1589,12 @@
 TL build system.
 
 In any case, a new package directory @file{foo} should contain the
-original sources, as modified for TL, in @file{foo/foo-src}, and the
-changes should be documented in @file{foo/TLpatches/*}; changes should
-also be submitted upstream whenever reasonable, of course.  In
-addition, @file{foo/} will need the usual Automake build-related files
-(@file{configure.ac}, @file{Makefile.am}, etc.  Please keep a
- at file{ChangeLog} for all TL changes.
+original sources, modified only with changes necessary for TL, in
+ at file{foo/foo-src}. The changes should be documented in
+ at file{foo/TLpatches/*}, and also be submitted upstream whenever
+reasonable.  In addition, @file{foo/} will need the usual Automake
+build-related files (@file{configure.ac}, @file{Makefile.am}, etc.
+Please maintain @file{foo/ChangeLog} for all TL changes.
 
 @menu
 * Adding a new program module::
@@ -1575,28 +1633,28 @@
 @enumerate
 @item a list of required libraries from the TL tree;
 
- at item a list of options (@code{disable} if this module is not to be
+ at item a list of options: @code{disable} if this module is not to be
 built without the configure option @code{--enable- at var{prog}},
 @code{native} if cross compilation is not possible, @code{x} if the
-program requires X11 libraries);
+program requires X11 libraries;
 
 @item a comment added to the help text for the @code{configure}
 option @code{--enable- at var{prog}} or @code{--disable- at var{prog}}.
 @end enumerate
 
-If the module requires specific configure options to be seen at the
-top level, they should be defined in an additional fragment
+If the module requires specific @code{configure} options to be seen at
+the top level, they should be defined in an additional fragment
 @file{ac/@var{prog}.ac} included from @file{ac/withenable.ac} and
 @file{configure.ac}.
 
 Usually, the new program is maintained somewhere outside of @TL{}.  In
-that case, we put the upstream sources into a subdirectory
+that case, as above, we put the upstream sources into a subdirectory
 @file{@var{prog}-src} (e.g., @file{utils/newprog/newprog-src}).  We do
-not run @code{configure} in this original @code{...-src} directory,
-only in our own directory, but we do compile using the source files in
- at code{...-src}.
+not typically run @code{configure} in this original @code{...-src}
+directory, but only in our own directory; but we do compile using the
+source files in @code{...-src}.
 
-So, these are the files that we must generally create:
+So, to summarize the files that we must (usually) create:
 
 @table @file
 @item ac/withenable.ac
@@ -1625,10 +1683,10 @@
 
 Then, run GNU @code{autoreconf} in the new directory (@pxref{Build
 system tools}).  After that works, @code{svn add} the necessary files,
-notably @file{Makefile.in aclocal.m4 configure}, and @code{svn:ignore}
-the Automake cache @file{autom4te.cache}.  (This is so people checking
-out the TL source tree do not have to run any autotools, but can
-simply run @code{configure}.)
+including the generated @file{Makefile.in aclocal.m4 configure}, and
+ at code{svn:ignore} the Automake cache @file{autom4te.cache}.  (This is
+so people checking out the TL source tree do not have to run any
+autotools, but can simply run @code{configure}.)
 
 Then, run the TL tool @code{reautoconf} in the top-level TL
 @code{source/} directory, to incorporate the new program into the
@@ -1651,7 +1709,7 @@
 @vindex kpse_libs_pkgs
 A generic library module in a subdirectory @file{libs/@var{lib}} must
 not depend on @TeX{}-specific libraries, by definition.  It is
-included by adding its name @file{@var{lib}} to the M4 list
+included by adding its name @file{@var{lib}} to the M4 macro
 @code{kpse_libs_pkgs} in @file{m4/kpse-pkgs.m4}---before any other
 libraries from the @TL{} tree on which it depends.
 
@@ -1662,9 +1720,9 @@
 that contains the M4 macro @code{KPSE_WITH_LIB} defined in
 @file{m4/kpse-setup.m4} with @code{@var{lib}} as the mandatory first
 argument and two optional arguments: a list of required libraries from
-the TL tree, and a list of options (currently there is only one:
-specify @code{tree} if this library cannot be replaced by a system
-version).
+the TL tree, and a list of options: for libraries, currently there is
+only one---specify @code{tree} if this library cannot be replaced by a
+system version.
 
 @findex KPSE_TRY_LIB
 @findex KPSE_TRY_LIBXX
@@ -1691,7 +1749,7 @@
 If a system library is allowed, @code{KPSE_ at var{LIB}_FLAGS} also
 provides the configure option @code{--with-system- at var{lib}} and uses
 the additional M4 macro @code{KPSE_ at var{LIB}_SYSTEM_FLAGS} to generate
-the @code{make} variables for a system library.  Furthermore the
+the @code{make} variables for a system library.  In addition, the
 definition of the M4 macro @code{KPSE_ALL_SYSTEM_FLAGS} in
 @file{m4/kpse-pkgs.m4} must be extended by the line:@*@ @ @
 @code{AC_REQUIRE([KPSE_ at var{LIB}_SYSTEM_FLAGS])}
@@ -1713,8 +1771,8 @@
 @itemize @bullet
 @item
 @vindex kpse_texlibs_pkgs
-The library name @code{@var{lib}} is added to the M4 list
- at code{kpse_texlibs_pkgs} also in @file{m4/kpse-pkgs.m4}.
+The library name @code{@var{lib}} is added to the M4 macro
+ at code{kpse_texlibs_pkgs}, which is also in @file{m4/kpse-pkgs.m4}.
 
 @item
 @findex KPSE_WITH_TEXLIB
@@ -1734,11 +1792,11 @@
 important module-specific ones, whereas, e.g.,@*@ @ @
 @code{texk/lcdf-typetools/configure --help}@* also displays the
 @code{lcdf-typetools} specific options, which are not shown at the
-top-level.
+top level.
 
 @cindex environment variables, for @code{configure}
 The help text also mentions several influential environment variables,
-but for @TL{} it is better to specify them as assigments on the
+but for @TL{} it is better to specify them as assignments on the
 command line.
 
 The @file{./Build} script used to make the binaries shipped with @TL{}
@@ -1745,7 +1803,7 @@
 invokes the top-level @code{configure} with a few additional options
 (@pxref{Building}).  The defaults discussed below are those for the
 actual @code{configure} script; invoking @code{configure} via
- at file{./Build} may yield different results.
+ at file{./Build} yields different results.
 
 Defaults for most options are set at the top level and propagated
 explicitly to all subdirectories.  Options specified on the command
@@ -1793,16 +1851,16 @@
 and enforces @code{--disable-shared}.
 
 If building TL for a GNU/Linux or other distribution, this should be
-disabled and system versions of most libraries would be used
-(@pxref{Distro builds}).  This may fail without GNU @code{make}, but
-will be tried regardless.
+disabled and system versions of most libraries should be used
+(@pxref{Distro builds}).
 
 @vindex --enable-texlive-build
 A related option, @code{--enable-texlive-build}, is automatically
 passed to all subdirectories (and cannot be disabled).  Subdirectories
 that can also be built independently from the TL tree (such as
- at file{utils/xindy} and @file{texk/dvipng}) can use this option, e.g.,
-to choose TL-specific installation paths.
+ at file{utils/xindy} and @file{texk/dvipng}) but cooperate with TL can
+use this option to enable TL-specific adaptations, such as
+installation paths.
 
 
 @node @code{--prefix} @code{--bindir} @dots{}
@@ -1826,10 +1884,10 @@
 @vindex --disable-largefile
 @cindex large file support
 @cindex LFS (large file support)
-Omit large file support (LFS), needed on most 32-bit Unix systems for
-files with 2GB or more.  Regardless of this, the size of @code{DVI}
-and @code{GF} files must always be @math{<2}GB, due to the file format
-specifications.
+Omit large file support (LFS), which is needed on most 32-bit Unix
+systems for files with 2GB or more.  Regardless of this option, the
+size of @code{DVI} and @code{GF} files must always be @math{<2}GB, due
+to the file format specifications.
 
 @cindex size of PDF and PS files
 @cindex PDF files, size of
@@ -1854,25 +1912,21 @@
 @subsection @code{--enable-compiler-warnings=}@var{level}
 
 @vindex --enable-compiler-warnings=@var{level}
-Enable various levels of compiler warnings for (Objective) C and C++:
-the @var{level} value can be one of: @code{no min yes max all}.
-The default is @code{yes} in @code{maintainer-mode} (see below) and
- at code{min} otherwise.  This option defines
- at code{WARNING_[OBJ]C[XX]FLAGS} but these flags are not used in all
-library and program modules.  Using them should help to resolve
-portability problems.
+Enable various levels of compiler warnings for C, C++, and/or
+Objective at tie{}C: the @var{level} value can be one of: @code{no min
+yes max all}.  The default is @code{yes} in @code{maintainer-mode}
+(see below) and @code{min} otherwise.  This option defines the
+variables @code{WARNING_[OBJ]C[XX]FLAGS}, but these variables are not
+consistently used in all library and program modules.  At present,
+these warning flags assume options from the GNU compilers.
 
-At present, these warning flags are only defined for the GNU compilers
-but flags for other compilers could be added when needed.
 
-
 @node @code{--enable-cxx-runtime-hack}
 @subsection @code{--enable-cxx-runtime-hack}
 
-If enabled (as it is for the native TL build) and when using
- at code{g++}, try to statically link with @code{libstdc++}, somewhat
-improving portability of the resulting binary.  @xref{Macros for
-compilers}.
+If enabled (as it is for the native TL build), when using @code{g++},
+try to statically link with @code{libstdc++}, thus improving
+portability of the resulting binary.  @xref{Macros for compilers}.
 
 
 @node @code{--enable-maintainer-mode}
@@ -1893,8 +1947,9 @@
 @vindex exec_prefix
 @vindex --bindir configure @r{option}
 @vindex --libdir configure @r{option}
-If enabled and @code{--bindir=@var{dir}} or @code{--libdir=@var{dir}}
-are not specified, install executables and libraries in per-platform
+If enabled (as it is for the native TL build) and
+ at code{--bindir=@var{dir}} or @code{--libdir=@var{dir}} are not
+specified, install executables and libraries in per-platform
 subdirectories of @file{@var{eprefix}/bin} and
 @file{@var{eprefix}/lib} where @var{eprefix} is the value given or
 implied for @code{exec_prefix}.  In any case, the values for
@@ -1915,11 +1970,12 @@
 @subsection @code{--enable-silent-rules}
 
 @vindex --enable-silent-rules
+ at cindex @code{make} rules, verbose vs.@: silent
 Enable the use of less verbose build rules.  When using GNU
- at code{make} (or another @code{make} implementation supporting nested
-variable expansions), you can specify @code{V=1} on the @code{make} command
-line to get more verbosity, or @code{V=0} to get less, regardless of
-this option.
+ at code{make} (or any @code{make} implementation supporting nested
+variable expansions), you can specify @code{V=1} on the @code{make}
+command line to get more verbosity, or @code{V=0} to get less,
+regardless of this option.
 
 
 @node @code{--without-ln-s}
@@ -1928,7 +1984,7 @@
 @vindex --without-ln-s
 Required when using a system without a working @code{ln -s} to build
 binaries for a Unix-like system.  However, @code{make install} will
-not create anything useful and might even fail.
+not create anything useful, and might fail.
 
 
 @node @code{--without-x}
@@ -1963,7 +2019,7 @@
 
 @vindex --enable- at var{prog}
 @vindex --disable- at var{prog}
-Do or do not build and install the program(s) of the module @code{@var{prog}}.
+Do or do not build and install the program(s) of module @code{@var{prog}}.
 
 
 @node @code{--disable-all-pkgs}
@@ -1975,11 +2031,7 @@
 program, which is specified with an additional @code{--enable} option,
 e.g., @code{--enable-dvipdfm-x}.  It's still simplest to check out and
 configure the whole source tree, but at least only the program you are
-interested in, and its dependencies, are built.  The @code{configure}
-will generally take less than a minute with everything disabled.  (It
-is a good idea to run @code{make check} after doing this, and after
-making any changes, to ensure that whatever tests have been written
-still pass.)
+interested in, and its dependencies, are built. @xref{Build one package}.
 
 Without this option, all modules are built except those that are
 explicitly disabled or specify @code{disable} in their
@@ -1993,14 +2045,14 @@
 
 @vindex --with-banner-add=@var{str}
 @noindent @code{--with-banner-add=@var{str}}@*Add @code{@var{str}} to the
-default version string (@code{TeX Live @var{year}} or @code{Web2C
- at var{year}}) appended to banner lines.  This is ignored for a native
-TL build, but distro builds should specify, e.g.,
+default version string (which is `@code{TeX Live @var{year}}' or
+`@code{Web2C @var{year}}') appended to banner lines.  This is ignored
+for a native TL build, but distro builds should specify, e.g.,
 @code{/@var{SomeDistro}}.
 
 @vindex --with-editor=@var{cmd}
 @noindent @code{--with-editor=@var{cmd}}@*Specify the command
- at code{@var{cmd}} to invoke from the @code{e} option of @TeX{}-like engines,
+ at code{@var{cmd}} to invoke from the @code{e} option of @TeX{} and friends,
 replacing the default @code{vi +%d '%s'} for Unix or @code{texworks
 --position=%d "%s"} for Windows.
 
@@ -2044,7 +2096,7 @@
 defined in the fragment @file{texk/web2c/ac/web2c.ac}).
 
 @vindex --disable-web-progs
- at noindent @code{--disable-web-progs}@*Do not build the core WEB programs
+ at noindent @code{--disable-web-progs}@*Do not build the original WEB programs
 @file{bibtex}, @dots{}, @file{weave}.  Useful if, e.g., you only want
 to (re)build some engines.
 
@@ -2057,6 +2109,8 @@
 
 @vindex --enable-libtool-hack
 @pindex libtool at r{, hack for avoiding excessive linking}
+ at pindex libfontconfig at r{, hack for avoiding linking dependencies}
+ at pindex libexpat at r{, dependency of @code{libfontconfig}}
 @noindent @code{--enable-libtool-hack}@*
 If enabled (which is the default for all platforms), prevents
 @code{libtool} from linking explicitly with dependencies of
@@ -2063,8 +2117,9 @@
 @file{libfontconfig} such as @file{libexpat}.
 
 @vindex --enable-*win @r{for Metafont window support}
- at noindent @code{--enable-*win}@*Include various types of other window
-support for Metafont (EPSF output, @code{mftalk}, old terminals, @dots{}).
+ at noindent @code{--enable-*win}@*Include various types of non-X window
+support for Metafont (EPSF output, @code{mftalk}, old graphics
+terminals, @dots{}).
 
 @vindex --enable-tex-synctex
 @vindex --disable-etex-synctex
@@ -2071,8 +2126,8 @@
 @cindex synctex
 @noindent @code{--enable-tex-synctex}, @code{--disable-etex-synctex},
 @dots{}@*Build the @TeX{} engines with or without @code{SyncTeX}
-support; ignored for a native @TL{} build, defaults are again defined
-in @file{texk/web2c/ac/web2c.ac}.
+support; ignored for a native @TL{} build.  Defaults are defined in
+ at file{texk/web2c/ac/web2c.ac}.
 
 @vindex --disable-synctex
 @cindex synctex
@@ -2102,6 +2157,7 @@
 @subsection Configure options for @file{texk/dvipdfm-x}
 
 @cindex @code{configure} options, for @code{dvipdfm-x}
+ at pindex dvipdfm-x
 @pindex dvipdfmx
 @pindex xdvipdfmx
 
@@ -2114,7 +2170,7 @@
 
 @vindex --disable-dvipdfmx
 @noindent @code{--disable-dvipdfmx}@*Do not build the @file{dvipdfmx}
-program with the @file{dvipdfm} symlink.
+program or make the @file{dvipdfm} symlink.
 
 @vindex --disable-xdvipdfmx
 @noindent @code{--disable-xdvipdfmx}@*Do not build the @file{xdvipdfmx}
@@ -2131,7 +2187,7 @@
 @noindent @code{--with-system-libgs}@*Build @file{dvisvgm} using installed
 Ghostscript (@code{gs}) headers and library (not allowed for a native
 TL build).  The default is to load the @code{gs} library at runtime if
-possible, or otherwise disable support for PostScript specials.
+possible, else to disable support for PostScript specials.
 
 @vindex --without-libgs
 @noindent @code{--without-libgs}@*Build @file{dvisvgm} without PostScript
@@ -2162,8 +2218,9 @@
 @pindex xdvik
 
 @vindex --with-gs=@var{filename}
+ at cindex Ghostscript location for Xdvik
 @noindent @code{--with-gs=@var{filename}}@*Hardwire the location of Ghostscript
-(@file{gs}).
+(@file{gs}) as called by Xdvik.
 
 @vindex --with-xdvi-x-toolkit=@var{kit}
 @pindex motif
@@ -2174,9 +2231,9 @@
 
 @vindex --enable-xi2-scrolling
 @pindex XInput
- at pindex scrolling
+ at pindex scrolling, smooth
 @noindent @code{--enable-xi2-scrolling}@*Use XInput 2.1 ``smooth scrolling''
-if available.  (default: yes, except for a native TL build).
+if available (default: yes, except for a native TL build).
 
 
 @node Configure options for @file{utils/xindy}
@@ -2197,13 +2254,13 @@
 @pindex lisp.run at r{,} lisp.exe
 @cindex CLISP
 @noindent @code{--with-clisp-runtime=@var{filename}}@*Specifies the
-Full path for the CLISP runtime file (@file{lisp.run} or
+full path for the Clisp runtime file (@file{lisp.run} or
 @file{lisp.exe}) to be installed.  When specified as @code{default}
 (the default for a native TL build) the path is determined by the
-CLISP executable; the value @code{system} (not allowed for a native TL
-build, but the default for a non-native one) indicates that
- at file{xindy} will use the installed version of @file{clisp} (which
-must be identical to the one used to build @file{xindy}).
+Clisp executable; the value @code{system} (not allowed for a native TL
+build, but the default otherwise) indicates that @file{xindy} will use
+the installed version of @file{clisp} (which must be identical to the
+one used to build @file{xindy}).
 
 
 @node Library-specific configure options
@@ -2220,7 +2277,7 @@
 Use an installed (system) version of the library @code{@var{lib}};
 this option exists for most libraries, but is not allowed for a native
 TL build.  Using a system version implies also using the system
-versions of all libraries (if any) that @var{lib} depends on.
+versions of all libraries that @var{lib} depends on.
 
 @vindex --with- at var{lib}-includes=@var{dir}@r{,} -libdir
 For many libraries @code{--with- at var{lib}-includes=@var{dir}} and
@@ -2244,7 +2301,7 @@
 
 @noindent @code{--enable- at var{cmd}-default},
 @code{--disable- at var{cmd}-default}@*Determine the compile time default
-whether or not to run @var{cmd}, one of:
+for whether or not to run @var{cmd}, which is one of:
 @table @code
 @item mkocp
 (Omega compiled translation process file)
@@ -2263,9 +2320,9 @@
 @end table
 
 @noindent to generate the specified type of file dynamically.
-The default can be overridden by the user in any case.
+The default can be overridden by the user in any case
+(@pxref{@code{kpathsea} library}).
 
-
 @node Configure options for system @code{poppler}
 @subsection Configure options for system @code{poppler}
 
@@ -2273,10 +2330,10 @@
 
 @pindex poppler
 @pindex xpdf @r{as library}
-Building Lua at TeX{} (or LuaJIT at TeX{}) and Xe at TeX{} requires
- at code{poppler}, either from the TL tree or system headers and
-library.  Building pdf at TeX{} requires either @code{xpdf} from
-the @TL{} tree or system @code{poppler} headers and library.
+Building Xe at TeX{} requires @code{poppler}, either from the TL tree or
+system headers and library.  Building pdf at TeX{} requires either
+ at code{xpdf} from the @TL{} tree or system @code{poppler} headers and
+library.
 
 @vindex --with-system-poppler
 @noindent @code{--with-system-poppler}@*Use a system version (0.18 or
@@ -2284,7 +2341,7 @@
 and use @file{pkg-config} to obtain the required flags.
 
 @vindex --with-system-xpdf
- at noindent @code{--with-system-xpdf}@*Use a system version (0.12 or better)
+ at noindent @code{--with-system-xpdf}@*Use a system version (0.12 or newer)
 of @code{poppler} (and @file{pkg-config}) for pdf at TeX{} instead of
 @code{xpdf} from the TL tree.  @xref{@code{--disable-largefile}}.
 
@@ -2305,7 +2362,7 @@
 @itemx CPPFLAGS
 And plenty more.  As usual with Autoconf, these variables specify the
 name (or full path) of compilers, preprocessor flags, and similar.
- at xref{Preset Output Variables,, autoconf, GNU Autoconf}.
+ at xref{Preset Output Variables,,, autoconf, GNU Autoconf}.
 
 @item CLISP
 @pindex clisp
@@ -2322,7 +2379,7 @@
 These specify the name (or path) for the @file{freetype-config},
 @file{icu-config}, and @file{pkg-config} commands used to determine the
 flags required for system versions of @file{libfreetype}, the ICU
-libraries, or many other libraries.
+libraries, and other libraries, respectively.
 
 @item KPSEWHICH
 @pindex kpsewhich
@@ -2350,14 +2407,14 @@
 @cindex coding conventions
 @cindex conventions, coding
 
-Ideally, building all of @TL{} with @code{--enable-compiler-warnings=max}
-should produce no (GCC) compiler warnings at all.  In spite of
-considerable efforts into that direction we are still far from that goal and
-there are reasons that we may never fully reach it.  Below are some rules
-about declarations of functions or variables and the use of @code{const}. 
-These rules should be applied to most of the @TL{} tree, the exception
-being code that is maintained independently and whose maintainers
-don't want to accept patches.
+Ideally, building all of @TL{} with
+ at code{--enable-compiler-warnings=max} should produce no (GCC) compiler
+warnings at all.  In spite of considerable efforts into that direction
+we are still far from that goal and there are reasons that we may
+never fully reach it.  Below are some rules about declarations of
+functions or variables and the use of @code{const}.  These rules
+should be applied to the code maintained in the @TL{} tree and for
+other packages whose maintainers are willing to accept patches.
 
 @menu
 * Declarations and definitions::
@@ -2371,6 +2428,7 @@
 @cindex declarations and definitions, in source code
 @cindex source code declarations
 @cindex ANSI C
+ at cindex declarations before statements, avoiding
 @cindex C, ANSI, required
 @cindex C99, avoided
 
@@ -2382,7 +2440,7 @@
 no parameters).  On the other hand, TL is built for a wide variety of
 systems, not all of which support the C99 standard.  Therefore using
 C99 features should be avoided if that can easily be done.  In
-particular C code must not contain declarations after statements or
+particular, C code must not contain declarations after statements or
 C++-style comments.
 
 @pindex chktex
@@ -2392,8 +2450,8 @@
 For example, the module @file{texk/chktex} uses the C99 function
 @code{stpcpy()} that may or may not be available on a particular
 system.  It uses @code{AC_CHECK_DECLS([stpcpy])} in
- at file{configure.ac} to test this, and provides the perhaps slightly
-less efficient alternative
+ at file{configure.ac} to test this, and provides a perhaps
+less efficient alternative (in the file @file{Utility.h}):
 
 @example
 #if !(defined HAVE_DECL_STPCPY && HAVE_DECL_STPCPY)
@@ -2404,14 +2462,11 @@
 #endif
 @end example
 
- at noindent in the file @file{Utility.h}.
-
-
 @subsubheading Static functions
 
 @cindex @code{static} functions
 Functions used in only one file should be declared @code{static}; they
-require no prototype except as forward declaration.
+require no prototype except in forward declarations.
 
 @subsubheading Extern functions
 
@@ -2457,8 +2512,8 @@
 Getting all @code{const} qualifiers right can get quite involved but
 can almost always be done.  There are only a couple notable
 exceptions: the X11 headers are full of declarations that ought to use
- at code{const} but do not, and the same is true to some extent for
- at file{libfreetype} (but, thankfully, not for @code{zlib} nowadays).
+ at code{const} but do not; at one time, @file{libfreetype} also did not
+fully specify @code{const}, but this has not been checked recently.
 
 @subsubheading What must be avoided with @code{const}
 
@@ -2466,13 +2521,13 @@
 @cindex discards qualifiers warning
 The GCC compiler warnings ``assignment discards qualifiers at dots{}''
 and analogous warnings for ``initialization'', ``passing arg'', or
-``return'' must be strenously avoided in our own code.  The only
-exception is when they are caused by X11 headers or macros or other
-third party code.
+``return'' must be strenuously avoided in our own code.  The only
+exception is when they are caused by X11 declarations or other third
+party code.
 
 @subsubheading What should be avoided with @code{const}
 
- at cindex type cast, avoiding
+ at cindex type cast from const, avoiding
 A type cast, e.g., from @code{const char*} to @code{char*} does not
 solve any problems; depending on warning options, it may only hide
 them.  Therefore such casts should be avoided whenever possible and
@@ -2483,14 +2538,12 @@
 @node Continuous integration
 @chapter Continuous integration
 
- at cindex ci
 @cindex continuous integration
 @cindex Travis-CI
 
-Overview: the sources of @TL{} are subjected to continuous integration
-testing on Travis-CI
-(@url{https://travis-ci.org/TeX-Live/texlive-source}) via a git-svn
-mirror of the sources that is pushed to Github
+The @TL{} sources are subjected to continuous integration testing on
+Travis-CI (@url{https://travis-ci.org/TeX-Live/texlive-source}) via a
+git-svn mirror of the sources that is pushed to Github
 (@url{https://github.com/TeX-Live/texlive-source}). The git-svn mirror
 is updated (currently) at 30 minute intervals, and only the last
 commit pushed is tested on Travis-CI.
@@ -2501,13 +2554,15 @@
 * CI testing on Travis-CI::
 @end menu
 
+
 @node Transfer from Subversion to Github
 @section Transfer from Subversion to Github
 
-git-svn (@url{https://git-scm.com/docs/git-svn}) is used to check out
-the subtree @code{Build/source} of the Subversion repository. The
-author index file used is not maintained in either Git or Subversion
-but can be provided on request.
+ at pindex git-svn
+The git-svn program (@url{https://git-scm.com/docs/git-svn}) is used
+to check out the subtree @code{Build/source} of the canonical
+Subversion repository.  The author index file used is not maintained
+in either Git or Subversion but can be provided on request.
 
 @c TODO what should we do here with the author index file? It contains a
 @c mapping from subversion names to name/email as shown in git.
@@ -2514,38 +2569,39 @@
 
 The initial checkout was done by invoking
 @example
-git svn --authors-file usermap clone svn://USER@@tug.org/texlive/trunk/Build/source
+git svn --authors-file usermap clone \
+  svn://@var{user}@@tug.org/texlive/trunk/Build/source
 @end example
 
 @noindent where the @code{usermap} file maps Subversion user names to
-name and emails of the authors. If no user account at @url{tug.org} is
-available, anonymous checkout is possible, too:
+name and emails of the authors.  Anonymous checkout is also possible:
 @example
-git svn --authors-file usermap clone svn://tug.org/texlive/trunk/Build/source
+git svn --authors-file usermap clone \
+  svn://tug.org/texlive/trunk/Build/source
 @end example
 
 In the following, we will use @emph{admin} to refer to a user who has
 read/write access to the @TL{} subversion repository, and is also an
-administrator of the @code{TeX-Live} Team on Github. The above initial
-checkout has been carried out by @emph{admin} on the server
+administrator of the `@code{TeX-Live}' team at Github. The above
+initial checkout has been carried out by @emph{admin} on the server
 @code{texlive.info}.
 
-On Github (@url{https://github.com}), a new git repository named
- at code{texlive-source} was created by @emph{admin} within the
- at code{TeX-Live} ``organization'' (@url{https://github.com/TeX-Live}).
-The remote was added to the checkout with @code{git remote add origin
+On Github, a new git repository named @code{texlive-source} was
+created by @emph{admin} within the @code{TeX-Live} ``organization''
+(@url{https://github.com/TeX-Live}).  The remote was added to the
+checkout with @code{git remote add origin
 git@@github.com:TeX-Live/texlive-source.git}.
 
-To automate the update on Github, a new ssh key was generated and added
-to the @code{texlive-source} repository on Github as deployment
-key. This way pushes using this key can only go to the
+To automate the update on Github, a new ssh key was generated and
+added to the @code{texlive-source} repository on Github as deployment
+key. Thus, pushes using this key can only go to the
 @code{texlive-source} repository and not anywhere else.
 
 The usage of @code{git-svn} requires a strict discipline to keep a
 linear history in the master branch. Since we are aiming at a pure
-mirror facility, we have decided to further restrict the @code{master}
-branch of the @code{texlive-source} repository on Github to changes by
- at emph{admin}.
+mirror facility on Github, we have decided to further restrict the
+ at code{master} branch of the @code{texlive-source} repository on Github
+to changes by @emph{admin}.
 
 This setup allows other developers to branch off @code{master} and
 push their branches to the Github repository, but all updates need to
@@ -2560,19 +2616,20 @@
 every 30 minute which essentially runs @code{git svn rebase} and
 @code{git push} in the @code{master} branch of the checkout. The first
 command fetches the changes from the Subversion repository and updates
-the @code{master} branch with them, the second one pushes changes (if
-available) to Github.
+the @code{master} branch with them, and the second pushes changes (if
+any) to Github.
 
 @node CI testing on Travis-CI
 @section CI testing on Travis-CI
 
- at pindex .travis.yml
+ at pindex travis.yml
 The @code{source} tree of @TL{} contains a top-level file
 @code{.travis.yml} which controls the automatic testing on
-Travis-CI. @emph{admin} has registered to Travis-CI and allowed access
-to the Github's @code{TeX-Live} organization's @code{texlive-source}
-repository. The default settings are to build the last commit of each
-push. No further action is necessary on Travis-CI.
+Travis-CI. @emph{admin} has registered with Travis-CI and allowed
+access to the Github's @code{TeX-Live} organization's
+ at code{texlive-source} repository. The default settings are to build
+the last commit of each push. No further action is necessary on
+Travis-CI.
 
 If changes have been pushed via the cron job above, Travis-CI will
 automatically checkout the last pushed commit and try building it.

Modified: branches/stable/source/src/libs/README
===================================================================
--- branches/stable/source/src/libs/README	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/README	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,4 +1,4 @@
-$Id: README 49641 2019-01-08 19:24:46Z karl $
+$Id: README 50122 2019-02-25 03:01:12Z kakuto $
 Public domain.  Originally created by Karl Berry, 2005.
 
 Libraries we compile for TeX Live.
@@ -25,7 +25,7 @@
   http://sourceforge.net/projects/silgraphite/files/graphite2/
   (requires C++11)
 
-harfbuzz 2.3.0 - checked 22dec18
+harfbuzz 2.3.1 - checked 31jan19
   http://www.freedesktop.org/software/harfbuzz/release/
 
 icu 63.1 - checked 8jan19
@@ -46,10 +46,10 @@
 luajit 2.1.0-beta3 - checked 20jun17
   http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz
 
-mpfr 4.0.1 - checked 10feb18
+mpfr 4.0.2 - checked 1jan19
   http://ftp.gnu.org/gnu/mpfr/
 
-pixman 0.36.0 - checked 22nov18
+pixman 0.38.0 - checked 13feb19
   http://cairographics.org/releases/
 
 poppler 0.68.0 - checked 20aug18
@@ -59,7 +59,7 @@
 teckit 2.5.8 - checked 24jul18
   https://github.com/silnrsi/teckit/archive/2.5.8.tar.gz
 
-xpdf 4.00 - checked 13aug17
+xpdf 4.01 - checked 25feb19
   http://www.xpdfreader.com/download.html
   with modifications for pdftex
 

Modified: branches/stable/source/src/libs/configure
===================================================================
--- branches/stable/source/src/libs/configure	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/configure	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for TeX Live libs 2019/dev.
+# Generated by GNU Autoconf 2.69 for TeX Live libs 2019.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -579,8 +579,8 @@
 # Identity of this package.
 PACKAGE_NAME='TeX Live libs'
 PACKAGE_TARNAME='tex-live-libs'
-PACKAGE_VERSION='2019/dev'
-PACKAGE_STRING='TeX Live libs 2019/dev'
+PACKAGE_VERSION='2019'
+PACKAGE_STRING='TeX Live libs 2019'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -732,7 +732,6 @@
 enable_pdftex
 enable_pdftex_synctex
 enable_luatex
-enable_luatex53
 enable_luajittex
 enable_mp
 enable_pmp
@@ -1394,7 +1393,7 @@
   # 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 TeX Live libs 2019/dev to adapt to many kinds of systems.
+\`configure' configures TeX Live libs 2019 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1464,7 +1463,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of TeX Live libs 2019/dev:";;
+     short | recursive ) echo "Configuration of TeX Live libs 2019:";;
    esac
   cat <<\_ACEOF
 
@@ -1518,7 +1517,6 @@
   --disable-pdftex          do not compile and install pdfTeX
   --disable-pdftex-synctex    build pdfTeX without SyncTeX support
   --disable-luatex          do not compile and install LuaTeX
-  --disable-luatex53        do not compile and install LuaTeX53
   --disable-luajittex       do not compile and install LuaJITTeX
   --disable-mp              do not compile and install MetaPost
   --disable-pmp             do not compile and install pMetaPost
@@ -1751,7 +1749,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-TeX Live libs configure 2019/dev
+TeX Live libs configure 2019
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1852,7 +1850,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by TeX Live libs $as_me 2019/dev, which was
+It was created by TeX Live libs $as_me 2019, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3557,7 +3555,8 @@
     ;;
 esac
 
-## utils/xindy/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xindy/
+# $Id: withenable.ac 49993 2019-02-10 19:14:27Z karl $
+# utils/xindy/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xindy/
 ## configure options and TL libraries required for xindy
 # Check whether --enable-xindy was given.
 if test "${enable_xindy+set}" = set; then :
@@ -3564,24 +3563,15 @@
   enableval=$enable_xindy;
 fi
 case $enable_xindy in #(
-  yes) :
-    if test "x$cross_compiling" = xyes; then :
-  as_fn_error $? "Unable to cross compile xindy" "$LINENO" 5
-fi ;; #(
-  no) :
+  yes|no) :
      ;; #(
   *) :
-    if test "x$cross_compiling" = xyes; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Cross compiling -> \`--disable-xindy'" >&5
-$as_echo "$as_me: Cross compiling -> \`--disable-xindy'" >&6;}
-            enable_xindy=no
-            ac_configure_args="$ac_configure_args '--disable-xindy'"
-          else
+
    enable_xindy=no
      { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-xindy=$enable_xindy'" >&5
 $as_echo "$as_me: Assuming \`--enable-xindy=$enable_xindy'" >&6;}
      ac_configure_args="$ac_configure_args '--enable-xindy=$enable_xindy'"
-   fi ;;
+    ;;
 esac
 
 ## utils/xindy/ac/xindy.ac: configure.ac fragment for the TeX Live subdirectory utils/xindy/
@@ -3679,7 +3669,8 @@
   need_zlib=yes
 }
 
-## texk/web2c/ac/web2c.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
+# $Id: web2c.ac 50341 2019-03-11 22:04:24Z karl $
+# texk/web2c/ac/web2c.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
 ## configure options for TeX and MF
 
 # Check whether --with-banner-add was given.
@@ -3854,22 +3845,6 @@
 test "x$enable_web2c:$enable_luatex" = xyes:yes && {
   need_libpng=yes
   need_zziplib=yes
-  need_lua52=yes
-}
-# Check whether --enable-luatex53 was given.
-if test "${enable_luatex53+set}" = set; then :
-  enableval=$enable_luatex53;
-fi
-case $enable_luatex53 in #(
-  yes | no) :
-     ;; #(
-  *) :
-    enable_luatex53=yes ;;
-esac
-
-test "x$enable_web2c:$enable_luatex53" = xyes:yes && {
-  need_libpng=yes
-  need_zziplib=yes
   need_lua53=yes
 }
 # Check whether --enable-luajittex was given.
@@ -4006,7 +3981,7 @@
 esac
 
 test "x$enable_web2c:$enable_mflua" = xyes:yes && {
-  need_lua52=yes
+  need_lua53=yes
 }
 # Check whether --enable-mfluajit was given.
 if test "${enable_mfluajit+set}" = set; then :
@@ -6084,7 +6059,7 @@
 
 # Define the identity of the package.
  PACKAGE='tex-live-libs'
- VERSION='2019/dev'
+ VERSION='2019'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -7069,7 +7044,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by TeX Live libs $as_me 2019/dev, which was
+This file was extended by TeX Live libs $as_me 2019, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7126,7 +7101,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-TeX Live libs config.status 2019/dev
+TeX Live libs config.status 2019
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: branches/stable/source/src/libs/libpng/ChangeLog
===================================================================
--- branches/stable/source/src/libs/libpng/ChangeLog	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/libpng/ChangeLog	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,3 +1,9 @@
+2019-02-14  Johannes Hielscher  <jhielscher at posteo.de>
+
+	* Makefile.am (nodist_libpng_a_SOURCES) [PNG_ARM_NEON]: add
+	@LIBPNG_TREE@/arm/palette_neon_intrinsics.c.
+	tlbuild 12 Feb 2019 00:07:11.
+
 2018-12-02 Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Import libpng-1.6.36.

Modified: branches/stable/source/src/libs/libpng/Makefile.am
===================================================================
--- branches/stable/source/src/libs/libpng/Makefile.am	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/libpng/Makefile.am	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am 45971 2017-12-02 23:51:48Z karl $
+## $Id: Makefile.am 50024 2019-02-14 17:11:10Z karl $
 ## Proxy Makefile.am to build libpng for TeX Live.
 ##
 ##   Copyright 2016-2017 Karl Berry <tex-live at tug.org>
@@ -45,7 +45,8 @@
 
 if PNG_ARM_NEON
 nodist_libpng_a_SOURCES += @LIBPNG_TREE@/arm/arm_init.c\
-	@LIBPNG_TREE@/arm/filter_neon.S @LIBPNG_TREE@/arm/filter_neon_intrinsics.c
+	@LIBPNG_TREE@/arm/filter_neon.S @LIBPNG_TREE@/arm/filter_neon_intrinsics.c \
+	@LIBPNG_TREE@/arm/palette_neon_intrinsics.c
 endif
 
 $(libpng_a_OBJECTS): config.force

Modified: branches/stable/source/src/libs/libpng/Makefile.in
===================================================================
--- branches/stable/source/src/libs/libpng/Makefile.in	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/libpng/Makefile.in	2019-05-30 16:25:31 UTC (rev 814)
@@ -87,7 +87,8 @@
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 @PNG_ARM_NEON_TRUE at am__append_1 = @LIBPNG_TREE@/arm/arm_init.c\
- at PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/filter_neon.S @LIBPNG_TREE@/arm/filter_neon_intrinsics.c
+ at PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/filter_neon.S @LIBPNG_TREE@/arm/filter_neon_intrinsics.c \
+ at PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/palette_neon_intrinsics.c
 
 @build_TRUE at check_PROGRAMS = pngtest$(EXEEXT)
 subdir = .
@@ -121,7 +122,8 @@
 @PNG_ARM_NEON_TRUE at am__objects_1 =  \
 @PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/arm_init.$(OBJEXT) \
 @PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/filter_neon.$(OBJEXT) \
- at PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/filter_neon_intrinsics.$(OBJEXT)
+ at PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/filter_neon_intrinsics.$(OBJEXT) \
+ at PNG_ARM_NEON_TRUE@	@LIBPNG_TREE@/arm/palette_neon_intrinsics.$(OBJEXT)
 nodist_libpng_a_OBJECTS = @LIBPNG_TREE@/png.$(OBJEXT) \
 	@LIBPNG_TREE@/pngerror.$(OBJEXT) \
 	@LIBPNG_TREE@/pngget.$(OBJEXT) @LIBPNG_TREE@/pngmem.$(OBJEXT) \
@@ -174,7 +176,8 @@
 	@LIBPNG_TREE@/$(DEPDIR)/pngwutil.Po \
 	@LIBPNG_TREE@/arm/$(DEPDIR)/arm_init.Po \
 	@LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon.Po \
-	@LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon_intrinsics.Po
+	@LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon_intrinsics.Po \
+	@LIBPNG_TREE@/arm/$(DEPDIR)/palette_neon_intrinsics.Po
 am__mv = mv -f
 CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
@@ -744,6 +747,9 @@
 @LIBPNG_TREE@/arm/filter_neon_intrinsics.$(OBJEXT):  \
 	@LIBPNG_TREE@/arm/$(am__dirstamp) \
 	@LIBPNG_TREE@/arm/$(DEPDIR)/$(am__dirstamp)
+ at LIBPNG_TREE@/arm/palette_neon_intrinsics.$(OBJEXT):  \
+	@LIBPNG_TREE@/arm/$(am__dirstamp) \
+	@LIBPNG_TREE@/arm/$(DEPDIR)/$(am__dirstamp)
 
 libpng.a: $(libpng_a_OBJECTS) $(libpng_a_DEPENDENCIES) $(EXTRA_libpng_a_DEPENDENCIES) 
 	$(AM_V_at)-rm -f libpng.a
@@ -783,6 +789,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@@LIBPNG_TREE@/arm/$(DEPDIR)/arm_init.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon_intrinsics.Po at am__quote@ # am--include-marker
+ at AMDEP_TRUE@@am__include@ @am__quote@@LIBPNG_TREE@/arm/$(DEPDIR)/palette_neon_intrinsics.Po at am__quote@ # am--include-marker
 
 $(am__depfiles_remade):
 	@$(MKDIR_P) $(@D)
@@ -1351,6 +1358,7 @@
 	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/arm_init.Po
 	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon.Po
 	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon_intrinsics.Po
+	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/palette_neon_intrinsics.Po
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-hdr distclean-tags
@@ -1417,6 +1425,7 @@
 	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/arm_init.Po
 	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon.Po
 	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/filter_neon_intrinsics.Po
+	-rm -f @LIBPNG_TREE@/arm/$(DEPDIR)/palette_neon_intrinsics.Po
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 

Modified: branches/stable/source/src/libs/xpdf/ChangeLog
===================================================================
--- branches/stable/source/src/libs/xpdf/ChangeLog	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/ChangeLog	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,3 +1,8 @@
+2019-02-25  Akira Kakuto  <kakuto at w32tex.org>
+
+	* Import xpdf-4.01.
+	* Makefile.am, version.ac: Adjust.
+
 2018-10-02  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* aconf-w32.h: Added for w32.

Modified: branches/stable/source/src/libs/xpdf/Makefile.am
===================================================================
--- branches/stable/source/src/libs/xpdf/Makefile.am	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/Makefile.am	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am 45031 2017-08-13 07:14:48Z kakuto $
+## $Id: Makefile.am 50122 2019-02-25 03:01:12Z kakuto $
 ## Proxy Makefile.am to build xpdf for TeX Live.
 ##
 ##   Copyright 2016-2017 Karl Berry <tex-live at tug.org>
@@ -103,6 +103,7 @@
 	@XPDF_TREE@/xpdf/OptionalContent.cc \
 	@XPDF_TREE@/xpdf/Outline.cc \
 	@XPDF_TREE@/xpdf/OutputDev.cc \
+	@XPDF_TREE@/xpdf/PDF417Barcode.cc \
 	@XPDF_TREE@/xpdf/PDFDoc.cc \
 	@XPDF_TREE@/xpdf/PDFDocEncoding.cc \
 	@XPDF_TREE@/xpdf/PSTokenizer.cc \
@@ -112,6 +113,7 @@
 	@XPDF_TREE@/xpdf/Stream.cc \
 	@XPDF_TREE@/xpdf/TextString.cc \
 	@XPDF_TREE@/xpdf/UnicodeMap.cc \
+	@XPDF_TREE@/xpdf/UnicodeRemapping.cc \
 	@XPDF_TREE@/xpdf/UTF8.cc \
 	@XPDF_TREE@/xpdf/XFAForm.cc \
 	@XPDF_TREE@/xpdf/XRef.cc \

Modified: branches/stable/source/src/libs/xpdf/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/Makefile.in	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/Makefile.in	2019-05-30 16:25:31 UTC (rev 814)
@@ -151,6 +151,7 @@
 	@XPDF_TREE@/xpdf/OptionalContent.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/Outline.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/OutputDev.$(OBJEXT) \
+	@XPDF_TREE@/xpdf/PDF417Barcode.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/PDFDoc.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/PDFDocEncoding.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/PSTokenizer.$(OBJEXT) \
@@ -160,6 +161,7 @@
 	@XPDF_TREE@/xpdf/Stream.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/TextString.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/UnicodeMap.$(OBJEXT) \
+	@XPDF_TREE@/xpdf/UnicodeRemapping.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/UTF8.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/XFAForm.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/XRef.$(OBJEXT) \
@@ -223,6 +225,7 @@
 	@XPDF_TREE@/xpdf/$(DEPDIR)/OptionalContent.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/Outline.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/OutputDev.Po \
+	@XPDF_TREE@/xpdf/$(DEPDIR)/PDF417Barcode.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/PDFDoc.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/PDFDocEncoding.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/PSTokenizer.Po \
@@ -233,6 +236,7 @@
 	@XPDF_TREE@/xpdf/$(DEPDIR)/TextString.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/UTF8.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeMap.Po \
+	@XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeRemapping.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/XFAForm.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/XRef.Po \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/Zoox.Po
@@ -518,6 +522,7 @@
 	@XPDF_TREE@/xpdf/OptionalContent.cc \
 	@XPDF_TREE@/xpdf/Outline.cc \
 	@XPDF_TREE@/xpdf/OutputDev.cc \
+	@XPDF_TREE@/xpdf/PDF417Barcode.cc \
 	@XPDF_TREE@/xpdf/PDFDoc.cc \
 	@XPDF_TREE@/xpdf/PDFDocEncoding.cc \
 	@XPDF_TREE@/xpdf/PSTokenizer.cc \
@@ -527,6 +532,7 @@
 	@XPDF_TREE@/xpdf/Stream.cc \
 	@XPDF_TREE@/xpdf/TextString.cc \
 	@XPDF_TREE@/xpdf/UnicodeMap.cc \
+	@XPDF_TREE@/xpdf/UnicodeRemapping.cc \
 	@XPDF_TREE@/xpdf/UTF8.cc \
 	@XPDF_TREE@/xpdf/XFAForm.cc \
 	@XPDF_TREE@/xpdf/XRef.cc \
@@ -710,6 +716,9 @@
 @XPDF_TREE@/xpdf/OutputDev.$(OBJEXT):  \
 	@XPDF_TREE@/xpdf/$(am__dirstamp) \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
+ at XPDF_TREE@/xpdf/PDF417Barcode.$(OBJEXT):  \
+	@XPDF_TREE@/xpdf/$(am__dirstamp) \
+	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
 @XPDF_TREE@/xpdf/PDFDoc.$(OBJEXT): @XPDF_TREE@/xpdf/$(am__dirstamp) \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
 @XPDF_TREE@/xpdf/PDFDocEncoding.$(OBJEXT):  \
@@ -733,6 +742,9 @@
 @XPDF_TREE@/xpdf/UnicodeMap.$(OBJEXT):  \
 	@XPDF_TREE@/xpdf/$(am__dirstamp) \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
+ at XPDF_TREE@/xpdf/UnicodeRemapping.$(OBJEXT):  \
+	@XPDF_TREE@/xpdf/$(am__dirstamp) \
+	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
 @XPDF_TREE@/xpdf/UTF8.$(OBJEXT): @XPDF_TREE@/xpdf/$(am__dirstamp) \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
 @XPDF_TREE@/xpdf/XFAForm.$(OBJEXT): @XPDF_TREE@/xpdf/$(am__dirstamp) \
@@ -797,6 +809,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/OptionalContent.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/Outline.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/OutputDev.Po at am__quote@ # am--include-marker
+ at AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/PDF417Barcode.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/PDFDoc.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/PDFDocEncoding.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/PSTokenizer.Po at am__quote@ # am--include-marker
@@ -807,6 +820,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/TextString.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/UTF8.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeMap.Po at am__quote@ # am--include-marker
+ at AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeRemapping.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/XFAForm.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/XRef.Po at am__quote@ # am--include-marker
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/Zoox.Po at am__quote@ # am--include-marker
@@ -1222,6 +1236,7 @@
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/OptionalContent.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/Outline.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/OutputDev.Po
+	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PDF417Barcode.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PDFDoc.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PDFDocEncoding.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PSTokenizer.Po
@@ -1232,6 +1247,7 @@
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/TextString.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/UTF8.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeMap.Po
+	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeRemapping.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/XFAForm.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/XRef.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/Zoox.Po
@@ -1323,6 +1339,7 @@
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/OptionalContent.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/Outline.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/OutputDev.Po
+	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PDF417Barcode.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PDFDoc.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PDFDocEncoding.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/PSTokenizer.Po
@@ -1333,6 +1350,7 @@
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/TextString.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/UTF8.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeMap.Po
+	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeRemapping.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/XFAForm.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/XRef.Po
 	-rm -f @XPDF_TREE@/xpdf/$(DEPDIR)/Zoox.Po

Modified: branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,3 +1,7 @@
+2019-02-25  Akira Kakuto  <kakuto at w32tex.org>
+
+	* patch-bunched: Adjust.
+
 2018-10-02  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* patch-bunched: Changed for w32.

Modified: branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,4 +1,4 @@
-Changes applied to the xpdf-4.00/ tree as obtained from:
+Changes applied to the xpdf-4.01/ tree as obtained from:
 	http://www.xpdfreader.com/download.html
 
 Removed:

Modified: branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,6 +1,6 @@
-diff -ur xpdf-4.00/goo/gfile.cc xpdf-src/goo/gfile.cc
---- xpdf-4.00/goo/gfile.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-src/goo/gfile.cc	Wed Oct 03 00:39:16 2018
+diff -ur xpdf-4.01/goo/gfile.cc xpdf-src/goo/gfile.cc
+--- xpdf-4.01/goo/gfile.cc	Tue Feb 19 03:24:19 2019
++++ xpdf-src/goo/gfile.cc	Mon Feb 25 11:09:32 2019
 @@ -7,6 +7,9 @@
  // Copyright 1996-2003 Glyph & Cog, LLC
  //
@@ -11,7 +11,7 @@
  
  #include <aconf.h>
  
-@@ -51,7 +54,11 @@
+@@ -52,7 +55,11 @@
    char *s;
    GString *ret;
  
@@ -23,7 +23,7 @@
      ret = new GString(s);
    else
      ret = new GString(".");
-@@ -400,6 +407,7 @@
+@@ -401,6 +408,7 @@
  #endif
  }
  
@@ -31,11 +31,11 @@
  GBool openTempFile(GString **name, FILE **f,
  		   const char *mode, const char *ext) {
  #if defined(_WIN32)
-@@ -514,10 +522,11 @@
+@@ -515,10 +523,11 @@
    return gTrue;
  #endif
  }
-+#endif
++#endif /* !PDF_PARSER_ONLY */
  
  GBool createDir(char *path, int mode) {
  #ifdef _WIN32
@@ -44,26 +44,51 @@
  #else
    return !mkdir(path, mode);
  #endif
-@@ -571,6 +580,8 @@
+@@ -572,6 +581,8 @@
  
  FILE *openFile(const char *path, const char *mode) {
- #ifdef _WIN32
+ #if defined(_WIN32)
 +  return fopen(path, mode);
 +#if 0
    OSVERSIONINFO version;
    wchar_t wPath[_MAX_PATH + 1];
    char nPath[_MAX_PATH + 1];
-@@ -627,6 +638,7 @@
+@@ -628,6 +639,7 @@
      nPath[i] = '\0';
      return fopen(nPath, mode);
    }
 +#endif /* 0 */
+ #elif defined(VMS)
+   return fopen(path, mode, "ctx=stm");
  #else
-   return fopen(path, mode);
+@@ -688,6 +700,7 @@
  #endif
-diff -ur xpdf-4.00/xpdf/GlobalParams.cc xpdf-src/xpdf/GlobalParams.cc
---- xpdf-4.00/xpdf/GlobalParams.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-src/xpdf/GlobalParams.cc	Sun Aug 13 13:51:38 2017
+ }
+ 
++#ifndef PDF_PARSER_ONLY
+ void fixCommandLine(int *argc, char **argv[]) {
+ #ifdef _WIN32
+   int argcw;
+@@ -713,3 +726,4 @@
+   LocalFree(argvw);
+ #endif
+ }
++#endif /* !PDF_PARSER_ONLY */
+diff -ur xpdf-4.01/goo/gfile.h xpdf-src/goo/gfile.h
+--- xpdf-4.01/goo/gfile.h	Tue Feb 19 03:24:19 2019
++++ xpdf-src/goo/gfile.h	Mon Feb 25 11:07:26 2019
+@@ -114,6 +114,8 @@
+ 
+ // On Windows, this gets the Unicode command line and converts it to
+ // UTF-8.  On other systems, this is a nop.
++#ifndef PDF_PARSER_ONLY
+ extern void fixCommandLine(int *argc, char **argv[]);
++#endif /* !PDF_PARSER_ONLY */
+ 
+ #endif
+diff -ur xpdf-4.01/xpdf/GlobalParams.cc xpdf-src/xpdf/GlobalParams.cc
+--- xpdf-4.01/xpdf/GlobalParams.cc	Tue Feb 19 03:24:19 2019
++++ xpdf-src/xpdf/GlobalParams.cc	Mon Feb 25 08:01:11 2019
 @@ -5,6 +5,9 @@
  // Copyright 2001-2003 Glyph & Cog, LLC
  //
@@ -74,7 +99,7 @@
  
  #include <aconf.h>
  
-@@ -38,8 +41,12 @@
+@@ -39,8 +42,12 @@
  #include "GlobalParams.h"
  
  #ifdef _WIN32
@@ -89,7 +114,7 @@
  #endif
  
  #if MULTITHREADED
-@@ -677,6 +684,7 @@
+@@ -684,6 +691,7 @@
    f = NULL;
    fileName = NULL;
    if (cfgFileName && cfgFileName[0]) {
@@ -97,7 +122,7 @@
      fileName = new GString(cfgFileName);
      if (!(f = fopen(fileName->getCString(), "r"))) {
        delete fileName;
-@@ -709,6 +717,7 @@
+@@ -716,6 +724,7 @@
      parseFile(fileName, f);
      delete fileName;
      fclose(f);
@@ -105,7 +130,7 @@
    }
  }
  
-@@ -2105,8 +2114,11 @@
+@@ -2092,8 +2101,11 @@
  				   base14->fontNum,
  				   displayFontTab[i].obliqueFactor));
        } else {
@@ -117,9 +142,9 @@
        }
      }
    }
-diff -ur xpdf-4.00/xpdf/GlobalParams.h xpdf-src/xpdf/GlobalParams.h
---- xpdf-4.00/xpdf/GlobalParams.h	Wed Aug 09 08:22:50 2017
-+++ xpdf-src/xpdf/GlobalParams.h	Sun Aug 13 16:14:54 2017
+diff -ur xpdf-4.01/xpdf/GlobalParams.h xpdf-src/xpdf/GlobalParams.h
+--- xpdf-4.01/xpdf/GlobalParams.h	Tue Feb 19 03:24:19 2019
++++ xpdf-src/xpdf/GlobalParams.h	Mon Feb 25 08:02:36 2019
 @@ -5,6 +5,9 @@
  // Copyright 2001-2003 Glyph & Cog, LLC
  //
@@ -130,7 +155,7 @@
  
  #ifndef GLOBALPARAMS_H
  #define GLOBALPARAMS_H
-@@ -217,7 +220,7 @@
+@@ -218,7 +221,7 @@
  
    // Initialize the global parameters by attempting to read a config
    // file.
@@ -139,28 +164,49 @@
  
    ~GlobalParams();
  
-diff -ur xpdf-4.00/xpdf/PDFDoc.cc xpdf-src/xpdf/PDFDoc.cc
---- xpdf-4.00/xpdf/PDFDoc.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-src/xpdf/PDFDoc.cc	Wed Oct 03 00:39:16 2018
-@@ -147,13 +147,17 @@
+diff -ur xpdf-4.01/xpdf/PDFDoc.cc xpdf-src/xpdf/PDFDoc.cc
+--- xpdf-4.01/xpdf/PDFDoc.cc	Tue Feb 19 03:24:19 2019
++++ xpdf-src/xpdf/PDFDoc.cc	Mon Feb 25 08:16:35 2019
+@@ -147,20 +147,25 @@
  
-   // try to open file
-   // NB: _wfopen is only available in NT
+ PDFDoc::PDFDoc(char *fileNameA, GString *ownerPassword,
+ 	       GString *userPassword, PDFCore *coreA) {
 +/*
-   version.dwOSVersionInfoSize = sizeof(version);
-   GetVersionEx(&version);
+ #ifdef _WIN32
+   OSVERSIONINFO version;
+ #endif
++*/
+   Object obj;
++/*
+ #ifdef _WIN32
+   Unicode u;
+   int n, i, j;
+ #endif
++*/
+ 
+   init(coreA);
+ 
+   fileName = new GString(fileNameA);
+ 
+ #if defined(_WIN32)
++#if 0
+   n = 0;
+   i = 0;
+   while (getUTF8(fileName, &i, &u)) {
+@@ -178,8 +183,12 @@
    if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
      file = _wfopen(fileNameU, L"rb");
    } else {
-+*/
++#endif /* 0 */
      file = fopen(fileName->getCString(), "rb");
-+/*
++#if 0
    }
-+*/
-   if (!file) {
-     error(errIO, -1, "Couldn't open file '{0:t}'", fileName);
-     errCode = errOpenFile;
-@@ -535,6 +539,7 @@
++#endif /* 0 */
++
+ #elif defined(VMS)
+   file = fopen(fileName->getCString(), "rb", "ctx=stm");
+ #else
+@@ -571,6 +580,7 @@
    GBool ret;
  
    // NB: _wfopen is only available in NT
@@ -168,7 +214,7 @@
    version.dwOSVersionInfoSize = sizeof(version);
    GetVersionEx(&version);
    if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
-@@ -544,12 +549,15 @@
+@@ -580,12 +590,15 @@
      path2w[i] = 0;
      f = _wfopen(path2w, L"wb");
    } else {
@@ -184,9 +230,9 @@
    if (!f) {
      return gFalse;
    }
-diff -ur xpdf-4.00/xpdf/Page.cc xpdf-src/xpdf/Page.cc
---- xpdf-4.00/xpdf/Page.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-src/xpdf/Page.cc	Sun Aug 13 13:24:08 2017
+diff -ur xpdf-4.01/xpdf/Page.cc xpdf-src/xpdf/Page.cc
+--- xpdf-4.01/xpdf/Page.cc	Tue Feb 19 03:24:19 2019
++++ xpdf-src/xpdf/Page.cc	Mon Feb 25 08:19:00 2019
 @@ -480,9 +480,9 @@
    delete links;
  }
@@ -205,10 +251,10 @@
 -}
  #endif
 +}
-diff -ur xpdf-4.00/xpdf/XFAForm.cc xpdf-src/xpdf/XFAForm.cc
---- xpdf-4.00/xpdf/XFAForm.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-src/xpdf/XFAForm.cc	Sun Aug 13 14:28:34 2017
-@@ -27,8 +27,10 @@
+diff -ur xpdf-4.01/xpdf/XFAForm.cc xpdf-src/xpdf/XFAForm.cc
+--- xpdf-4.01/xpdf/XFAForm.cc	Tue Feb 19 03:24:19 2019
++++ xpdf-src/xpdf/XFAForm.cc	Mon Feb 25 08:20:00 2019
+@@ -28,8 +28,10 @@
  #include "XFAForm.h"
  
  #ifdef _WIN32
@@ -221,9 +267,9 @@
  #endif
  
  //------------------------------------------------------------------------
-diff -ur xpdf-4.00/xpdf/config.h xpdf-src/xpdf/config.h
---- xpdf-4.00/xpdf/config.h	Wed Aug 09 08:22:50 2017
-+++ xpdf-src/xpdf/config.h	Sun Aug 13 16:14:54 2017
+diff -ur xpdf-4.01/xpdf/config.h xpdf-src/xpdf/config.h
+--- xpdf-4.01/xpdf/config.h	Tue Feb 19 03:24:19 2019
++++ xpdf-src/xpdf/config.h	Mon Feb 25 08:21:02 2019
 @@ -78,11 +78,6 @@
  // popen
  //------------------------------------------------------------------------

Modified: branches/stable/source/src/libs/xpdf/configure
===================================================================
--- branches/stable/source/src/libs/xpdf/configure	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/configure	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xpdf (TeX Live) 4.00.
+# Generated by GNU Autoconf 2.69 for xpdf (TeX Live) 4.01.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='xpdf (TeX Live)'
 PACKAGE_TARNAME='xpdf--tex-live-'
-PACKAGE_VERSION='4.00'
-PACKAGE_STRING='xpdf (TeX Live) 4.00'
+PACKAGE_VERSION='4.01'
+PACKAGE_STRING='xpdf (TeX Live) 4.01'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1290,7 +1290,7 @@
   # 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 xpdf (TeX Live) 4.00 to adapt to many kinds of systems.
+\`configure' configures xpdf (TeX Live) 4.01 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1356,7 +1356,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of xpdf (TeX Live) 4.00:";;
+     short | recursive ) echo "Configuration of xpdf (TeX Live) 4.01:";;
    esac
   cat <<\_ACEOF
 
@@ -1460,7 +1460,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-xpdf (TeX Live) configure 4.00
+xpdf (TeX Live) configure 4.01
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1867,7 +1867,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by xpdf (TeX Live) $as_me 4.00, which was
+It was created by xpdf (TeX Live) $as_me 4.01, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3791,7 +3791,7 @@
 
 # Define the identity of the package.
  PACKAGE='xpdf--tex-live-'
- VERSION='4.00'
+ VERSION='4.01'
 
 
 # Some tools Automake needs.
@@ -6704,7 +6704,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by xpdf (TeX Live) $as_me 4.00, which was
+This file was extended by xpdf (TeX Live) $as_me 4.01, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6774,7 +6774,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-xpdf (TeX Live) config.status 4.00
+xpdf (TeX Live) config.status 4.01
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: branches/stable/source/src/libs/xpdf/version.ac
===================================================================
--- branches/stable/source/src/libs/xpdf/version.ac	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/version.ac	2019-05-30 16:25:31 UTC (rev 814)
@@ -8,4 +8,4 @@
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current xpdf version
-m4_define([xpdf_version], [4.00])
+m4_define([xpdf_version], [4.01])

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,4 +1,4 @@
-Subject: ANNOUNCE: Xpdf 4.00 - a PDF viewer and related tools
+Subject: ANNOUNCE: Xpdf 4.01 - a PDF viewer and related tools
 
 Glyph & Cog, LLC is pleased to announce a new version of Xpdf, the
 open source Portable Document Format (PDF) viewer.  The Xpdf project
@@ -12,12 +12,14 @@
 Unix, Windows, MacOSX, and pretty much any other system with a decent
 C++ compiler.
 
-Major changes:
-* Complete rewrite of the xpdf GUI, using Qt instead of Motif.
-* Multithreaded rasterization in the viewer - pages are now rasterized
-  in a separate thread so that scrolling and other UI activity is not
-  blocked.
-* Added a linear text selection mode.
+4.01 is primarily a bug fix release.  There are some new features:
+* Added remote server mode back into xpdf.
+* Added support for Unicode file names for the command line tools on
+  Windows.
+* Added the tabStateFile setting, the saveTabState/loadTabState
+  commands, and the "-tabstate" switch to xpdf.  [Thanks to Christian
+  Barthel for the suggestion.]
+* Added the defaultPrinter xpdfrc setting.
 
 See the `CHANGES' file for a complete list of changes.
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES	2019-05-30 16:25:31 UTC (rev 814)
@@ -2454,3 +2454,88 @@
 Fixed a security hole in Function.cc (write past end of array).
 Fixed a security hole with the use of d0/d1 operators outside of a
   Type3 CharProc [CVE-2016-9027].
+
+4.01 (2019-feb-18)
+------------------
+Added remote server mode back into xpdf.
+Add support for Unicode file names for the command line tools on
+  Windows.
+Added the tabStateFile setting, the saveTabState/loadTabState
+  commands, and the "-tabstate" switch to xpdf.  [Thanks to Christian
+  Barthel for the suggestion.]
+Added the defaultPrinter xpdfrc setting.
+Removed the psFile xpdfrc option (should have been removed in the 4.00
+  release).
+Tweaked the TrueType encoding/cmap code again, to get closer to the
+  PDF 2.0 spec, and to fix a problem (difference between Xpdf and
+  Adobe) with a specific PDF file.
+Optimized transparency group rasterization: only composite the part of
+  the group bitmap that was modified.
+If vector antialiasing is disabled, use the narrow stroke code for
+  lines less than one pixel wide.
+Do not map through Unicode for non-embedded CID TrueType fonts with
+  encoding = Identity-H and char collection = Adobe-Identity -- this
+  matches Adobe's behavior on a somewhat common case.
+The CCITTFax decoder now aborts after 1000 error messages, avoiding
+  problems with huge data expansion for badly corrupted CCITTFax
+  streams.
+The xref loop detection code was only looking at xref tables, and not
+  xref streams.  (CVE-2018-7174)  [Thanks to skysider for the bug
+  report.]
+The JPX decoder wasn't checking to make sure the number of components
+  is non-zero.  (CVE-2018-7175)  [Thanks to skysider for the bug
+  report.]
+Modify the lexer to accept leading '+' signs on numbers.
+Pdftohtml wasn't setting the background image width/height attributes
+  correctly for rotated pages.
+Ignore color-setting operators in cached Type 3 characters.
+Support color-key masking in Level3Gray PS output with preload.
+Xpdf was crashing on zero-page PDF files.
+Added the unicodeRemapping xpdfrc option.
+Change the cursor when the mouse is over text (in linear selection
+  mode).
+Support external OpenType CFF fonts for PostScript output.
+Handle choice-type AcroForm fields that have separate display values
+  and export values.
+Increased the supported PDF version from 1.7 to 2.0.  (This isn't a
+  change in functionality.  The code was already in place -- I just
+  forgot to bump the PDF version number.)
+Added the dropFont xpdfrc option.
+Added support for PDF417 barcodes in XFA forms.
+Modified pdfinfo to look at both the Info dict and the XML metadata.
+Check for invalid line cap/join values.  [Thanks to
+  fish at 360TeamSeri0us for the bug report.]
+Modified the object stream cache to hold onto more object streams, if
+  they're being used.
+Don't look at the "DV" (default value) key in AcroForm fields -- that
+  should only be used when a form is explicitly reset.
+Accept 8-byte values in xref streams.
+Two DCTStream bugs: don't allow SOF headers between progressive scans;
+  check for invalid Huffman table indexes.  [Thanks to
+  fish at 360TeamSeri0us for the bug reports.]
+Check for uses of the scn/SCN operators with no arguments.  [Thanks to
+  fish at 360TeamSeri0us for the bug report.]
+Correctly handle indexed color spaces with empty lookup tables.
+  [Thanks to fish at 360TeamSeri0us for the bug report.]
+Support large bitmaps (>4GB) on 64-bit systems.
+Soft masks are always isolated.
+When "undoing" preblended image/softmask data, clip the resulting
+  color values to avoid problems with incorrect data.
+Set the default text encoding to UCS-2 in Xpdf, so that copying to the
+  clipboard works as expected.
+Added a sanity check for JBIG2 symbol height.  (CVE-2018-7173)
+  [Reported by skysider.]
+Check for uninitialized value in JPXStream::fillReadBuf.
+  (CVE-2018-7452)  [Thanks to skysider for the bug report.]
+Don't try to load an XFAForm if the PDF file has zero pages.
+  (CVE-2018-7454)  [Thanks to skysider for the bug report.]
+Check for invalid line cap/join values.  (CVE-2018-16368)  [Thanks to
+  fish at 360TeamSeri0us for the bug report.]
+If the page count is greater than 50k, rescan the page tree and count
+  the pages.  This prevents long load times where various tools try to
+  read pages 1 through n.  (CVE-2018-18651)  [Thanks to krace for the
+  bug report.]
+Handle a null font name in PSOutputDev::setupEmbeddedType1Font.
+  [Thanks to r4xis for the bug report.]
+Check for invalid quant table indexes in the DCT decoder.  [Thanks to
+  r4xis for the bug report.]

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,11 +1,11 @@
 Xpdf
 ====
 
-version 4.00
-2017-aug-10
+version 4.01
+2019-feb-18
 
 The Xpdf software and documentation are
-copyright 1996-2017 Glyph & Cog, LLC.
+copyright 1996-2019 Glyph & Cog, LLC.
 
 Email: xpdf at xpdfreader.com
 WWW: http://www.xpdfreader.com/
@@ -119,6 +119,14 @@
      -DCMAKE_EXE_LINKER_FLAGS="..."
         Set additional options to pass to the linker.
 
+     -DCMAKE_INSTALL_BINDIR
+        Set the bin directory, relative to CMAKE_INSTALL_PREFIX
+        (typically "bin").
+
+     -DCMAKE_INSTALL_MANDIR
+        Set the man directory, relative to CMAKE_INSTALL_PREFIX
+        (typically "man" or "share/man").
+
 * Build:
 
       make

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/README
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/README	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/README	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,17 +1,17 @@
 Xpdf
 ====
 
-version 4.00
-2017-aug-10
+version 4.01
+2019-feb-18
 
 The Xpdf software and documentation are
-copyright 1996-2017 Glyph & Cog, LLC.
+copyright 1996-2019 Glyph & Cog, LLC.
 
 Email: xpdf at xpdfreader.com
 WWW: http://www.xpdfreader.com/
 
 The PDF data structures, operators, and specification are
-documented in ISO 32000-1:2008.
+documented in ISO 32000-2:2017.
 
 
 What is Xpdf?
@@ -196,21 +196,6 @@
 References
 ----------
 
-Adobe Systems Inc., ISO 32000-1:2008, Document Management - Portable
-document format - Part 1: PDF 1.7.
-http://www.adobe.com/devnet/pdf/pdf_reference.html
-[The manual for PDF version 1.7.]
-
-Adobe Systems Inc., Adobe Supplement to the ISO 32000, BaseVersion
-1.7, ExtensionLevel 3, June 2008.
-http://www.adobe.com/devnet/pdf/pdf_reference.html
-[Additions to the PDF 1.7 spec.]
-
-Adobe Systems Inc., Adobe Supplement to ISO 32000-1, BaseVersion 1.7,
-ExtensionLevel 5, June 2009.
-http://www.adobe.com/devnet/pdf/pdf_reference.html
-[Additions to the PDF 1.7 spec.]
-
 Adobe Systems Inc., _PostScript Language Reference_, 3rd ed.
 Addison-Wesley, 1999, ISBN 0-201-37922-8.
 [The official PostScript manual.]
@@ -340,6 +325,10 @@
 were changes made to the bitstream format between that draft and the
 published spec.]
 
+ISO, International Standard -- Document Management - Portable document
+format - Part 2: PDF 2.0.  ISO 32000-2:2017.
+[The manual for PDF version 2.0.]
+
 ITU, "Standardization of Group 3 facsimile terminals for document
 transmission", ITU-T Recommendation T.4, 1999.
 ITU, "Facsimile coding schemes and coding control functions for Group 4

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt	2019-05-30 16:25:31 UTC (rev 814)
@@ -10,6 +10,7 @@
 
 include(CheckFunctionExists)
 include(CheckCXXSourceCompiles)
+include(GNUInstallDirs)
 
 enable_language(CXX)
 
@@ -18,6 +19,8 @@
 if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
   if (CYGWIN)
     set(PIC_FLAG "")
+  elseif (CMAKE_HOST_SYSTEM_NAME MATCHES "AIX")
+    set(PIC_FLAG "-qPIC")
   else ()
     set(PIC_FLAG "-fPIC")
   endif ()
@@ -78,12 +81,6 @@
 option(USE_EXCEPTIONS "use C++ exceptions" ON)
 option(USE_FIXEDPOINT "use fixed point (instead of floating point) arithmetic" OFF)
 option(SPLASH_CMYK "include support for CMYK rasterization" OFF)
-option(SPLASH_DEVICEN "include support for DeviceN rasterization" OFF)
-if (SPLASH_DEVICEN)
-  set(SPLASH_CMYK ON)
-endif ()
-option(USE_LCMS "enable color management using lcms2" OFF)
-option(HIGHLIGHTED_REGIONS "include support for highlighted regions" OFF)
 option(SYSTEM_XPDFRC "full path for system-wide xpdfrc file" "")
 if (SYSTEM_XPDFRC)
   set(SYSTEM_XPDFRC_DEFINE "#define SYSTEM_XPDFRC \"${SYSTEM_XPDFRC}\"")
@@ -90,9 +87,11 @@
 else ()
   set(SYSTEM_XPDFRC_DEFINE "/* #undef SYSTEM_XPDFRC */")
 endif ()
-option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" OFF)
-option(EVAL_MODE "enable evaluation mode" OFF)
-option(BUILDING_XPDFREADER "enable closed source XpdfReader build" OFF)
+if (WIN32)
+  option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" OFF)
+else ()
+  option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" ON)
+endif ()
 
 #--- check for various library functions
 check_function_exists(mkstemp HAVE_MKSTEMP)
@@ -178,11 +177,6 @@
   set(HAVE_SPLASH TRUE)
 endif ()
 
-#--- look for D-Type
-if (DTYPE_INCLUDE_DIR AND DTYPE_LIBRARY)
-  set(HAVE_DTYPE4_H TRUE)
-  message(STATUS "Found D-Type: ${DTYPE_LIBRARY}")
-endif ()
 
 #--- look for zlib
 find_package(ZLIB)
@@ -190,42 +184,13 @@
 #--- look for libpng
 find_package(PNG)
 
-#--- look for libjpeg
-find_package(JPEG)
 
-#--- look for libtiff
-find_package(TIFF)
 
-#--- look for lcms2
-if (USE_LCMS)
-  find_path(LCMS_INCLUDE_DIR lcms2.h
-    HINTS
-    ${LCMS_DIR}
-    PATHS
-    /usr/local/include
-    /usr/freeware/include
-    PATH_SUFFIXES include
-  )
-  find_library(LCMS_LIBRARY
-    NAMES lcms2 liblcms2
-    HINTS
-    ${LCMS_DIR}
-    PATHS
-    /usr/local
-    /usr/freeware
-  )
-endif ()
-if (USE_LCMS AND LCMS_INCLUDE_DIR AND LCMS_LIBRARY)
-  set(HAVE_LCMS TRUE)
-  message(STATUS "Found lcms2: ${LCMS_LIBRARY}")
-else ()
-  set(HAVE_LCMS FALSE)
-  message(STATUS "lcms2 not found")
-endif ()
 
 #--- look for Qt
 find_package(Qt5Widgets QUIET)
 if (Qt5Widgets_FOUND)
+  find_package(Qt5Network)
   find_package(Qt5PrintSupport)
 else ()
   find_package(Qt4)
@@ -233,19 +198,19 @@
 if(Qt5Widgets_FOUND)
   message(STATUS "Qt5 found")
   if (XPDFWIDGET_PRINTING)
-    set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}")
-    set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}")
+    set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}")
+    set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}")
     if (APPLE)
-      set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport "-framework ApplicationServices")
+      set(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::PrintSupport "-framework ApplicationServices")
     elseif (UNIX)
-      set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport cups)
+      set(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::PrintSupport cups)
     else ()
-      set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport)
+      set(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::PrintSupport)
     endif ()
   else ()
-    set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS}")
-    set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS}")
-    set(QT_LIBRARIES Qt5::Widgets)
+    set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS}")
+    set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5Network_DEFINITIONS}")
+    set(QT_LIBRARIES Qt5::Widgets Qt5::Network)
   endif ()
   if (XPDFWIDGET_PRINTING)
     if (APPLE)
@@ -258,10 +223,6 @@
   endif ()
   # remove "-fPIE" here because we added "-fPIC" above
   string(REPLACE "-fPIE" "" QT_CFLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
-  if (POLICY CMP0020)
-    # do not link to qtmain.lib
-    cmake_policy(SET CMP0020 OLD)
-  endif ()
 elseif(QT4_FOUND)
   message(STATUS "Qt4 found")
   if (XPDFWIDGET_PRINTING)
@@ -278,10 +239,16 @@
 endif()
 
 #--- look for libpaper
-find_library(HAVE_PAPER_H
+find_library(PAPER_LIBRARY
              NAMES paper libpaper
              PATH_SUFFIXES lib64 lib
 )
+if (PAPER_LIBRARY)
+  set(HAVE_PAPER_H TRUE)
+else ()
+  set(HAVE_PAPER_H FALSE)
+  set(PAPER_LIBRARY "")
+endif ()
 
 #--- look for pthreads
 find_package(Threads)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 2013-2017 Glyph & Cog, LLC
-.TH pdfdetach 1 "10 Aug 2017"
+.\" Copyright 2013-2019 Glyph & Cog, LLC
+.TH pdfdetach 1 "18 Feb 2019"
 .SH NAME
 pdfdetach \- Portable Document Format (PDF) document embedded file
-extractor (version 4.00)
+extractor (version 4.01)
 .SH SYNOPSIS
 .B pdfdetach
 [options]
@@ -90,7 +90,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdfinfo software and documentation are copyright 1996-2017 Glyph &
+The pdfinfo software and documentation are copyright 1996-2019 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdfdetach  -  Portable  Document  Format  (PDF)  document embedded file
-       extractor (version 4.00)
+       extractor (version 4.01)
 
 SYNOPSIS
        pdfdetach [options] [PDF-file]
@@ -79,7 +79,7 @@
        99     Other error.
 
 AUTHOR
-       The pdfinfo software and documentation are copyright 1996-2017 Glyph  &
+       The pdfinfo software and documentation are copyright 1996-2019 Glyph  &
        Cog, LLC.
 
 SEE ALSO
@@ -89,4 +89,4 @@
 
 
 
-                                  10 Aug 2017                     pdfdetach(1)
+                                  18 Feb 2019                     pdfdetach(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 1999-2017 Glyph & Cog, LLC
-.TH pdffonts 1 "10 Aug 2017"
+.\" Copyright 1999-2019 Glyph & Cog, LLC
+.TH pdffonts 1 "18 Feb 2019"
 .SH NAME
 pdffonts \- Portable Document Format (PDF) font analyzer (version
-4.00)
+4.01)
 .SH SYNOPSIS
 .B pdffonts
 [options]
@@ -147,7 +147,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdffonts software and documentation are copyright 1996-2017 Glyph
+The pdffonts software and documentation are copyright 1996-2019 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -3,7 +3,7 @@
 
 
 NAME
-       pdffonts - Portable Document Format (PDF) font analyzer (version 4.00)
+       pdffonts - Portable Document Format (PDF) font analyzer (version 4.01)
 
 SYNOPSIS
        pdffonts [options] [PDF-file]
@@ -105,7 +105,7 @@
        99     Other error.
 
 AUTHOR
-       The pdffonts software and documentation are copyright 1996-2017 Glyph &
+       The pdffonts software and documentation are copyright 1996-2019 Glyph &
        Cog, LLC.
 
 SEE ALSO
@@ -115,4 +115,4 @@
 
 
 
-                                  10 Aug 2017                      pdffonts(1)
+                                  18 Feb 2019                      pdffonts(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 1998-2017 Glyph & Cog, LLC
-.TH pdfimages 1 "10 Aug 2017"
+.\" Copyright 1998-2019 Glyph & Cog, LLC
+.TH pdfimages 1 "18 Feb 2019"
 .SH NAME
 pdfimages \- Portable Document Format (PDF) image extractor
-(version 4.00)
+(version 4.01)
 .SH SYNOPSIS
 .B pdfimages
 [options]
@@ -102,7 +102,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdfimages software and documentation are copyright 1998-2017 Glyph
+The pdfimages software and documentation are copyright 1998-2019 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdfimages  -  Portable  Document  Format (PDF) image extractor (version
-       4.00)
+       4.01)
 
 SYNOPSIS
        pdfimages [options] PDF-file image-root
@@ -85,7 +85,7 @@
        99     Other error.
 
 AUTHOR
-       The  pdfimages software and documentation are copyright 1998-2017 Glyph
+       The  pdfimages software and documentation are copyright 1998-2019 Glyph
        & Cog, LLC.
 
 SEE ALSO
@@ -95,4 +95,4 @@
 
 
 
-                                  10 Aug 2017                     pdfimages(1)
+                                  18 Feb 2019                     pdfimages(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 1999-2017 Glyph & Cog, LLC
-.TH pdfinfo 1 "10 Aug 2017"
+.\" Copyright 1999-2019 Glyph & Cog, LLC
+.TH pdfinfo 1 "18 Feb 2019"
 .SH NAME
 pdfinfo \- Portable Document Format (PDF) document information
-extractor (version 4.00)
+extractor (version 4.01)
 .SH SYNOPSIS
 .B pdfinfo
 [options]
@@ -150,7 +150,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdfinfo software and documentation are copyright 1996-2017 Glyph &
+The pdfinfo software and documentation are copyright 1996-2019 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdfinfo - Portable Document Format (PDF) document information extractor
-       (version 4.00)
+       (version 4.01)
 
 SYNOPSIS
        pdfinfo [options] [PDF-file]
@@ -104,7 +104,7 @@
        99     Other error.
 
 AUTHOR
-       The  pdfinfo software and documentation are copyright 1996-2017 Glyph &
+       The  pdfinfo software and documentation are copyright 1996-2019 Glyph &
        Cog, LLC.
 
 SEE ALSO
@@ -114,4 +114,4 @@
 
 
 
-                                  10 Aug 2017                       pdfinfo(1)
+                                  18 Feb 2019                       pdfinfo(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 1997-2017 Glyph & Cog, LLC
-.TH pdftohtml 1 "10 Aug 2017"
+.\" Copyright 1997-2019 Glyph & Cog, LLC
+.TH pdftohtml 1 "18 Feb 2019"
 .SH NAME
 pdftohtml \- Portable Document Format (PDF) to HTML converter
-(version 4.00)
+(version 4.01)
 .SH SYNOPSIS
 .B pdftohtml
 [options]
@@ -109,7 +109,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftohtml software and documentation are copyright 1996-2017 Glyph
+The pdftohtml software and documentation are copyright 1996-2019 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdftohtml  -  Portable Document Format (PDF) to HTML converter (version
-       4.00)
+       4.01)
 
 SYNOPSIS
        pdftohtml [options] PDF-file HTML-dir
@@ -97,7 +97,7 @@
        99     Other error.
 
 AUTHOR
-       The  pdftohtml software and documentation are copyright 1996-2017 Glyph
+       The  pdftohtml software and documentation are copyright 1996-2019 Glyph
        & Cog, LLC.
 
 SEE ALSO
@@ -107,4 +107,4 @@
 
 
 
-                                  10 Aug 2017                     pdftohtml(1)
+                                  18 Feb 2019                     pdftohtml(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 2017 Glyph & Cog, LLC
-.TH pdftopng 1 "10 Aug 2017"
+.\" Copyright 2017-2019 Glyph & Cog, LLC
+.TH pdftopng 1 "18 Feb 2019"
 .SH NAME
 pdftopng \- Portable Document Format (PDF) to Portable Network Graphics
-(PNG) converter (version 4.00)
+(PNG) converter (version 4.01)
 .SH SYNOPSIS
 .B pdftopng
 [options]
@@ -107,7 +107,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftopng software and documentation are copyright 1996-2017 Glyph
+The pdftopng software and documentation are copyright 1996-2019 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdftopng  - Portable Document Format (PDF) to Portable Network Graphics
-       (PNG) converter (version 4.00)
+       (PNG) converter (version 4.01)
 
 SYNOPSIS
        pdftopng [options] PDF-file PNG-root
@@ -87,7 +87,7 @@
        99     Other error.
 
 AUTHOR
-       The pdftopng software and documentation are copyright 1996-2017 Glyph &
+       The pdftopng software and documentation are copyright 1996-2019 Glyph &
        Cog, LLC.
 
 SEE ALSO
@@ -97,4 +97,4 @@
 
 
 
-                                  10 Aug 2017                      pdftopng(1)
+                                  18 Feb 2019                      pdftopng(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 2005-2017 Glyph & Cog, LLC
-.TH pdftoppm 1 "10 Aug 2017"
+.\" Copyright 2005-2019 Glyph & Cog, LLC
+.TH pdftoppm 1 "18 Feb 2019"
 .SH NAME
 pdftoppm \- Portable Document Format (PDF) to Portable Pixmap (PPM)
-converter (version 4.00)
+converter (version 4.01)
 .SH SYNOPSIS
 .B pdftoppm
 [options]
@@ -107,7 +107,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftoppm software and documentation are copyright 1996-2017 Glyph
+The pdftoppm software and documentation are copyright 1996-2019 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdftoppm - Portable Document Format (PDF) to Portable Pixmap (PPM) con-
-       verter (version 4.00)
+       verter (version 4.01)
 
 SYNOPSIS
        pdftoppm [options] PDF-file PPM-root
@@ -86,7 +86,7 @@
        99     Other error.
 
 AUTHOR
-       The pdftoppm software and documentation are copyright 1996-2017 Glyph &
+       The pdftoppm software and documentation are copyright 1996-2019 Glyph &
        Cog, LLC.
 
 SEE ALSO
@@ -96,4 +96,4 @@
 
 
 
-                                  10 Aug 2017                      pdftoppm(1)
+                                  18 Feb 2019                      pdftoppm(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 1996-2017 Glyph & Cog, LLC
-.TH pdftops 1 "10 Aug 2017"
+.\" Copyright 1996-2019 Glyph & Cog, LLC
+.TH pdftops 1 "18 Feb 2019"
 .SH NAME
 pdftops \- Portable Document Format (PDF) to PostScript converter
-(version 4.00)
+(version 4.01)
 .SH SYNOPSIS
 .B pdftops
 [options]
@@ -236,7 +236,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftops software and documentation are copyright 1996-2017 Glyph &
+The pdftops software and documentation are copyright 1996-2019 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdftops  - Portable Document Format (PDF) to PostScript converter (ver-
-       sion 4.00)
+       sion 4.01)
 
 SYNOPSIS
        pdftops [options] [PDF-file [PS-file]]
@@ -201,7 +201,7 @@
        99     Other error.
 
 AUTHOR
-       The  pdftops software and documentation are copyright 1996-2017 Glyph &
+       The  pdftops software and documentation are copyright 1996-2019 Glyph &
        Cog, LLC.
 
 SEE ALSO
@@ -211,4 +211,4 @@
 
 
 
-                                  10 Aug 2017                       pdftops(1)
+                                  18 Feb 2019                       pdftops(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,8 +1,8 @@
-.\" Copyright 1997-2017 Glyph & Cog, LLC
-.TH pdftotext 1 "10 Aug 2017"
+.\" Copyright 1997-2019 Glyph & Cog, LLC
+.TH pdftotext 1 "18 Feb 2019"
 .SH NAME
 pdftotext \- Portable Document Format (PDF) to text converter
-(version 4.00)
+(version 4.01)
 .SH SYNOPSIS
 .B pdftotext
 [options]
@@ -172,7 +172,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftotext software and documentation are copyright 1996-2017 Glyph
+The pdftotext software and documentation are copyright 1996-2019 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -4,7 +4,7 @@
 
 NAME
        pdftotext  -  Portable Document Format (PDF) to text converter (version
-       4.00)
+       4.01)
 
 SYNOPSIS
        pdftotext [options] [PDF-file [text-file]]
@@ -138,7 +138,7 @@
        99     Other error.
 
 AUTHOR
-       The  pdftotext software and documentation are copyright 1996-2017 Glyph
+       The  pdftotext software and documentation are copyright 1996-2019 Glyph
        & Cog, LLC.
 
 SEE ALSO
@@ -148,4 +148,4 @@
 
 
 
-                                  10 Aug 2017                     pdftotext(1)
+                                  18 Feb 2019                     pdftotext(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc	2019-05-30 16:25:31 UTC (rev 814)
@@ -54,10 +54,6 @@
 
 #----- PostScript output control
 
-# Set the default PostScript file or command.
-
-#psFile			"|lpr -Pmyprinter"
-
 # Set the default PostScript paper size -- this can be letter, legal,
 # A4, or A3.  You can also specify a paper size as width and height
 # (in points).
@@ -88,4 +84,3 @@
 # clicked.
 
 #launchCommand  viewer-script
-#urlCommand	"netscape -remote 'openURL(%s)'"

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,12 +1,17 @@
-.\" Copyright 1996-2017 Glyph & Cog, LLC
-.TH xpdf 1 "10 Aug 2017"
+.\" Copyright 1996-2019 Glyph & Cog, LLC
+.TH xpdf 1 "18 Feb 2019"
 .SH NAME
-xpdf \- Portable Document Format (PDF) file viewer (version 4.00)
+xpdf \- Portable Document Format (PDF) file viewer (version 4.01)
 .SH SYNOPSIS
 .B xpdf
 [options]
 .RI [ PDF-file
 .RI [: page " | +" dest "]] ..."
+.PP
+.B xpdf
+[options]
+.B -remote
+.IR remote-name " [" command " ...]"
 .SH DESCRIPTION
 .B Xpdf
 is a viewer for Portable Document Format (PDF) files.  (These are also
@@ -124,6 +129,9 @@
 .B \-fullscreen
 Open xpdf in full-screen mode, useful for presentations.
 .TP
+.BI \-remote " remote-name"
+Start Xpdf in remote server mode.  See the REMOVE SERVER MODE section.
+.TP
 .BI \-display " display"
 Set the X display (only available with X11).
 .TP
@@ -349,7 +357,8 @@
 command line option, the \'full screen' menu item, or a binding to the
 .B fullScreenMode
 or
-.BR toggleFullScreenMode command .
+.B toggleFullScreenMode
+command.
 .PP
 Entering full-screen mode automatically switches to single-page view
 mode and to the fit-page zoom factor.
@@ -376,6 +385,23 @@
 rectangle.  Any part of the page can be selected, regardless of the
 content on the page.
 .TP
+.BI checkOpenFile( file )
+Check that
+.I file
+is open in the current tab, and open it if not.
+.TP
+.BI checkOpenFileAtDest( file, dest )
+Check that
+.I file
+is open in the current tab, and open it if not.  In either case go to
+the specified named destination.
+.TP
+.BI checkOpenFileAtPage( file, page )
+Check that
+.I file
+is open in the current tab, and open it if not.  In either case go to
+the specified page.
+.TP
 .B closeSidebar
 Close the sidebar.
 .TP
@@ -478,6 +504,12 @@
 Set linear selection mode.  In this mode, the selection follows text.
 Non-text regions cannot be selected.
 .TP
+.BI loadTabState
+Load the tab state file (which was written via the saveTabState
+command), and restore the tabs listed in that file.  The path for the
+tab state file is specified with the tabStateFile setting (see
+.BR xpdfrc (5)).
+.TP
 .B newTab
 Open an empty new tab.
 .TP
@@ -499,6 +531,16 @@
 .B openErrorWindow
 Open the error window.
 .TP
+.BI openFile( file )
+Open the specified file in the current tab.
+.TP
+.BI openFileAtDest( file, dest )
+Open the specified file in the current tab at the specified named
+destination.
+.TP
+.BI openFileAtPage( file, page )
+Open the specified file in the current tab at the specified page.
+.TP
 .B openSidebar
 Open the sidebar.
 .TP
@@ -579,6 +621,10 @@
     bind x "run(ls -l)"
 
 .fi
+The command string may not be run through a shell.  It is recommended
+to keep the command simple, so that it doesn't depend on specific
+shell functionality.  For complex things, you can have the command
+string run a shell script.
 .TP
 .B saveAs
 Save PDF via a file requester.
@@ -586,12 +632,20 @@
 .B saveImage
 Open the \'save image' dialog.
 .TP
+.BI saveTabState
+Save a list of all tabs open in this window to the tab state file.
+For each tab, this writes the PDF file name and page number (on
+separate lines).  This file can be loaded later with the loadTabState
+command.  The path for the tab state file is specified with the
+tabStateFile setting (see
+.BR xpdfrc (5)).
+.TP
 .BI scrollDown( n )
 Scroll down by
 .I n
 pixels.
 .TP
-.BI scrollDownPrevPage( n )
+.BI scrollDownNextPage( n )
 Scroll down by
 .I n
 pixels, moving to the next page if appropriate.
@@ -617,11 +671,11 @@
 pixels.
 .TP
 .B scrollToBottomEdge
-Scroll to the bottom edge of the current page, with no horizontal
-movement.
+Scroll to the bottom edge of the last displayed page, with no
+horizontal movement.
 .TP
 .B scrollToBottomRight
-Scroll to the bottom-right corner of the current page.
+Scroll to the bottom-right corner of the last displayed page.
 .TP
 .B scrollToLeftEdge
 Scroll to the left edge of the current page, with no vertical
@@ -632,11 +686,11 @@
 movement.
 .TP
 .B scrollToTopEdge
-Scroll to the top edge of the current page, with no horizontal
+Scroll to the top edge of the first displayed page, with no horizontal
 movement.
 .TP
 .B scrollToTopLeft
-Scroll to the top-left corner of the current page.
+Scroll to the top-left corner of the first displayed page.
 .TP
 .BI scrollUp( n )
 Scroll up by
@@ -710,6 +764,25 @@
 .TP
 .B zoomToSelection
 Zoom to the current selection.
+.SH REMOTE SERVER MODE
+Starting xpdf with the "-remote" switch puts it into remote server
+mode.  All remaining command line options are commands (see the
+COMMANDS section).  Subsequent invocations of "xpdf -remote" with the
+same remote server name will send commands to the already-running
+instance of xpdf.  The "checkOpenFile" commands are useful here for
+things like changing pages.
+For example:
+.PP
+.RS
+    # Start up xpdf, and open something.pdf.
+    xpdf -remote foo 'openFile(something.pdf)'
+
+    # Switch to page 7 in the already-open something.pdf.  If the user
+    # has closed xpdf in the meantime, this will restart it and reopen
+    # the file.
+    xpdf -remote foo 'checkOpenFileAtPage(something.pdf, 7)'
+.RE
+.PP
 .SH EXIT CODES
 The Xpdf tools use the following exit codes:
 .TP
@@ -728,7 +801,7 @@
 99
 Other error.
 .SH AUTHOR
-The xpdf software and documentation are copyright 1996-2017 Glyph &
+The xpdf software and documentation are copyright 1996-2019 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR pdftops (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -3,11 +3,13 @@
 
 
 NAME
-       xpdf - Portable Document Format (PDF) file viewer (version 4.00)
+       xpdf - Portable Document Format (PDF) file viewer (version 4.01)
 
 SYNOPSIS
        xpdf [options] [PDF-file [:page | +dest]] ...
 
+       xpdf [options] -remote remote-name [command ...]
+
 DESCRIPTION
        Xpdf  is a viewer for Portable Document Format (PDF) files.  (These are
        also sometimes also called 'Acrobat' files, from the  name  of  Adobe's
@@ -108,10 +110,14 @@
        -fullscreen
               Open xpdf in full-screen mode, useful for presentations.
 
+       -remote remote-name
+              Start  Xpdf  in  remote server mode.  See the REMOVE SERVER MODE
+              section.
+
        -display display
               Set the X display (only available with X11).
 
-       -cmd   Print  commands  as  they're  executed  (useful  for debugging).
+       -cmd   Print commands  as  they're  executed  (useful  for  debugging).
               [config file: printCommands]
 
        -cfg config-file
@@ -125,7 +131,7 @@
 CONTROLS
    Tool bar
        'page' entry box
-              Move  to  a  specific page number.  Click in the box to activate
+              Move to a specific page number.  Click in the  box  to  activate
               it, type the page number, then hit return.
 
        left/right arrow buttons
@@ -135,11 +141,11 @@
               Zoom out or in (i.e., change magnification) incrementally.
 
        zoom popup menu
-              Change the zoom factor (see the description  of  the  -z  option
+              Change  the  zoom  factor  (see the description of the -z option
               above).
 
        fit width button
-              Change  the  zoom  factor  to  fit  the page width to the window
+              Change the zoom factor to fit  the  page  width  to  the  window
               width.
 
        fit page button
@@ -146,12 +152,12 @@
               Change the zoom factor to fit the page to the window size.
 
        working/error indicator
-              This icon is animated while Xpdf is rendering a page.  It  turns
-              red  when  an  error or warning has been issued.  Clicking on it
+              This  icon is animated while Xpdf is rendering a page.  It turns
+              red when an error or warning has been issued.   Clicking  on  it
               opens the error dialog.
 
        'find' box
-              Find a text string.  Click in the box to  activate  it,  type  a
+              Find  a  text  string.   Click in the box to activate it, type a
               search string, then hit return.
 
        find next button
@@ -165,41 +171,41 @@
               whole words (on/off).
 
    Menu bar
-       The menu bar is above the tool bar.  The menu  items  should  be  self-
+       The  menu  bar  is  above the tool bar.  The menu items should be self-
        explanatory.
 
    Tab list
-       The  tab  list  is  on the left, just below the tool bar.  It lists all
+       The tab list is on the left, just below the tool  bar.   It  lists  all
        open tabs.
 
    Outline/layers/attachments pane
-       This pane is on the left, below the tab list.  The popup allows you  to
+       This  pane is on the left, below the tab list.  The popup allows you to
        select from outline, layers, or attachments.
 
-       The  outline  is  a tree-like structure of bookmarks that allows moving
+       The outline is a tree-like structure of bookmarks  that  allows  moving
        within the PDF file.  Not all PDF files have outlines.
 
-       Layers (a.k.a. optional content) allow parts of the PDF content  to  be
+       Layers  (a.k.a.  optional content) allow parts of the PDF content to be
        shown or hidden.  Not all PDF files have layers.
 
-       Attachments  are  other files embedded within the PDF file.  There is a
-       'save' button for each attached file.  Not all PDF files  have  attach-
+       Attachments are other files embedded within the PDF file.  There  is  a
+       'save'  button  for each attached file.  Not all PDF files have attach-
        ments.
 
    Text selection
-       Dragging  the  mouse  with  the left button held down will highlight an
-       arbitrary rectangle.  Selected text can  be  copied  to  the  clipboard
-       (with  the  edit/copy menu item).  On X11, selected text will be avail-
+       Dragging the mouse with the left button held  down  will  highlight  an
+       arbitrary  rectangle.   Selected  text  can  be copied to the clipboard
+       (with the edit/copy menu item).  On X11, selected text will  be  avail-
        able in the X selection buffer.
 
    Links
-       When the mouse is over a hyperlink, the link target will be shown in  a
+       When  the mouse is over a hyperlink, the link target will be shown in a
        popup near the bottom of the window.
 
        Clicking on a hyperlink will jump to the link's destination.  A link to
-       another PDF document will make xpdf load  that  document.   A  'launch'
-       link  to  an executable program will display a dialog, and if you click
-       'ok', execute the program.  URL links are opened in a  system-dependent
+       another  PDF  document  will  make xpdf load that document.  A 'launch'
+       link to an executable program will display a dialog, and if  you  click
+       'ok',  execute the program.  URL links are opened in a system-dependent
        way.  (On UNIX, Qt uses the $BROWSER environment variable.)
 
    Mouse bindings
@@ -209,11 +215,11 @@
 
        Dragging the mouse with the middle button held down pans the window.
 
-       The  right  mouse  button  opens  a  popup  menu  (see  popupMenuCmd in
+       The right  mouse  button  opens  a  popup  menu  (see  popupMenuCmd  in
        xpdfrc(5)).
 
    Key bindings
-       This section lists the default key bindings.  Bindings can  be  changed
+       This  section  lists the default key bindings.  Bindings can be changed
        using the config file (see xpdfrc(5)).
 
        control-o
@@ -220,8 +226,8 @@
               Open a new PDF file via a file requester.
 
        control-r
-              Reload  the  current  PDF  file.  Note that Xpdf will reload the
-              file automatically (on a  page  change  or  redraw)  if  it  has
+              Reload the current PDF file.  Note that  Xpdf  will  reload  the
+              file  automatically  (on  a  page  change  or  redraw) if it has
               changed since it was last loaded.
 
        control-f
@@ -255,8 +261,8 @@
               Open a new window.
 
        control-w
-              Close  the  current tab.  Closes the window if this was the last
-              open tab.  Quits the application if this was the last open  win-
+              Close the current tab.  Closes the window if this was  the  last
+              open  tab.  Quits the application if this was the last open win-
               dow.
 
        control-q
@@ -288,11 +294,11 @@
               Go to the last page.
 
        <space> or <PageDown>
-              Scroll  down  on the current page; if already at bottom, move to
+              Scroll down on the current page; if already at bottom,  move  to
               next page.
 
        control-<PageDown> or control-<down-arrow>
-              Go to the next page.  If <ScrollLock> is active, this  maintains
+              Go  to the next page.  If <ScrollLock> is active, this maintains
               the relative position on the page.
 
        <PageUp>
@@ -300,7 +306,7 @@
               ous page.
 
        control-<PageUp> or control-<up-arrow>
-              Go to the previous page.  If <ScrollLock> is active, this  main-
+              Go  to the previous page.  If <ScrollLock> is active, this main-
               tains the relative position on the page.
 
        <esc>  Exit full-screen mode.
@@ -314,20 +320,20 @@
        w      Set the zoom factor to 'width' (fit page width to window).
 
 Full-screen mode
-       Xpdf  can  be  placed into full-screen mode via the -fullscreen command
-       line option,  the  'full  screen'  menu  item,  or  a  binding  to  the
-       fullScreenMode or toggleFullScreenModecommand.
+       Xpdf can be placed into full-screen mode via  the  -fullscreen  command
+       line  option,  the  'full  screen'  menu  item,  or  a  binding  to the
+       fullScreenMode or toggleFullScreenMode command.
 
-       Entering  full-screen  mode  automatically switches to single-page view
+       Entering full-screen mode automatically switches  to  single-page  view
        mode and to the fit-page zoom factor.
 
-       Full-screen mode can be exited via the default <esc>  key  binding,  or
+       Full-screen  mode  can  be exited via the default <esc> key binding, or
        via a binding to the windowMode or toggleFullScreenModecommand.
 
 COMMANDS
        Xpdf's key and mouse bindings are user-configurable, using the bind and
-       unbind commands in the config file (see xpdfrc(5)).  The  bind  command
-       allows  you  to bind a key or mouse button to a sequence of one or more
+       unbind  commands  in the config file (see xpdfrc(5)).  The bind command
+       allows you to bind a key or mouse button to a sequence of one  or  more
        commands.
 
        The following commands are supported:
@@ -339,6 +345,17 @@
               ple rectangle.  Any part of the page can be selected, regardless
               of the content on the page.
 
+       checkOpenFile(file)
+              Check that file is open in the current tab, and open it if not.
+
+       checkOpenFileAtDest(file,dest)
+              Check  that file is open in the current tab, and open it if not.
+              In either case go to the specified named destination.
+
+       checkOpenFileAtPage(file,page)
+              Check that file is open in the current tab, and open it if  not.
+              In either case go to the specified page.
+
        closeSidebar
               Close the sidebar.
 
@@ -386,29 +403,29 @@
               Set keyboard focus to the page number text box.
 
        followLink
-              Follow a hyperlink (does nothing if the  mouse  is  not  over  a
+              Follow  a  hyperlink  (does  nothing  if the mouse is not over a
               link).
 
        followLinkInNewTab
               Follow a hyperlink, opening PDF files in a new tab (does nothing
-              if the mouse is not over a link).  For links to  non-PDF  files,
+              if  the  mouse is not over a link).  For links to non-PDF files,
               this command is identical to followLink.
 
        followLinkInNewTabNoSel
-              Same  as followLinkInNewTab, but does nothing if there is a non-
+              Same as followLinkInNewTab, but does nothing if there is a  non-
               empty selection.  (This is useful as a mouse button binding.)
 
        followLinkInNewWin
-              Follow a hyperlink, opening PDF files  in  a  new  window  (does
-              nothing  if the mouse is not over a link).  For links to non-PDF
+              Follow  a  hyperlink,  opening  PDF  files in a new window (does
+              nothing if the mouse is not over a link).  For links to  non-PDF
               files, this command is identical to followLink.
 
        followLinkInNewWinNoSel
-              Same as followLinkInNewWin, but does nothing if there is a  non-
+              Same  as followLinkInNewWin, but does nothing if there is a non-
               empty selection.  (This is useful as a mouse button binding.)
 
        followLinkNoSel
-              Same  as  followLink,  but  does nothing if there is a non-empty
+              Same as followLink, but does nothing if  there  is  a  non-empty
               selection.  (This is useful as a mouse button binding.)
 
        fullScreenMode
@@ -435,9 +452,15 @@
               Switch to horizontal continuous view mode.
 
        linearSelectMode
-              Set linear selection mode.  In this mode, the selection  follows
+              Set  linear selection mode.  In this mode, the selection follows
               text.  Non-text regions cannot be selected.
 
+       loadTabState
+              Load the tab state file (which was written via the  saveTabState
+              command),  and  restore  the tabs listed in that file.  The path
+              for the tab state file is specified with the  tabStateFile  set-
+              ting (see xpdfrc(5)).
+
        newTab Open an empty new tab.
 
        newWindow
@@ -457,6 +480,17 @@
        openErrorWindow
               Open the error window.
 
+       openFile(file)
+              Open the specified file in the current tab.
+
+       openFileAtDest(file,dest)
+              Open  the  specified  file  in  the current tab at the specified
+              named destination.
+
+       openFileAtPage(file,page)
+              Open the specified file in the  current  tab  at  the  specified
+              page.
+
        openSidebar
               Open the sidebar.
 
@@ -530,6 +564,10 @@
 
                   bind x "run(ls -l)"
 
+              The command string may not be run through a shell.  It is recom-
+              mended to keep the command simple, so that it doesn't depend  on
+              specific  shell functionality.  For complex things, you can have
+              the command string run a shell script.
 
        saveAs Save PDF via a file requester.
 
@@ -536,10 +574,17 @@
        saveImage
               Open the 'save image' dialog.
 
+       saveTabState
+              Save a list of all tabs open in this window  to  the  tab  state
+              file.  For each tab, this writes the PDF file name and page num-
+              ber (on separate lines).  This file can be loaded later with the
+              loadTabState command.  The path for the tab state file is speci-
+              fied with the tabStateFile setting (see xpdfrc(5)).
+
        scrollDown(n)
               Scroll down by n pixels.
 
-       scrollDownPrevPage(n)
+       scrollDownNextPage(n)
               Scroll down by n pixels, moving to the next page if appropriate.
 
        scrollLeft(n)
@@ -555,36 +600,36 @@
               Scroll right by n pixels.
 
        scrollToBottomEdge
-              Scroll  to the bottom edge of the current page, with no horizon-
-              tal movement.
+              Scroll to the bottom edge of the last displayed  page,  with  no
+              horizontal movement.
 
        scrollToBottomRight
-              Scroll to the bottom-right corner of the current page.
+              Scroll to the bottom-right corner of the last displayed page.
 
        scrollToLeftEdge
-              Scroll to the left edge of the current page,  with  no  vertical
+              Scroll  to  the  left edge of the current page, with no vertical
               movement.
 
        scrollToRightEdge
-              Scroll  to  the right edge of the current page, with no vertical
+              Scroll to the right edge of the current page, with  no  vertical
               movement.
 
        scrollToTopEdge
-              Scroll to the top edge of the current page, with  no  horizontal
-              movement.
+              Scroll to the top edge of the first displayed page, with no hor-
+              izontal movement.
 
        scrollToTopLeft
-              Scroll to the top-left corner of the current page.
+              Scroll to the top-left corner of the first displayed page.
 
        scrollUp(n)
               Scroll up by n pixels.
 
        scrollUpPrevPage(n)
-              Scroll  up by n pixels, moving to the previous page if appropri-
+              Scroll up by n pixels, moving to the previous page if  appropri-
               ate.
 
        setSelection(pg,ulx,uly,lrx,lry)
-              Set the selection to the specified coordinates on the  specified
+              Set  the selection to the specified coordinates on the specified
               page.
 
        sideBySideContinuousMode
@@ -597,11 +642,11 @@
               Switch to single-page view mode.
 
        startPan
-              Start  a pan operation at the current mouse position, which will
+              Start a pan operation at the current mouse position, which  will
               scroll the document as the mouse moves.
 
        startSelection
-              Start a selection at the current mouse position, which  will  be
+              Start  a  selection at the current mouse position, which will be
               extended as the mouse moves.
 
        toggleContinuousMode
@@ -617,12 +662,12 @@
               Toggle the sidebar between open and closed.
 
        toggleSidebarMoveResizeWin
-              Toggle  the sidebar between open and closed, resizing the window
-              so that the document size doesn't change, and moving the  window
+              Toggle the sidebar between open and closed, resizing the  window
+              so  that the document size doesn't change, and moving the window
               so that the document stays in the same place on the screen.
 
        toggleSidebarResizeWin
-              Toggle  the sidebar between open and closed, resizing the window
+              Toggle the sidebar between open and closed, resizing the  window
               so that the document size doesn't change.
 
        windowMode
@@ -645,6 +690,24 @@
        zoomToSelection
               Zoom to the current selection.
 
+REMOTE SERVER MODE
+       Starting  xpdf  with  the  "-remote"  switch puts it into remote server
+       mode.  All remaining command line options are commands  (see  the  COM-
+       MANDS section).  Subsequent invocations of "xpdf -remote" with the same
+       remote server name will send commands to the  already-running  instance
+       of  xpdf.  The "checkOpenFile" commands are useful here for things like
+       changing pages.  For example:
+
+                  # Start up xpdf, and open something.pdf.
+                  xpdf -remote foo 'openFile(something.pdf)'
+
+                  # Switch to page 7 in the  already-open  something.pdf.   If
+              the user
+                  #  has closed xpdf in the meantime, this will restart it and
+              reopen
+                  # the file.
+                  xpdf -remote foo 'checkOpenFileAtPage(something.pdf, 7)'
+
 EXIT CODES
        The Xpdf tools use the following exit codes:
 
@@ -659,7 +722,7 @@
        99     Other error.
 
 AUTHOR
-       The xpdf software and documentation are  copyright  1996-2017  Glyph  &
+       The xpdf software and documentation are  copyright  1996-2019  Glyph  &
        Cog, LLC.
 
 SEE ALSO
@@ -669,4 +732,4 @@
 
 
 
-                                  10 Aug 2017                          xpdf(1)
+                                  18 Feb 2019                          xpdf(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5	2019-05-30 16:25:31 UTC (rev 814)
@@ -1,7 +1,7 @@
-.\" Copyright 2002-2017 Glyph & Cog, LLC
-.TH xpdfrc 5 "10 Aug 2017"
+.\" Copyright 2002-2019 Glyph & Cog, LLC
+.TH xpdfrc 5 "18 Feb 2019"
 .SH NAME
-xpdfrc \- configuration file for Xpdf tools (version 4.00)
+xpdfrc \- configuration file for Xpdf tools (version 4.01)
 .SH DESCRIPTION
 All of the Xpdf tools read a single configuration file.  If you have a
 .I .xpdfrc
@@ -234,18 +234,13 @@
 defaults to "no".
 .TP
 .BR psNeverRasterize " yes | no"
-If set to "yes", PostScript output will never be rasterized.  This
-will likely result in incorrect output for PDF files that use
-transparency.  (If both psAlwaysRasterize and psNeverRasterize are set
-to "yes", the psAlwaysRasterize setting wins.)  This defaults to "no".
+Pdftops rasterizes an pages that use transparency (because PostScript
+doesn't support transparency).  If psNeverRasterize is set to "yes",
+rasterization is disabled: pages will never be rasterized, even if
+they contain transparency.  This will likely result in incorrect
+output for PDF files that use transparency, and a warning message to
+that effect will be printed.  This defaults to "no".
 .TP
-.BI psFile " file\-or\-command"
-Sets the default PostScript file or print command for xpdf.  Commands
-start with a \'|' character; anything else is a file.  If the file
-name or command contains spaces it must be quoted.  This defaults to
-unset, which tells xpdf to generate a name of the form <file>.ps for a
-PDF file <file>.pdf.
-.TP
 .BI fontDir " dir"
 See the description above, in the DISPLAY FONTS section.
 .SH TEXT CONTROL AND CHARACTER MAPPING
@@ -330,6 +325,18 @@
 .I in\-hex
 will be converted to the specified output sequence.
 .TP
+.BI unicodeRemapping " remap\-file"
+Remap Unicode characters when doing text extraction.  This specifies a
+file that maps from a particular Unicode index to zero or more
+replacement Unicode indexes.  Each line of the remap file represents
+one Unicode character:
+
+.RI "    " in\-hex " " out\-hex1 " " out\-hex2 " ..."
+
+Any Unicode characters not listed will be left unchanged.  This
+function is typically used to remap things like non-breaking spaces,
+soft hyphens, ligatures, etc.
+.TP
 .BI unicodeMap " encoding\-name map\-file"
 Specifies the file with mapping from Unicode to
 .IR encoding\-name .
@@ -412,6 +419,16 @@
 mapExtTrueTypeFontsViaUnicode is set to "no", Xpdf will assume the
 character codes are GIDs (i.e., use an identity mapping).  This
 defaults to "yes".
+.TP
+.BI dropFont " font-name"
+Drop all text drawn in the specified font.  To drop text drawn in
+unnamed fonts, use:
+.nf
+
+    dropFont ""
+
+.fi
+There can be any number of dropFont commands.
 .SH RASTERIZER SETTINGS
 .TP
 .BR enableFreeType " yes | no"
@@ -450,6 +467,11 @@
 the same adjusted width (at the expense of allowing gaps and overlaps
 between adjacent lines).  This defaults to "yes".
 .TP
+.BR forceAccurateTiling " yes | no"
+If this is set to "yes", the TilingType is forced to 2 (no distortion)
+for all tiling patterns, regardless of the setting in the pattern
+dictionary.  This defaults to "no".
+.TP
 .BR screenType " dispersed | clustered | stochasticClustered"
 Sets the halftone screen type, which will be used when generating a
 monochrome (1-bit) bitmap.  The three options are dispersed-dot
@@ -518,7 +540,7 @@
 .BI initialSidebarState " yes | no"
 If set to "yes", xpdf opens with the sidebar (tabs, outline, etc.)
 visible.  If set to "no", xpdf opens with the sidebar collapsed.  The
-default is "no".
+default is "yes".
 .TP
 .BI paperColor " color"
 Set the "paper color", i.e., the background of the page display.  The
@@ -574,6 +596,9 @@
 string "%s" will be replaced with the movie file name.  This has no
 default value.
 .TP
+.BI defaultPrinter " printer"
+Sets the default printer used in the viewer's print dialog.
+.TP
 .BI bind " modifiers-key context command ..."
 Add a key or mouse button binding.
 .I Modifiers
@@ -652,6 +677,12 @@
 useful to remove default key bindings before establishing new ones
 (e.g., if the default key binding is given for "any" context, and you
 want to create new key bindings for multiple contexts).
+.TP
+.BI tabStateFile " path"
+Sets the file used by the loadTabState and saveTabState commands (see
+the
+.BR xpdf (1)
+man page for more information).
 .SH MISCELLANEOUS SETTINGS
 .TP
 .BI drawAnnotations " yes | no"
@@ -712,7 +743,6 @@
 psLevel              level2
 psEmbedType1Fonts    yes
 psEmbedTrueTypeFonts yes
-psFile               "| lpr \-Pprinter5"
 
 # assume that the PostScript printer has the Univers and
 # Univers-Bold fonts
@@ -726,7 +756,6 @@
 # misc options
 enableFreeType  yes
 launchCommand   viewer-script
-urlCommand      "netscape \-remote 'openURL(%s)'"
 
 .fi
 .SH FILES
@@ -739,7 +768,7 @@
 This is the user's configuration file.  If it exists, it will be read
 in place of the system-wide file.
 .SH AUTHOR
-The Xpdf software and documentation are copyright 1996-2017 Glyph &
+The Xpdf software and documentation are copyright 1996-2019 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat	2019-05-30 16:25:31 UTC (rev 814)
@@ -3,7 +3,7 @@
 
 
 NAME
-       xpdfrc - configuration file for Xpdf tools (version 4.00)
+       xpdfrc - configuration file for Xpdf tools (version 4.01)
 
 DESCRIPTION
        All  of the Xpdf tools read a single configuration file.  If you have a
@@ -216,19 +216,14 @@
               defaults to "no".
 
        psNeverRasterize yes | no
-              If set to "yes", PostScript output  will  never  be  rasterized.
-              This  will  likely result in incorrect output for PDF files that
-              use transparency.  (If both psAlwaysRasterize and psNeverRaster-
-              ize are set to "yes", the psAlwaysRasterize setting wins.)  This
+              Pdftops rasterizes an pages that use transparency (because Post-
+              Script  doesn't  support  transparency).  If psNeverRasterize is
+              set to "yes", rasterization is disabled:  pages  will  never  be
+              rasterized, even if they contain transparency.  This will likely
+              result in incorrect output for PDF files that use  transparency,
+              and  a  warning  message  to  that effect will be printed.  This
               defaults to "no".
 
-       psFile file-or-command
-              Sets the default PostScript file  or  print  command  for  xpdf.
-              Commands  start  with  a '|' character; anything else is a file.
-              If the file name or command contains spaces it must  be  quoted.
-              This  defaults  to unset, which tells xpdf to generate a name of
-              the form <file>.ps for a PDF file <file>.pdf.
-
        fontDir dir
               See the description above, in the DISPLAY FONTS section.
 
@@ -305,11 +300,23 @@
               indexes.  Each occurrence of in-hex will  be  converted  to  the
               specified output sequence.
 
+       unicodeRemapping remap-file
+              Remap Unicode characters when doing text extraction.  This spec-
+              ifies a file that maps from a particular Unicode index  to  zero
+              or  more  replacement  Unicode  indexes.  Each line of the remap
+              file represents one Unicode character:
+
+                  in-hex out-hex1 out-hex2 ...
+
+              Any Unicode characters not listed will be left unchanged.   This
+              function  is  typically  used  to remap things like non-breaking
+              spaces, soft hyphens, ligatures, etc.
+
        unicodeMap encoding-name map-file
-              Specifies  the  file with mapping from Unicode to encoding-name.
+              Specifies the file with mapping from Unicode  to  encoding-name.
               These encodings are used for text output (see below).  Each line
-              of  a  unicodeMap file represents a range of one or more Unicode
-              characters which maps linearly to a range in the  output  encod-
+              of a unicodeMap file represents a range of one or  more  Unicode
+              characters  which  maps linearly to a range in the output encod-
               ing:
 
                    in-start-hex in-end-hex out-start-hex
@@ -318,54 +325,62 @@
 
                    in-hex out-hex
 
-              The  in-start-hex  and  in-end-hex  fields (or the single in-hex
-              field) specify the Unicode range.  The out-start-hex  field  (or
-              the  out-hex  field)  specifies the start of the output encoding
-              range.  The length of  the  out-start-hex  (or  out-hex)  string
+              The in-start-hex and in-end-hex fields  (or  the  single  in-hex
+              field)  specify  the Unicode range.  The out-start-hex field (or
+              the out-hex field) specifies the start of  the  output  encoding
+              range.   The  length  of  the  out-start-hex (or out-hex) string
               determines the length of the output characters (e.g., UTF-8 uses
-              different numbers of bytes to represent characters in  different
-              ranges).   Entries  must  be  given in increasing Unicode order.
-              Only one file is allowed per encoding; the last  specified  file
-              is  used.   The Latin1, ASCII7, Symbol, ZapfDingbats, UTF-8, and
+              different  numbers of bytes to represent characters in different
+              ranges).  Entries must be given  in  increasing  Unicode  order.
+              Only  one  file is allowed per encoding; the last specified file
+              is used.  The Latin1, ASCII7, Symbol, ZapfDingbats,  UTF-8,  and
               UCS-2 encodings are predefined.
 
        cMapDir registry-ordering dir
-              Specifies a search  directory,  dir,  for  CMaps  for  the  reg-
-              istry-ordering  character  collection.   There  can  be multiple
-              directories for a particular collection.  There are  no  default
+              Specifies  a  search  directory,  dir,  for  CMaps  for the reg-
+              istry-ordering character  collection.   There  can  be  multiple
+              directories  for  a particular collection.  There are no default
               CMap directories.
 
        toUnicodeDir dir
-              Specifies  a  search directory, dir, for ToUnicode CMaps.  There
-              can be multiple ToUnicode directories.   There  are  no  default
+              Specifies a search directory, dir, for ToUnicode  CMaps.   There
+              can  be  multiple  ToUnicode  directories.  There are no default
               ToUnicode directories.
 
        mapNumericCharNames yes | no
-              If  set  to  "yes",  the  Xpdf tools will attempt to map various
+              If set to "yes", the Xpdf tools  will  attempt  to  map  various
               numeric character names sometimes used in font subsets.  In some
-              cases  this leads to usable text, and in other cases it leads to
+              cases this leads to usable text, and in other cases it leads  to
               gibberish -- there is no way for Xpdf to tell.  This defaults to
               "yes".
 
        mapUnknownCharNames yes | no
-              If  set  to  "yes",  and mapNumericCharNames is set to "no", the
-              Xpdf tools will apply a  simple  pass-through  mapping  (Unicode
-              index  = character code) for all unrecognized glyph names.  (For
-              CID fonts, setting mapNumericCharNames to "no" is  unnecessary.)
-              In  some cases, this leads to usable text, and in other cases it
-              leads to gibberish -- there is no way for Xpdf  to  tell.   This
+              If set to "yes", and mapNumericCharNames is  set  to  "no",  the
+              Xpdf  tools  will  apply  a simple pass-through mapping (Unicode
+              index = character code) for all unrecognized glyph names.   (For
+              CID  fonts, setting mapNumericCharNames to "no" is unnecessary.)
+              In some cases, this leads to usable text, and in other cases  it
+              leads  to  gibberish  -- there is no way for Xpdf to tell.  This
               defaults to "no".
 
        mapExtTrueTypeFontsViaUnicode yes | no
               When rasterizing text using an external TrueType font, there are
-              two options for handling character  codes.   If  mapExtTrueType-
-              FontsViaUnicode  is  set to "yes", Xpdf will use the font encod-
-              ing/ToUnicode info to map character codes to Unicode,  and  then
-              use  the font's Unicode cmap to map Unicode to GIDs.  If mapExt-
-              TrueTypeFontsViaUnicode is set to "no",  Xpdf  will  assume  the
-              character  codes are GIDs (i.e., use an identity mapping).  This
+              two  options  for  handling character codes.  If mapExtTrueType-
+              FontsViaUnicode is set to "yes", Xpdf will use the  font  encod-
+              ing/ToUnicode  info  to map character codes to Unicode, and then
+              use the font's Unicode cmap to map Unicode to GIDs.  If  mapExt-
+              TrueTypeFontsViaUnicode  is  set  to  "no", Xpdf will assume the
+              character codes are GIDs (i.e., use an identity mapping).   This
               defaults to "yes".
 
+       dropFont font-name
+              Drop  all  text drawn in the specified font.  To drop text drawn
+              in unnamed fonts, use:
+
+                  dropFont ""
+
+              There can be any number of dropFont commands.
+
 RASTERIZER SETTINGS
        enableFreeType yes | no
               Enables or disables use of FreeType (a TrueType /  Type  1  font
@@ -404,6 +419,11 @@
               (at the expense of allowing gaps and overlaps  between  adjacent
               lines).  This defaults to "yes".
 
+       forceAccurateTiling yes | no
+              If  this is set to "yes", the TilingType is forced to 2 (no dis-
+              tortion) for all tiling patterns, regardless of the  setting  in
+              the pattern dictionary.  This defaults to "no".
+
        screenType dispersed | clustered | stochasticClustered
               Sets  the halftone screen type, which will be used when generat-
               ing a monochrome (1-bit) bitmap.  The  three  options  are  dis-
@@ -476,7 +496,7 @@
        initialSidebarState yes | no
               If set to "yes", xpdf opens with  the  sidebar  (tabs,  outline,
               etc.)   visible.   If  set  to "no", xpdf opens with the sidebar
-              collapsed.  The default is "no".
+              collapsed.  The default is "yes".
 
        paperColor color
               Set the "paper color", i.e., the background of the page display.
@@ -529,6 +549,9 @@
               The string "%s" will be replaced with the movie file name.  This
               has no default value.
 
+       defaultPrinter printer
+              Sets the default printer used in the viewer's print dialog.
+
        bind modifiers-key context command ...
               Add  a  key  or  mouse button binding.  Modifiers can be zero or
               more of:
@@ -595,26 +618,30 @@
               "any" context, and you want to create new key bindings for  mul-
               tiple contexts).
 
+       tabStateFile path
+              Sets the file used by the loadTabState and saveTabState commands
+              (see the xpdf(1) man page for more information).
+
 MISCELLANEOUS SETTINGS
        drawAnnotations yes | no
-              If  set  to "no", annotations will not be drawn or printed.  The
+              If set to "no", annotations will not be drawn or  printed.   The
               default value is "yes".
 
        drawFormFields yes | no
-              If set to "no", form fields will not be drawn or  printed.   The
+              If  set  to "no", form fields will not be drawn or printed.  The
               default value is "yes".
 
        enableXFA yes | no
-              If  set  to  "yes", an XFA form (if present) will be rendered in
-              place of an AcroForm.  If "no", an XFA form will never  be  ren-
+              If set to "yes", an XFA form (if present) will  be  rendered  in
+              place  of  an AcroForm.  If "no", an XFA form will never be ren-
               dered.  This defaults to "yes".
 
        printCommands yes | no
-              If  set  to  "yes", drawing commands are printed as they're exe-
+              If set to "yes", drawing commands are printed  as  they're  exe-
               cuted (useful for debugging).  This defaults to "no".
 
        errQuiet yes | no
-              If set to "yes", this suppresses all error and warning  messages
+              If  set to "yes", this suppresses all error and warning messages
               from all of the Xpdf tools.  This defaults to "no".
 
 EXAMPLES
@@ -654,7 +681,6 @@
        psLevel              level2
        psEmbedType1Fonts    yes
        psEmbedTrueTypeFonts yes
-       psFile               "| lpr -Pprinter5"
 
        # assume that the PostScript printer has the Univers and
        # Univers-Bold fonts
@@ -668,12 +694,11 @@
        # misc options
        enableFreeType  yes
        launchCommand   viewer-script
-       urlCommand      "netscape -remote 'openURL(%s)'"
 
 
 FILES
        /usr/local/etc/xpdfrc
-              This  is  the default location for the system-wide configuration
+              This is the default location for the  system-wide  configuration
               file.  Depending on build options, it may be placed elsewhere.
 
        $HOME/.xpdfrc
@@ -681,14 +706,14 @@
               read in place of the system-wide file.
 
 AUTHOR
-       The  Xpdf  software  and  documentation are copyright 1996-2017 Glyph &
+       The Xpdf software and documentation are  copyright  1996-2019  Glyph  &
        Cog, LLC.
 
 SEE ALSO
-       xpdf(1),  pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),   pdf-
+       xpdf(1),   pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),  pdf-
        fonts(1), pdfdetach(1), pdftoppm(1), pdftopng(1), pdfimages(1)
        http://www.xpdfreader.com/
 
 
 
-                                  10 Aug 2017                        xpdfrc(5)
+                                  18 Feb 2019                        xpdfrc(5)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -543,6 +543,21 @@
   { 0x000002e4, 0x05bcf058,	// MingLiU 1996-
     0x000087c4, 0x28233bf1,
     0x000001e1, 0xa344a1eb },
+  { 0x00000350,	0x12c3ebb2,	// DFGothic-EB
+    0x000087a7, 0xb680ee64,
+    0x00000758, 0xce939563 },
+  { 0x00000350, 0x11e5ead4,	// DFGyoSho-Lt
+    0x0000bc85, 0xce5956e9,
+    0x00000045, 0x8272f416 },
+  { 0x00000350, 0x1262eb4e,	// DFHSGothic-W5
+    0x00007940, 0xe86a5d64,
+    0x000005ff, 0x7850f729 },
+  { 0x00000350, 0x122deb0a,	// DFHSMincho-W3
+    0x0000859b, 0x3d16328a,
+    0x000002cb, 0xa93fc33b },
+  { 0x00000350, 0x125feb26,	// DFHSMincho-W7
+    0x00007ee1, 0xa5acc982,
+    0x0000041f, 0x90999196 },
   { 0x00000350, 0x11e5ead4,	// DFKaiShu
     0x00009063, 0x5a30ca3b,
     0x0000007e, 0x13a42602 },
@@ -590,7 +605,10 @@
     0x000022e0, 0x40745a5f },
   { 0x00000000, 0x00000000,	// NEC FA-RoundGothicM, 1996
     0x000001c2, 0xf055fc48,
-    0x00001e18, 0x3900ded3 }
+    0x00001e18, 0x3900ded3 },
+  { 0x00000060, 0x00170003,	// MINGLI, 1992
+    0x000058aa, 0xdbb4306e,
+    0x00000035, 0xd643482a }
 };
 
 #define nTrickyFonts ((int)(sizeof(trickyFonts) / sizeof(FoFiTrueTypeTrickyFont)))
@@ -965,9 +983,9 @@
   delete ff;
 }
 
-void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
-			    void *outputStream, char *name,
-			    int *codeToGID) {
+GBool FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
+			     void *outputStream, char *name,
+			     int *codeToGID) {
   // this substitute cmap table maps char code ffff to glyph 0,
   // with tables for MacRoman and MS Unicode
   static char cmapTab[44] = {
@@ -1061,7 +1079,7 @@
   int pos, i, j, k, n;
 
   if (openTypeCFF) {
-    return;
+    return gFalse;
   }
 
   // check for missing tables
@@ -1172,7 +1190,8 @@
       nZeroLengthTables == 0 && nBogusTables == 0 &&
       !name && !codeToGID && !isDfont) {
     (*outputFunc)(outputStream, (char *)file, len);
-    goto done1;
+    gfree(locaTable);
+    return gFalse;
   }
 
   // sort the 'loca' table: some (non-compliant) fonts have
@@ -1263,11 +1282,13 @@
       newNameTab[6 + i*12 + 4] = 0x04;	// language ID = American English
       newNameTab[6 + i*12 + 5] = 0x09;
       newNameTab[6 + i*12 + 6] = 0;	// name ID
-      newNameTab[6 + i*12 + 7] = i + 1;
-      newNameTab[6 + i*12 + 8] = i+1 == 2 ? 0 : ((2*n) >> 8); // string length
-      newNameTab[6 + i*12 + 9] = i+1 == 2 ? 14 : ((2*n) & 0xff);
-      newNameTab[6 + i*12 + 10] = next >> 8;		    // string offset
-      newNameTab[6 + i*12 + 11] = next & 0xff;
+      newNameTab[6 + i*12 + 7] = (char)(i + 1);
+      // string length
+      newNameTab[6 + i*12 + 8] = (char)(i+1 == 2 ? 0 : ((2*n) >> 8));
+      newNameTab[6 + i*12 + 9] = (char)(i+1 == 2 ? 14 : ((2*n) & 0xff));
+      // string offset
+      newNameTab[6 + i*12 + 10] = (char)(next >> 8);
+      newNameTab[6 + i*12 + 11] = (char)(next & 0xff);
       if (i+1 == 2) {
 	memcpy(newNameTab + 6 + 4*12 + next, "\0R\0e\0g\0u\0l\0a\0r", 14);
 	next += 14;
@@ -1340,8 +1361,8 @@
 	newCmapTab[44 + 2*i] = 0;
 	newCmapTab[44 + 2*i + 1] = 0;
       } else {
-	newCmapTab[44 + 2*i] = codeToGID[i] >> 8;
-	newCmapTab[44 + 2*i + 1] = codeToGID[i] & 0xff;
+	newCmapTab[44 + 2*i] = (char)(codeToGID[i] >> 8);
+	newCmapTab[44 + 2*i + 1] = (char)(codeToGID[i] & 0xff);
       }
     }
   } else {
@@ -1356,10 +1377,10 @@
     newHHEALen = 36;
     newHHEATab = (char *)gmalloc(newHHEALen);
     for (i = 0; i < newHHEALen; ++i) {
-      newHHEATab[i] = getU8(pos++, &ok);
+      newHHEATab[i] = (char)getU8(pos++, &ok);
     }
-    newHHEATab[34] = nGlyphs >> 8;
-    newHHEATab[35] = nGlyphs & 0xff;
+    newHHEATab[34] = (char)(nGlyphs >> 8);
+    newHHEATab[35] = (char)(nGlyphs & 0xff);
     i = seekTable("hmtx");
     pos = tables[i].offset;
     newHMTXLen = 4 * nGlyphs;
@@ -1369,18 +1390,18 @@
       advWidth = getU16BE(pos, &ok);
       lsb = getU16BE(pos + 2, &ok);
       pos += 4;
-      newHMTXTab[4*i    ] = advWidth >> 8;
-      newHMTXTab[4*i + 1] = advWidth & 0xff;
-      newHMTXTab[4*i + 2] = lsb >> 8;
-      newHMTXTab[4*i + 3] = lsb & 0xff;
+      newHMTXTab[4*i    ] = (char)(advWidth >> 8);
+      newHMTXTab[4*i + 1] = (char)(advWidth & 0xff);
+      newHMTXTab[4*i + 2] = (char)(lsb >> 8);
+      newHMTXTab[4*i + 3] = (char)(lsb & 0xff);
     }
     for (; i < nGlyphs; ++i) {
       lsb = getU16BE(pos, &ok);
       pos += 2;
-      newHMTXTab[4*i    ] = advWidth >> 8;
-      newHMTXTab[4*i + 1] = advWidth & 0xff;
-      newHMTXTab[4*i + 2] = lsb >> 8;
-      newHMTXTab[4*i + 3] = lsb & 0xff;
+      newHMTXTab[4*i    ] = (char)(advWidth >> 8);
+      newHMTXTab[4*i + 1] = (char)(advWidth & 0xff);
+      newHMTXTab[4*i + 2] = (char)(lsb >> 8);
+      newHMTXTab[4*i + 3] = (char)(lsb & 0xff);
     }
   } else {
     newHHEATab = newHMTXTab = NULL;
@@ -1554,10 +1575,10 @@
     if (newTables[i].tag == headTag) {
       if (checkRegion(newTables[i].origOffset, newTables[i].len)) {
 	(*outputFunc)(outputStream, (char *)file + newTables[i].origOffset, 8);
-	checksumBuf[0] = fileChecksum >> 24;
-	checksumBuf[1] = fileChecksum >> 16;
-	checksumBuf[2] = fileChecksum >> 8;
-	checksumBuf[3] = fileChecksum;
+	checksumBuf[0] = (char)(fileChecksum >> 24);
+	checksumBuf[1] = (char)(fileChecksum >> 16);
+	checksumBuf[2] = (char)(fileChecksum >> 8);
+	checksumBuf[3] = (char)fileChecksum;
 	(*outputFunc)(outputStream, checksumBuf, 4);
 	(*outputFunc)(outputStream,
 		      (char *)file + newTables[i].origOffset + 12,
@@ -1636,8 +1657,8 @@
   gfree(newNameTab);
   gfree(tableDir);
   gfree(newTables);
- done1:
   gfree(locaTable);
+  return gTrue;
 }
 
 void FoFiTrueType::cvtEncoding(char **encoding,
@@ -1907,15 +1928,15 @@
 	  checksum = computeTableChecksum(file + tables[j].offset, length);
 	}
       } else if (needVerticalMetrics && i == t42VheaTable) {
-	vheaTab[10] = advance / 256;    // max advance height
-	vheaTab[11] = advance % 256;
+	vheaTab[10] = (Guchar)(advance / 256);    // max advance height
+	vheaTab[11] = (Guchar)(advance % 256);
 	length = sizeof(vheaTab);
 	checksum = computeTableChecksum(vheaTab, length);
       } else if (needVerticalMetrics && i == t42VmtxTable) {
 	length = 4 + (nGlyphs - 1) * 2;
 	vmtxTab = (Guchar *)gmalloc(length);
-	vmtxTab[0] = advance / 256;
-	vmtxTab[1] = advance % 256;
+	vmtxTab[0] = (Guchar)(advance / 256);
+	vmtxTab[1] = (Guchar)(advance % 256);
 	for (j = 2; j < length; j += 2) {
 	  vmtxTab[j] = 0;
 	  vmtxTab[j+1] = 0;
@@ -1950,7 +1971,7 @@
   tableDir[2] = 0x00;
   tableDir[3] = 0x00;
   tableDir[4] = 0;		// numTables
-  tableDir[5] = nNewTables;
+  tableDir[5] = (Guchar)nNewTables;
   tableDir[6] = 0;		// searchRange
   tableDir[7] = (Guchar)128;
   tableDir[8] = 0;		// entrySelector
@@ -2343,12 +2364,9 @@
     if (!ok) {
       goto err;
     }
-    if (n > nGlyphs) {
-      n = nGlyphs;
-    }
     stringIdx = 0;
     stringPos = tablePos + 34 + 2*n;
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < n && i < nGlyphs; ++i) {
       ok = gTrue;
       j = getU16BE(tablePos + 34 + 2*i, &ok);
       if (j < 258) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -155,9 +155,9 @@
   // to <name>.  If <codeToGID> is non-NULL, the font is re-encoded,
   // using a Windows Unicode cmap.  If <name> is NULL and the font is
   // complete and correct, it will be written unmodified.  (Not useful
-  // for OpenType CFF fonts.)
-  void writeTTF(FoFiOutputFunc outputFunc, void *outputStream,
-		char *name = NULL, int *codeToGID = NULL);
+  // for OpenType CFF fonts.)  Returns true if the font was modified.
+  GBool writeTTF(FoFiOutputFunc outputFunc, void *outputStream,
+		 char *name = NULL, int *codeToGID = NULL);
 
   // Returns a pointer to the CFF font embedded in this OpenType font.
   // If successful, sets *<start> and *<length>, and returns true.

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -195,7 +195,7 @@
   char buf[256];
   char c;
   int n, code, base, i, j;
-  GBool gotMatrix;
+  GBool gotMatrix, startsWithDup, endsWithDup;
 
   gotMatrix = gFalse;
   for (i = 1, line = (char *)file;
@@ -231,9 +231,14 @@
 	strncpy(buf, line, n);
 	buf[n] = '\0';
 	for (p = buf; *p == ' ' || *p == '\t'; ++p) ;
-	if (!strncmp(p, "dup", 3)) {
+	endsWithDup = !strncmp(line - 4, "dup\x0a", 4) ||
+	              !strncmp(line - 5, "dup\x0d", 4);
+	startsWithDup = !strncmp(p, "dup", 3);
+	if (endsWithDup || startsWithDup) {
+	  if (startsWithDup) {
+	    p += 3;
+	  }
 	  while (1) {
-	    p += 3;
 	    for (; *p == ' ' || *p == '\t'; ++p) ;
 	    code = 0;
 	    if (*p == '8' && p[1] == '#') {
@@ -268,6 +273,7 @@
 	    if (strncmp(p, "dup", 3)) {
 	      break;
 	    }
+	    p += 3;
 	  }
 	} else {
 	  if (strtok(buf, " \t") &&

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -2000,9 +2000,9 @@
   if (top) {
     r2 = 4330;
     for (i = start; i < charBuf->getLength(); ++i) {
-      byte = charBuf->getChar(i) ^ (r2 >> 8);
+      byte = (Guchar)(charBuf->getChar(i) ^ (r2 >> 8));
       charBuf->setChar(i, byte);
-      r2 = (byte + r2) * 52845 + 22719;
+      r2 = (Gushort)((byte + r2) * 52845 + 22719);
     }
   }
 }
@@ -2112,8 +2112,8 @@
   Guchar x;
 
   for (p = (Guchar *)s; *p; ++p) {
-    x = *p ^ (eb->r1 >> 8);
-    eb->r1 = (x + eb->r1) * 52845 + 22719;
+    x = *p ^ (Guchar)(eb->r1 >> 8);
+    eb->r1 = (Gushort)((x + eb->r1) * 52845 + 22719);
     if (eb->ascii) {
       (*eb->outputFunc)(eb->outputStream, &hexChars[x >> 4], 1);
       (*eb->outputFunc)(eb->outputStream, &hexChars[x & 0x0f], 1);
@@ -2135,8 +2135,8 @@
 
   // eexec encryption
   for (i = 0; i < n; ++i) {
-    x = s[i] ^ (eb->r1 >> 8);
-    eb->r1 = (x + eb->r1) * 52845 + 22719;
+    x = s[i] ^ (Guchar)(eb->r1 >> 8);
+    eb->r1 = (Gushort)((x + eb->r1) * 52845 + 22719);
     if (eb->ascii) {
       (*eb->outputFunc)(eb->outputStream, &hexChars[x >> 4], 1);
       (*eb->outputFunc)(eb->outputStream, &hexChars[x & 0x0f], 1);
@@ -2163,14 +2163,14 @@
     c = *p & 0xff;
     if (c == '(' || c == ')' || c == '\\') {
       buf[i++] = '\\';
-      buf[i++] = c;
+      buf[i++] = (char)c;
     } else if (c < 0x20 || c >= 0x80) {
       buf[i++] = '\\';
-      buf[i++] = '0' + ((c >> 6) & 7);
-      buf[i++] = '0' + ((c >> 3) & 7);
-      buf[i++] = '0' + (c & 7);
+      buf[i++] = (char)('0' + ((c >> 6) & 7));
+      buf[i++] = (char)('0' + ((c >> 3) & 7));
+      buf[i++] = (char)('0' + (c & 7));
     } else {
-      buf[i++] = c;
+      buf[i++] = (char)c;
     }
     if (i >= 64) {
       buf[i++] = '\\';
@@ -2596,7 +2596,7 @@
 	  return;
 	}
 	for (j = gid0; j < gid1; ++j) {
-	  fdSelect[j] = fd;
+	  fdSelect[j] = (Guchar)fd;
 	}
 	gid0 = gid1;
       }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -68,8 +68,11 @@
 
 #if defined(_WIN32)
   newVal = _InterlockedIncrement(counter);
-#elif defined(__GNUC__) // this also works for LLVM/clang
+#elif defined(__GNUC__) || defined(__xlC__)
+  // __GNUC__ also covers LLVM/clang
   newVal = __sync_add_and_fetch(counter, 1);
+#elif defined(__SUNPRO_CC)
+  newVal = atomic_inc_ulong_nv((ulong_t *)counter);
 #else
 #  error "gAtomicIncrement is not defined for this compiler/platform"
 #endif
@@ -83,8 +86,11 @@
 
 #if defined(_WIN32)
   newVal = _InterlockedDecrement(counter);
-#elif defined(__GNUC__) // this also works for LLVM/clang
+#elif defined(__GNUC__) || defined(__xlC__)
+  // __GNUC__ also covers LLVM/clang
   newVal = __sync_sub_and_fetch(counter, 1);
+#elif defined(__SUNPRO_CC)
+  newVal = atomic_dec_ulong_nv((ulong_t *)counter);
 #else
 #  error "gAtomicDecrement is not defined for this compiler/platform"
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -656,7 +656,7 @@
     x2 = floor(0.1 * (x + 0.5));
     d = (int)floor(x - 10 * x2 + 0.5);
     if (started || d != 0) {
-      buf[--i] = '0' + d;
+      buf[--i] = (char)('0' + d);
       started = gTrue;
     }
     x = x2;
@@ -668,7 +668,7 @@
     do {
       x2 = floor(0.1 * (x + 0.5));
       d = (int)floor(x - 10 * x2 + 0.5);
-      buf[--i] = '0' + d;
+      buf[--i] = (char)('0' + d);
       x = x2;
     } while (i > 1 && x);
   }
@@ -757,7 +757,7 @@
 
   for (i = 0; i < length; ++i) {
     if (islower(s[i] & 0xff)) {
-      s[i] = toupper(s[i] & 0xff);
+      s[i] = (char)toupper(s[i] & 0xff);
     }
   }
   return this;
@@ -768,7 +768,7 @@
 
   for (i = 0; i < length; ++i) {
     if (isupper(s[i] & 0xff)) {
-      s[i] = tolower(s[i] & 0xff);
+      s[i] = (char)tolower(s[i] & 0xff);
     }
   }
   return this;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -32,6 +32,7 @@
 #    include <unixlib.h>
 #  endif
 #endif // _WIN32
+#include "gmem.h"
 #include "gmempp.h"
 #include "GString.h"
 #include "gfile.h"
@@ -291,7 +292,7 @@
   char *p;
 
   if ((p = strrchr(fileName, '/')))
-    return new GString(fileName, p - fileName);
+    return new GString(fileName, (int)(p - fileName));
   return new GString();
 #endif
 }
@@ -372,12 +373,12 @@
 #else
       for (p2 = p1; *p2 && *p2 != '/'; ++p2) ;
 #endif
-      if ((n = p2 - p1) > PATH_MAX)
+      if ((n = (int)(p2 - p1)) > PATH_MAX)
 	n = PATH_MAX;
       strncpy(buf, p1, n);
       buf[n] = '\0';
       if ((pw = getpwnam(buf))) {
-	path->del(0, p2 - p1 + 1);
+	path->del(0, (int)(p2 - p1 + 1));
 	path->insert(0, pw->pw_dir);
       }
     }
@@ -488,7 +489,7 @@
       *name = new GString("/tmp");
     }
     (*name)->append("/XXXXXX")->append(ext);
-    fd = mkstemps((*name)->getCString(), strlen(ext));
+    fd = mkstemps((*name)->getCString(), (int)strlen(ext));
 #else
     if (!(s = tmpnam(NULL))) {
       return gFalse;
@@ -522,7 +523,7 @@
   return gTrue;
 #endif
 }
-#endif
+#endif /* !PDF_PARSER_ONLY */
 
 GBool createDir(char *path, int mode) {
 #ifdef _WIN32
@@ -579,7 +580,7 @@
 #endif
 
 FILE *openFile(const char *path, const char *mode) {
-#ifdef _WIN32
+#if defined(_WIN32)
   return fopen(path, mode);
 #if 0
   OSVERSIONINFO version;
@@ -612,7 +613,7 @@
       }
     }
     wPath[i] = (wchar_t)0;
-    for (i = 0; mode[i] && i < sizeof(mode) - 1; ++i) {
+    for (i = 0; mode[i] && i < sizeof(wMode) - 1; ++i) {
       wMode[i] = (wchar_t)(mode[i] & 0xff);
     }
     wMode[i] = (wchar_t)0;
@@ -639,6 +640,8 @@
     return fopen(nPath, mode);
   }
 #endif /* 0 */
+#elif defined(VMS)
+  return fopen(path, mode, "ctx=stm");
 #else
   return fopen(path, mode);
 #endif
@@ -696,3 +699,31 @@
   return ftell(f);
 #endif
 }
+
+#ifndef PDF_PARSER_ONLY
+void fixCommandLine(int *argc, char **argv[]) {
+#ifdef _WIN32
+  int argcw;
+  wchar_t **argvw;
+  GString *arg;
+  int i;
+
+  argvw = CommandLineToArgvW(GetCommandLineW(), &argcw);
+  if (!argvw || argcw < 0) {
+    return;
+  }
+
+  *argc = argcw;
+
+  *argv = (char **)gmallocn(argcw + 1, sizeof(char *));
+  for (i = 0; i < argcw; ++i) {
+    arg = fileNameToUTF8(argvw[i]);
+    (*argv)[i] = copyString(arg->getCString());
+    delete arg;
+  }
+  (*argv)[argcw] = NULL;
+
+  LocalFree(argvw);
+#endif
+}
+#endif /* !PDF_PARSER_ONLY */

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -112,4 +112,10 @@
 // Like ftell, but returns a 64-bit file offset if available.
 extern GFileOffset gftell(FILE *f);
 
+// On Windows, this gets the Unicode command line and converts it to
+// UTF-8.  On other systems, this is a nop.
+#ifndef PDF_PARSER_ONLY
+extern void fixCommandLine(int *argc, char **argv[]);
+#endif /* !PDF_PARSER_ONLY */
+
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -10,6 +10,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
+// older compilers won't define SIZE_MAX in stdint.h without this
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
 #include <string.h>
 #include <limits.h>
 #if MULTITHREADED && defined(_WIN32)
@@ -21,8 +24,8 @@
 
 typedef struct _GMemHdr {
   unsigned int magic;
-  int size;
   int index;
+  size_t size;
   struct _GMemHdr *next, *prev;
 } GMemHdr;
 
@@ -39,15 +42,18 @@
 
 /* round data size so trailer will be aligned */
 #define gMemDataSize(size) \
-  ((((size) + gMemTrlSize - 1) / gMemTrlSize) * gMemTrlSize)
+  (int)(((((size) + gMemTrlSize - 1) / gMemTrlSize) * gMemTrlSize))
 
+#define gMemDataSize64(size) \
+  (size_t)(((((size) + gMemTrlSize - 1) / gMemTrlSize) * gMemTrlSize))
+
 static GMemHdr *gMemHead = NULL;
 static GMemHdr *gMemTail = NULL;
 
 static int gMemIndex = 0;
 static int gMemAlloc = 0;
-static int gMemInUse = 0;
-static int gMaxMemInUse = 0;
+static size_t gMemInUse = 0;
+static size_t gMaxMemInUse = 0;
 
 #if MULTITHREADED
 #  ifdef _WIN32
@@ -161,7 +167,7 @@
   }
   if (p) {
     hdr = (GMemHdr *)((char *)p - gMemHdrSize);
-    oldSize = hdr->size;
+    oldSize = (int)hdr->size;
     q = gmalloc(size);
     memcpy(q, p, size < oldSize ? size : oldSize);
     gfree(p);
@@ -206,6 +212,80 @@
   return gmalloc(n);
 }
 
+#ifdef DEBUG_MEM
+void *gmalloc64(size_t size, int ignore) GMEM_EXCEP {
+  size_t size1;
+  char *mem;
+  GMemHdr *hdr;
+  void *data;
+  unsigned long *trl, *p;
+
+  gMemInitMutex;
+  if (size == 0) {
+    return NULL;
+  }
+  size1 = gMemDataSize64(size);
+  if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
+    gMemError("Out of memory");
+  }
+  hdr = (GMemHdr *)mem;
+  data = (void *)(mem + gMemHdrSize);
+  trl = (unsigned long *)(mem + gMemHdrSize + size1);
+  hdr->magic = gMemMagic;
+  hdr->size = size;
+  if (ignore) {
+    hdr->index = -1;
+  } else {
+    hdr->index = gMemIndex++;
+  }
+  gMemLock;
+  if (gMemTail) {
+    gMemTail->next = hdr;
+    hdr->prev = gMemTail;
+    gMemTail = hdr;
+  } else {
+    hdr->prev = NULL;
+    gMemHead = gMemTail = hdr;
+  }
+  hdr->next = NULL;
+  ++gMemAlloc;
+  gMemInUse += size;
+  if (gMemInUse > gMaxMemInUse) {
+    gMaxMemInUse = gMemInUse;
+  }
+  gMemUnlock;
+  for (p = (unsigned long *)data; p <= trl; ++p) {
+    *p = gMemDeadVal;
+  }
+  return data;
+}
+#else
+void *gmalloc64(size_t size) GMEM_EXCEP {
+  void *p;
+
+  if (size == 0) {
+    return NULL;
+  }
+  if (!(p = malloc(size))) {
+    gMemError("Out of memory");
+  }
+  return p;
+}
+#endif
+
+void *gmallocn64(int nObjs, size_t objSize) GMEM_EXCEP {
+  size_t n;
+
+  if (nObjs == 0) {
+    return NULL;
+  }
+  n = nObjs * objSize;
+  if (nObjs < 0 || (size_t)nObjs >= SIZE_MAX / objSize) {
+    gMemError("Bogus memory allocation size");
+  }
+  return gmalloc64(n);
+}
+
 void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP {
   int n;
 
@@ -224,7 +304,7 @@
 
 void gfree(void *p) {
 #ifdef DEBUG_MEM
-  int size;
+  size_t size;
   GMemHdr *hdr;
   unsigned long *trl, *clr;
 
@@ -247,7 +327,7 @@
       --gMemAlloc;
       gMemInUse -= hdr->size;
       gMemUnlock;
-      size = gMemDataSize(hdr->size);
+      size = gMemDataSize64(hdr->size);
       trl = (unsigned long *)((char *)hdr + gMemHdrSize + size);
       if (*trl != gMemDeadVal) {
 	fprintf(stderr, "Overwrite past end of block %d at address %p\n",
@@ -284,7 +364,7 @@
   int left;
 
   fprintf(f, "%d memory allocations in all\n", gMemIndex);
-  fprintf(f, "maximum memory in use: %d bytes\n", gMaxMemInUse);
+  fprintf(f, "maximum memory in use: %zd bytes\n", gMaxMemInUse);
   left = 0;
   if (gMemAlloc > 0) {
     for (p = gMemHead; p; p = p->next) {
@@ -295,7 +375,7 @@
 	  fprintf(f, "-------- --------\n");
 	  left = 1;
 	}
-	fprintf(f, "%8d %8d\n", p->index, p->size);
+	fprintf(f, "%8d %8zd\n", p->index, p->size);
       }
     }
   }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -58,6 +58,17 @@
 extern void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP;
 
 /*
+ * Same as gmalloc and gmallocn, but allow a 64-bit size on 64-bit
+ * systems.
+ */
+#ifdef DEBUG_MEM
+extern void *gmalloc64(size_t size, int ignore = 0) GMEM_EXCEP;
+#else
+extern void *gmalloc64(size_t size) GMEM_EXCEP;
+#endif
+extern void *gmallocn64(int nObjs, size_t objSize) GMEM_EXCEP;
+
+/*
  * Same as free, but checks for and ignores NULL pointers.
  */
 extern void gfree(void *p);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -50,7 +50,7 @@
 
 // Clip x to lie in [0, 255].
 static inline Guchar clip255(int x) {
-  return x < 0 ? 0 : x > 255 ? 255 : x;
+  return x < 0 ? 0 : x > 255 ? 255 : (Guchar)x;
 }
 
 // Used by drawImage and fillImageMask to divide the target
@@ -132,8 +132,8 @@
 //------------------------------------------------------------------------
 
 void Splash::clearModRegion() {
-  modXMin = bitmap->getWidth();
-  modYMin = bitmap->getHeight();
+  modXMin = bitmap->width;
+  modYMin = bitmap->height;
   modXMax = -1;
   modYMax = -1;
 }
@@ -163,6 +163,10 @@
 inline void Splash::pipeInit(SplashPipe *pipe, SplashPattern *pattern,
 			     Guchar aInput, GBool usesShape,
 			     GBool nonIsolatedGroup) {
+  SplashColorMode mode;
+
+  mode = bitmap->mode;
+
   pipe->pattern = NULL;
 
   // source color
@@ -195,11 +199,11 @@
   // result color
   if (pipe->noTransparency) {
     // the !state->blendFunc case is handled separately in pipeRun
-    pipe->resultColorCtrl = pipeResultColorNoAlphaBlend[bitmap->mode];
+    pipe->resultColorCtrl = pipeResultColorNoAlphaBlend[mode];
   } else if (!state->blendFunc) {
-    pipe->resultColorCtrl = pipeResultColorAlphaNoBlend[bitmap->mode];
+    pipe->resultColorCtrl = pipeResultColorAlphaNoBlend[mode];
   } else {
-    pipe->resultColorCtrl = pipeResultColorAlphaBlend[bitmap->mode];
+    pipe->resultColorCtrl = pipeResultColorAlphaBlend[mode];
   }
 
   // non-isolated group correction
@@ -208,30 +212,30 @@
   // select the 'run' function
   pipe->run = &Splash::pipeRun;
   if (!pipe->pattern && pipe->noTransparency && !state->blendFunc) {
-    if (bitmap->mode == splashModeMono1 && !bitmap->alpha) {
+    if (mode == splashModeMono1 && !bitmap->alpha) {
       pipe->run = &Splash::pipeRunSimpleMono1;
-    } else if (bitmap->mode == splashModeMono8 && bitmap->alpha) {
+    } else if (mode == splashModeMono8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunSimpleMono8;
-    } else if (bitmap->mode == splashModeRGB8 && bitmap->alpha) {
+    } else if (mode == splashModeRGB8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunSimpleRGB8;
-    } else if (bitmap->mode == splashModeBGR8 && bitmap->alpha) {
+    } else if (mode == splashModeBGR8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunSimpleBGR8;
 #if SPLASH_CMYK
-    } else if (bitmap->mode == splashModeCMYK8 && bitmap->alpha) {
+    } else if (mode == splashModeCMYK8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunSimpleCMYK8;
 #endif
     }
   } else if (!pipe->pattern && pipe->shapeOnly && !state->blendFunc) {
-    if (bitmap->mode == splashModeMono1 && !bitmap->alpha) {
+    if (mode == splashModeMono1 && !bitmap->alpha) {
       pipe->run = &Splash::pipeRunShapeMono1;
-    } else if (bitmap->mode == splashModeMono8 && bitmap->alpha) {
+    } else if (mode == splashModeMono8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunShapeMono8;
-    } else if (bitmap->mode == splashModeRGB8 && bitmap->alpha) {
+    } else if (mode == splashModeRGB8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunShapeRGB8;
-    } else if (bitmap->mode == splashModeBGR8 && bitmap->alpha) {
+    } else if (mode == splashModeBGR8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunShapeBGR8;
 #if SPLASH_CMYK
-    } else if (bitmap->mode == splashModeCMYK8 && bitmap->alpha) {
+    } else if (mode == splashModeCMYK8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunShapeCMYK8;
 #endif
     }
@@ -240,16 +244,16 @@
 	     !(state->inNonIsolatedGroup && groupBackBitmap->alpha) &&
 	     !state->inKnockoutGroup &&
 	     !state->blendFunc && !pipe->nonIsolatedGroup) {
-    if (bitmap->mode == splashModeMono1 && !bitmap->alpha) {
+    if (mode == splashModeMono1 && !bitmap->alpha) {
       pipe->run = &Splash::pipeRunAAMono1;
-    } else if (bitmap->mode == splashModeMono8 && bitmap->alpha) {
+    } else if (mode == splashModeMono8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunAAMono8;
-    } else if (bitmap->mode == splashModeRGB8 && bitmap->alpha) {
+    } else if (mode == splashModeRGB8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunAARGB8;
-    } else if (bitmap->mode == splashModeBGR8 && bitmap->alpha) {
+    } else if (mode == splashModeBGR8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunAABGR8;
 #if SPLASH_CMYK
-    } else if (bitmap->mode == splashModeCMYK8 && bitmap->alpha) {
+    } else if (mode == splashModeCMYK8 && bitmap->alpha) {
       pipe->run = &Splash::pipeRunAACMYK8;
 #endif
     }
@@ -306,13 +310,13 @@
 
   if (bitmap->mode == splashModeMono1) {
     destColorPtr = &bitmap->data[y * bitmap->rowSize + (x0 >> 3)];
-    destColorMask = 0x80 >> (x0 & 7);
+    destColorMask = (Guchar)(0x80 >> (x0 & 7));
   } else {
     destColorPtr = &bitmap->data[y * bitmap->rowSize + x0 * bitmapComps];
     destColorMask = 0; // make gcc happy
   }
   if (bitmap->alpha) {
-    destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+    destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
   } else {
     destAlphaPtr = NULL;
   }
@@ -326,7 +330,7 @@
       color0Ptr =
           &groupBackBitmap->data[(groupBackY + y) * groupBackBitmap->rowSize +
 				 ((groupBackX + x0) >> 3)];
-      color0Mask = 0x80 >> ((groupBackX + x0) & 7);
+      color0Mask = (Guchar)(0x80 >> ((groupBackX + x0) & 7));
     } else {
       color0Ptr =
           &groupBackBitmap->data[(groupBackY + y) * groupBackBitmap->rowSize +
@@ -339,7 +343,8 @@
   }
   if (state->inNonIsolatedGroup && groupBackBitmap->alpha) {
     alpha0Ptr =
-        &groupBackBitmap->alpha[(groupBackY + y) * groupBackBitmap->width +
+        &groupBackBitmap->alpha[(groupBackY + y)
+				  * groupBackBitmap->alphaRowSize +
 				(groupBackX + x0)];
   } else {
     alpha0Ptr = NULL;
@@ -353,7 +358,7 @@
     if (!shape) {
       if (bitmap->mode == splashModeMono1) {
 	destColorPtr += destColorMask & 1;
-	destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+	destColorMask = (Guchar)((destColorMask << 7) | (destColorMask >> 1));
       } else {
 	destColorPtr += bitmapComps;
       }
@@ -366,7 +371,7 @@
       if (color0Ptr) {
 	if (bitmap->mode == splashModeMono1) {
 	  color0Ptr += color0Mask & 1;
-	  color0Mask = (color0Mask << 7) | (color0Mask >> 1);
+	  color0Mask = (Guchar)((color0Mask << 7) | (color0Mask >> 1));
 	} else {
 	  color0Ptr += bitmapComps;
 	}
@@ -429,7 +434,7 @@
 	case splashModeMono1:
 	  cDest[0] = (*color0Ptr & color0Mask) ? 0xff : 0x00;
 	  color0Ptr += color0Mask & 1;
-	  color0Mask = (color0Mask << 7) | (color0Mask >> 1);
+	  color0Mask = (Guchar)((color0Mask << 7) | (color0Mask >> 1));
 	  break;
 	case splashModeMono8:
 	  cDest[0] = *color0Ptr++;
@@ -576,20 +581,20 @@
 #if SPLASH_CMYK
 	if (bitmap->mode == splashModeCMYK8) {
 	  // convert colors to additive
-	  cSrc2[0] = 0xff - cSrc[0];
-	  cSrc2[1] = 0xff - cSrc[1];
-	  cSrc2[2] = 0xff - cSrc[2];
-	  cSrc2[3] = 0xff - cSrc[3];
-	  cDest2[0] = 0xff - cDest[0];
-	  cDest2[1] = 0xff - cDest[1];
-	  cDest2[2] = 0xff - cDest[2];
-	  cDest2[3] = 0xff - cDest[3];
+	  cSrc2[0] = (Guchar)(0xff - cSrc[0]);
+	  cSrc2[1] = (Guchar)(0xff - cSrc[1]);
+	  cSrc2[2] = (Guchar)(0xff - cSrc[2]);
+	  cSrc2[3] = (Guchar)(0xff - cSrc[3]);
+	  cDest2[0] = (Guchar)(0xff - cDest[0]);
+	  cDest2[1] = (Guchar)(0xff - cDest[1]);
+	  cDest2[2] = (Guchar)(0xff - cDest[2]);
+	  cDest2[3] = (Guchar)(0xff - cDest[3]);
 	  (*state->blendFunc)(cSrc2, cDest2, cBlend, bitmap->mode);
 	  // convert result back to subtractive
-	  cBlend[0] = 0xff - cBlend[0];
-	  cBlend[1] = 0xff - cBlend[1];
-	  cBlend[2] = 0xff - cBlend[2];
-	  cBlend[3] = 0xff - cBlend[3];
+	  cBlend[0] = (Guchar)(0xff - cBlend[0]);
+	  cBlend[1] = (Guchar)(0xff - cBlend[1]);
+	  cBlend[2] = (Guchar)(0xff - cBlend[2]);
+	  cBlend[3] = (Guchar)(0xff - cBlend[3]);
 	} else
 #endif
 	(*state->blendFunc)(cSrc, cDest, cBlend, bitmap->mode);
@@ -607,14 +612,14 @@
 	  // non-isolated, knockout
 	  aResult = aSrc;
 	  alpha0 = *alpha0Ptr++;
-	  alphaI = aSrc + alpha0 - div255(aSrc * alpha0);
+	  alphaI = (Guchar)(aSrc + alpha0 - div255(aSrc * alpha0));
 	  alphaIm1 = alpha0;
 	} else {
 	  // non-isolated, non-knockout
-	  aResult = aSrc + aDest - div255(aSrc * aDest);
+	  aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
 	  alpha0 = *alpha0Ptr++;
-	  alphaI = aResult + alpha0 - div255(aResult * alpha0);
-	  alphaIm1 = alpha0 + aDest - div255(alpha0 * aDest);
+	  alphaI = (Guchar)(aResult + alpha0 - div255(aResult * alpha0));
+	  alphaIm1 = (Guchar)(alpha0 + aDest - div255(alpha0 * aDest));
 	}
       } else {
 	if (color0Ptr) {
@@ -624,7 +629,7 @@
 	  alphaIm1 = 0;
 	} else {
 	  // isolated, non-knockout
-	  aResult = aSrc + aDest - div255(aSrc * aDest);
+	  aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
 	  alphaI = aResult;
 	  alphaIm1 = aDest;
 	}
@@ -655,7 +660,8 @@
 	if (alphaI == 0) {
 	  cResult0 = 0;
 	} else {
-	  cResult0 = ((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0]) / alphaI;
+	  cResult0 = (Guchar)(((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0])
+			      / alphaI);
 	}
 	break;
       case splashPipeResultColorAlphaNoBlendRGB:
@@ -664,9 +670,12 @@
 	  cResult1 = 0;
 	  cResult2 = 0;
 	} else {
-	  cResult0 = ((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0]) / alphaI;
-	  cResult1 = ((alphaI - aSrc) * cDest[1] + aSrc * cSrc[1]) / alphaI;
-	  cResult2 = ((alphaI - aSrc) * cDest[2] + aSrc * cSrc[2]) / alphaI;
+	  cResult0 = (Guchar)(((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0])
+			      / alphaI);
+	  cResult1 = (Guchar)(((alphaI - aSrc) * cDest[1] + aSrc * cSrc[1])
+			      / alphaI);
+	  cResult2 = (Guchar)(((alphaI - aSrc) * cDest[2] + aSrc * cSrc[2])
+			      / alphaI);
 	}
 	break;
 #if SPLASH_CMYK
@@ -677,10 +686,14 @@
 	  cResult2 = 0;
 	  cResult3 = 0;
 	} else {
-	  cResult0 = ((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0]) / alphaI;
-	  cResult1 = ((alphaI - aSrc) * cDest[1] + aSrc * cSrc[1]) / alphaI;
-	  cResult2 = ((alphaI - aSrc) * cDest[2] + aSrc * cSrc[2]) / alphaI;
-	  cResult3 = ((alphaI - aSrc) * cDest[3] + aSrc * cSrc[3]) / alphaI;
+	  cResult0 = (Guchar)(((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0])
+			      / alphaI);
+	  cResult1 = (Guchar)(((alphaI - aSrc) * cDest[1] + aSrc * cSrc[1])
+			      / alphaI);
+	  cResult2 = (Guchar)(((alphaI - aSrc) * cDest[2] + aSrc * cSrc[2])
+			      / alphaI);
+	  cResult3 = (Guchar)(((alphaI - aSrc) * cDest[3] + aSrc * cSrc[3])
+			      / alphaI);
 	}
 	break;
 #endif
@@ -689,10 +702,10 @@
 	if (alphaI == 0) {
 	  cResult0 = 0;
 	} else {
-	  cResult0 = ((alphaI - aSrc) * cDest[0] +
-		      aSrc * ((255 - alphaIm1) * cSrc[0] +
-			      alphaIm1 * cBlend[0]) / 255)
-	             / alphaI;
+	  cResult0 = (Guchar)(((alphaI - aSrc) * cDest[0] +
+			       aSrc * ((255 - alphaIm1) * cSrc[0] +
+				       alphaIm1 * cBlend[0]) / 255)
+			      / alphaI);
 	}
 	break;
       case splashPipeResultColorAlphaBlendRGB:
@@ -701,18 +714,18 @@
 	  cResult1 = 0;
 	  cResult2 = 0;
 	} else {
-	  cResult0 = ((alphaI - aSrc) * cDest[0] +
-		      aSrc * ((255 - alphaIm1) * cSrc[0] +
-			      alphaIm1 * cBlend[0]) / 255)
-	             / alphaI;
-	  cResult1 = ((alphaI - aSrc) * cDest[1] +
-		      aSrc * ((255 - alphaIm1) * cSrc[1] +
-			      alphaIm1 * cBlend[1]) / 255)
-	             / alphaI;
-	  cResult2 = ((alphaI - aSrc) * cDest[2] +
-		      aSrc * ((255 - alphaIm1) * cSrc[2] +
-			      alphaIm1 * cBlend[2]) / 255)
-	             / alphaI;
+	  cResult0 = (Guchar)(((alphaI - aSrc) * cDest[0] +
+			       aSrc * ((255 - alphaIm1) * cSrc[0] +
+				       alphaIm1 * cBlend[0]) / 255)
+			      / alphaI);
+	  cResult1 = (Guchar)(((alphaI - aSrc) * cDest[1] +
+			       aSrc * ((255 - alphaIm1) * cSrc[1] +
+				       alphaIm1 * cBlend[1]) / 255)
+			      / alphaI);
+	  cResult2 = (Guchar)(((alphaI - aSrc) * cDest[2] +
+			       aSrc * ((255 - alphaIm1) * cSrc[2] +
+				       alphaIm1 * cBlend[2]) / 255)
+			      / alphaI);
 	}
 	break;
 #if SPLASH_CMYK
@@ -723,22 +736,22 @@
 	  cResult2 = 0;
 	  cResult3 = 0;
 	} else {
-	  cResult0 = ((alphaI - aSrc) * cDest[0] +
-		      aSrc * ((255 - alphaIm1) * cSrc[0] +
-			      alphaIm1 * cBlend[0]) / 255)
-	             / alphaI;
-	  cResult1 = ((alphaI - aSrc) * cDest[1] +
-		      aSrc * ((255 - alphaIm1) * cSrc[1] +
-			      alphaIm1 * cBlend[1]) / 255)
-	             / alphaI;
-	  cResult2 = ((alphaI - aSrc) * cDest[2] +
-		      aSrc * ((255 - alphaIm1) * cSrc[2] +
-			      alphaIm1 * cBlend[2]) / 255)
-	             / alphaI;
-	  cResult3 = ((alphaI - aSrc) * cDest[3] +
-		      aSrc * ((255 - alphaIm1) * cSrc[3] +
-			      alphaIm1 * cBlend[3]) / 255)
-	             / alphaI;
+	  cResult0 = (Guchar)(((alphaI - aSrc) * cDest[0] +
+			       aSrc * ((255 - alphaIm1) * cSrc[0] +
+				       alphaIm1 * cBlend[0]) / 255)
+			      / alphaI);
+	  cResult1 = (Guchar)(((alphaI - aSrc) * cDest[1] +
+			       aSrc * ((255 - alphaIm1) * cSrc[1] +
+				       alphaIm1 * cBlend[1]) / 255)
+			      / alphaI);
+	  cResult2 = (Guchar)(((alphaI - aSrc) * cDest[2] +
+			       aSrc * ((255 - alphaIm1) * cSrc[2] +
+				       alphaIm1 * cBlend[2]) / 255)
+			      / alphaI);
+	  cResult3 = (Guchar)(((alphaI - aSrc) * cDest[3] +
+			       aSrc * ((255 - alphaIm1) * cSrc[3] +
+				       alphaIm1 * cBlend[3]) / 255)
+			      / alphaI);
 	}
 	break;
 #endif
@@ -753,10 +766,10 @@
       if (state->screen->test(x, y, cResult0)) {
 	*destColorPtr |= destColorMask;
       } else {
-	*destColorPtr &= ~destColorMask;
+	*destColorPtr &= (Guchar)~destColorMask;
       }
       destColorPtr += destColorMask & 1;
-      destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+      destColorMask = (Guchar)((destColorMask << 7) | (destColorMask >> 1));
       break;
     case splashModeMono8:
       *destColorPtr++ = cResult0;
@@ -819,7 +832,7 @@
   updateModY(y);
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + (x0 >> 3)];
-  destColorMask = 0x80 >> (x0 & 7);
+  destColorMask = (Guchar)(0x80 >> (x0 & 7));
 
   screenCursor = state->screen->getTestCursor(y);
 
@@ -830,10 +843,10 @@
     if (state->screen->testWithCursor(screenCursor, x, cResult0)) {
       *destColorPtr |= destColorMask;
     } else {
-      *destColorPtr &= ~destColorMask;
+      *destColorPtr &= (Guchar)~destColorMask;
     }
     destColorPtr += destColorMask & 1;
-    destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+    destColorMask = (Guchar)((destColorMask << 7) | (destColorMask >> 1));
 
     cSrcPtr += cSrcStride;
   }
@@ -862,7 +875,7 @@
   updateModY(y);
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -897,7 +910,7 @@
   updateModY(y);
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -935,7 +948,7 @@
   updateModY(y);
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -974,7 +987,7 @@
   updateModY(y);
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1024,7 +1037,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + (x0 >> 3)];
-  destColorMask = 0x80 >> (x0 & 7);
+  destColorMask = (Guchar)(0x80 >> (x0 & 7));
 
   screenCursor = state->screen->getTestCursor(y);
 
@@ -1034,7 +1047,7 @@
     shape = *shapePtr;
     if (!shape) {
       destColorPtr += destColorMask & 1;
-      destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+      destColorMask = (Guchar)((destColorMask << 7) | (destColorMask >> 1));
       cSrcPtr += cSrcStride;
       ++shapePtr;
       continue;
@@ -1064,10 +1077,10 @@
     if (state->screen->testWithCursor(screenCursor, x, cResult0)) {
       *destColorPtr |= destColorMask;
     } else {
-      *destColorPtr &= ~destColorMask;
+      *destColorPtr &= (Guchar)~destColorMask;
     }
     destColorPtr += destColorMask & 1;
-    destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+    destColorMask = (Guchar)((destColorMask << 7) | (destColorMask >> 1));
 
     cSrcPtr += cSrcStride;
     ++shapePtr;
@@ -1107,7 +1120,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1147,7 +1160,7 @@
 	cDest0 = *destColorPtr;
 
 	//----- result alpha and non-isolated group element correction
-	aResult = aSrc + aDest - div255(aSrc * aDest);
+	aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
 	alphaI = aResult;
 
 	//----- result color
@@ -1200,7 +1213,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1248,7 +1261,7 @@
 	cDest2 = destColorPtr[2];
 
 	//----- result alpha and non-isolated group element correction
-	aResult = aSrc + aDest - div255(aSrc * aDest);
+	aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
 	alphaI = aResult;
 
 	//----- result color
@@ -1306,7 +1319,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1354,7 +1367,7 @@
 	cDest2 = destColorPtr[0];
 
 	//----- result alpha and non-isolated group element correction
-	aResult = aSrc + aDest - div255(aSrc * aDest);
+	aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
 	alphaI = aResult;
 
 	//----- result color
@@ -1413,7 +1426,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1479,7 +1492,7 @@
       } else {
 
 	//----- result alpha and non-isolated group element correction
-	aResult = aSrc + aDest - div255(aSrc * aDest);
+	aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
 	alphaI = aResult;
 
 	//----- result color
@@ -1541,7 +1554,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + (x0 >> 3)];
-  destColorMask = 0x80 >> (x0 & 7);
+  destColorMask = (Guchar)(0x80 >> (x0 & 7));
 
   screenCursor = state->screen->getTestCursor(y);
 
@@ -1551,7 +1564,7 @@
     shape = *shapePtr;
     if (!shape) {
       destColorPtr += destColorMask & 1;
-      destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+      destColorMask = (Guchar)((destColorMask << 7) | (destColorMask >> 1));
       cSrcPtr += cSrcStride;
       ++shapePtr;
       continue;
@@ -1575,10 +1588,10 @@
     if (state->screen->testWithCursor(screenCursor, x, cResult0)) {
       *destColorPtr |= destColorMask;
     } else {
-      *destColorPtr &= ~destColorMask;
+      *destColorPtr &= (Guchar)~destColorMask;
     }
     destColorPtr += destColorMask & 1;
-    destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+    destColorMask = (Guchar)((destColorMask << 7) | (destColorMask >> 1));
 
     cSrcPtr += cSrcStride;
     ++shapePtr;
@@ -1620,7 +1633,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1646,7 +1659,7 @@
     aSrc = div255(pipe->aInput * shape);
 
     //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
+    aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
     alphaI = aResult;
 
     //----- result color
@@ -1703,7 +1716,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1733,7 +1746,7 @@
     aSrc = div255(pipe->aInput * shape);
 
     //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
+    aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
     alphaI = aResult;
 
     //----- result color
@@ -1797,7 +1810,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 3 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1827,7 +1840,7 @@
     aSrc = div255(pipe->aInput * shape);
 
     //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
+    aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
     alphaI = aResult;
 
     //----- result color
@@ -1892,7 +1905,7 @@
   lastX = x0;
 
   destColorPtr = &bitmap->data[y * bitmap->rowSize + 4 * x0];
-  destAlphaPtr = &bitmap->alpha[y * bitmap->width + x0];
+  destAlphaPtr = &bitmap->alpha[y * bitmap->alphaRowSize + x0];
 
   for (x = x0; x <= x1; ++x) {
 
@@ -1940,7 +1953,7 @@
     aSrc = div255(pipe->aInput * shape);
 
     //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
+    aResult = (Guchar)(aSrc + aDest - div255(aSrc * aDest));
     alphaI = aResult;
 
     //----- result color
@@ -2160,11 +2173,19 @@
 }
 
 void Splash::setLineCap(int lineCap) {
-  state->lineCap = lineCap;
+  if (lineCap >= 0 && lineCap <= 2) {
+    state->lineCap = lineCap;
+  } else {
+    state->lineCap = 0;
+  }
 }
 
 void Splash::setLineJoin(int lineJoin) {
-  state->lineJoin = lineJoin;
+  if (lineJoin >= 0 && lineJoin <= 2) {
+    state->lineJoin = lineJoin;
+  } else {
+    state->lineJoin = 0;
+  }
 }
 
 void Splash::setMiterLimit(SplashCoord miterLimit) {
@@ -2225,6 +2246,7 @@
   state->overprintMask = overprintMask;
 }
 
+
 void Splash::setEnablePathSimplification(GBool en) {
   state->enablePathSimplification = en;
 }
@@ -2349,7 +2371,7 @@
   }
 
   if (bitmap->alpha) {
-    memset(bitmap->alpha, alpha, bitmap->width * bitmap->height);
+    memset(bitmap->alpha, alpha, bitmap->alphaRowSize * bitmap->height);
   }
 
   updateModX(0);
@@ -2449,10 +2471,10 @@
   // is smaller, use the min line width
   if (w > 0 && w2 < minLineWidth) {
     strokeWide(path2, minLineWidth / w, splashLineCapButt, splashLineJoinBevel);
-  } else if (bitmap->mode == splashModeMono1) {
-    // in monochrome mode, use 0-width lines for any transformed line
-    // width <= 1 -- lines less than 1 pixel wide look too fat without
-    // antialiasing
+  } else if (bitmap->mode == splashModeMono1 || !vectorAntialias) {
+    // in monochrome mode or if antialiasing is disabled, use 0-width
+    // lines for any transformed line width <= 1 -- lines less than 1
+    // pixel wide look too fat without antialiasing
     if (w2 < 1.001) {
       strokeNarrow(path2);
     } else {
@@ -3251,7 +3273,7 @@
 	    alpha = *p++;
 	    for (xx = 0; xx < 8 && x + xx <= xMax; ++xx) {
 	      scanBuf[x + xx] = (alpha & 0x80) ? 0xff : 0x00;
-	      alpha <<= 1;
+	      alpha = (Guchar)(alpha << 1);
 	    }
 	  }
 	  (this->*pipe.run)(&pipe, xMin, xMax, y, scanBuf + xMin, NULL);
@@ -3285,16 +3307,16 @@
 	      + ((xMin - xg) >> 3);
 	    alpha = *p++;
 	    xx = (xMin - xg) & 7;
-	    alpha <<= xx;
+	    alpha = (Guchar)(alpha << xx);
 	    for (x = xMin; xx < 8 && x <= xMax; ++x, ++xx) {
 	      scanBuf[x] = (alpha & 0x80) ? 255 : 0;
-	      alpha <<= 1;
+	      alpha = (Guchar)(alpha << 1);
 	    }
 	    for (; x <= xMax; x += 8) {
 	      alpha = *p++;
 	      for (xx = 0; xx < 8 && x + xx <= xMax; ++xx) {
 		scanBuf[x + xx] = (alpha & 0x80) ? 255 : 0;
-		alpha <<= 1;
+		alpha = (Guchar)(alpha << 1);
 	      }
 	    }
 	    state->clip->clipSpanBinary(scanBuf, y, xMin, xMax,
@@ -3360,10 +3382,12 @@
   // pixels)
 #if USE_FIXEDPOINT
   if ((wSize > 2 * w && hSize > 2 * h && (int)wSize > 1000000 / (int)hSize) ||
-      (wSize >     w && hSize >     h && (int)wSize > 10000000 / (int)hSize)) {
+      (wSize >     w && hSize >     h && (int)wSize > 10000000 / (int)hSize) ||
+      ((wSize > w || hSize > h) && (int)wSize > 25000000 / (int)hSize)) {
 #else
   if ((wSize > 2 * w && hSize > 2 * h && wSize * hSize > 1000000) ||
-      (wSize >     w && hSize >     h && wSize * hSize > 10000000)) {
+      (wSize >     w && hSize >     h && wSize * hSize > 10000000) ||
+      ((wSize > w || hSize > h) && wSize * hSize > 25000000)) {
     upscaleMask(src, srcData, w, h, mat, glyphMode, interpolate);
 #endif
 
@@ -3540,7 +3564,7 @@
   for (y = 0, p = unscaledImage; y < srcHeight; ++y, p += srcWidth) {
     (*src)(srcData, p);
     for (x = 0; x < srcWidth; ++x) {
-      p[x] *= 255;
+      p[x] = (Guchar)(p[x] * 255);
     }
   }
 
@@ -3623,7 +3647,7 @@
   int xMin, yMin, xMax, yMax;
   ImageSection section[3];
   int nSections;
-  int y, xa, xb, x, i, xx, yy;
+  int bw, y, xa, xb, x, i, xx, yy;
 
   // compute the four vertices of the target quadrilateral
   vx[0] = mat[4];                    vy[0] = mat[5];
@@ -3817,6 +3841,7 @@
   }
 
   // scan all pixels inside the target region
+  bw = bitmap->width;
   for (i = 0; i < nSections; ++i) {
     for (y = section[i].y0; y <= section[i].y1; ++y) {
       xa = splashRound(section[i].xa0 +
@@ -3833,14 +3858,14 @@
 	++xb;
       }
       // check the scanBuf bounds
-      if (xa >= bitmap->width || xb < 0) {
+      if (xa >= bw || xb < 0) {
 	continue;
       }
       if (xa < 0) {
 	xa = 0;
       }
-      if (xb > bitmap->width) {
-	xb = bitmap->width;
+      if (xb > bw) {
+	xb = bw;
       }
       // get the scan line
       for (x = xa; x < xb; ++x) {
@@ -4333,8 +4358,8 @@
   SplashPipe pipe;
   int w, h, x0, x1, y0, y1, y, t;
 
-  w = src->getWidth();
-  h = src->getHeight();
+  w = src->width;
+  h = src->height;
   pipeInit(&pipe, state->fillPattern,
 	   (Guchar)splashRound(state->fillAlpha * 255),
 	   gTrue, gFalse);
@@ -4341,7 +4366,7 @@
   if (clipRes == splashClipAllInside) {
     for (y = 0; y < h; ++y) {
       (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
-			src->getDataPtr() + y * w, NULL);
+			src->data + y * (size_t)w, NULL);
     }
   } else {
     x0 = xDest;
@@ -4363,7 +4388,7 @@
     if (x0 < x1 && y0 < y1) {
       for (y = y0; y < y1; ++y) {
 	memcpy(scanBuf + x0,
-	       src->getDataPtr() + (y - yDest) * w + (x0 - xDest),
+	       src->data + (y - yDest) * (size_t)w + (x0 - xDest),
 	       x1 - x0);
 	if (vectorAntialias) {
 	  state->clip->clipSpan(scanBuf, y, x0, x1 - 1,
@@ -4444,10 +4469,12 @@
   // many pixels)
 #if USE_FIXEDPOINT
   if ((wSize > 2 * w && hSize > 2 * h && (int)wSize > 1000000 / (int)hSize) ||
-      (wSize >     w && hSize >     h && (int)wSize > 10000000 / (int)hSize)) {
+      (wSize >     w && hSize >     h && (int)wSize > 10000000 / (int)hSize) ||
+      ((wSize > w || hSize > h) && (int)wSize > 25000000 / (int)hSize)) {
 #else
   if ((wSize > 2 * w && hSize > 2 * h && wSize * hSize > 1000000) ||
-      (wSize >     w && hSize >     h && wSize * hSize > 10000000)) {
+      (wSize >     w && hSize >     h && wSize * hSize > 10000000) ||
+      ((wSize > w || hSize > h) && wSize * hSize > 25000000)) {
 #endif
     upscaleImage(src, srcData, srcMode, nComps, srcAlpha,
 		 w, h, mat, interpolate);
@@ -5080,7 +5107,7 @@
 
   // allocate buffers
   lineBuf = (Guchar *)gmallocn(srcWidth, nComps);
-  pixBuf = (Guint *)gmallocn(srcWidth, nComps * sizeof(int));
+  pixBuf = (Guint *)gmallocn(srcWidth, (int)(nComps * sizeof(int)));
   if (srcAlpha) {
     alphaLineBuf = (Guchar *)gmalloc(srcWidth);
     alphaPixBuf = (Guint *)gmallocn(srcWidth, sizeof(int));
@@ -5251,7 +5278,7 @@
 
   // allocate buffers
   lineBuf = (Guchar *)gmallocn(srcWidth, nComps);
-  pixBuf = (Guint *)gmallocn(srcWidth, nComps * sizeof(int));
+  pixBuf = (Guint *)gmallocn(srcWidth, (int)(nComps * sizeof(int)));
   if (srcAlpha) {
     alphaLineBuf = (Guchar *)gmalloc(srcWidth);
     alphaPixBuf = (Guint *)gmallocn(srcWidth, sizeof(int));
@@ -5517,7 +5544,7 @@
 #if SPLASH_CMYK
   Guchar pix3;
 #endif
-  Guint alpha;
+  Guchar alpha;
   Guchar *srcPtr, *srcAlphaPtr;
   Guchar *destPtr, *destAlphaPtr;
   int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep;
@@ -5824,7 +5851,7 @@
 
   w = width * nComps;
   lineBuf = (Guchar *)gmalloc(w);
-  for (p0 = img->data, p1 = img->data + (height - 1) * w;
+  for (p0 = img->data, p1 = img->data + (height - 1) * (size_t)w;
        p0 < p1;
        p0 += w, p1 -= w) {
     memcpy(lineBuf, p0, w);
@@ -5832,7 +5859,7 @@
     memcpy(p1, lineBuf, w);
   }
   if (img->alpha) {
-    for (p0 = img->alpha, p1 = img->alpha + (height - 1) * width;
+    for (p0 = img->alpha, p1 = img->alpha + (height - 1) * (size_t)width;
 	 p0 < p1;
 	 p0 += width, p1 -= width) {
       memcpy(lineBuf, p0, width);
@@ -5882,8 +5909,8 @@
   int w, h, x0, y0, x1, y1, y;
 
   // split the image into clipped and unclipped regions
-  w = src->getWidth();
-  h = src->getHeight();
+  w = src->width;
+  h = src->height;
   if (clipRes == splashClipAllInside) {
     x0 = 0;
     y0 = 0;
@@ -5923,15 +5950,14 @@
     if (srcAlpha) {
       for (y = y0; y < y1; ++y) {
 	(this->*pipe.run)(&pipe, xDest + x0, xDest + x1 - 1, yDest + y,
-			  src->getAlphaPtr() + y * w + x0,
-			  src->getDataPtr() + y * src->getRowSize() +
-			    x0 * bitmapComps);
+			  src->alpha + y * src->alphaRowSize + x0,
+			  src->data + y * src->rowSize + x0 * bitmapComps);
       }
     } else {
       for (y = y0; y < y1; ++y) {
 	(this->*pipe.run)(&pipe, xDest + x0, xDest + x1 - 1, yDest + y,
 			  NULL,
-			  src->getDataPtr() + y * src->getRowSize() +
+			  src->data + y * src->getRowSize() +
 			    x0 * bitmapComps);
       }
     }
@@ -5985,7 +6011,7 @@
   if (srcAlpha) {
     for (y = 0; y < h; ++y) {
       memcpy(scanBuf + xDest,
-	     src->getAlphaPtr() + (ySrc + y) * src->getWidth() + xSrc,
+	     src->alpha + (ySrc + y) * src->alphaRowSize + xSrc,
 	     w);
       if (vectorAntialias) {
 	state->clip->clipSpan(scanBuf, yDest + y, xDest, xDest + w - 1,
@@ -5996,7 +6022,7 @@
       }
       (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
 			scanBuf + xDest,
-			src->getDataPtr() + (ySrc + y) * src->getRowSize() +
+			src->data + (ySrc + y) * src->rowSize +
 			  xSrc * bitmapComps);
     }
   } else {
@@ -6011,7 +6037,7 @@
       }
       (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
 			scanBuf + xDest,
-			src->getDataPtr() + (ySrc + y) * src->getRowSize() +
+			src->data + (ySrc + y) * src->rowSize +
 			  xSrc * bitmapComps);
     }
   }
@@ -6041,30 +6067,28 @@
     if (noClip) {
       if (src->alpha) {
 	for (y = 0; y < h; ++y) {
-	  mono1Ptr = src->getDataPtr()
-	             + (ySrc + y) * src->rowSize + (xSrc >> 3);
-	  mono1Mask = 0x80 >> (xSrc & 7);
+	  mono1Ptr = src->data + (ySrc + y) * src->rowSize + (xSrc >> 3);
+	  mono1Mask = (Guchar)(0x80 >> (xSrc & 7));
 	  for (x = 0; x < w; ++x) {
 	    scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
 	    mono1Ptr += mono1Mask & 1;
-	    mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	    mono1Mask = (Guchar)((mono1Mask << 7) | (mono1Mask >> 1));
 	  }
 	  // this uses shape instead of alpha, which isn't technically
 	  // correct, but works out the same
 	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
-			    src->getAlphaPtr() +
-			      (ySrc + y) * src->getWidth() + xSrc,
+			    src->alpha +
+			      (ySrc + y) * src->alphaRowSize + xSrc,
 			    scanBuf);
 	}
       } else {
 	for (y = 0; y < h; ++y) {
-	  mono1Ptr = src->getDataPtr()
-	             + (ySrc + y) * src->rowSize + (xSrc >> 3);
-	  mono1Mask = 0x80 >> (xSrc & 7);
+	  mono1Ptr = src->data + (ySrc + y) * src->rowSize + (xSrc >> 3);
+	  mono1Mask = (Guchar)(0x80 >> (xSrc & 7));
 	  for (x = 0; x < w; ++x) {
 	    scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
 	    mono1Ptr += mono1Mask & 1;
-	    mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	    mono1Mask = (Guchar)((mono1Mask << 7) | (mono1Mask >> 1));
 	  }
 	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
 			    NULL,
@@ -6091,17 +6115,17 @@
       if (x0 < x1 && y0 < y1) {
 	if (src->alpha) {
 	  for (y = y0; y < y1; ++y) {
-	    mono1Ptr = src->getDataPtr()
+	    mono1Ptr = src->data
 	               + (ySrc + y - yDest) * src->rowSize
 	               + ((xSrc + x0 - xDest) >> 3);
-	    mono1Mask = 0x80 >> ((xSrc + x0 - xDest) & 7);
+	    mono1Mask = (Guchar)(0x80 >> ((xSrc + x0 - xDest) & 7));
 	    for (x = x0; x < x1; ++x) {
 	      scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
 	      mono1Ptr += mono1Mask & 1;
-	      mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	      mono1Mask = (Guchar)((mono1Mask << 7) | (mono1Mask >> 1));
 	    }
 	    memcpy(scanBuf2 + x0,
-		   src->getAlphaPtr() + (ySrc + y - yDest) * src->getWidth() + 
+		   src->alpha + (ySrc + y - yDest) * src->alphaRowSize + 
 		     (xSrc + x0 - xDest),
 		   x1 - x0);
 	    if (!state->clip->clipSpanBinary(scanBuf2, y, x0, x1 - 1,
@@ -6116,14 +6140,14 @@
 	  }
 	} else {
 	  for (y = y0; y < y1; ++y) {
-	    mono1Ptr = src->getDataPtr()
+	    mono1Ptr = src->data
 	               + (ySrc + y - yDest) * src->rowSize
 	               + ((xSrc + x0 - xDest) >> 3);
-	    mono1Mask = 0x80 >> ((xSrc + x0 - xDest) & 7);
+	    mono1Mask = (Guchar)(0x80 >> ((xSrc + x0 - xDest) & 7));
 	    for (x = x0; x < x1; ++x) {
 	      scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
 	      mono1Ptr += mono1Mask & 1;
-	      mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	      mono1Mask = (Guchar)((mono1Mask << 7) | (mono1Mask >> 1));
 	    }
 	    memset(scanBuf2 + x0, 0xff, x1 - x0);
 	    if (!state->clip->clipSpanBinary(scanBuf2, y, x0, x1 - 1,
@@ -6146,7 +6170,7 @@
       if (src->alpha) {
 	for (y = 0; y < h; ++y) {
 	  memcpy(lineBuf,
-		 src->getDataPtr() + (ySrc + y) * src->rowSize + xSrc * 3,
+		 src->data + (ySrc + y) * src->rowSize + xSrc * 3,
 		 w * 3);
 	  for (x = 0, linePtr = lineBuf; x < w; ++x, linePtr += 3) {
 	    b = linePtr[0];
@@ -6156,14 +6180,14 @@
 	  // this uses shape instead of alpha, which isn't technically
 	  // correct, but works out the same
 	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
-			    src->getAlphaPtr() +
-			      (ySrc + y) * src->getWidth() + xSrc,
+			    src->alpha +
+			      (ySrc + y) * src->alphaRowSize + xSrc,
 			    lineBuf);
 	}
       } else {
 	for (y = 0; y < h; ++y) {
 	  memcpy(lineBuf,
-		 src->getDataPtr() + (ySrc + y) * src->rowSize + xSrc * 3,
+		 src->data + (ySrc + y) * src->rowSize + xSrc * 3,
 		 w * 3);
 	  for (x = 0, linePtr = lineBuf; x < w; ++x, linePtr += 3) {
 	    b = linePtr[0];
@@ -6195,12 +6219,12 @@
 	if (src->alpha) {
 	  for (y = y0; y < y1; ++y) {
 	    memcpy(scanBuf + x0,
-		   src->getAlphaPtr() + (ySrc + y - yDest) * src->getWidth() + 
+		   src->alpha + (ySrc + y - yDest) * src->alphaRowSize + 
 		     (xSrc + x0 - xDest),
 		   x1 - x0);
 	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
 	    memcpy(lineBuf,
-		   src->getDataPtr() +
+		   src->data +
 		     (ySrc + y - yDest) * src->rowSize +
 		     (xSrc + x0 - xDest) * 3,
 		   (x1 - x0) * 3);
@@ -6219,7 +6243,7 @@
 	    memset(scanBuf + x0, 0xff, x1 - x0);
 	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
 	    memcpy(lineBuf,
-		   src->getDataPtr() +
+		   src->data +
 		     (ySrc + y - yDest) * src->rowSize +
 		     (xSrc + x0 - xDest) * 3,
 		   (x1 - x0) * 3);
@@ -6230,7 +6254,7 @@
 	    }
 	    (this->*pipe.run)(&pipe, x0, x1 - 1, yDest + y,
 			      scanBuf + x0,
-			      src->getDataPtr() +
+			      src->data +
 			        (ySrc + y - yDest) * src->rowSize +
 			        (xSrc + x0 - xDest) * bitmapComps);
 	  }
@@ -6246,9 +6270,9 @@
 	  // this uses shape instead of alpha, which isn't technically
 	  // correct, but works out the same
 	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
-			    src->getAlphaPtr() +
-			      (ySrc + y) * src->getWidth() + xSrc,
-			    src->getDataPtr() + (ySrc + y) * src->rowSize +
+			    src->alpha +
+			      (ySrc + y) * src->alphaRowSize + xSrc,
+			    src->data + (ySrc + y) * src->rowSize +
 			      xSrc * bitmapComps);
 	}
       } else {
@@ -6255,7 +6279,7 @@
 	for (y = 0; y < h; ++y) {
 	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
 			    NULL,
-			    src->getDataPtr() + (ySrc + y) * src->rowSize +
+			    src->data + (ySrc + y) * src->rowSize +
 			      xSrc * bitmapComps);
 	}
       }
@@ -6280,7 +6304,7 @@
 	if (src->alpha) {
 	  for (y = y0; y < y1; ++y) {
 	    memcpy(scanBuf + x0,
-		   src->getAlphaPtr() + (ySrc + y - yDest) * src->getWidth() + 
+		   src->alpha + (ySrc + y - yDest) * src->alphaRowSize + 
 		     (xSrc + x0 - xDest),
 		   x1 - x0);
 	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
@@ -6288,7 +6312,7 @@
 	    // correct, but works out the same
 	    (this->*pipe.run)(&pipe, x0, x1 - 1, y,
 			      scanBuf + x0,
-			      src->getDataPtr() +
+			      src->data +
 			        (ySrc + y - yDest) * src->rowSize +
 			        (xSrc + x0 - xDest) * bitmapComps);
 	  }
@@ -6298,7 +6322,7 @@
 	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
 	    (this->*pipe.run)(&pipe, x0, x1 - 1, yDest + y,
 			      scanBuf + x0,
-			      src->getDataPtr() +
+			      src->data +
 			        (ySrc + y - yDest) * src->rowSize +
 			        (xSrc + x0 - xDest) * bitmapComps);
 	  }
@@ -6313,11 +6337,11 @@
 void Splash::compositeBackground(SplashColorPtr color) {
   SplashColorPtr p;
   Guchar *q;
-  Guchar alpha, alpha1, c, color0, color1, color2;
+  Guchar alpha, alpha1, c, color0, color1, color2, mask;
 #if SPLASH_CMYK
   Guchar color3;
 #endif
-  int x, y, mask;
+  int x, y;
 
   switch (bitmap->mode) {
   case splashModeMono1:
@@ -6324,7 +6348,7 @@
     color0 = color[0];
     for (y = 0; y < bitmap->height; ++y) {
       p = &bitmap->data[y * bitmap->rowSize];
-      q = &bitmap->alpha[y * bitmap->width];
+      q = &bitmap->alpha[y * bitmap->alphaRowSize];
       mask = 0x80;
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
@@ -6332,19 +6356,19 @@
 	  if (color0 & 0x80) {
 	    *p |= mask;
 	  } else {
-	    *p &= ~mask;
+	    *p &= (Guchar)~mask;
 	  }
 	} else if (alpha != 255) {
-	  alpha1 = 255 - alpha;
+	  alpha1 = (Guchar)(255 - alpha);
 	  c = (*p & mask) ? 0xff : 0x00;
 	  c = div255(alpha1 * color0 + alpha * c);
 	  if (c & 0x80) {
 	    *p |= mask;
 	  } else {
-	    *p &= ~mask;
+	    *p &= (Guchar)~mask;
 	  }
 	}
-	if (!(mask >>= 1)) {
+	if (!(mask = (Guchar)(mask >> 1))) {
 	  mask = 0x80;
 	  ++p;
 	}
@@ -6355,13 +6379,13 @@
     color0 = color[0];
     for (y = 0; y < bitmap->height; ++y) {
       p = &bitmap->data[y * bitmap->rowSize];
-      q = &bitmap->alpha[y * bitmap->width];
+      q = &bitmap->alpha[y * bitmap->alphaRowSize];
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
 	if (alpha == 0) {
 	  p[0] = color0;
 	} else if (alpha != 255) {
-	  alpha1 = 255 - alpha;
+	  alpha1 = (Guchar)(255 - alpha);
 	  p[0] = div255(alpha1 * color0 + alpha * p[0]);
 	}
 	++p;
@@ -6375,7 +6399,7 @@
     color2 = color[2];
     for (y = 0; y < bitmap->height; ++y) {
       p = &bitmap->data[y * bitmap->rowSize];
-      q = &bitmap->alpha[y * bitmap->width];
+      q = &bitmap->alpha[y * bitmap->alphaRowSize];
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
 	if (alpha == 0) {
@@ -6383,7 +6407,7 @@
 	  p[1] = color1;
 	  p[2] = color2;
 	} else if (alpha != 255) {
-	  alpha1 = 255 - alpha;
+	  alpha1 = (Guchar)(255 - alpha);
 	  p[0] = div255(alpha1 * color0 + alpha * p[0]);
 	  p[1] = div255(alpha1 * color1 + alpha * p[1]);
 	  p[2] = div255(alpha1 * color2 + alpha * p[2]);
@@ -6400,7 +6424,7 @@
     color3 = color[3];
     for (y = 0; y < bitmap->height; ++y) {
       p = &bitmap->data[y * bitmap->rowSize];
-      q = &bitmap->alpha[y * bitmap->width];
+      q = &bitmap->alpha[y * bitmap->alphaRowSize];
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
 	if (alpha == 0) {
@@ -6409,7 +6433,7 @@
 	  p[2] = color2;
 	  p[3] = color3;
 	} else if (alpha != 255) {
-	  alpha1 = 255 - alpha;
+	  alpha1 = (Guchar)(255 - alpha);
 	  p[0] = div255(alpha1 * color0 + alpha * p[0]);
 	  p[1] = div255(alpha1 * color1 + alpha * p[1]);
 	  p[2] = div255(alpha1 * color2 + alpha * p[2]);
@@ -6421,13 +6445,14 @@
     break;
 #endif
   }
-  memset(bitmap->alpha, 255, bitmap->width * bitmap->height);
+  memset(bitmap->alpha, 255, bitmap->alphaRowSize * bitmap->height);
 }
 
 SplashError Splash::blitTransparent(SplashBitmap *src, int xSrc, int ySrc,
 				    int xDest, int yDest, int w, int h) {
   SplashColorPtr p, q;
-  int x, y, mask, srcMask;
+  Guchar mask, srcMask;
+  int x, y;
 
   if (src->mode != bitmap->mode) {
     return splashErrModeMismatch;
@@ -6437,20 +6462,20 @@
   case splashModeMono1:
     for (y = 0; y < h; ++y) {
       p = &bitmap->data[(yDest + y) * bitmap->rowSize + (xDest >> 3)];
-      mask = 0x80 >> (xDest & 7);
+      mask = (Guchar)(0x80 >> (xDest & 7));
       q = &src->data[(ySrc + y) * src->rowSize + (xSrc >> 3)];
-      srcMask = 0x80 >> (xSrc & 7);
+      srcMask = (Guchar)(0x80 >> (xSrc & 7));
       for (x = 0; x < w; ++x) {
 	if (*q & srcMask) {
 	  *p |= mask;
 	} else {
-	  *p &= ~mask;
+	  *p &= (Guchar)~mask;
 	}
-	if (!(mask >>= 1)) {
+	if (!(mask = (Guchar)(mask >> 1))) {
 	  mask = 0x80;
 	  ++p;
 	}
-	if (!(srcMask >>= 1)) {
+	if (!(srcMask = (Guchar)(srcMask >> 1))) {
 	  srcMask = 0x80;
 	  ++q;
 	}
@@ -6485,7 +6510,7 @@
 
   if (bitmap->alpha) {
     for (y = 0; y < h; ++y) {
-      q = &bitmap->alpha[(yDest + y) * bitmap->width + xDest];
+      q = &bitmap->alpha[(yDest + y) * bitmap->alphaRowSize + xDest];
       memset(q, 0, w);
     }
   }
@@ -6497,8 +6522,8 @@
 				       int xDest, int yDest, int w, int h) {
   SplashColorPtr p, q;
   Guchar *alpha0Ptr;
-  Guchar alpha0, aSrc;
-  int x, y, mask, srcMask;
+  Guchar alpha0, aSrc, mask, srcMask;
+  int x, y;
 
   if (bitmap->mode != dest->mode ||
       !bitmap->alpha ||
@@ -6511,20 +6536,20 @@
   case splashModeMono1:
     for (y = 0; y < h; ++y) {
       p = &dest->data[(yDest + y) * dest->rowSize + (xDest >> 3)];
-      mask = 0x80 >> (xDest & 7);
+      mask = (Guchar)(0x80 >> (xDest & 7));
       q = &bitmap->data[(ySrc + y) * bitmap->rowSize + (xSrc >> 3)];
-      srcMask = 0x80 >> (xSrc & 7);
+      srcMask = (Guchar)(0x80 >> (xSrc & 7));
       for (x = 0; x < w; ++x) {
 	if (*q & srcMask) {
 	  *p |= mask;
 	} else {
-	  *p &= ~mask;
+	  *p &= (Guchar)~mask;
 	}
-	if (!(mask >>= 1)) {
+	if (!(mask = (Guchar)(mask >> 1))) {
 	  mask = 0x80;
 	  ++p;
 	}
-	if (!(srcMask >>= 1)) {
+	if (!(srcMask = (Guchar)(srcMask >> 1))) {
 	  srcMask = 0x80;
 	  ++q;
 	}
@@ -6558,15 +6583,15 @@
   }
 
   for (y = 0; y < h; ++y) {
-    p = &dest->alpha[(yDest + y) * dest->width + xDest];
-    q = &bitmap->alpha[(ySrc + y) * bitmap->width + xSrc];
+    p = &dest->alpha[(yDest + y) * dest->alphaRowSize + xDest];
+    q = &bitmap->alpha[(ySrc + y) * bitmap->alphaRowSize + xSrc];
     alpha0Ptr = &groupBackBitmap->alpha[(groupBackY + ySrc + y)
-					  * groupBackBitmap->width +
+					  * groupBackBitmap->alphaRowSize +
 					(groupBackX + xSrc)];
     for (x = 0; x < w; ++x) {
       alpha0 = *alpha0Ptr++;
       aSrc = *q++;
-      *p++ = alpha0 + aSrc - div255(alpha0 * aSrc);
+      *p++ = (Guchar)(alpha0 + aSrc - div255(alpha0 * aSrc));
     }
   }
 
@@ -7155,3 +7180,4 @@
 	   path->segs[i].count);
   }
 }
+

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -34,7 +34,7 @@
 // Retrieves the next line of pixels in an image mask.  Normally,
 // fills in *<line> and returns true.  If the image stream is
 // exhausted, returns false.
-typedef GBool (*SplashImageMaskSource)(void *data, SplashColorPtr pixel);
+typedef GBool (*SplashImageMaskSource)(void *data, Guchar *pixel);
 
 // Retrieves the next line of pixels in an image.  Normally, fills in
 // *<line> and returns true.  If the image stream is exhausted,
@@ -42,6 +42,7 @@
 typedef GBool (*SplashImageSource)(void *data, SplashColorPtr colorLine,
 				   Guchar *alphaLine);
 
+
 //------------------------------------------------------------------------
 
 enum SplashPipeResultColorCtrl {
@@ -258,6 +259,7 @@
   void setInShading(GBool sh) { inShading = sh; }
 #endif
 
+
 private:
 
   void pipeInit(SplashPipe *pipe, SplashPattern *pattern,
@@ -410,6 +412,7 @@
   void dumpPath(SplashPath *path);
   void dumpXPath(SplashXPath *path);
 
+
   static SplashPipeResultColorCtrl pipeResultColorNoAlphaBlend[];
   static SplashPipeResultColorCtrl pipeResultColorAlphaNoBlend[];
   static SplashPipeResultColorCtrl pipeResultColorAlphaBlend[];

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -26,54 +26,53 @@
 SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPad,
 			   SplashColorMode modeA, GBool alphaA,
 			   GBool topDown) {
+  // NB: this code checks that rowSize fits in a signed 32-bit
+  // integer, because some code (outside this class) makes that
+  // assumption
   width = widthA;
   height = heightA;
   mode = modeA;
   switch (mode) {
   case splashModeMono1:
-    if (width > 0) {
-      rowSize = (width + 7) >> 3;
-    } else {
-      rowSize = -1;
+    if (width <= 0) {
+      gMemError("invalid bitmap width");
     }
+    rowSize = (width + 7) >> 3;
     break;
   case splashModeMono8:
-    if (width > 0) {
-      rowSize = width;
-    } else {
-      rowSize = -1;
+    if (width <= 0) {
+      gMemError("invalid bitmap width");
     }
+    rowSize = width;
     break;
   case splashModeRGB8:
   case splashModeBGR8:
-    if (width > 0 && width <= INT_MAX / 3) {
-      rowSize = width * 3;
-    } else {
-      rowSize = -1;
+    if (width <= 0 || width > INT_MAX / 3) {
+      gMemError("invalid bitmap width");
     }
+    rowSize = (SplashBitmapRowSize)width * 3;
     break;
 #if SPLASH_CMYK
   case splashModeCMYK8:
-    if (width > 0 && width <= INT_MAX / 4) {
-      rowSize = width * 4;
-    } else {
-      rowSize = -1;
+    if (width <= 0 || width > INT_MAX / 4) {
+      gMemError("invalid bitmap width");
     }
+    rowSize = (SplashBitmapRowSize)width * 4;
     break;
 #endif
   }
-  if (rowSize > 0) {
-    rowSize += rowPad - 1;
-    rowSize -= rowSize % rowPad;
-  }
-  data = (SplashColorPtr)gmallocn(height, rowSize);
+  rowSize += rowPad - 1;
+  rowSize -= rowSize % rowPad;
+  data = (SplashColorPtr)gmallocn64(height, rowSize);
   if (!topDown) {
     data += (height - 1) * rowSize;
     rowSize = -rowSize;
   }
   if (alphaA) {
-    alpha = (Guchar *)gmallocn(width, height);
+    alphaRowSize = width;
+    alpha = (Guchar *)gmallocn64(height, alphaRowSize);
   } else {
+    alphaRowSize = 0;
     alpha = NULL;
   }
 }
@@ -231,7 +230,7 @@
 }
 
 Guchar SplashBitmap::getAlpha(int x, int y) {
-  return alpha[y * width + x];
+  return alpha[y * (size_t)width + x];
 }
 
 SplashColorPtr SplashBitmap::takeData() {
@@ -241,3 +240,4 @@
   data = NULL;
   return data2;
 }
+

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -16,9 +16,22 @@
 #endif
 
 #include <stdio.h>
+#include <limits.h>
+#include <stdint.h>
 #include "SplashTypes.h"
 
 //------------------------------------------------------------------------
+
+// ssize_t isn't well-defined, so define our own
+#if SIZE_MAX == UINT_MAX
+  typedef int SplashBitmapRowSize;
+# define SplashBitmapRowSizeMax INT_MAX
+#else
+  typedef long long SplashBitmapRowSize;
+# define SplashBitmapRowSizeMax LLONG_MAX
+#endif
+
+//------------------------------------------------------------------------
 // SplashBitmap
 //------------------------------------------------------------------------
 
@@ -37,8 +50,8 @@
 
   int getWidth() { return width; }
   int getHeight() { return height; }
-  int getRowSize() { return rowSize; }
-  int getAlphaRowSize() { return width; }
+  SplashBitmapRowSize getRowSize() { return rowSize; }
+  size_t getAlphaRowSize() { return alphaRowSize; }
   SplashColorMode getMode() { return mode; }
   SplashColorPtr getDataPtr() { return data; }
   Guchar *getAlphaPtr() { return alpha; }
@@ -58,8 +71,9 @@
 private:
 
   int width, height;		// size of bitmap
-  int rowSize;			// size of one row of data, in bytes
+  SplashBitmapRowSize rowSize;	// size of one row of data, in bytes
 				//   - negative for bottom-up bitmaps
+  size_t alphaRowSize;		// size of one row of alpha, in bytes
   SplashColorMode mode;		// color mode
   SplashColorPtr data;		// pointer to row zero of the color data
   Guchar *alpha;		// pointer to row zero of the alpha data
@@ -68,4 +82,5 @@
   friend class Splash;
 };
 
+
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -130,13 +130,16 @@
 #else // USE_FIXEDPOINT
   // transform the four corners of the font bounding box -- the min
   // and max values form the bounding box of the transformed font
-  x = (int)((mat[0] * face->bbox.xMin + mat[2] * face->bbox.yMin) /
+  x = (int)((mat[0] * (SplashCoord)face->bbox.xMin
+	     + mat[2] * (SplashCoord)face->bbox.yMin) /
 	    (div * face->units_per_EM));
   xMin = xMax = x;
-  y = (int)((mat[1] * face->bbox.xMin + mat[3] * face->bbox.yMin) /
+  y = (int)((mat[1] * (SplashCoord)face->bbox.xMin
+	     + mat[3] * (SplashCoord)face->bbox.yMin) /
 	    (div * face->units_per_EM));
   yMin = yMax = y;
-  x = (int)((mat[0] * face->bbox.xMin + mat[2] * face->bbox.yMax) /
+  x = (int)((mat[0] * (SplashCoord)face->bbox.xMin
+	     + mat[2] * (SplashCoord)face->bbox.yMax) /
 	    (div * face->units_per_EM));
   if (x < xMin) {
     xMin = x;
@@ -143,7 +146,8 @@
   } else if (x > xMax) {
     xMax = x;
   }
-  y = (int)((mat[1] * face->bbox.xMin + mat[3] * face->bbox.yMax) /
+  y = (int)((mat[1] * (SplashCoord)face->bbox.xMin
+	     + mat[3] * (SplashCoord)face->bbox.yMax) /
 	    (div * face->units_per_EM));
   if (y < yMin) {
     yMin = y;
@@ -150,7 +154,8 @@
   } else if (y > yMax) {
     yMax = y;
   }
-  x = (int)((mat[0] * face->bbox.xMax + mat[2] * face->bbox.yMin) /
+  x = (int)((mat[0] * (SplashCoord)face->bbox.xMax
+	     + mat[2] * (SplashCoord)face->bbox.yMin) /
 	    (div * face->units_per_EM));
   if (x < xMin) {
     xMin = x;
@@ -157,7 +162,8 @@
   } else if (x > xMax) {
     xMax = x;
   }
-  y = (int)((mat[1] * face->bbox.xMax + mat[3] * face->bbox.yMin) /
+  y = (int)((mat[1] * (SplashCoord)face->bbox.xMax
+	     + mat[3] * (SplashCoord)face->bbox.yMin) /
 	    (div * face->units_per_EM));
   if (y < yMin) {
     yMin = y;
@@ -164,7 +170,8 @@
   } else if (y > yMax) {
     yMax = y;
   }
-  x = (int)((mat[0] * face->bbox.xMax + mat[2] * face->bbox.yMax) /
+  x = (int)((mat[0] * (SplashCoord)face->bbox.xMax
+	     + mat[2] * (SplashCoord)face->bbox.yMax) /
 	    (div * face->units_per_EM));
   if (x < xMin) {
     xMin = x;
@@ -171,7 +178,8 @@
   } else if (x > xMax) {
     xMax = x;
   }
-  y = (int)((mat[1] * face->bbox.xMax + mat[3] * face->bbox.yMax) /
+  y = (int)((mat[1] * (SplashCoord)face->bbox.xMax
+	     + mat[3] * (SplashCoord)face->bbox.yMax) /
 	    (div * face->units_per_EM));
   if (y < yMin) {
     yMin = y;
@@ -260,7 +268,10 @@
   //   seems to be very rare (Type 1 fonts are mostly used for
   //   substitution, in which case the full font is being used, which
   //   means we have the glyph names)
-  flags = FT_LOAD_NO_BITMAP;
+  // This also sets the "pedantic" flag, running the FreeType hinter
+  // in paranoid mode.  If that triggers any errors, we disable
+  // hinting below.
+  flags = FT_LOAD_NO_BITMAP | FT_LOAD_PEDANTIC;
   if (ff->engine->flags & splashFTNoHinting) {
     flags |= FT_LOAD_NO_HINTING;
   } else if (ff->fontType == splashFontType1) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -112,7 +112,7 @@
   }
 #endif
 
-#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32) && !defined(__ANDROID__)
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -148,7 +148,7 @@
   }
 #endif
 
-#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32) && !defined(__ANDROID__)
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -184,7 +184,7 @@
   }
 #endif
 
-#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32) && !defined(__ANDROID__)
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -221,7 +221,7 @@
   }
 #endif
 
-#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32) && !defined(__ANDROID__)
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -258,7 +258,7 @@
   }
 #endif
 
-#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32) && !defined(__ANDROID__)
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -301,7 +301,7 @@
     gfree(codeToGID);
   }
 
-#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32) && !defined(__ANDROID__)
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -347,8 +347,12 @@
     }
 #endif
   }
-  if (x1 == x0) {
-    ++x1;
+  if (x0 == x1) {
+    if (xMin + xMax < 2 * x0) {
+      --x0;
+    } else {
+      ++x1;
+    }
   }
   *xMinI = x0;
   *xMaxI = x1;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPath.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPath.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPath.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -108,7 +108,7 @@
   if (noCurrentPoint()) {
     return splashErrNoCurPt;
   }
-  flags[length-1] &= ~splashPathLast;
+  flags[length-1] &= (Guchar)~splashPathLast;
   grow(1);
   pts[length].x = x;
   pts[length].y = y;
@@ -123,7 +123,7 @@
   if (noCurrentPoint()) {
     return splashErrNoCurPt;
   }
-  flags[length-1] &= ~splashPathLast;
+  flags[length-1] &= (Guchar)~splashPathLast;
   grow(3);
   pts[length].x = x1;
   pts[length].y = y1;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -41,3 +41,4 @@
 void SplashSolidColor::getColor(int x, int y, SplashColorPtr c) {
   splashColorCopy(c, color);
 }
+

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -35,6 +35,7 @@
   // Return the color value for a specific pixel.
   virtual void getColor(int x, int y, SplashColorPtr c) = 0;
 
+
   // Returns true if this pattern object will return the same color
   // value for all pixels.
   virtual GBool isStatic() = 0;
@@ -64,4 +65,5 @@
   SplashColor color;
 };
 
+
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashScreen.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashScreen.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashScreen.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -113,8 +113,9 @@
     white = 255;
   }
   for (i = 0; i < size * size; ++i) {
-    u = splashRound((SplashCoord)255.0 *
-		    splashPow((SplashCoord)mat[i] / 255.0, params->gamma));
+    u = (Guchar)splashRound((SplashCoord)255.0 *
+			    splashPow((SplashCoord)mat[i] / 255.0,
+				      params->gamma));
     if (u < black) {
       u = (Guchar)black;
     } else if (u >= white) {
@@ -133,7 +134,8 @@
 					int delta, int offset) {
   if (delta == 0) {
     // map values in [1, size^2] --> [1, 255]
-    mat[(i << log2Size) + j] = 1 + (254 * (val - 1)) / (size * size - 1);
+    mat[(i << log2Size) + j] =
+        (Guchar)(1 + (254 * (val - 1)) / (size * size - 1));
   } else {
     buildDispersedMatrix(i, j,
 			 val, delta / 2, 4*offset);
@@ -203,9 +205,9 @@
       }
     }
     // map values in [0, 2*size*size2-1] --> [1, 255]
-    val = 1 + (254 * (2*i)) / (2*size*size2 - 1);
+    val = (Guchar)(1 + (254 * (2*i)) / (2*size*size2 - 1));
     mat[(y1 << log2Size) + x1] = val;
-    val = 1 + (254 * (2*i+1)) / (2*size*size2 - 1);
+    val = (Guchar)(1 + (254 * (2*i+1)) / (2*size*size2 - 1));
     if (y1 < size2) {
       mat[((y1 + size2) << log2Size) + x1 + size2] = val;
     } else {
@@ -354,7 +356,8 @@
 #endif
     for (j = 0; j < n; ++j) {
       // map values in [0 .. n-1] --> [255 .. 1]
-      mat[(pts[j].y << log2Size) + pts[j].x] = 255 - (254 * j) / (n - 1);
+      mat[(pts[j].y << log2Size) + pts[j].x] =
+	  (Guchar)(255 - (254 * j) / (n - 1));
     }
   }
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -285,10 +285,11 @@
   memcpy(grayTransfer, gray, 256);
 #if SPLASH_CMYK
   for (i = 0; i < 256; ++i) {
-    cmykTransferC[i] = 255 - rgbTransferR[255 - i];
-    cmykTransferM[i] = 255 - rgbTransferG[255 - i];
-    cmykTransferY[i] = 255 - rgbTransferB[255 - i];
-    cmykTransferK[i] = 255 - grayTransfer[255 - i];
+    cmykTransferC[i] = (Guchar)(255 - rgbTransferR[255 - i]);
+    cmykTransferM[i] = (Guchar)(255 - rgbTransferG[255 - i]);
+    cmykTransferY[i] = (Guchar)(255 - rgbTransferB[255 - i]);
+    cmykTransferK[i] = (Guchar)(255 - grayTransfer[255 - i]);
   }
 #endif
 }
+

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -86,6 +86,7 @@
   // Set the transfer function.
   void setTransfer(Guchar *red, Guchar *green, Guchar *blue, Guchar *gray);
 
+
 private:
 
   SplashState(SplashState *state);
@@ -125,6 +126,7 @@
   Guint overprintMask;
   GBool enablePathSimplification;
 
+
   SplashState *next;		// used by Splash class
 
   friend class Splash;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashTypes.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashTypes.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashTypes.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -141,4 +141,5 @@
 
 typedef int SplashError;
 
+
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/AcroForm.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/AcroForm.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/AcroForm.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -875,14 +875,15 @@
   GString *appearBuf;
   Object appearance, mkObj, ftObj, appearDict, drObj, apObj, asObj;
   Object resources, fontResources, defaultFont, gfxStateDict;
-  Object obj1, obj2, obj3;
+  Object obj1, obj2, obj3, obj4;
   Dict *mkDict;
   MemStream *appearStream;
   GfxFontDict *fontDict;
   GBool hasCaption;
   double dx, dy, r;
-  GString *caption, *da;
+  GString *val, *caption, *da;
   GString **text;
+  GBool done;
   GBool *selection;
   AnnotBorderType borderType;
   double borderWidth;
@@ -1200,10 +1201,7 @@
     }
   } else if (ftObj.isName("Tx")) {
     //~ value strings can be Unicode
-    if (!fieldLookup("V", &obj1)->isString()) {
-      obj1.free();
-      fieldLookup("DV", &obj1);
-    }
+    fieldLookup("V", &obj1);
     if (obj1.isString()) {
       if (fieldLookup("Q", &obj2)->isInt()) {
 	quadding = obj2.getInt();
@@ -1235,9 +1233,30 @@
     // combo box
     if (flags & acroFormFlagCombo) {
       if (fieldLookup("V", &obj1)->isString()) {
-	drawText(obj1.getString(), da, fontDict,
+	val = obj1.getString()->copy();
+	if (fieldObj.dictLookup("Opt", &obj2)->isArray()) {
+	  for (i = 0, done = false; i < obj2.arrayGetLength() && !done; ++i) {
+	    obj2.arrayGet(i, &obj3);
+	    if (obj3.isArray() && obj3.arrayGetLength() == 2) {
+	      if (obj3.arrayGet(0, &obj4)->isString() &&
+		  obj4.getString()->cmp(val) == 0) {
+		obj4.free();
+		if (obj3.arrayGet(1, &obj4)->isString()) {
+		  delete val;
+		  val = obj4.getString()->copy();
+		}
+		done = gTrue;
+	      }
+	      obj4.free();
+	    }
+	    obj3.free();
+	  }
+	}
+	obj2.free();
+	drawText(val, da, fontDict,
 		 gFalse, 0, quadding, gTrue, gFalse, rot,
 		 xMin, yMin, xMax, yMax, borderWidth, appearBuf);
+	delete val;
 	//~ Acrobat draws a popup icon on the right side
       }
       obj1.free();
@@ -1470,6 +1489,12 @@
   } else {
     text2 = text;
   }
+  if (text2->getLength() == 0) {
+    if (text2 != text) {
+      delete text2;
+    }
+    return;
+  }
 
   // parse the default appearance string
   tfPos = tmPos = -1;
@@ -1630,11 +1655,11 @@
 	c = text2->getChar(i) & 0xff;
 	if (c == '(' || c == ')' || c == '\\') {
 	  appearBuf->append('\\');
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	} else if (c < 0x20 || c >= 0x80) {
 	  appearBuf->appendf("\\{0:03o}", c);
 	} else {
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	}
       }
       appearBuf->append(") Tj\n");
@@ -1716,11 +1741,11 @@
 	c = text2->getChar(i) & 0xff;
 	if (c == '(' || c == ')' || c == '\\') {
 	  appearBuf->append('\\');
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	} else if (c < 0x20 || c >= 0x80) {
 	  appearBuf->appendf("{0:.4f} 0 Td\n", w);
 	} else {
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	}
 	appearBuf->append(") Tj\n");
       }
@@ -1798,11 +1823,11 @@
 	c = text2->getChar(i) & 0xff;
 	if (c == '(' || c == ')' || c == '\\') {
 	  appearBuf->append('\\');
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	} else if (c < 0x20 || c >= 0x80) {
 	  appearBuf->appendf("\\{0:03o}", c);
 	} else {
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	}
       }
       appearBuf->append(") Tj\n");
@@ -1986,11 +2011,11 @@
       c = text[i]->getChar(j) & 0xff;
       if (c == '(' || c == ')' || c == '\\') {
 	appearBuf->append('\\');
-	appearBuf->append(c);
+	appearBuf->append((char)c);
       } else if (c < 0x20 || c >= 0x80) {
 	appearBuf->appendf("\\{0:03o}", c);
       } else {
-	appearBuf->append(c);
+	appearBuf->append((char)c);
       }
     }
     appearBuf->append(") Tj\n");
@@ -2027,7 +2052,7 @@
       break;
     }
     if (font && !font->isCIDFont()) {
-      dw = ((Gfx8BitFont *)font)->getWidth(c) * fontSize;
+      dw = ((Gfx8BitFont *)font)->getWidth((Guchar)c) * fontSize;
     } else {
       // otherwise, make a crude estimate
       dw = 0.5 * fontSize;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Annot.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Annot.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Annot.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -1287,11 +1287,11 @@
     c = text2->getChar(i) & 0xff;
     if (c == '(' || c == ')' || c == '\\') {
       appearBuf->append('\\');
-      appearBuf->append(c);
+      appearBuf->append((char)c);
     } else if (c < 0x20 || c >= 0x80) {
       appearBuf->appendf("\\{0:03o}", c);
     } else {
-      appearBuf->append(c);
+      appearBuf->append((char)c);
     }
   }
   appearBuf->append(") Tj\n");

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -51,7 +51,7 @@
   ++length;
 }
 
-Object *Array::get(int i, Object *obj) {
+Object *Array::get(int i, Object *obj, int recursion) {
   if (i < 0 || i >= length) {
 #ifdef DEBUG_MEM
     abort();
@@ -59,7 +59,7 @@
     return obj->initNull();
 #endif
   }
-  return elems[i].fetch(xref, obj);
+  return elems[i].fetch(xref, obj, recursion);
 }
 
 Object *Array::getNF(int i, Object *obj) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -37,11 +37,11 @@
 
   // Reference counting.
 #if MULTITHREADED
-  int incRef() { return gAtomicIncrement(&ref); }
-  int decRef() { return gAtomicDecrement(&ref); }
+  long incRef() { return gAtomicIncrement(&ref); }
+  long decRef() { return gAtomicDecrement(&ref); }
 #else
-  int incRef() { return ++ref; }
-  int decRef() { return --ref; }
+  long incRef() { return ++ref; }
+  long decRef() { return --ref; }
 #endif
 
   // Get number of elements.
@@ -51,7 +51,7 @@
   void add(Object *elem);
 
   // Accessors.
-  Object *get(int i, Object *obj);
+  Object *get(int i, Object *obj, int recursion = 0);
   Object *getNF(int i, Object *obj);
 
 private:
@@ -63,7 +63,7 @@
 #if MULTITHREADED
   GAtomicCounter ref;		// reference count
 #else
-  int ref;			// reference count
+  long ref;			// reference count
 #endif
 };
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFont.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -25,6 +25,7 @@
 struct BuiltinFont {
   const char *name;
   const char **defaultBaseEnc;
+  short missingWidth;
   short ascent;
   short descent;
   short bbox[4];

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFontTables.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFontTables.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFontTables.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -2,7 +2,7 @@
 //
 // BuiltinFontTables.cc
 //
-// Copyright 2001-2003 Glyph & Cog, LLC
+// Copyright 2001-2017 Glyph & Cog, LLC
 //
 //========================================================================
 
@@ -13,4235 +13,4235 @@
 #include "BuiltinFontTables.h"
 
 static BuiltinFontWidth courierWidthsTab[] = {
-  { "Ntilde",                            600, NULL },
-  { "rcaron",                            600, NULL },
-  { "kcommaaccent",                      600, NULL },
+  { "odieresis",                         600, NULL },
+  { "M",                                 600, NULL },
+  { "Ograve",                            600, NULL },
+  { "T",                                 600, NULL },
+  { "amacron",                           600, NULL },
   { "Ncommaaccent",                      600, NULL },
-  { "Zacute",                            600, NULL },
-  { "comma",                             600, NULL },
-  { "cedilla",                           600, NULL },
-  { "plusminus",                         600, NULL },
+  { "numbersign",                        600, NULL },
+  { "emacron",                           600, NULL },
+  { "divide",                            600, NULL },
+  { "fl",                                600, NULL },
+  { "E",                                 600, NULL },
+  { "quotedblbase",                      600, NULL },
+  { "guillemotleft",                     600, NULL },
+  { "endash",                            600, NULL },
+  { "w",                                 600, NULL },
+  { "twosuperior",                       600, NULL },
+  { "eth",                               600, NULL },
+  { "space",                             600, NULL },
+  { "Thorn",                             600, NULL },
+  { "ecaron",                            600, NULL },
+  { "brokenbar",                         600, NULL },
+  { "Aogonek",                           600, NULL },
+  { "commaaccent",                       600, NULL },
+  { "W",                                 600, NULL },
+  { "bracketright",                      600, NULL },
+  { "germandbls",                        600, NULL },
+  { "Ugrave",                            600, NULL },
+  { "thorn",                             600, NULL },
+  { "zero",                              600, NULL },
+  { "udieresis",                         600, NULL },
+  { "period",                            600, NULL },
+  { "scedilla",                          600, NULL },
+  { "Ccedilla",                          600, NULL },
+  { "Igrave",                            600, NULL },
+  { "Ocircumflex",                       600, NULL },
+  { "F",                                 600, NULL },
+  { "Uring",                             600, NULL },
+  { "perthousand",                       600, NULL },
+  { "Edotaccent",                        600, NULL },
+  { "acircumflex",                       600, NULL },
+  { "G",                                 600, NULL },
   { "circumflex",                        600, NULL },
+  { "Zcaron",                            600, NULL },
+  { "ogonek",                            600, NULL },
+  { "idieresis",                         600, NULL },
+  { "cent",                              600, NULL },
+  { "ae",                                600, NULL },
+  { "less",                              600, NULL },
+  { "ocircumflex",                       600, NULL },
+  { "minus",                             600, NULL },
+  { "four",                              600, NULL },
+  { "dollar",                            600, NULL },
+  { "Tcommaaccent",                      600, NULL },
   { "dotaccent",                         600, NULL },
-  { "edotaccent",                        600, NULL },
-  { "asciitilde",                        600, NULL },
-  { "colon",                             600, NULL },
-  { "onehalf",                           600, NULL },
-  { "dollar",                            600, NULL },
-  { "Lcaron",                            600, NULL },
-  { "ntilde",                            600, NULL },
-  { "Aogonek",                           600, NULL },
-  { "ncommaaccent",                      600, NULL },
-  { "minus",                             600, NULL },
-  { "Iogonek",                           600, NULL },
-  { "zacute",                            600, NULL },
+  { "Nacute",                            600, NULL },
+  { "v",                                 600, NULL },
+  { "Kcommaaccent",                      600, NULL },
+  { "imacron",                           600, NULL },
+  { "rcommaaccent",                      600, NULL },
+  { "tilde",                             600, NULL },
+  { "underscore",                        600, NULL },
+  { "racute",                            600, NULL },
+  { "mu",                                600, NULL },
+  { "D",                                 600, NULL },
+  { "Ccaron",                            600, NULL },
+  { "j",                                 600, NULL },
+  { "hungarumlaut",                      600, NULL },
+  { "Y",                                 600, NULL },
   { "yen",                               600, NULL },
-  { "space",                             600, NULL },
+  { "ccaron",                            600, NULL },
+  { "lessequal",                         600, NULL },
+  { "Ucircumflex",                       600, NULL },
   { "Omacron",                           600, NULL },
-  { "questiondown",                      600, NULL },
+  { "quotesinglbase",                    600, NULL },
+  { "Scedilla",                          600, NULL },
+  { "grave",                             600, NULL },
+  { "parenleft",                         600, NULL },
+  { "nine",                              600, NULL },
+  { "currency",                          600, NULL },
+  { "radical",                           600, NULL },
+  { "Ntilde",                            600, NULL },
+  { "p",                                 600, NULL },
+  { "dotlessi",                          600, NULL },
+  { "cedilla",                           600, NULL },
+  { "Idotaccent",                        600, NULL },
+  { "plusminus",                         600, NULL },
+  { "Eth",                               600, NULL },
+  { "quotedblright",                     600, NULL },
+  { "ccedilla",                          600, NULL },
+  { "colon",                             600, NULL },
+  { "g",                                 600, NULL },
+  { "oe",                                600, NULL },
+  { "Odieresis",                         600, NULL },
+  { "five",                              600, NULL },
+  { "asciicircum",                       600, NULL },
+  { "X",                                 600, NULL },
   { "emdash",                            600, NULL },
-  { "Agrave",                            600, NULL },
-  { "three",                             600, NULL },
-  { "numbersign",                        600, NULL },
+  { "Egrave",                            600, NULL },
+  { "aogonek",                           600, NULL },
+  { "ring",                              600, NULL },
+  { "Dcaron",                            600, NULL },
+  { "ecircumflex",                       600, NULL },
+  { "Z",                                 600, NULL },
+  { "breve",                             600, NULL },
+  { "Amacron",                           600, NULL },
+  { "zcaron",                            600, NULL },
+  { "paragraph",                         600, NULL },
   { "lcaron",                            600, NULL },
-  { "A",                                 600, NULL },
-  { "B",                                 600, NULL },
-  { "C",                                 600, NULL },
-  { "aogonek",                           600, NULL },
-  { "D",                                 600, NULL },
-  { "E",                                 600, NULL },
-  { "onequarter",                        600, NULL },
-  { "F",                                 600, NULL },
-  { "G",                                 600, NULL },
-  { "H",                                 600, NULL },
-  { "I",                                 600, NULL },
-  { "J",                                 600, NULL },
+  { "Ydieresis",                         600, NULL },
+  { "aring",                             600, NULL },
+  { "iogonek",                           600, NULL },
+  { "florin",                            600, NULL },
+  { "Euro",                              600, NULL },
+  { "Scaron",                            600, NULL },
+  { "degree",                            600, NULL },
+  { "section",                           600, NULL },
   { "K",                                 600, NULL },
-  { "iogonek",                           600, NULL },
-  { "L",                                 600, NULL },
-  { "backslash",                         600, NULL },
-  { "periodcentered",                    600, NULL },
-  { "M",                                 600, NULL },
-  { "N",                                 600, NULL },
-  { "omacron",                           600, NULL },
-  { "Tcommaaccent",                      600, NULL },
-  { "O",                                 600, NULL },
-  { "P",                                 600, NULL },
-  { "Q",                                 600, NULL },
-  { "Uhungarumlaut",                     600, NULL },
-  { "R",                                 600, NULL },
   { "Aacute",                            600, NULL },
-  { "caron",                             600, NULL },
-  { "S",                                 600, NULL },
-  { "T",                                 600, NULL },
-  { "U",                                 600, NULL },
-  { "agrave",                            600, NULL },
-  { "V",                                 600, NULL },
-  { "W",                                 600, NULL },
-  { "equal",                             600, NULL },
-  { "question",                          600, NULL },
-  { "X",                                 600, NULL },
-  { "Y",                                 600, NULL },
-  { "Z",                                 600, NULL },
-  { "four",                              600, NULL },
-  { "a",                                 600, NULL },
-  { "Gcommaaccent",                      600, NULL },
+  { "Scommaaccent",                      600, NULL },
   { "b",                                 600, NULL },
-  { "c",                                 600, NULL },
-  { "d",                                 600, NULL },
+  { "greater",                           600, NULL },
+  { "asterisk",                          600, NULL },
+  { "scommaaccent",                      600, NULL },
+  { "Emacron",                           600, NULL },
+  { "onesuperior",                       600, NULL },
+  { "percent",                           600, NULL },
+  { "o",                                 600, NULL },
+  { "icircumflex",                       600, NULL },
+  { "iacute",                            600, NULL },
   { "e",                                 600, NULL },
-  { "f",                                 600, NULL },
-  { "g",                                 600, NULL },
-  { "bullet",                            600, NULL },
-  { "h",                                 600, NULL },
-  { "i",                                 600, NULL },
-  { "Oslash",                            600, NULL },
+  { "Imacron",                           600, NULL },
+  { "abreve",                            600, NULL },
+  { "N",                                 600, NULL },
+  { "equal",                             600, NULL },
   { "dagger",                            600, NULL },
-  { "j",                                 600, NULL },
-  { "k",                                 600, NULL },
+  { "u",                                 600, NULL },
+  { "C",                                 600, NULL },
   { "l",                                 600, NULL },
-  { "m",                                 600, NULL },
-  { "n",                                 600, NULL },
-  { "tcommaaccent",                      600, NULL },
-  { "o",                                 600, NULL },
-  { "ordfeminine",                       600, NULL },
-  { "ring",                              600, NULL },
-  { "p",                                 600, NULL },
   { "q",                                 600, NULL },
+  { "quoteleft",                         600, NULL },
+  { "registered",                        600, NULL },
+  { "Gcommaaccent",                      600, NULL },
+  { "Racute",                            600, NULL },
+  { "k",                                 600, NULL },
+  { "copyright",                         600, NULL },
+  { "onehalf",                           600, NULL },
+  { "lcommaaccent",                      600, NULL },
   { "uhungarumlaut",                     600, NULL },
-  { "r",                                 600, NULL },
-  { "twosuperior",                       600, NULL },
-  { "aacute",                            600, NULL },
-  { "s",                                 600, NULL },
-  { "OE",                                600, NULL },
-  { "t",                                 600, NULL },
-  { "divide",                            600, NULL },
-  { "u",                                 600, NULL },
-  { "Ccaron",                            600, NULL },
-  { "v",                                 600, NULL },
-  { "w",                                 600, NULL },
-  { "x",                                 600, NULL },
-  { "y",                                 600, NULL },
-  { "z",                                 600, NULL },
-  { "Gbreve",                            600, NULL },
-  { "commaaccent",                       600, NULL },
-  { "hungarumlaut",                      600, NULL },
-  { "Idotaccent",                        600, NULL },
-  { "Nacute",                            600, NULL },
-  { "quotedbl",                          600, NULL },
-  { "gcommaaccent",                      600, NULL },
-  { "mu",                                600, NULL },
+  { "gbreve",                            600, NULL },
+  { "n",                                 600, NULL },
+  { "Ecaron",                            600, NULL },
+  { "zdotaccent",                        600, NULL },
+  { "threesuperior",                     600, NULL },
+  { "Uacute",                            600, NULL },
+  { "Zacute",                            600, NULL },
+  { "atilde",                            600, NULL },
+  { "fraction",                          600, NULL },
+  { "Adieresis",                         600, NULL },
+  { "Sacute",                            600, NULL },
+  { "asciitilde",                        600, NULL },
+  { "lacute",                            600, NULL },
+  { "Uogonek",                           600, NULL },
+  { "caron",                             600, NULL },
+  { "Lslash",                            600, NULL },
+  { "sterling",                          600, NULL },
+  { "H",                                 600, NULL },
+  { "at",                                600, NULL },
   { "greaterequal",                      600, NULL },
-  { "Scaron",                            600, NULL },
-  { "Lslash",                            600, NULL },
-  { "semicolon",                         600, NULL },
+  { "J",                                 600, NULL },
+  { "threequarters",                     600, NULL },
+  { "ohungarumlaut",                     600, NULL },
+  { "Ecircumflex",                       600, NULL },
+  { "L",                                 600, NULL },
+  { "Agrave",                            600, NULL },
+  { "exclam",                            600, NULL },
+  { "AE",                                600, NULL },
+  { "notequal",                          600, NULL },
   { "oslash",                            600, NULL },
-  { "lessequal",                         600, NULL },
-  { "lozenge",                           600, NULL },
+  { "Acircumflex",                       600, NULL },
+  { "ograve",                            600, NULL },
+  { "Rcommaaccent",                      600, NULL },
+  { "Lacute",                            600, NULL },
+  { "Idieresis",                         600, NULL },
+  { "sacute",                            600, NULL },
+  { "f",                                 600, NULL },
+  { "gcommaaccent",                      600, NULL },
+  { "bracketleft",                       600, NULL },
+  { "Ohungarumlaut",                     600, NULL },
+  { "otilde",                            600, NULL },
   { "parenright",                        600, NULL },
-  { "ccaron",                            600, NULL },
-  { "Ecircumflex",                       600, NULL },
-  { "gbreve",                            600, NULL },
-  { "trademark",                         600, NULL },
-  { "daggerdbl",                         600, NULL },
-  { "nacute",                            600, NULL },
+  { "questiondown",                      600, NULL },
+  { "Lcaron",                            600, NULL },
+  { "ordmasculine",                      600, NULL },
+  { "backslash",                         600, NULL },
+  { "Eogonek",                           600, NULL },
   { "macron",                            600, NULL },
-  { "Otilde",                            600, NULL },
-  { "Emacron",                           600, NULL },
+  { "three",                             600, NULL },
+  { "slash",                             600, NULL },
+  { "r",                                 600, NULL },
+  { "ucircumflex",                       600, NULL },
+  { "zacute",                            600, NULL },
+  { "Umacron",                           600, NULL },
+  { "adieresis",                         600, NULL },
+  { "ncaron",                            600, NULL },
+  { "V",                                 600, NULL },
+  { "lozenge",                           600, NULL },
+  { "exclamdown",                        600, NULL },
+  { "Q",                                 600, NULL },
+  { "uogonek",                           600, NULL },
+  { "quoteright",                        600, NULL },
+  { "guilsinglright",                    600, NULL },
+  { "semicolon",                         600, NULL },
+  { "egrave",                            600, NULL },
+  { "s",                                 600, NULL },
+  { "uring",                             600, NULL },
+  { "z",                                 600, NULL },
+  { "Uhungarumlaut",                     600, NULL },
+  { "I",                                 600, NULL },
+  { "one",                               600, NULL },
+  { "eight",                             600, NULL },
+  { "periodcentered",                    600, NULL },
+  { "d",                                 600, NULL },
+  { "c",                                 600, NULL },
+  { "agrave",                            600, NULL },
   { "ellipsis",                          600, NULL },
-  { "scaron",                            600, NULL },
-  { "AE",                                600, NULL },
-  { "Ucircumflex",                       600, NULL },
+  { "Aring",                             600, NULL },
+  { "t",                                 600, NULL },
+  { "quotedbl",                          600, NULL },
+  { "Oacute",                            600, NULL },
+  { "edotaccent",                        600, NULL },
+  { "six",                               600, NULL },
   { "lslash",                            600, NULL },
-  { "quotedblleft",                      600, NULL },
-  { "hyphen",                            600, NULL },
-  { "guilsinglright",                    600, NULL },
+  { "P",                                 600, NULL },
+  { "i",                                 600, NULL },
+  { "multiply",                          600, NULL },
+  { "bar",                               600, NULL },
   { "quotesingle",                       600, NULL },
-  { "eight",                             600, NULL },
-  { "exclamdown",                        600, NULL },
-  { "endash",                            600, NULL },
-  { "oe",                                600, NULL },
-  { "Abreve",                            600, NULL },
-  { "Umacron",                           600, NULL },
-  { "ecircumflex",                       600, NULL },
-  { "Adieresis",                         600, NULL },
-  { "copyright",                         600, NULL },
-  { "Egrave",                            600, NULL },
-  { "slash",                             600, NULL },
+  { "acute",                             600, NULL },
+  { "braceright",                        600, NULL },
+  { "braceleft",                         600, NULL },
+  { "onequarter",                        600, NULL },
+  { "Atilde",                            600, NULL },
   { "Edieresis",                         600, NULL },
-  { "otilde",                            600, NULL },
-  { "Idieresis",                         600, NULL },
-  { "parenleft",                         600, NULL },
-  { "one",                               600, NULL },
-  { "emacron",                           600, NULL },
-  { "Odieresis",                         600, NULL },
-  { "ucircumflex",                       600, NULL },
-  { "bracketleft",                       600, NULL },
-  { "Ugrave",                            600, NULL },
-  { "quoteright",                        600, NULL },
-  { "Udieresis",                         600, NULL },
-  { "perthousand",                       600, NULL },
-  { "Ydieresis",                         600, NULL },
-  { "umacron",                           600, NULL },
-  { "abreve",                            600, NULL },
-  { "Eacute",                            600, NULL },
-  { "adieresis",                         600, NULL },
-  { "egrave",                            600, NULL },
+  { "oacute",                            600, NULL },
+  { "Yacute",                            600, NULL },
+  { "daggerdbl",                         600, NULL },
+  { "ncommaaccent",                      600, NULL },
+  { "logicalnot",                        600, NULL },
+  { "tcommaaccent",                      600, NULL },
+  { "Dcroat",                            600, NULL },
+  { "cacute",                            600, NULL },
+  { "tcaron",                            600, NULL },
+  { "rcaron",                            600, NULL },
+  { "Iogonek",                           600, NULL },
+  { "y",                                 600, NULL },
   { "edieresis",                         600, NULL },
-  { "idieresis",                         600, NULL },
-  { "Eth",                               600, NULL },
-  { "ae",                                600, NULL },
-  { "asterisk",                          600, NULL },
-  { "odieresis",                         600, NULL },
-  { "Uacute",                            600, NULL },
-  { "ugrave",                            600, NULL },
-  { "five",                              600, NULL },
-  { "nine",                              600, NULL },
-  { "udieresis",                         600, NULL },
-  { "Zcaron",                            600, NULL },
-  { "Scommaaccent",                      600, NULL },
-  { "threequarters",                     600, NULL },
-  { "guillemotright",                    600, NULL },
-  { "Ccedilla",                          600, NULL },
-  { "ydieresis",                         600, NULL },
-  { "tilde",                             600, NULL },
-  { "at",                                600, NULL },
-  { "eacute",                            600, NULL },
-  { "underscore",                        600, NULL },
-  { "Euro",                              600, NULL },
-  { "Dcroat",                            600, NULL },
-  { "zero",                              600, NULL },
-  { "multiply",                          600, NULL },
-  { "eth",                               600, NULL },
-  { "Scedilla",                          600, NULL },
-  { "Racute",                            600, NULL },
-  { "Ograve",                            600, NULL },
+  { "x",                                 600, NULL },
+  { "Ncaron",                            600, NULL },
+  { "OE",                                600, NULL },
+  { "m",                                 600, NULL },
+  { "U",                                 600, NULL },
   { "partialdiff",                       600, NULL },
-  { "uacute",                            600, NULL },
-  { "braceleft",                         600, NULL },
-  { "Thorn",                             600, NULL },
-  { "zcaron",                            600, NULL },
-  { "scommaaccent",                      600, NULL },
-  { "ccedilla",                          600, NULL },
-  { "Dcaron",                            600, NULL },
   { "dcroat",                            600, NULL },
-  { "scedilla",                          600, NULL },
-  { "Oacute",                            600, NULL },
-  { "Ocircumflex",                       600, NULL },
-  { "ogonek",                            600, NULL },
-  { "ograve",                            600, NULL },
-  { "racute",                            600, NULL },
+  { "igrave",                            600, NULL },
+  { "summation",                         600, NULL },
+  { "question",                          600, NULL },
+  { "A",                                 600, NULL },
+  { "Cacute",                            600, NULL },
+  { "h",                                 600, NULL },
+  { "guilsinglleft",                     600, NULL },
+  { "plus",                              600, NULL },
+  { "Otilde",                            600, NULL },
+  { "umacron",                           600, NULL },
   { "Tcaron",                            600, NULL },
-  { "Eogonek",                           600, NULL },
-  { "thorn",                             600, NULL },
-  { "degree",                            600, NULL },
-  { "registered",                        600, NULL },
-  { "radical",                           600, NULL },
-  { "Aring",                             600, NULL },
-  { "percent",                           600, NULL },
-  { "six",                               600, NULL },
-  { "paragraph",                         600, NULL },
+  { "aacute",                            600, NULL },
+  { "B",                                 600, NULL },
+  { "R",                                 600, NULL },
+  { "ydieresis",                         600, NULL },
+  { "Rcaron",                            600, NULL },
+  { "kcommaaccent",                      600, NULL },
+  { "yacute",                            600, NULL },
   { "dcaron",                            600, NULL },
-  { "Uogonek",                           600, NULL },
-  { "two",                               600, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            600, NULL },
-  { "Lacute",                            600, NULL },
-  { "ocircumflex",                       600, NULL },
-  { "oacute",                            600, NULL },
-  { "Uring",                             600, NULL },
-  { "Lcommaaccent",                      600, NULL },
-  { "tcaron",                            600, NULL },
-  { "eogonek",                           600, NULL },
+  { "ugrave",                            600, NULL },
+  { "a",                                 600, NULL },
+  { "hyphen",                            600, NULL },
+  { "Oslash",                            600, NULL },
+  { "comma",                             600, NULL },
   { "Delta",                             600, NULL },
-  { "Ohungarumlaut",                     600, NULL },
-  { "asciicircum",                       600, NULL },
-  { "aring",                             600, NULL },
-  { "grave",                             600, NULL },
-  { "uogonek",                           600, NULL },
-  { "bracketright",                      600, NULL },
+  { "omacron",                           600, NULL },
+  { "Gbreve",                            600, NULL },
+  { "S",                                 600, NULL },
+  { "quotedblleft",                      600, NULL },
+  { "ordfeminine",                       600, NULL },
   { "ampersand",                         600, NULL },
-  { "Iacute",                            600, NULL },
-  { "lacute",                            600, NULL },
-  { "igrave",                            600, NULL },
-  { "Ncaron",                            600, NULL },
-  { "plus",                              600, NULL },
-  { "uring",                             600, NULL },
-  { "quotesinglbase",                    600, NULL },
-  { "lcommaaccent",                      600, NULL },
-  { "Yacute",                            600, NULL },
-  { "ohungarumlaut",                     600, NULL },
-  { "threesuperior",                     600, NULL },
-  { "acute",                             600, NULL },
-  { "section",                           600, NULL },
+  { "trademark",                         600, NULL },
+  { "Lcommaaccent",                      600, NULL },
+  { "ntilde",                            600, NULL },
+  { "fi",                                600, NULL },
   { "dieresis",                          600, NULL },
-  { "quotedblbase",                      600, NULL },
-  { "iacute",                            600, NULL },
-  { "ncaron",                            600, NULL },
-  { "florin",                            600, NULL },
-  { "yacute",                            600, NULL },
-  { "Rcommaaccent",                      600, NULL },
-  { "fi",                                600, NULL },
-  { "fl",                                600, NULL },
-  { "Acircumflex",                       600, NULL },
-  { "Cacute",                            600, NULL },
+  { "Eacute",                            600, NULL },
+  { "nacute",                            600, NULL },
+  { "O",                                 600, NULL },
   { "Icircumflex",                       600, NULL },
-  { "guillemotleft",                     600, NULL },
-  { "germandbls",                        600, NULL },
+  { "Udieresis",                         600, NULL },
+  { "Abreve",                            600, NULL },
+  { "Iacute",                            600, NULL },
+  { "uacute",                            600, NULL },
+  { "two",                               600, NULL },
   { "seven",                             600, NULL },
-  { "Amacron",                           600, NULL },
-  { "Sacute",                            600, NULL },
-  { "ordmasculine",                      600, NULL },
-  { "dotlessi",                          600, NULL },
-  { "sterling",                          600, NULL },
-  { "notequal",                          600, NULL },
-  { "Imacron",                           600, NULL },
-  { "rcommaaccent",                      600, NULL },
-  { "Zdotaccent",                        600, NULL },
-  { "acircumflex",                       600, NULL },
-  { "cacute",                            600, NULL },
-  { "Ecaron",                            600, NULL },
-  { "braceright",                        600, NULL },
-  { "icircumflex",                       600, NULL },
-  { "quotedblright",                     600, NULL },
-  { "amacron",                           600, NULL },
-  { "sacute",                            600, NULL },
-  { "imacron",                           600, NULL },
-  { "cent",                              600, NULL },
-  { "currency",                          600, NULL },
-  { "logicalnot",                        600, NULL },
-  { "zdotaccent",                        600, NULL },
-  { "Atilde",                            600, NULL },
-  { "breve",                             600, NULL },
-  { "bar",                               600, NULL },
-  { "fraction",                          600, NULL },
-  { "less",                              600, NULL },
-  { "ecaron",                            600, NULL },
-  { "guilsinglleft",                     600, NULL },
-  { "exclam",                            600, NULL },
-  { "period",                            600, NULL },
-  { "Rcaron",                            600, NULL },
-  { "Kcommaaccent",                      600, NULL },
-  { "greater",                           600, NULL },
-  { "atilde",                            600, NULL },
-  { "brokenbar",                         600, NULL },
-  { "quoteleft",                         600, NULL },
-  { "Edotaccent",                        600, NULL },
-  { "onesuperior",                       600, NULL }
+  { "scaron",                            600, NULL },
+  { "guillemotright",                    600, NULL },
+  { "bullet",                            600, NULL },
+  { "eogonek",                           600, NULL },
+  { "eacute",                            600, NULL },
+  { "Zdotaccent",                        600, NULL }
 };
 
 static BuiltinFontWidth courierBoldWidthsTab[] = {
-  { "Ntilde",                            600, NULL },
-  { "rcaron",                            600, NULL },
-  { "kcommaaccent",                      600, NULL },
-  { "Ncommaaccent",                      600, NULL },
-  { "Zacute",                            600, NULL },
-  { "comma",                             600, NULL },
-  { "cedilla",                           600, NULL },
-  { "plusminus",                         600, NULL },
-  { "circumflex",                        600, NULL },
-  { "dotaccent",                         600, NULL },
-  { "edotaccent",                        600, NULL },
-  { "asciitilde",                        600, NULL },
-  { "colon",                             600, NULL },
-  { "onehalf",                           600, NULL },
-  { "dollar",                            600, NULL },
-  { "Lcaron",                            600, NULL },
-  { "ntilde",                            600, NULL },
-  { "Aogonek",                           600, NULL },
-  { "ncommaaccent",                      600, NULL },
-  { "minus",                             600, NULL },
-  { "Iogonek",                           600, NULL },
-  { "zacute",                            600, NULL },
-  { "yen",                               600, NULL },
-  { "space",                             600, NULL },
-  { "Omacron",                           600, NULL },
-  { "questiondown",                      600, NULL },
-  { "emdash",                            600, NULL },
-  { "Agrave",                            600, NULL },
-  { "three",                             600, NULL },
-  { "numbersign",                        600, NULL },
-  { "lcaron",                            600, NULL },
-  { "A",                                 600, NULL },
-  { "B",                                 600, NULL },
-  { "C",                                 600, NULL },
-  { "aogonek",                           600, NULL },
-  { "D",                                 600, NULL },
-  { "E",                                 600, NULL },
-  { "onequarter",                        600, NULL },
-  { "F",                                 600, NULL },
-  { "G",                                 600, NULL },
-  { "H",                                 600, NULL },
+  { "t",                                 600, NULL },
+  { "quotedbl",                          600, NULL },
+  { "Oacute",                            600, NULL },
+  { "agrave",                            600, NULL },
+  { "ellipsis",                          600, NULL },
+  { "Aring",                             600, NULL },
+  { "eight",                             600, NULL },
   { "I",                                 600, NULL },
-  { "J",                                 600, NULL },
-  { "K",                                 600, NULL },
-  { "iogonek",                           600, NULL },
-  { "backslash",                         600, NULL },
-  { "L",                                 600, NULL },
+  { "one",                               600, NULL },
   { "periodcentered",                    600, NULL },
-  { "M",                                 600, NULL },
-  { "N",                                 600, NULL },
-  { "omacron",                           600, NULL },
-  { "Tcommaaccent",                      600, NULL },
-  { "O",                                 600, NULL },
-  { "P",                                 600, NULL },
-  { "Q",                                 600, NULL },
-  { "Uhungarumlaut",                     600, NULL },
-  { "R",                                 600, NULL },
-  { "Aacute",                            600, NULL },
-  { "caron",                             600, NULL },
-  { "S",                                 600, NULL },
-  { "T",                                 600, NULL },
-  { "U",                                 600, NULL },
-  { "agrave",                            600, NULL },
-  { "V",                                 600, NULL },
-  { "W",                                 600, NULL },
-  { "X",                                 600, NULL },
-  { "question",                          600, NULL },
-  { "equal",                             600, NULL },
-  { "Y",                                 600, NULL },
-  { "Z",                                 600, NULL },
-  { "four",                              600, NULL },
-  { "a",                                 600, NULL },
-  { "Gcommaaccent",                      600, NULL },
-  { "b",                                 600, NULL },
   { "c",                                 600, NULL },
   { "d",                                 600, NULL },
-  { "e",                                 600, NULL },
-  { "f",                                 600, NULL },
-  { "g",                                 600, NULL },
-  { "bullet",                            600, NULL },
-  { "h",                                 600, NULL },
-  { "i",                                 600, NULL },
-  { "Oslash",                            600, NULL },
-  { "dagger",                            600, NULL },
-  { "j",                                 600, NULL },
-  { "k",                                 600, NULL },
-  { "l",                                 600, NULL },
-  { "m",                                 600, NULL },
-  { "n",                                 600, NULL },
-  { "tcommaaccent",                      600, NULL },
-  { "o",                                 600, NULL },
-  { "ordfeminine",                       600, NULL },
-  { "ring",                              600, NULL },
-  { "p",                                 600, NULL },
-  { "q",                                 600, NULL },
-  { "uhungarumlaut",                     600, NULL },
-  { "r",                                 600, NULL },
-  { "twosuperior",                       600, NULL },
-  { "aacute",                            600, NULL },
+  { "egrave",                            600, NULL },
+  { "uring",                             600, NULL },
   { "s",                                 600, NULL },
-  { "OE",                                600, NULL },
-  { "t",                                 600, NULL },
-  { "divide",                            600, NULL },
-  { "u",                                 600, NULL },
-  { "Ccaron",                            600, NULL },
-  { "v",                                 600, NULL },
-  { "w",                                 600, NULL },
-  { "x",                                 600, NULL },
-  { "y",                                 600, NULL },
   { "z",                                 600, NULL },
-  { "Gbreve",                            600, NULL },
-  { "commaaccent",                       600, NULL },
-  { "hungarumlaut",                      600, NULL },
-  { "Idotaccent",                        600, NULL },
-  { "Nacute",                            600, NULL },
-  { "quotedbl",                          600, NULL },
-  { "gcommaaccent",                      600, NULL },
-  { "mu",                                600, NULL },
-  { "greaterequal",                      600, NULL },
-  { "Scaron",                            600, NULL },
-  { "Lslash",                            600, NULL },
+  { "Uhungarumlaut",                     600, NULL },
+  { "uogonek",                           600, NULL },
+  { "quoteright",                        600, NULL },
   { "semicolon",                         600, NULL },
-  { "oslash",                            600, NULL },
-  { "lessequal",                         600, NULL },
+  { "guilsinglright",                    600, NULL },
+  { "Umacron",                           600, NULL },
+  { "zacute",                            600, NULL },
+  { "ncaron",                            600, NULL },
+  { "adieresis",                         600, NULL },
   { "lozenge",                           600, NULL },
-  { "parenright",                        600, NULL },
-  { "ccaron",                            600, NULL },
-  { "Ecircumflex",                       600, NULL },
-  { "gbreve",                            600, NULL },
-  { "trademark",                         600, NULL },
-  { "daggerdbl",                         600, NULL },
-  { "nacute",                            600, NULL },
-  { "macron",                            600, NULL },
-  { "Otilde",                            600, NULL },
-  { "Emacron",                           600, NULL },
-  { "ellipsis",                          600, NULL },
-  { "scaron",                            600, NULL },
-  { "AE",                                600, NULL },
-  { "Ucircumflex",                       600, NULL },
-  { "lslash",                            600, NULL },
-  { "quotedblleft",                      600, NULL },
-  { "guilsinglright",                    600, NULL },
-  { "hyphen",                            600, NULL },
-  { "quotesingle",                       600, NULL },
-  { "eight",                             600, NULL },
+  { "V",                                 600, NULL },
+  { "Q",                                 600, NULL },
   { "exclamdown",                        600, NULL },
-  { "endash",                            600, NULL },
-  { "oe",                                600, NULL },
-  { "Abreve",                            600, NULL },
-  { "Umacron",                           600, NULL },
-  { "ecircumflex",                       600, NULL },
-  { "Adieresis",                         600, NULL },
-  { "copyright",                         600, NULL },
-  { "Egrave",                            600, NULL },
+  { "three",                             600, NULL },
   { "slash",                             600, NULL },
-  { "Edieresis",                         600, NULL },
+  { "r",                                 600, NULL },
+  { "ucircumflex",                       600, NULL },
+  { "macron",                            600, NULL },
+  { "Eogonek",                           600, NULL },
+  { "Lcaron",                            600, NULL },
+  { "ordmasculine",                      600, NULL },
+  { "questiondown",                      600, NULL },
+  { "backslash",                         600, NULL },
+  { "gcommaaccent",                      600, NULL },
+  { "Ohungarumlaut",                     600, NULL },
+  { "bracketleft",                       600, NULL },
   { "otilde",                            600, NULL },
+  { "parenright",                        600, NULL },
+  { "f",                                 600, NULL },
+  { "Lacute",                            600, NULL },
   { "Idieresis",                         600, NULL },
-  { "parenleft",                         600, NULL },
-  { "one",                               600, NULL },
-  { "emacron",                           600, NULL },
-  { "Odieresis",                         600, NULL },
-  { "ucircumflex",                       600, NULL },
-  { "bracketleft",                       600, NULL },
-  { "Ugrave",                            600, NULL },
-  { "quoteright",                        600, NULL },
-  { "Udieresis",                         600, NULL },
-  { "perthousand",                       600, NULL },
-  { "Ydieresis",                         600, NULL },
-  { "umacron",                           600, NULL },
-  { "abreve",                            600, NULL },
-  { "Eacute",                            600, NULL },
-  { "adieresis",                         600, NULL },
-  { "egrave",                            600, NULL },
-  { "edieresis",                         600, NULL },
-  { "idieresis",                         600, NULL },
-  { "Eth",                               600, NULL },
-  { "ae",                                600, NULL },
-  { "asterisk",                          600, NULL },
-  { "odieresis",                         600, NULL },
+  { "sacute",                            600, NULL },
+  { "Rcommaaccent",                      600, NULL },
+  { "ograve",                            600, NULL },
+  { "threequarters",                     600, NULL },
+  { "J",                                 600, NULL },
+  { "ohungarumlaut",                     600, NULL },
+  { "Ecircumflex",                       600, NULL },
+  { "L",                                 600, NULL },
+  { "notequal",                          600, NULL },
+  { "exclam",                            600, NULL },
+  { "Agrave",                            600, NULL },
+  { "AE",                                600, NULL },
+  { "Acircumflex",                       600, NULL },
+  { "oslash",                            600, NULL },
+  { "Uogonek",                           600, NULL },
+  { "caron",                             600, NULL },
+  { "Lslash",                            600, NULL },
+  { "lacute",                            600, NULL },
+  { "sterling",                          600, NULL },
+  { "H",                                 600, NULL },
+  { "at",                                600, NULL },
+  { "greaterequal",                      600, NULL },
+  { "asciitilde",                        600, NULL },
   { "Uacute",                            600, NULL },
-  { "ugrave",                            600, NULL },
-  { "nine",                              600, NULL },
-  { "five",                              600, NULL },
-  { "udieresis",                         600, NULL },
-  { "Zcaron",                            600, NULL },
-  { "Scommaaccent",                      600, NULL },
-  { "threequarters",                     600, NULL },
+  { "atilde",                            600, NULL },
+  { "Zacute",                            600, NULL },
+  { "fraction",                          600, NULL },
+  { "Adieresis",                         600, NULL },
+  { "Sacute",                            600, NULL },
+  { "scaron",                            600, NULL },
   { "guillemotright",                    600, NULL },
-  { "Ccedilla",                          600, NULL },
-  { "ydieresis",                         600, NULL },
-  { "tilde",                             600, NULL },
-  { "at",                                600, NULL },
+  { "bullet",                            600, NULL },
+  { "eogonek",                           600, NULL },
   { "eacute",                            600, NULL },
-  { "underscore",                        600, NULL },
-  { "Euro",                              600, NULL },
-  { "Dcroat",                            600, NULL },
-  { "multiply",                          600, NULL },
-  { "zero",                              600, NULL },
-  { "eth",                               600, NULL },
-  { "Scedilla",                          600, NULL },
-  { "Ograve",                            600, NULL },
-  { "Racute",                            600, NULL },
-  { "partialdiff",                       600, NULL },
+  { "Zdotaccent",                        600, NULL },
+  { "Abreve",                            600, NULL },
+  { "Udieresis",                         600, NULL },
+  { "Iacute",                            600, NULL },
+  { "two",                               600, NULL },
   { "uacute",                            600, NULL },
-  { "braceleft",                         600, NULL },
-  { "Thorn",                             600, NULL },
-  { "zcaron",                            600, NULL },
-  { "scommaaccent",                      600, NULL },
-  { "ccedilla",                          600, NULL },
-  { "Dcaron",                            600, NULL },
-  { "dcroat",                            600, NULL },
-  { "Ocircumflex",                       600, NULL },
-  { "Oacute",                            600, NULL },
-  { "scedilla",                          600, NULL },
-  { "ogonek",                            600, NULL },
-  { "ograve",                            600, NULL },
-  { "racute",                            600, NULL },
-  { "Tcaron",                            600, NULL },
-  { "Eogonek",                           600, NULL },
-  { "thorn",                             600, NULL },
-  { "degree",                            600, NULL },
-  { "registered",                        600, NULL },
-  { "radical",                           600, NULL },
-  { "Aring",                             600, NULL },
-  { "percent",                           600, NULL },
-  { "six",                               600, NULL },
-  { "paragraph",                         600, NULL },
-  { "dcaron",                            600, NULL },
-  { "Uogonek",                           600, NULL },
-  { "two",                               600, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            600, NULL },
-  { "Lacute",                            600, NULL },
-  { "ocircumflex",                       600, NULL },
-  { "oacute",                            600, NULL },
-  { "Uring",                             600, NULL },
+  { "seven",                             600, NULL },
+  { "dieresis",                          600, NULL },
+  { "Eacute",                            600, NULL },
+  { "O",                                 600, NULL },
+  { "Icircumflex",                       600, NULL },
+  { "nacute",                            600, NULL },
+  { "trademark",                         600, NULL },
+  { "ampersand",                         600, NULL },
   { "Lcommaaccent",                      600, NULL },
-  { "tcaron",                            600, NULL },
-  { "eogonek",                           600, NULL },
+  { "ntilde",                            600, NULL },
+  { "fi",                                600, NULL },
+  { "quotedblleft",                      600, NULL },
+  { "ordfeminine",                       600, NULL },
+  { "omacron",                           600, NULL },
+  { "comma",                             600, NULL },
   { "Delta",                             600, NULL },
-  { "Ohungarumlaut",                     600, NULL },
-  { "asciicircum",                       600, NULL },
-  { "aring",                             600, NULL },
-  { "grave",                             600, NULL },
-  { "uogonek",                           600, NULL },
-  { "bracketright",                      600, NULL },
-  { "Iacute",                            600, NULL },
-  { "ampersand",                         600, NULL },
+  { "Gbreve",                            600, NULL },
+  { "S",                                 600, NULL },
+  { "B",                                 600, NULL },
+  { "kcommaaccent",                      600, NULL },
+  { "Rcaron",                            600, NULL },
+  { "yacute",                            600, NULL },
+  { "ydieresis",                         600, NULL },
+  { "R",                                 600, NULL },
+  { "ugrave",                            600, NULL },
+  { "dcaron",                            600, NULL },
+  { "Oslash",                            600, NULL },
+  { "hyphen",                            600, NULL },
+  { "a",                                 600, NULL },
+  { "Otilde",                            600, NULL },
+  { "umacron",                           600, NULL },
+  { "Tcaron",                            600, NULL },
+  { "aacute",                            600, NULL },
+  { "guilsinglleft",                     600, NULL },
+  { "Cacute",                            600, NULL },
+  { "h",                                 600, NULL },
+  { "plus",                              600, NULL },
   { "igrave",                            600, NULL },
-  { "lacute",                            600, NULL },
+  { "dcroat",                            600, NULL },
+  { "question",                          600, NULL },
+  { "summation",                         600, NULL },
+  { "A",                                 600, NULL },
+  { "x",                                 600, NULL },
+  { "edieresis",                         600, NULL },
+  { "Iogonek",                           600, NULL },
+  { "y",                                 600, NULL },
   { "Ncaron",                            600, NULL },
-  { "plus",                              600, NULL },
-  { "uring",                             600, NULL },
-  { "quotesinglbase",                    600, NULL },
-  { "lcommaaccent",                      600, NULL },
+  { "m",                                 600, NULL },
+  { "OE",                                600, NULL },
+  { "partialdiff",                       600, NULL },
+  { "U",                                 600, NULL },
+  { "ncommaaccent",                      600, NULL },
+  { "tcommaaccent",                      600, NULL },
+  { "logicalnot",                        600, NULL },
+  { "cacute",                            600, NULL },
+  { "Dcroat",                            600, NULL },
+  { "tcaron",                            600, NULL },
+  { "rcaron",                            600, NULL },
+  { "Atilde",                            600, NULL },
+  { "Edieresis",                         600, NULL },
   { "Yacute",                            600, NULL },
-  { "ohungarumlaut",                     600, NULL },
-  { "threesuperior",                     600, NULL },
+  { "oacute",                            600, NULL },
+  { "daggerdbl",                         600, NULL },
+  { "braceleft",                         600, NULL },
+  { "braceright",                        600, NULL },
   { "acute",                             600, NULL },
-  { "section",                           600, NULL },
-  { "dieresis",                          600, NULL },
-  { "iacute",                            600, NULL },
-  { "quotedblbase",                      600, NULL },
-  { "ncaron",                            600, NULL },
-  { "florin",                            600, NULL },
-  { "yacute",                            600, NULL },
-  { "Rcommaaccent",                      600, NULL },
-  { "fi",                                600, NULL },
-  { "fl",                                600, NULL },
-  { "Acircumflex",                       600, NULL },
-  { "Cacute",                            600, NULL },
-  { "Icircumflex",                       600, NULL },
-  { "guillemotleft",                     600, NULL },
-  { "germandbls",                        600, NULL },
-  { "Amacron",                           600, NULL },
-  { "seven",                             600, NULL },
-  { "Sacute",                            600, NULL },
-  { "ordmasculine",                      600, NULL },
-  { "dotlessi",                          600, NULL },
-  { "sterling",                          600, NULL },
-  { "notequal",                          600, NULL },
-  { "Imacron",                           600, NULL },
+  { "onequarter",                        600, NULL },
+  { "i",                                 600, NULL },
+  { "multiply",                          600, NULL },
+  { "quotesingle",                       600, NULL },
+  { "bar",                               600, NULL },
+  { "six",                               600, NULL },
+  { "edotaccent",                        600, NULL },
+  { "lslash",                            600, NULL },
+  { "P",                                 600, NULL },
+  { "parenleft",                         600, NULL },
+  { "currency",                          600, NULL },
+  { "nine",                              600, NULL },
+  { "quotesinglbase",                    600, NULL },
+  { "grave",                             600, NULL },
+  { "Scedilla",                          600, NULL },
+  { "ccaron",                            600, NULL },
+  { "Ucircumflex",                       600, NULL },
+  { "lessequal",                         600, NULL },
+  { "Omacron",                           600, NULL },
+  { "hungarumlaut",                      600, NULL },
+  { "Ccaron",                            600, NULL },
+  { "j",                                 600, NULL },
+  { "Y",                                 600, NULL },
+  { "yen",                               600, NULL },
   { "rcommaaccent",                      600, NULL },
-  { "Zdotaccent",                        600, NULL },
-  { "acircumflex",                       600, NULL },
-  { "cacute",                            600, NULL },
-  { "Ecaron",                            600, NULL },
-  { "icircumflex",                       600, NULL },
-  { "braceright",                        600, NULL },
-  { "quotedblright",                     600, NULL },
-  { "amacron",                           600, NULL },
-  { "sacute",                            600, NULL },
+  { "Kcommaaccent",                      600, NULL },
   { "imacron",                           600, NULL },
+  { "tilde",                             600, NULL },
+  { "underscore",                        600, NULL },
+  { "mu",                                600, NULL },
+  { "D",                                 600, NULL },
+  { "racute",                            600, NULL },
+  { "Tcommaaccent",                      600, NULL },
+  { "dollar",                            600, NULL },
+  { "Nacute",                            600, NULL },
+  { "v",                                 600, NULL },
+  { "dotaccent",                         600, NULL },
   { "cent",                              600, NULL },
-  { "currency",                          600, NULL },
-  { "logicalnot",                        600, NULL },
-  { "zdotaccent",                        600, NULL },
-  { "Atilde",                            600, NULL },
-  { "breve",                             600, NULL },
-  { "bar",                               600, NULL },
-  { "fraction",                          600, NULL },
+  { "ae",                                600, NULL },
+  { "ocircumflex",                       600, NULL },
   { "less",                              600, NULL },
+  { "minus",                             600, NULL },
+  { "four",                              600, NULL },
+  { "circumflex",                        600, NULL },
+  { "Zcaron",                            600, NULL },
+  { "ogonek",                            600, NULL },
+  { "idieresis",                         600, NULL },
+  { "G",                                 600, NULL },
+  { "F",                                 600, NULL },
+  { "Ocircumflex",                       600, NULL },
+  { "Uring",                             600, NULL },
+  { "perthousand",                       600, NULL },
+  { "Edotaccent",                        600, NULL },
+  { "acircumflex",                       600, NULL },
+  { "zero",                              600, NULL },
+  { "period",                            600, NULL },
+  { "scedilla",                          600, NULL },
+  { "udieresis",                         600, NULL },
+  { "Ccedilla",                          600, NULL },
+  { "Igrave",                            600, NULL },
+  { "commaaccent",                       600, NULL },
+  { "W",                                 600, NULL },
+  { "bracketright",                      600, NULL },
+  { "Ugrave",                            600, NULL },
+  { "germandbls",                        600, NULL },
+  { "thorn",                             600, NULL },
+  { "w",                                 600, NULL },
+  { "Thorn",                             600, NULL },
+  { "space",                             600, NULL },
+  { "eth",                               600, NULL },
+  { "twosuperior",                       600, NULL },
   { "ecaron",                            600, NULL },
-  { "guilsinglleft",                     600, NULL },
-  { "exclam",                            600, NULL },
-  { "period",                            600, NULL },
-  { "Rcaron",                            600, NULL },
-  { "Kcommaaccent",                      600, NULL },
-  { "greater",                           600, NULL },
-  { "atilde",                            600, NULL },
+  { "Aogonek",                           600, NULL },
   { "brokenbar",                         600, NULL },
+  { "fl",                                600, NULL },
+  { "E",                                 600, NULL },
+  { "quotedblbase",                      600, NULL },
+  { "guillemotleft",                     600, NULL },
+  { "endash",                            600, NULL },
+  { "amacron",                           600, NULL },
+  { "Ncommaaccent",                      600, NULL },
+  { "numbersign",                        600, NULL },
+  { "divide",                            600, NULL },
+  { "emacron",                           600, NULL },
+  { "M",                                 600, NULL },
+  { "odieresis",                         600, NULL },
+  { "Ograve",                            600, NULL },
+  { "T",                                 600, NULL },
+  { "n",                                 600, NULL },
+  { "Ecaron",                            600, NULL },
+  { "threesuperior",                     600, NULL },
+  { "zdotaccent",                        600, NULL },
+  { "lcommaaccent",                      600, NULL },
+  { "onehalf",                           600, NULL },
+  { "gbreve",                            600, NULL },
+  { "uhungarumlaut",                     600, NULL },
+  { "Racute",                            600, NULL },
+  { "k",                                 600, NULL },
+  { "copyright",                         600, NULL },
   { "quoteleft",                         600, NULL },
-  { "Edotaccent",                        600, NULL },
-  { "onesuperior",                       600, NULL }
+  { "registered",                        600, NULL },
+  { "Gcommaaccent",                      600, NULL },
+  { "equal",                             600, NULL },
+  { "dagger",                            600, NULL },
+  { "N",                                 600, NULL },
+  { "C",                                 600, NULL },
+  { "u",                                 600, NULL },
+  { "q",                                 600, NULL },
+  { "l",                                 600, NULL },
+  { "icircumflex",                       600, NULL },
+  { "Imacron",                           600, NULL },
+  { "abreve",                            600, NULL },
+  { "e",                                 600, NULL },
+  { "iacute",                            600, NULL },
+  { "percent",                           600, NULL },
+  { "o",                                 600, NULL },
+  { "greater",                           600, NULL },
+  { "Emacron",                           600, NULL },
+  { "asterisk",                          600, NULL },
+  { "scommaaccent",                      600, NULL },
+  { "onesuperior",                       600, NULL },
+  { "K",                                 600, NULL },
+  { "Scommaaccent",                      600, NULL },
+  { "Aacute",                            600, NULL },
+  { "b",                                 600, NULL },
+  { "Euro",                              600, NULL },
+  { "florin",                            600, NULL },
+  { "iogonek",                           600, NULL },
+  { "section",                           600, NULL },
+  { "Scaron",                            600, NULL },
+  { "degree",                            600, NULL },
+  { "lcaron",                            600, NULL },
+  { "paragraph",                         600, NULL },
+  { "zcaron",                            600, NULL },
+  { "aring",                             600, NULL },
+  { "Ydieresis",                         600, NULL },
+  { "Dcaron",                            600, NULL },
+  { "Z",                                 600, NULL },
+  { "ecircumflex",                       600, NULL },
+  { "Amacron",                           600, NULL },
+  { "breve",                             600, NULL },
+  { "emdash",                            600, NULL },
+  { "Egrave",                            600, NULL },
+  { "aogonek",                           600, NULL },
+  { "ring",                              600, NULL },
+  { "Odieresis",                         600, NULL },
+  { "oe",                                600, NULL },
+  { "five",                              600, NULL },
+  { "X",                                 600, NULL },
+  { "asciicircum",                       600, NULL },
+  { "plusminus",                         600, NULL },
+  { "Idotaccent",                        600, NULL },
+  { "cedilla",                           600, NULL },
+  { "quotedblright",                     600, NULL },
+  { "Eth",                               600, NULL },
+  { "colon",                             600, NULL },
+  { "g",                                 600, NULL },
+  { "ccedilla",                          600, NULL },
+  { "radical",                           600, NULL },
+  { "Ntilde",                            600, NULL },
+  { "dotlessi",                          600, NULL },
+  { "p",                                 600, NULL }
 };
 
 static BuiltinFontWidth courierBoldObliqueWidthsTab[] = {
+  { "greater",                           600, NULL },
+  { "asterisk",                          600, NULL },
+  { "Emacron",                           600, NULL },
+  { "scommaaccent",                      600, NULL },
+  { "onesuperior",                       600, NULL },
+  { "percent",                           600, NULL },
+  { "o",                                 600, NULL },
+  { "icircumflex",                       600, NULL },
+  { "iacute",                            600, NULL },
+  { "e",                                 600, NULL },
+  { "Imacron",                           600, NULL },
+  { "abreve",                            600, NULL },
+  { "N",                                 600, NULL },
+  { "equal",                             600, NULL },
+  { "dagger",                            600, NULL },
+  { "u",                                 600, NULL },
+  { "C",                                 600, NULL },
+  { "l",                                 600, NULL },
+  { "q",                                 600, NULL },
+  { "quoteleft",                         600, NULL },
+  { "registered",                        600, NULL },
+  { "Gcommaaccent",                      600, NULL },
+  { "Racute",                            600, NULL },
+  { "k",                                 600, NULL },
+  { "copyright",                         600, NULL },
+  { "onehalf",                           600, NULL },
+  { "lcommaaccent",                      600, NULL },
+  { "uhungarumlaut",                     600, NULL },
+  { "gbreve",                            600, NULL },
+  { "n",                                 600, NULL },
+  { "Ecaron",                            600, NULL },
+  { "zdotaccent",                        600, NULL },
+  { "threesuperior",                     600, NULL },
+  { "radical",                           600, NULL },
   { "Ntilde",                            600, NULL },
-  { "rcaron",                            600, NULL },
-  { "kcommaaccent",                      600, NULL },
-  { "Ncommaaccent",                      600, NULL },
-  { "Zacute",                            600, NULL },
-  { "comma",                             600, NULL },
+  { "p",                                 600, NULL },
+  { "dotlessi",                          600, NULL },
   { "cedilla",                           600, NULL },
+  { "Idotaccent",                        600, NULL },
   { "plusminus",                         600, NULL },
-  { "circumflex",                        600, NULL },
-  { "dotaccent",                         600, NULL },
-  { "edotaccent",                        600, NULL },
-  { "asciitilde",                        600, NULL },
+  { "Eth",                               600, NULL },
+  { "quotedblright",                     600, NULL },
+  { "ccedilla",                          600, NULL },
+  { "g",                                 600, NULL },
   { "colon",                             600, NULL },
-  { "onehalf",                           600, NULL },
-  { "dollar",                            600, NULL },
-  { "Lcaron",                            600, NULL },
-  { "ntilde",                            600, NULL },
-  { "Aogonek",                           600, NULL },
-  { "ncommaaccent",                      600, NULL },
-  { "minus",                             600, NULL },
-  { "Iogonek",                           600, NULL },
-  { "zacute",                            600, NULL },
-  { "yen",                               600, NULL },
-  { "space",                             600, NULL },
-  { "Omacron",                           600, NULL },
-  { "questiondown",                      600, NULL },
+  { "oe",                                600, NULL },
+  { "Odieresis",                         600, NULL },
+  { "five",                              600, NULL },
+  { "asciicircum",                       600, NULL },
+  { "X",                                 600, NULL },
   { "emdash",                            600, NULL },
-  { "Agrave",                            600, NULL },
-  { "three",                             600, NULL },
-  { "numbersign",                        600, NULL },
+  { "aogonek",                           600, NULL },
+  { "Egrave",                            600, NULL },
+  { "ring",                              600, NULL },
+  { "Dcaron",                            600, NULL },
+  { "ecircumflex",                       600, NULL },
+  { "Z",                                 600, NULL },
+  { "breve",                             600, NULL },
+  { "Amacron",                           600, NULL },
+  { "paragraph",                         600, NULL },
+  { "zcaron",                            600, NULL },
   { "lcaron",                            600, NULL },
-  { "A",                                 600, NULL },
-  { "B",                                 600, NULL },
-  { "C",                                 600, NULL },
-  { "aogonek",                           600, NULL },
-  { "D",                                 600, NULL },
-  { "E",                                 600, NULL },
-  { "onequarter",                        600, NULL },
-  { "F",                                 600, NULL },
-  { "G",                                 600, NULL },
-  { "H",                                 600, NULL },
-  { "I",                                 600, NULL },
-  { "J",                                 600, NULL },
+  { "Ydieresis",                         600, NULL },
+  { "aring",                             600, NULL },
+  { "iogonek",                           600, NULL },
+  { "florin",                            600, NULL },
+  { "Euro",                              600, NULL },
+  { "Scaron",                            600, NULL },
+  { "degree",                            600, NULL },
+  { "section",                           600, NULL },
   { "K",                                 600, NULL },
-  { "iogonek",                           600, NULL },
-  { "backslash",                         600, NULL },
-  { "L",                                 600, NULL },
-  { "periodcentered",                    600, NULL },
-  { "M",                                 600, NULL },
-  { "N",                                 600, NULL },
-  { "omacron",                           600, NULL },
-  { "Tcommaaccent",                      600, NULL },
-  { "O",                                 600, NULL },
-  { "P",                                 600, NULL },
-  { "Q",                                 600, NULL },
-  { "Uhungarumlaut",                     600, NULL },
-  { "R",                                 600, NULL },
   { "Aacute",                            600, NULL },
-  { "caron",                             600, NULL },
-  { "S",                                 600, NULL },
-  { "T",                                 600, NULL },
-  { "U",                                 600, NULL },
-  { "agrave",                            600, NULL },
-  { "V",                                 600, NULL },
-  { "W",                                 600, NULL },
-  { "X",                                 600, NULL },
-  { "question",                          600, NULL },
-  { "equal",                             600, NULL },
-  { "Y",                                 600, NULL },
-  { "Z",                                 600, NULL },
+  { "Scommaaccent",                      600, NULL },
+  { "b",                                 600, NULL },
+  { "circumflex",                        600, NULL },
+  { "Zcaron",                            600, NULL },
+  { "ogonek",                            600, NULL },
+  { "idieresis",                         600, NULL },
+  { "ae",                                600, NULL },
+  { "cent",                              600, NULL },
+  { "less",                              600, NULL },
+  { "ocircumflex",                       600, NULL },
+  { "minus",                             600, NULL },
   { "four",                              600, NULL },
-  { "a",                                 600, NULL },
-  { "Gcommaaccent",                      600, NULL },
-  { "b",                                 600, NULL },
-  { "c",                                 600, NULL },
-  { "d",                                 600, NULL },
-  { "e",                                 600, NULL },
-  { "f",                                 600, NULL },
-  { "g",                                 600, NULL },
-  { "bullet",                            600, NULL },
-  { "h",                                 600, NULL },
-  { "i",                                 600, NULL },
-  { "Oslash",                            600, NULL },
-  { "dagger",                            600, NULL },
-  { "j",                                 600, NULL },
-  { "k",                                 600, NULL },
-  { "l",                                 600, NULL },
-  { "m",                                 600, NULL },
-  { "n",                                 600, NULL },
-  { "tcommaaccent",                      600, NULL },
-  { "o",                                 600, NULL },
-  { "ordfeminine",                       600, NULL },
-  { "ring",                              600, NULL },
-  { "p",                                 600, NULL },
-  { "q",                                 600, NULL },
-  { "uhungarumlaut",                     600, NULL },
-  { "r",                                 600, NULL },
-  { "twosuperior",                       600, NULL },
-  { "aacute",                            600, NULL },
-  { "s",                                 600, NULL },
-  { "OE",                                600, NULL },
-  { "t",                                 600, NULL },
-  { "divide",                            600, NULL },
-  { "u",                                 600, NULL },
-  { "Ccaron",                            600, NULL },
+  { "Tcommaaccent",                      600, NULL },
+  { "dollar",                            600, NULL },
+  { "dotaccent",                         600, NULL },
   { "v",                                 600, NULL },
-  { "w",                                 600, NULL },
-  { "x",                                 600, NULL },
-  { "y",                                 600, NULL },
-  { "z",                                 600, NULL },
-  { "Gbreve",                            600, NULL },
-  { "commaaccent",                       600, NULL },
-  { "hungarumlaut",                      600, NULL },
-  { "Idotaccent",                        600, NULL },
   { "Nacute",                            600, NULL },
-  { "quotedbl",                          600, NULL },
-  { "gcommaaccent",                      600, NULL },
+  { "Kcommaaccent",                      600, NULL },
+  { "imacron",                           600, NULL },
+  { "rcommaaccent",                      600, NULL },
+  { "tilde",                             600, NULL },
+  { "underscore",                        600, NULL },
+  { "racute",                            600, NULL },
   { "mu",                                600, NULL },
-  { "greaterequal",                      600, NULL },
-  { "Scaron",                            600, NULL },
-  { "Lslash",                            600, NULL },
-  { "semicolon",                         600, NULL },
-  { "oslash",                            600, NULL },
-  { "lessequal",                         600, NULL },
-  { "lozenge",                           600, NULL },
-  { "parenright",                        600, NULL },
+  { "D",                                 600, NULL },
+  { "Ccaron",                            600, NULL },
+  { "j",                                 600, NULL },
+  { "hungarumlaut",                      600, NULL },
+  { "Y",                                 600, NULL },
+  { "yen",                               600, NULL },
   { "ccaron",                            600, NULL },
-  { "Ecircumflex",                       600, NULL },
-  { "gbreve",                            600, NULL },
-  { "trademark",                         600, NULL },
-  { "daggerdbl",                         600, NULL },
-  { "nacute",                            600, NULL },
-  { "macron",                            600, NULL },
-  { "Otilde",                            600, NULL },
-  { "Emacron",                           600, NULL },
-  { "ellipsis",                          600, NULL },
-  { "scaron",                            600, NULL },
-  { "AE",                                600, NULL },
   { "Ucircumflex",                       600, NULL },
-  { "lslash",                            600, NULL },
-  { "quotedblleft",                      600, NULL },
-  { "guilsinglright",                    600, NULL },
-  { "hyphen",                            600, NULL },
-  { "quotesingle",                       600, NULL },
-  { "eight",                             600, NULL },
-  { "exclamdown",                        600, NULL },
-  { "endash",                            600, NULL },
-  { "oe",                                600, NULL },
-  { "Abreve",                            600, NULL },
-  { "Umacron",                           600, NULL },
-  { "ecircumflex",                       600, NULL },
-  { "Adieresis",                         600, NULL },
-  { "copyright",                         600, NULL },
-  { "Egrave",                            600, NULL },
-  { "slash",                             600, NULL },
-  { "Edieresis",                         600, NULL },
-  { "otilde",                            600, NULL },
-  { "Idieresis",                         600, NULL },
+  { "lessequal",                         600, NULL },
+  { "Omacron",                           600, NULL },
+  { "quotesinglbase",                    600, NULL },
+  { "Scedilla",                          600, NULL },
+  { "grave",                             600, NULL },
   { "parenleft",                         600, NULL },
-  { "one",                               600, NULL },
+  { "nine",                              600, NULL },
+  { "currency",                          600, NULL },
+  { "odieresis",                         600, NULL },
+  { "M",                                 600, NULL },
+  { "Ograve",                            600, NULL },
+  { "T",                                 600, NULL },
+  { "amacron",                           600, NULL },
+  { "Ncommaaccent",                      600, NULL },
+  { "numbersign",                        600, NULL },
   { "emacron",                           600, NULL },
-  { "Odieresis",                         600, NULL },
-  { "ucircumflex",                       600, NULL },
-  { "bracketleft",                       600, NULL },
+  { "divide",                            600, NULL },
+  { "fl",                                600, NULL },
+  { "quotedblbase",                      600, NULL },
+  { "E",                                 600, NULL },
+  { "guillemotleft",                     600, NULL },
+  { "endash",                            600, NULL },
+  { "w",                                 600, NULL },
+  { "eth",                               600, NULL },
+  { "twosuperior",                       600, NULL },
+  { "space",                             600, NULL },
+  { "Thorn",                             600, NULL },
+  { "ecaron",                            600, NULL },
+  { "brokenbar",                         600, NULL },
+  { "Aogonek",                           600, NULL },
+  { "commaaccent",                       600, NULL },
+  { "bracketright",                      600, NULL },
+  { "W",                                 600, NULL },
+  { "germandbls",                        600, NULL },
   { "Ugrave",                            600, NULL },
-  { "quoteright",                        600, NULL },
-  { "Udieresis",                         600, NULL },
+  { "thorn",                             600, NULL },
+  { "zero",                              600, NULL },
+  { "udieresis",                         600, NULL },
+  { "scedilla",                          600, NULL },
+  { "period",                            600, NULL },
+  { "Ccedilla",                          600, NULL },
+  { "Igrave",                            600, NULL },
+  { "F",                                 600, NULL },
+  { "Ocircumflex",                       600, NULL },
+  { "Uring",                             600, NULL },
   { "perthousand",                       600, NULL },
-  { "Ydieresis",                         600, NULL },
+  { "Edotaccent",                        600, NULL },
+  { "acircumflex",                       600, NULL },
+  { "G",                                 600, NULL },
+  { "Otilde",                            600, NULL },
   { "umacron",                           600, NULL },
-  { "abreve",                            600, NULL },
+  { "Tcaron",                            600, NULL },
+  { "aacute",                            600, NULL },
+  { "B",                                 600, NULL },
+  { "ydieresis",                         600, NULL },
+  { "R",                                 600, NULL },
+  { "kcommaaccent",                      600, NULL },
+  { "yacute",                            600, NULL },
+  { "Rcaron",                            600, NULL },
+  { "dcaron",                            600, NULL },
+  { "ugrave",                            600, NULL },
+  { "a",                                 600, NULL },
+  { "hyphen",                            600, NULL },
+  { "Oslash",                            600, NULL },
+  { "comma",                             600, NULL },
+  { "Delta",                             600, NULL },
+  { "omacron",                           600, NULL },
+  { "Gbreve",                            600, NULL },
+  { "S",                                 600, NULL },
+  { "quotedblleft",                      600, NULL },
+  { "ordfeminine",                       600, NULL },
+  { "ampersand",                         600, NULL },
+  { "trademark",                         600, NULL },
+  { "Lcommaaccent",                      600, NULL },
+  { "ntilde",                            600, NULL },
+  { "fi",                                600, NULL },
+  { "dieresis",                          600, NULL },
   { "Eacute",                            600, NULL },
-  { "adieresis",                         600, NULL },
-  { "egrave",                            600, NULL },
-  { "edieresis",                         600, NULL },
-  { "idieresis",                         600, NULL },
-  { "Eth",                               600, NULL },
-  { "ae",                                600, NULL },
-  { "asterisk",                          600, NULL },
-  { "odieresis",                         600, NULL },
-  { "Uacute",                            600, NULL },
-  { "ugrave",                            600, NULL },
-  { "nine",                              600, NULL },
-  { "five",                              600, NULL },
-  { "udieresis",                         600, NULL },
-  { "Zcaron",                            600, NULL },
-  { "Scommaaccent",                      600, NULL },
-  { "threequarters",                     600, NULL },
+  { "nacute",                            600, NULL },
+  { "O",                                 600, NULL },
+  { "Icircumflex",                       600, NULL },
+  { "Udieresis",                         600, NULL },
+  { "Abreve",                            600, NULL },
+  { "Iacute",                            600, NULL },
+  { "uacute",                            600, NULL },
+  { "two",                               600, NULL },
+  { "seven",                             600, NULL },
+  { "scaron",                            600, NULL },
   { "guillemotright",                    600, NULL },
-  { "Ccedilla",                          600, NULL },
-  { "ydieresis",                         600, NULL },
-  { "tilde",                             600, NULL },
-  { "at",                                600, NULL },
+  { "eogonek",                           600, NULL },
   { "eacute",                            600, NULL },
-  { "underscore",                        600, NULL },
-  { "Euro",                              600, NULL },
-  { "Dcroat",                            600, NULL },
+  { "bullet",                            600, NULL },
+  { "Zdotaccent",                        600, NULL },
+  { "edotaccent",                        600, NULL },
+  { "six",                               600, NULL },
+  { "lslash",                            600, NULL },
+  { "P",                                 600, NULL },
   { "multiply",                          600, NULL },
-  { "zero",                              600, NULL },
-  { "eth",                               600, NULL },
-  { "Scedilla",                          600, NULL },
-  { "Ograve",                            600, NULL },
-  { "Racute",                            600, NULL },
-  { "partialdiff",                       600, NULL },
-  { "uacute",                            600, NULL },
+  { "i",                                 600, NULL },
+  { "bar",                               600, NULL },
+  { "quotesingle",                       600, NULL },
+  { "acute",                             600, NULL },
+  { "braceright",                        600, NULL },
   { "braceleft",                         600, NULL },
-  { "Thorn",                             600, NULL },
-  { "zcaron",                            600, NULL },
-  { "scommaaccent",                      600, NULL },
-  { "ccedilla",                          600, NULL },
-  { "Dcaron",                            600, NULL },
-  { "dcroat",                            600, NULL },
-  { "Ocircumflex",                       600, NULL },
-  { "Oacute",                            600, NULL },
-  { "scedilla",                          600, NULL },
-  { "ogonek",                            600, NULL },
-  { "ograve",                            600, NULL },
-  { "racute",                            600, NULL },
-  { "Tcaron",                            600, NULL },
-  { "Eogonek",                           600, NULL },
-  { "thorn",                             600, NULL },
-  { "degree",                            600, NULL },
-  { "registered",                        600, NULL },
-  { "radical",                           600, NULL },
-  { "Aring",                             600, NULL },
-  { "percent",                           600, NULL },
-  { "six",                               600, NULL },
-  { "paragraph",                         600, NULL },
-  { "dcaron",                            600, NULL },
-  { "Uogonek",                           600, NULL },
-  { "two",                               600, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            600, NULL },
-  { "Lacute",                            600, NULL },
-  { "ocircumflex",                       600, NULL },
+  { "onequarter",                        600, NULL },
+  { "Atilde",                            600, NULL },
+  { "Edieresis",                         600, NULL },
+  { "Yacute",                            600, NULL },
   { "oacute",                            600, NULL },
-  { "Uring",                             600, NULL },
-  { "Lcommaaccent",                      600, NULL },
+  { "daggerdbl",                         600, NULL },
+  { "ncommaaccent",                      600, NULL },
+  { "logicalnot",                        600, NULL },
+  { "tcommaaccent",                      600, NULL },
+  { "Dcroat",                            600, NULL },
+  { "cacute",                            600, NULL },
+  { "rcaron",                            600, NULL },
   { "tcaron",                            600, NULL },
-  { "eogonek",                           600, NULL },
-  { "Delta",                             600, NULL },
-  { "Ohungarumlaut",                     600, NULL },
-  { "asciicircum",                       600, NULL },
-  { "aring",                             600, NULL },
-  { "grave",                             600, NULL },
-  { "uogonek",                           600, NULL },
-  { "bracketright",                      600, NULL },
-  { "Iacute",                            600, NULL },
-  { "ampersand",                         600, NULL },
+  { "y",                                 600, NULL },
+  { "Iogonek",                           600, NULL },
+  { "edieresis",                         600, NULL },
+  { "x",                                 600, NULL },
+  { "Ncaron",                            600, NULL },
+  { "OE",                                600, NULL },
+  { "m",                                 600, NULL },
+  { "U",                                 600, NULL },
+  { "partialdiff",                       600, NULL },
+  { "dcroat",                            600, NULL },
   { "igrave",                            600, NULL },
-  { "lacute",                            600, NULL },
-  { "Ncaron",                            600, NULL },
+  { "summation",                         600, NULL },
+  { "question",                          600, NULL },
+  { "A",                                 600, NULL },
+  { "h",                                 600, NULL },
+  { "Cacute",                            600, NULL },
+  { "guilsinglleft",                     600, NULL },
   { "plus",                              600, NULL },
+  { "ordmasculine",                      600, NULL },
+  { "Lcaron",                            600, NULL },
+  { "backslash",                         600, NULL },
+  { "questiondown",                      600, NULL },
+  { "macron",                            600, NULL },
+  { "Eogonek",                           600, NULL },
+  { "three",                             600, NULL },
+  { "slash",                             600, NULL },
+  { "ucircumflex",                       600, NULL },
+  { "r",                                 600, NULL },
+  { "zacute",                            600, NULL },
+  { "Umacron",                           600, NULL },
+  { "adieresis",                         600, NULL },
+  { "ncaron",                            600, NULL },
+  { "V",                                 600, NULL },
+  { "lozenge",                           600, NULL },
+  { "exclamdown",                        600, NULL },
+  { "Q",                                 600, NULL },
+  { "quoteright",                        600, NULL },
+  { "uogonek",                           600, NULL },
+  { "guilsinglright",                    600, NULL },
+  { "semicolon",                         600, NULL },
+  { "egrave",                            600, NULL },
+  { "s",                                 600, NULL },
   { "uring",                             600, NULL },
-  { "quotesinglbase",                    600, NULL },
-  { "lcommaaccent",                      600, NULL },
-  { "Yacute",                            600, NULL },
-  { "ohungarumlaut",                     600, NULL },
-  { "threesuperior",                     600, NULL },
-  { "acute",                             600, NULL },
-  { "section",                           600, NULL },
-  { "dieresis",                          600, NULL },
-  { "iacute",                            600, NULL },
-  { "quotedblbase",                      600, NULL },
-  { "ncaron",                            600, NULL },
-  { "florin",                            600, NULL },
-  { "yacute",                            600, NULL },
-  { "Rcommaaccent",                      600, NULL },
-  { "fi",                                600, NULL },
-  { "fl",                                600, NULL },
-  { "Acircumflex",                       600, NULL },
-  { "Cacute",                            600, NULL },
-  { "Icircumflex",                       600, NULL },
-  { "guillemotleft",                     600, NULL },
-  { "germandbls",                        600, NULL },
-  { "Amacron",                           600, NULL },
-  { "seven",                             600, NULL },
+  { "Uhungarumlaut",                     600, NULL },
+  { "z",                                 600, NULL },
+  { "I",                                 600, NULL },
+  { "one",                               600, NULL },
+  { "eight",                             600, NULL },
+  { "periodcentered",                    600, NULL },
+  { "d",                                 600, NULL },
+  { "c",                                 600, NULL },
+  { "agrave",                            600, NULL },
+  { "ellipsis",                          600, NULL },
+  { "Aring",                             600, NULL },
+  { "t",                                 600, NULL },
+  { "quotedbl",                          600, NULL },
+  { "Oacute",                            600, NULL },
+  { "Uacute",                            600, NULL },
+  { "Zacute",                            600, NULL },
+  { "atilde",                            600, NULL },
+  { "fraction",                          600, NULL },
+  { "Adieresis",                         600, NULL },
   { "Sacute",                            600, NULL },
-  { "ordmasculine",                      600, NULL },
-  { "dotlessi",                          600, NULL },
+  { "asciitilde",                        600, NULL },
+  { "lacute",                            600, NULL },
+  { "Uogonek",                           600, NULL },
+  { "Lslash",                            600, NULL },
+  { "caron",                             600, NULL },
   { "sterling",                          600, NULL },
+  { "H",                                 600, NULL },
+  { "greaterequal",                      600, NULL },
+  { "at",                                600, NULL },
+  { "J",                                 600, NULL },
+  { "threequarters",                     600, NULL },
+  { "ohungarumlaut",                     600, NULL },
+  { "Ecircumflex",                       600, NULL },
+  { "L",                                 600, NULL },
+  { "AE",                                600, NULL },
+  { "Agrave",                            600, NULL },
+  { "exclam",                            600, NULL },
   { "notequal",                          600, NULL },
-  { "Imacron",                           600, NULL },
-  { "rcommaaccent",                      600, NULL },
-  { "Zdotaccent",                        600, NULL },
-  { "acircumflex",                       600, NULL },
-  { "cacute",                            600, NULL },
-  { "Ecaron",                            600, NULL },
-  { "icircumflex",                       600, NULL },
-  { "braceright",                        600, NULL },
-  { "quotedblright",                     600, NULL },
-  { "amacron",                           600, NULL },
+  { "oslash",                            600, NULL },
+  { "Acircumflex",                       600, NULL },
+  { "Rcommaaccent",                      600, NULL },
+  { "ograve",                            600, NULL },
+  { "Lacute",                            600, NULL },
+  { "Idieresis",                         600, NULL },
   { "sacute",                            600, NULL },
-  { "imacron",                           600, NULL },
-  { "cent",                              600, NULL },
-  { "currency",                          600, NULL },
-  { "logicalnot",                        600, NULL },
-  { "zdotaccent",                        600, NULL },
-  { "Atilde",                            600, NULL },
-  { "breve",                             600, NULL },
-  { "bar",                               600, NULL },
-  { "fraction",                          600, NULL },
-  { "less",                              600, NULL },
-  { "ecaron",                            600, NULL },
-  { "guilsinglleft",                     600, NULL },
-  { "exclam",                            600, NULL },
-  { "period",                            600, NULL },
-  { "Rcaron",                            600, NULL },
-  { "Kcommaaccent",                      600, NULL },
-  { "greater",                           600, NULL },
-  { "atilde",                            600, NULL },
-  { "brokenbar",                         600, NULL },
-  { "quoteleft",                         600, NULL },
-  { "Edotaccent",                        600, NULL },
-  { "onesuperior",                       600, NULL }
+  { "f",                                 600, NULL },
+  { "gcommaaccent",                      600, NULL },
+  { "bracketleft",                       600, NULL },
+  { "Ohungarumlaut",                     600, NULL },
+  { "otilde",                            600, NULL },
+  { "parenright",                        600, NULL }
 };
 
 static BuiltinFontWidth courierObliqueWidthsTab[] = {
-  { "Ntilde",                            600, NULL },
-  { "rcaron",                            600, NULL },
-  { "kcommaaccent",                      600, NULL },
+  { "ecaron",                            600, NULL },
+  { "brokenbar",                         600, NULL },
+  { "Aogonek",                           600, NULL },
+  { "w",                                 600, NULL },
+  { "Thorn",                             600, NULL },
+  { "space",                             600, NULL },
+  { "eth",                               600, NULL },
+  { "twosuperior",                       600, NULL },
+  { "guillemotleft",                     600, NULL },
+  { "endash",                            600, NULL },
+  { "fl",                                600, NULL },
+  { "E",                                 600, NULL },
+  { "quotedblbase",                      600, NULL },
+  { "numbersign",                        600, NULL },
+  { "divide",                            600, NULL },
+  { "emacron",                           600, NULL },
+  { "amacron",                           600, NULL },
   { "Ncommaaccent",                      600, NULL },
-  { "Zacute",                            600, NULL },
-  { "comma",                             600, NULL },
-  { "cedilla",                           600, NULL },
-  { "plusminus",                         600, NULL },
-  { "circumflex",                        600, NULL },
+  { "T",                                 600, NULL },
+  { "M",                                 600, NULL },
+  { "odieresis",                         600, NULL },
+  { "Ograve",                            600, NULL },
+  { "G",                                 600, NULL },
+  { "perthousand",                       600, NULL },
+  { "Edotaccent",                        600, NULL },
+  { "acircumflex",                       600, NULL },
+  { "Ocircumflex",                       600, NULL },
+  { "F",                                 600, NULL },
+  { "Uring",                             600, NULL },
+  { "Ccedilla",                          600, NULL },
+  { "Igrave",                            600, NULL },
+  { "zero",                              600, NULL },
+  { "scedilla",                          600, NULL },
+  { "period",                            600, NULL },
+  { "udieresis",                         600, NULL },
+  { "Ugrave",                            600, NULL },
+  { "germandbls",                        600, NULL },
+  { "thorn",                             600, NULL },
+  { "commaaccent",                       600, NULL },
+  { "W",                                 600, NULL },
+  { "bracketright",                      600, NULL },
+  { "underscore",                        600, NULL },
+  { "D",                                 600, NULL },
+  { "mu",                                600, NULL },
+  { "racute",                            600, NULL },
+  { "rcommaaccent",                      600, NULL },
+  { "imacron",                           600, NULL },
+  { "Kcommaaccent",                      600, NULL },
+  { "tilde",                             600, NULL },
+  { "Tcommaaccent",                      600, NULL },
+  { "dollar",                            600, NULL },
+  { "v",                                 600, NULL },
+  { "Nacute",                            600, NULL },
   { "dotaccent",                         600, NULL },
-  { "edotaccent",                        600, NULL },
-  { "asciitilde",                        600, NULL },
-  { "colon",                             600, NULL },
-  { "onehalf",                           600, NULL },
-  { "dollar",                            600, NULL },
-  { "Lcaron",                            600, NULL },
-  { "ntilde",                            600, NULL },
-  { "Aogonek",                           600, NULL },
-  { "ncommaaccent",                      600, NULL },
+  { "ocircumflex",                       600, NULL },
+  { "less",                              600, NULL },
   { "minus",                             600, NULL },
-  { "Iogonek",                           600, NULL },
-  { "zacute",                            600, NULL },
+  { "four",                              600, NULL },
+  { "ae",                                600, NULL },
+  { "cent",                              600, NULL },
+  { "ogonek",                            600, NULL },
+  { "idieresis",                         600, NULL },
+  { "circumflex",                        600, NULL },
+  { "Zcaron",                            600, NULL },
+  { "currency",                          600, NULL },
+  { "nine",                              600, NULL },
+  { "parenleft",                         600, NULL },
+  { "grave",                             600, NULL },
+  { "Scedilla",                          600, NULL },
+  { "quotesinglbase",                    600, NULL },
+  { "lessequal",                         600, NULL },
+  { "Omacron",                           600, NULL },
+  { "Ucircumflex",                       600, NULL },
+  { "ccaron",                            600, NULL },
   { "yen",                               600, NULL },
-  { "space",                             600, NULL },
-  { "Omacron",                           600, NULL },
-  { "questiondown",                      600, NULL },
+  { "Y",                                 600, NULL },
+  { "hungarumlaut",                      600, NULL },
+  { "Ccaron",                            600, NULL },
+  { "j",                                 600, NULL },
+  { "aogonek",                           600, NULL },
+  { "Egrave",                            600, NULL },
+  { "ring",                              600, NULL },
   { "emdash",                            600, NULL },
-  { "Agrave",                            600, NULL },
-  { "three",                             600, NULL },
-  { "numbersign",                        600, NULL },
-  { "lcaron",                            600, NULL },
-  { "A",                                 600, NULL },
-  { "B",                                 600, NULL },
-  { "C",                                 600, NULL },
-  { "aogonek",                           600, NULL },
-  { "D",                                 600, NULL },
-  { "E",                                 600, NULL },
-  { "onequarter",                        600, NULL },
-  { "F",                                 600, NULL },
-  { "G",                                 600, NULL },
-  { "H",                                 600, NULL },
-  { "I",                                 600, NULL },
-  { "J",                                 600, NULL },
+  { "five",                              600, NULL },
+  { "X",                                 600, NULL },
+  { "asciicircum",                       600, NULL },
+  { "Odieresis",                         600, NULL },
+  { "oe",                                600, NULL },
+  { "colon",                             600, NULL },
+  { "g",                                 600, NULL },
+  { "ccedilla",                          600, NULL },
+  { "plusminus",                         600, NULL },
+  { "cedilla",                           600, NULL },
+  { "Idotaccent",                        600, NULL },
+  { "quotedblright",                     600, NULL },
+  { "Eth",                               600, NULL },
+  { "dotlessi",                          600, NULL },
+  { "p",                                 600, NULL },
+  { "radical",                           600, NULL },
+  { "Ntilde",                            600, NULL },
+  { "Scommaaccent",                      600, NULL },
+  { "Aacute",                            600, NULL },
+  { "b",                                 600, NULL },
   { "K",                                 600, NULL },
+  { "section",                           600, NULL },
+  { "degree",                            600, NULL },
+  { "Scaron",                            600, NULL },
+  { "Euro",                              600, NULL },
+  { "florin",                            600, NULL },
   { "iogonek",                           600, NULL },
-  { "backslash",                         600, NULL },
-  { "L",                                 600, NULL },
-  { "periodcentered",                    600, NULL },
-  { "M",                                 600, NULL },
+  { "lcaron",                            600, NULL },
+  { "paragraph",                         600, NULL },
+  { "zcaron",                            600, NULL },
+  { "aring",                             600, NULL },
+  { "Ydieresis",                         600, NULL },
+  { "Amacron",                           600, NULL },
+  { "breve",                             600, NULL },
+  { "Dcaron",                            600, NULL },
+  { "Z",                                 600, NULL },
+  { "ecircumflex",                       600, NULL },
+  { "q",                                 600, NULL },
+  { "l",                                 600, NULL },
+  { "dagger",                            600, NULL },
+  { "equal",                             600, NULL },
   { "N",                                 600, NULL },
-  { "omacron",                           600, NULL },
-  { "Tcommaaccent",                      600, NULL },
-  { "O",                                 600, NULL },
-  { "P",                                 600, NULL },
-  { "Q",                                 600, NULL },
-  { "Uhungarumlaut",                     600, NULL },
-  { "R",                                 600, NULL },
-  { "Aacute",                            600, NULL },
-  { "caron",                             600, NULL },
-  { "S",                                 600, NULL },
-  { "T",                                 600, NULL },
-  { "U",                                 600, NULL },
-  { "agrave",                            600, NULL },
-  { "V",                                 600, NULL },
-  { "W",                                 600, NULL },
-  { "X",                                 600, NULL },
-  { "question",                          600, NULL },
-  { "equal",                             600, NULL },
-  { "Y",                                 600, NULL },
-  { "Z",                                 600, NULL },
-  { "four",                              600, NULL },
-  { "a",                                 600, NULL },
-  { "Gcommaaccent",                      600, NULL },
-  { "b",                                 600, NULL },
-  { "c",                                 600, NULL },
-  { "d",                                 600, NULL },
+  { "C",                                 600, NULL },
+  { "u",                                 600, NULL },
+  { "abreve",                            600, NULL },
+  { "Imacron",                           600, NULL },
+  { "iacute",                            600, NULL },
   { "e",                                 600, NULL },
-  { "f",                                 600, NULL },
-  { "g",                                 600, NULL },
-  { "bullet",                            600, NULL },
-  { "h",                                 600, NULL },
-  { "i",                                 600, NULL },
-  { "Oslash",                            600, NULL },
-  { "dagger",                            600, NULL },
-  { "j",                                 600, NULL },
-  { "k",                                 600, NULL },
-  { "l",                                 600, NULL },
-  { "m",                                 600, NULL },
+  { "icircumflex",                       600, NULL },
+  { "percent",                           600, NULL },
+  { "o",                                 600, NULL },
+  { "asterisk",                          600, NULL },
+  { "Emacron",                           600, NULL },
+  { "scommaaccent",                      600, NULL },
+  { "onesuperior",                       600, NULL },
+  { "greater",                           600, NULL },
+  { "Ecaron",                            600, NULL },
+  { "threesuperior",                     600, NULL },
+  { "zdotaccent",                        600, NULL },
   { "n",                                 600, NULL },
-  { "tcommaaccent",                      600, NULL },
-  { "o",                                 600, NULL },
-  { "ordfeminine",                       600, NULL },
-  { "ring",                              600, NULL },
-  { "p",                                 600, NULL },
-  { "q",                                 600, NULL },
+  { "lcommaaccent",                      600, NULL },
+  { "onehalf",                           600, NULL },
+  { "gbreve",                            600, NULL },
   { "uhungarumlaut",                     600, NULL },
-  { "r",                                 600, NULL },
-  { "twosuperior",                       600, NULL },
-  { "aacute",                            600, NULL },
-  { "s",                                 600, NULL },
-  { "OE",                                600, NULL },
-  { "t",                                 600, NULL },
-  { "divide",                            600, NULL },
-  { "u",                                 600, NULL },
-  { "Ccaron",                            600, NULL },
-  { "v",                                 600, NULL },
-  { "w",                                 600, NULL },
-  { "x",                                 600, NULL },
-  { "y",                                 600, NULL },
-  { "z",                                 600, NULL },
-  { "Gbreve",                            600, NULL },
-  { "commaaccent",                       600, NULL },
-  { "hungarumlaut",                      600, NULL },
-  { "Idotaccent",                        600, NULL },
-  { "Nacute",                            600, NULL },
-  { "quotedbl",                          600, NULL },
-  { "gcommaaccent",                      600, NULL },
-  { "mu",                                600, NULL },
+  { "k",                                 600, NULL },
+  { "copyright",                         600, NULL },
+  { "Racute",                            600, NULL },
+  { "Gcommaaccent",                      600, NULL },
+  { "quoteleft",                         600, NULL },
+  { "registered",                        600, NULL },
+  { "notequal",                          600, NULL },
+  { "Agrave",                            600, NULL },
+  { "AE",                                600, NULL },
+  { "exclam",                            600, NULL },
+  { "Acircumflex",                       600, NULL },
+  { "oslash",                            600, NULL },
+  { "threequarters",                     600, NULL },
+  { "J",                                 600, NULL },
+  { "Ecircumflex",                       600, NULL },
+  { "ohungarumlaut",                     600, NULL },
+  { "L",                                 600, NULL },
+  { "H",                                 600, NULL },
+  { "sterling",                          600, NULL },
   { "greaterequal",                      600, NULL },
-  { "Scaron",                            600, NULL },
+  { "at",                                600, NULL },
+  { "caron",                             600, NULL },
+  { "Uogonek",                           600, NULL },
   { "Lslash",                            600, NULL },
+  { "lacute",                            600, NULL },
+  { "asciitilde",                        600, NULL },
+  { "fraction",                          600, NULL },
+  { "Sacute",                            600, NULL },
+  { "Adieresis",                         600, NULL },
+  { "Uacute",                            600, NULL },
+  { "atilde",                            600, NULL },
+  { "Zacute",                            600, NULL },
+  { "otilde",                            600, NULL },
+  { "parenright",                        600, NULL },
+  { "gcommaaccent",                      600, NULL },
+  { "Ohungarumlaut",                     600, NULL },
+  { "bracketleft",                       600, NULL },
+  { "f",                                 600, NULL },
+  { "Lacute",                            600, NULL },
+  { "Idieresis",                         600, NULL },
+  { "sacute",                            600, NULL },
+  { "Rcommaaccent",                      600, NULL },
+  { "ograve",                            600, NULL },
+  { "quoteright",                        600, NULL },
+  { "uogonek",                           600, NULL },
   { "semicolon",                         600, NULL },
-  { "oslash",                            600, NULL },
-  { "lessequal",                         600, NULL },
+  { "guilsinglright",                    600, NULL },
   { "lozenge",                           600, NULL },
-  { "parenright",                        600, NULL },
-  { "ccaron",                            600, NULL },
-  { "Ecircumflex",                       600, NULL },
-  { "gbreve",                            600, NULL },
-  { "trademark",                         600, NULL },
-  { "daggerdbl",                         600, NULL },
-  { "nacute",                            600, NULL },
-  { "macron",                            600, NULL },
-  { "Otilde",                            600, NULL },
-  { "Emacron",                           600, NULL },
-  { "ellipsis",                          600, NULL },
-  { "scaron",                            600, NULL },
-  { "AE",                                600, NULL },
-  { "Ucircumflex",                       600, NULL },
-  { "lslash",                            600, NULL },
-  { "quotedblleft",                      600, NULL },
-  { "guilsinglright",                    600, NULL },
-  { "hyphen",                            600, NULL },
-  { "quotesingle",                       600, NULL },
-  { "eight",                             600, NULL },
+  { "V",                                 600, NULL },
+  { "Q",                                 600, NULL },
   { "exclamdown",                        600, NULL },
-  { "endash",                            600, NULL },
-  { "oe",                                600, NULL },
-  { "Abreve",                            600, NULL },
   { "Umacron",                           600, NULL },
-  { "ecircumflex",                       600, NULL },
-  { "Adieresis",                         600, NULL },
-  { "copyright",                         600, NULL },
-  { "Egrave",                            600, NULL },
+  { "zacute",                            600, NULL },
+  { "ncaron",                            600, NULL },
+  { "adieresis",                         600, NULL },
   { "slash",                             600, NULL },
-  { "Edieresis",                         600, NULL },
-  { "otilde",                            600, NULL },
-  { "Idieresis",                         600, NULL },
-  { "parenleft",                         600, NULL },
+  { "ucircumflex",                       600, NULL },
+  { "r",                                 600, NULL },
+  { "three",                             600, NULL },
+  { "Eogonek",                           600, NULL },
+  { "macron",                            600, NULL },
+  { "Lcaron",                            600, NULL },
+  { "ordmasculine",                      600, NULL },
+  { "backslash",                         600, NULL },
+  { "questiondown",                      600, NULL },
+  { "Oacute",                            600, NULL },
+  { "t",                                 600, NULL },
+  { "quotedbl",                          600, NULL },
+  { "ellipsis",                          600, NULL },
+  { "Aring",                             600, NULL },
+  { "agrave",                            600, NULL },
+  { "c",                                 600, NULL },
+  { "d",                                 600, NULL },
   { "one",                               600, NULL },
-  { "emacron",                           600, NULL },
-  { "Odieresis",                         600, NULL },
-  { "ucircumflex",                       600, NULL },
-  { "bracketleft",                       600, NULL },
-  { "Ugrave",                            600, NULL },
-  { "quoteright",                        600, NULL },
-  { "Udieresis",                         600, NULL },
-  { "perthousand",                       600, NULL },
-  { "Ydieresis",                         600, NULL },
-  { "umacron",                           600, NULL },
-  { "abreve",                            600, NULL },
-  { "Eacute",                            600, NULL },
-  { "adieresis",                         600, NULL },
+  { "I",                                 600, NULL },
+  { "eight",                             600, NULL },
+  { "periodcentered",                    600, NULL },
+  { "z",                                 600, NULL },
+  { "Uhungarumlaut",                     600, NULL },
   { "egrave",                            600, NULL },
+  { "uring",                             600, NULL },
+  { "s",                                 600, NULL },
+  { "oacute",                            600, NULL },
+  { "Yacute",                            600, NULL },
+  { "daggerdbl",                         600, NULL },
+  { "Atilde",                            600, NULL },
+  { "Edieresis",                         600, NULL },
+  { "onequarter",                        600, NULL },
+  { "braceleft",                         600, NULL },
+  { "braceright",                        600, NULL },
+  { "acute",                             600, NULL },
+  { "quotesingle",                       600, NULL },
+  { "bar",                               600, NULL },
+  { "i",                                 600, NULL },
+  { "multiply",                          600, NULL },
+  { "lslash",                            600, NULL },
+  { "P",                                 600, NULL },
+  { "six",                               600, NULL },
+  { "edotaccent",                        600, NULL },
+  { "guilsinglleft",                     600, NULL },
+  { "h",                                 600, NULL },
+  { "Cacute",                            600, NULL },
+  { "plus",                              600, NULL },
+  { "question",                          600, NULL },
+  { "summation",                         600, NULL },
+  { "A",                                 600, NULL },
+  { "igrave",                            600, NULL },
+  { "dcroat",                            600, NULL },
+  { "m",                                 600, NULL },
+  { "OE",                                600, NULL },
+  { "partialdiff",                       600, NULL },
+  { "U",                                 600, NULL },
+  { "x",                                 600, NULL },
+  { "y",                                 600, NULL },
+  { "Iogonek",                           600, NULL },
   { "edieresis",                         600, NULL },
-  { "idieresis",                         600, NULL },
-  { "Eth",                               600, NULL },
-  { "ae",                                600, NULL },
-  { "asterisk",                          600, NULL },
-  { "odieresis",                         600, NULL },
-  { "Uacute",                            600, NULL },
+  { "Ncaron",                            600, NULL },
+  { "cacute",                            600, NULL },
+  { "Dcroat",                            600, NULL },
+  { "rcaron",                            600, NULL },
+  { "tcaron",                            600, NULL },
+  { "ncommaaccent",                      600, NULL },
+  { "tcommaaccent",                      600, NULL },
+  { "logicalnot",                        600, NULL },
+  { "ordfeminine",                       600, NULL },
+  { "quotedblleft",                      600, NULL },
+  { "S",                                 600, NULL },
+  { "omacron",                           600, NULL },
+  { "Delta",                             600, NULL },
+  { "comma",                             600, NULL },
+  { "Gbreve",                            600, NULL },
   { "ugrave",                            600, NULL },
-  { "nine",                              600, NULL },
-  { "five",                              600, NULL },
-  { "udieresis",                         600, NULL },
-  { "Zcaron",                            600, NULL },
-  { "Scommaaccent",                      600, NULL },
-  { "threequarters",                     600, NULL },
-  { "guillemotright",                    600, NULL },
-  { "Ccedilla",                          600, NULL },
+  { "dcaron",                            600, NULL },
+  { "hyphen",                            600, NULL },
+  { "Oslash",                            600, NULL },
+  { "a",                                 600, NULL },
+  { "B",                                 600, NULL },
+  { "Rcaron",                            600, NULL },
+  { "kcommaaccent",                      600, NULL },
+  { "yacute",                            600, NULL },
   { "ydieresis",                         600, NULL },
-  { "tilde",                             600, NULL },
-  { "at",                                600, NULL },
+  { "R",                                 600, NULL },
+  { "aacute",                            600, NULL },
+  { "umacron",                           600, NULL },
+  { "Otilde",                            600, NULL },
+  { "Tcaron",                            600, NULL },
+  { "eogonek",                           600, NULL },
+  { "bullet",                            600, NULL },
   { "eacute",                            600, NULL },
-  { "underscore",                        600, NULL },
-  { "Euro",                              600, NULL },
-  { "Dcroat",                            600, NULL },
-  { "multiply",                          600, NULL },
-  { "zero",                              600, NULL },
-  { "eth",                               600, NULL },
-  { "Scedilla",                          600, NULL },
-  { "Ograve",                            600, NULL },
-  { "Racute",                            600, NULL },
-  { "partialdiff",                       600, NULL },
+  { "Zdotaccent",                        600, NULL },
+  { "scaron",                            600, NULL },
+  { "guillemotright",                    600, NULL },
+  { "two",                               600, NULL },
   { "uacute",                            600, NULL },
-  { "braceleft",                         600, NULL },
-  { "Thorn",                             600, NULL },
-  { "zcaron",                            600, NULL },
-  { "scommaaccent",                      600, NULL },
-  { "ccedilla",                          600, NULL },
-  { "Dcaron",                            600, NULL },
-  { "dcroat",                            600, NULL },
-  { "Ocircumflex",                       600, NULL },
-  { "Oacute",                            600, NULL },
-  { "scedilla",                          600, NULL },
-  { "ogonek",                            600, NULL },
-  { "ograve",                            600, NULL },
-  { "racute",                            600, NULL },
-  { "Tcaron",                            600, NULL },
-  { "Eogonek",                           600, NULL },
-  { "thorn",                             600, NULL },
-  { "degree",                            600, NULL },
-  { "registered",                        600, NULL },
-  { "radical",                           600, NULL },
-  { "Aring",                             600, NULL },
-  { "percent",                           600, NULL },
-  { "six",                               600, NULL },
-  { "paragraph",                         600, NULL },
-  { "dcaron",                            600, NULL },
-  { "Uogonek",                           600, NULL },
-  { "two",                               600, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            600, NULL },
-  { "Lacute",                            600, NULL },
-  { "ocircumflex",                       600, NULL },
-  { "oacute",                            600, NULL },
-  { "Uring",                             600, NULL },
-  { "Lcommaaccent",                      600, NULL },
-  { "tcaron",                            600, NULL },
-  { "eogonek",                           600, NULL },
-  { "Delta",                             600, NULL },
-  { "Ohungarumlaut",                     600, NULL },
-  { "asciicircum",                       600, NULL },
-  { "aring",                             600, NULL },
-  { "grave",                             600, NULL },
-  { "uogonek",                           600, NULL },
-  { "bracketright",                      600, NULL },
+  { "seven",                             600, NULL },
+  { "Abreve",                            600, NULL },
+  { "Udieresis",                         600, NULL },
   { "Iacute",                            600, NULL },
-  { "ampersand",                         600, NULL },
-  { "igrave",                            600, NULL },
-  { "lacute",                            600, NULL },
-  { "Ncaron",                            600, NULL },
-  { "plus",                              600, NULL },
-  { "uring",                             600, NULL },
-  { "quotesinglbase",                    600, NULL },
-  { "lcommaaccent",                      600, NULL },
-  { "Yacute",                            600, NULL },
-  { "ohungarumlaut",                     600, NULL },
-  { "threesuperior",                     600, NULL },
-  { "acute",                             600, NULL },
-  { "section",                           600, NULL },
+  { "Icircumflex",                       600, NULL },
+  { "O",                                 600, NULL },
+  { "nacute",                            600, NULL },
   { "dieresis",                          600, NULL },
-  { "iacute",                            600, NULL },
-  { "quotedblbase",                      600, NULL },
-  { "ncaron",                            600, NULL },
-  { "florin",                            600, NULL },
-  { "yacute",                            600, NULL },
-  { "Rcommaaccent",                      600, NULL },
+  { "Eacute",                            600, NULL },
+  { "ntilde",                            600, NULL },
   { "fi",                                600, NULL },
-  { "fl",                                600, NULL },
-  { "Acircumflex",                       600, NULL },
-  { "Cacute",                            600, NULL },
-  { "Icircumflex",                       600, NULL },
-  { "guillemotleft",                     600, NULL },
-  { "germandbls",                        600, NULL },
-  { "Amacron",                           600, NULL },
-  { "seven",                             600, NULL },
-  { "Sacute",                            600, NULL },
-  { "ordmasculine",                      600, NULL },
-  { "dotlessi",                          600, NULL },
-  { "sterling",                          600, NULL },
-  { "notequal",                          600, NULL },
-  { "Imacron",                           600, NULL },
-  { "rcommaaccent",                      600, NULL },
-  { "Zdotaccent",                        600, NULL },
-  { "acircumflex",                       600, NULL },
-  { "cacute",                            600, NULL },
-  { "Ecaron",                            600, NULL },
-  { "icircumflex",                       600, NULL },
-  { "braceright",                        600, NULL },
-  { "quotedblright",                     600, NULL },
-  { "amacron",                           600, NULL },
-  { "sacute",                            600, NULL },
-  { "imacron",                           600, NULL },
-  { "cent",                              600, NULL },
-  { "currency",                          600, NULL },
-  { "logicalnot",                        600, NULL },
-  { "zdotaccent",                        600, NULL },
-  { "Atilde",                            600, NULL },
-  { "breve",                             600, NULL },
-  { "bar",                               600, NULL },
-  { "fraction",                          600, NULL },
-  { "less",                              600, NULL },
-  { "ecaron",                            600, NULL },
-  { "guilsinglleft",                     600, NULL },
-  { "exclam",                            600, NULL },
-  { "period",                            600, NULL },
-  { "Rcaron",                            600, NULL },
-  { "Kcommaaccent",                      600, NULL },
-  { "greater",                           600, NULL },
-  { "atilde",                            600, NULL },
-  { "brokenbar",                         600, NULL },
-  { "quoteleft",                         600, NULL },
-  { "Edotaccent",                        600, NULL },
-  { "onesuperior",                       600, NULL }
+  { "trademark",                         600, NULL },
+  { "ampersand",                         600, NULL },
+  { "Lcommaaccent",                      600, NULL }
 };
 
 static BuiltinFontWidth helveticaWidthsTab[] = {
+  { "lcommaaccent",                      222, NULL },
+  { "onehalf",                           834, NULL },
+  { "uhungarumlaut",                     556, NULL },
+  { "gbreve",                            556, NULL },
+  { "n",                                 556, NULL },
+  { "Ecaron",                            667, NULL },
+  { "threesuperior",                     333, NULL },
+  { "zdotaccent",                        500, NULL },
+  { "quoteleft",                         222, NULL },
+  { "registered",                        737, NULL },
+  { "Gcommaaccent",                      778, NULL },
+  { "Racute",                            722, NULL },
+  { "k",                                 500, NULL },
+  { "copyright",                         737, NULL },
+  { "icircumflex",                       278, NULL },
+  { "abreve",                            556, NULL },
+  { "Imacron",                           278, NULL },
+  { "iacute",                            278, NULL },
+  { "e",                                 556, NULL },
+  { "equal",                             584, NULL },
+  { "dagger",                            556, NULL },
+  { "N",                                 722, NULL },
+  { "C",                                 722, NULL },
+  { "u",                                 556, NULL },
+  { "q",                                 556, NULL },
+  { "l",                                 222, NULL },
+  { "greater",                           584, NULL },
+  { "asterisk",                          389, NULL },
+  { "Emacron",                           667, NULL },
+  { "scommaaccent",                      500, NULL },
+  { "onesuperior",                       333, NULL },
+  { "percent",                           889, NULL },
+  { "o",                                 556, NULL },
+  { "Euro",                              556, NULL },
+  { "florin",                            556, NULL },
+  { "iogonek",                           222, NULL },
+  { "section",                           556, NULL },
+  { "Scaron",                            667, NULL },
+  { "degree",                            400, NULL },
+  { "K",                                 667, NULL },
+  { "Scommaaccent",                      667, NULL },
+  { "Aacute",                            667, NULL },
+  { "b",                                 556, NULL },
+  { "Dcaron",                            722, NULL },
+  { "Z",                                 611, NULL },
+  { "ecircumflex",                       556, NULL },
+  { "Amacron",                           667, NULL },
+  { "breve",                             333, NULL },
+  { "lcaron",                            299, NULL },
+  { "paragraph",                         537, NULL },
+  { "zcaron",                            500, NULL },
+  { "aring",                             556, NULL },
+  { "Ydieresis",                         667, NULL },
+  { "Odieresis",                         778, NULL },
+  { "oe",                                944, NULL },
+  { "five",                              556, NULL },
+  { "X",                                 667, NULL },
+  { "asciicircum",                       469, NULL },
+  { "emdash",                           1000, NULL },
+  { "Egrave",                            667, NULL },
+  { "aogonek",                           556, NULL },
+  { "ring",                              333, NULL },
   { "Ntilde",                            722, NULL },
-  { "rcaron",                            333, NULL },
-  { "kcommaaccent",                      500, NULL },
-  { "Ncommaaccent",                      722, NULL },
-  { "Zacute",                            611, NULL },
-  { "comma",                             278, NULL },
+  { "radical",                           453, NULL },
+  { "dotlessi",                          278, NULL },
+  { "p",                                 556, NULL },
+  { "plusminus",                         584, NULL },
   { "cedilla",                           333, NULL },
-  { "plusminus",                         584, NULL },
-  { "circumflex",                        333, NULL },
-  { "dotaccent",                         333, NULL },
-  { "edotaccent",                        556, NULL },
-  { "asciitilde",                        584, NULL },
+  { "Idotaccent",                        278, NULL },
+  { "quotedblright",                     333, NULL },
+  { "Eth",                               722, NULL },
+  { "g",                                 556, NULL },
   { "colon",                             278, NULL },
-  { "onehalf",                           834, NULL },
-  { "dollar",                            556, NULL },
-  { "Lcaron",                            556, NULL },
-  { "ntilde",                            556, NULL },
-  { "Aogonek",                           667, NULL },
-  { "ncommaaccent",                      556, NULL },
-  { "minus",                             584, NULL },
-  { "Iogonek",                           278, NULL },
-  { "zacute",                            500, NULL },
+  { "ccedilla",                          500, NULL },
+  { "quotesinglbase",                    222, NULL },
+  { "grave",                             333, NULL },
+  { "Scedilla",                          667, NULL },
+  { "parenleft",                         333, NULL },
+  { "currency",                          556, NULL },
+  { "nine",                              556, NULL },
+  { "hungarumlaut",                      333, NULL },
+  { "Ccaron",                            722, NULL },
+  { "j",                                 222, NULL },
   { "yen",                               556, NULL },
-  { "space",                             278, NULL },
+  { "Y",                                 667, NULL },
+  { "ccaron",                            500, NULL },
   { "Omacron",                           778, NULL },
-  { "questiondown",                      611, NULL },
-  { "emdash",                           1000, NULL },
-  { "Agrave",                            667, NULL },
-  { "three",                             556, NULL },
-  { "numbersign",                        556, NULL },
-  { "lcaron",                            299, NULL },
-  { "A",                                 667, NULL },
-  { "B",                                 667, NULL },
-  { "C",                                 722, NULL },
-  { "aogonek",                           556, NULL },
+  { "lessequal",                         549, NULL },
+  { "Ucircumflex",                       722, NULL },
+  { "dollar",                            556, NULL },
+  { "Tcommaaccent",                      611, NULL },
+  { "Nacute",                            722, NULL },
+  { "v",                                 500, NULL },
+  { "dotaccent",                         333, NULL },
+  { "rcommaaccent",                      333, NULL },
+  { "Kcommaaccent",                      667, NULL },
+  { "imacron",                           278, NULL },
+  { "tilde",                             333, NULL },
+  { "underscore",                        556, NULL },
+  { "mu",                                556, NULL },
   { "D",                                 722, NULL },
-  { "E",                                 667, NULL },
-  { "onequarter",                        834, NULL },
+  { "racute",                            333, NULL },
+  { "circumflex",                        333, NULL },
+  { "Zcaron",                            611, NULL },
+  { "ogonek",                            333, NULL },
+  { "idieresis",                         278, NULL },
+  { "cent",                              556, NULL },
+  { "ae",                                889, NULL },
+  { "ocircumflex",                       556, NULL },
+  { "less",                              584, NULL },
+  { "minus",                             584, NULL },
+  { "four",                              556, NULL },
   { "F",                                 611, NULL },
+  { "Ocircumflex",                       778, NULL },
+  { "Uring",                             722, NULL },
+  { "Edotaccent",                        667, NULL },
+  { "perthousand",                      1000, NULL },
+  { "acircumflex",                       556, NULL },
   { "G",                                 778, NULL },
-  { "H",                                 722, NULL },
-  { "I",                                 278, NULL },
-  { "J",                                 500, NULL },
-  { "K",                                 667, NULL },
-  { "iogonek",                           222, NULL },
-  { "backslash",                         278, NULL },
-  { "L",                                 556, NULL },
-  { "periodcentered",                    278, NULL },
+  { "commaaccent",                       250, NULL },
+  { "W",                                 944, NULL },
+  { "bracketright",                      278, NULL },
+  { "Ugrave",                            722, NULL },
+  { "germandbls",                        611, NULL },
+  { "thorn",                             556, NULL },
+  { "zero",                              556, NULL },
+  { "period",                            278, NULL },
+  { "scedilla",                          500, NULL },
+  { "udieresis",                         556, NULL },
+  { "Ccedilla",                          722, NULL },
+  { "Igrave",                            278, NULL },
+  { "fl",                                500, NULL },
+  { "quotedblbase",                      333, NULL },
+  { "E",                                 667, NULL },
+  { "endash",                            556, NULL },
+  { "guillemotleft",                     556, NULL },
+  { "w",                                 722, NULL },
+  { "space",                             278, NULL },
+  { "Thorn",                             667, NULL },
+  { "eth",                               556, NULL },
+  { "twosuperior",                       333, NULL },
+  { "ecaron",                            556, NULL },
+  { "brokenbar",                         260, NULL },
+  { "Aogonek",                           667, NULL },
   { "M",                                 833, NULL },
-  { "N",                                 722, NULL },
+  { "odieresis",                         556, NULL },
+  { "Ograve",                            778, NULL },
+  { "T",                                 611, NULL },
+  { "amacron",                           556, NULL },
+  { "Ncommaaccent",                      722, NULL },
+  { "numbersign",                        556, NULL },
+  { "divide",                            584, NULL },
+  { "emacron",                           556, NULL },
+  { "Abreve",                            667, NULL },
+  { "Udieresis",                         722, NULL },
+  { "Iacute",                            278, NULL },
+  { "two",                               556, NULL },
+  { "uacute",                            556, NULL },
+  { "seven",                             556, NULL },
+  { "scaron",                            500, NULL },
+  { "guillemotright",                    556, NULL },
+  { "bullet",                            350, NULL },
+  { "eogonek",                           556, NULL },
+  { "eacute",                            556, NULL },
+  { "Zdotaccent",                        611, NULL },
+  { "trademark",                        1000, NULL },
+  { "ampersand",                         667, NULL },
+  { "Lcommaaccent",                      556, NULL },
+  { "ntilde",                            556, NULL },
+  { "fi",                                500, NULL },
+  { "dieresis",                          333, NULL },
+  { "Eacute",                            667, NULL },
+  { "O",                                 778, NULL },
+  { "Icircumflex",                       278, NULL },
+  { "nacute",                            556, NULL },
   { "omacron",                           556, NULL },
-  { "Tcommaaccent",                      611, NULL },
-  { "O",                                 778, NULL },
-  { "P",                                 667, NULL },
-  { "Q",                                 778, NULL },
-  { "Uhungarumlaut",                     722, NULL },
+  { "comma",                             278, NULL },
+  { "Delta",                             612, NULL },
+  { "Gbreve",                            778, NULL },
+  { "S",                                 667, NULL },
+  { "quotedblleft",                      333, NULL },
+  { "ordfeminine",                       370, NULL },
+  { "Otilde",                            778, NULL },
+  { "umacron",                           556, NULL },
+  { "Tcaron",                            611, NULL },
+  { "aacute",                            556, NULL },
+  { "B",                                 667, NULL },
+  { "kcommaaccent",                      500, NULL },
+  { "Rcaron",                            722, NULL },
+  { "yacute",                            500, NULL },
+  { "ydieresis",                         500, NULL },
   { "R",                                 722, NULL },
-  { "Aacute",                            667, NULL },
-  { "caron",                             333, NULL },
-  { "S",                                 667, NULL },
-  { "T",                                 611, NULL },
-  { "U",                                 722, NULL },
-  { "agrave",                            556, NULL },
-  { "V",                                 667, NULL },
-  { "W",                                 944, NULL },
-  { "X",                                 667, NULL },
+  { "ugrave",                            556, NULL },
+  { "dcaron",                            643, NULL },
+  { "hyphen",                            333, NULL },
+  { "Oslash",                            778, NULL },
+  { "a",                                 556, NULL },
+  { "igrave",                            278, NULL },
+  { "dcroat",                            556, NULL },
   { "question",                          556, NULL },
-  { "equal",                             584, NULL },
-  { "Y",                                 667, NULL },
-  { "Z",                                 611, NULL },
-  { "four",                              556, NULL },
-  { "a",                                 556, NULL },
-  { "Gcommaaccent",                      778, NULL },
-  { "b",                                 556, NULL },
-  { "c",                                 500, NULL },
-  { "d",                                 556, NULL },
-  { "e",                                 556, NULL },
-  { "f",                                 278, NULL },
-  { "g",                                 556, NULL },
-  { "bullet",                            350, NULL },
+  { "summation",                         600, NULL },
+  { "A",                                 667, NULL },
+  { "guilsinglleft",                     333, NULL },
   { "h",                                 556, NULL },
-  { "i",                                 222, NULL },
-  { "Oslash",                            778, NULL },
-  { "dagger",                            556, NULL },
-  { "j",                                 222, NULL },
-  { "k",                                 500, NULL },
-  { "l",                                 222, NULL },
-  { "m",                                 833, NULL },
-  { "n",                                 556, NULL },
+  { "Cacute",                            722, NULL },
+  { "plus",                              584, NULL },
+  { "ncommaaccent",                      556, NULL },
   { "tcommaaccent",                      278, NULL },
-  { "o",                                 556, NULL },
-  { "ordfeminine",                       370, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 556, NULL },
-  { "q",                                 556, NULL },
-  { "uhungarumlaut",                     556, NULL },
-  { "r",                                 333, NULL },
-  { "twosuperior",                       333, NULL },
-  { "aacute",                            556, NULL },
-  { "s",                                 500, NULL },
-  { "OE",                               1000, NULL },
-  { "t",                                 278, NULL },
-  { "divide",                            584, NULL },
-  { "u",                                 556, NULL },
-  { "Ccaron",                            722, NULL },
-  { "v",                                 500, NULL },
-  { "w",                                 722, NULL },
+  { "logicalnot",                        584, NULL },
+  { "cacute",                            500, NULL },
+  { "Dcroat",                            722, NULL },
+  { "tcaron",                            317, NULL },
+  { "rcaron",                            333, NULL },
   { "x",                                 500, NULL },
+  { "Iogonek",                           278, NULL },
   { "y",                                 500, NULL },
-  { "z",                                 500, NULL },
-  { "Gbreve",                            778, NULL },
-  { "commaaccent",                       250, NULL },
-  { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        278, NULL },
-  { "Nacute",                            722, NULL },
-  { "quotedbl",                          355, NULL },
-  { "gcommaaccent",                      556, NULL },
-  { "mu",                                556, NULL },
-  { "greaterequal",                      549, NULL },
-  { "Scaron",                            667, NULL },
-  { "Lslash",                            556, NULL },
-  { "semicolon",                         278, NULL },
-  { "oslash",                            611, NULL },
-  { "lessequal",                         549, NULL },
-  { "lozenge",                           471, NULL },
-  { "parenright",                        333, NULL },
-  { "ccaron",                            500, NULL },
-  { "Ecircumflex",                       667, NULL },
-  { "gbreve",                            556, NULL },
-  { "trademark",                        1000, NULL },
+  { "edieresis",                         556, NULL },
+  { "Ncaron",                            722, NULL },
+  { "m",                                 833, NULL },
+  { "OE",                               1000, NULL },
+  { "U",                                 722, NULL },
+  { "partialdiff",                       476, NULL },
+  { "braceright",                        334, NULL },
+  { "braceleft",                         334, NULL },
+  { "acute",                             333, NULL },
+  { "onequarter",                        834, NULL },
+  { "Atilde",                            667, NULL },
+  { "Edieresis",                         667, NULL },
+  { "Yacute",                            667, NULL },
+  { "oacute",                            556, NULL },
   { "daggerdbl",                         556, NULL },
-  { "nacute",                            556, NULL },
-  { "macron",                            333, NULL },
-  { "Otilde",                            778, NULL },
-  { "Emacron",                           667, NULL },
-  { "ellipsis",                         1000, NULL },
-  { "scaron",                            500, NULL },
-  { "AE",                               1000, NULL },
-  { "Ucircumflex",                       722, NULL },
+  { "six",                               556, NULL },
+  { "edotaccent",                        556, NULL },
+  { "P",                                 667, NULL },
   { "lslash",                            222, NULL },
-  { "quotedblleft",                      333, NULL },
-  { "guilsinglright",                    333, NULL },
-  { "hyphen",                            333, NULL },
+  { "multiply",                          584, NULL },
+  { "i",                                 222, NULL },
   { "quotesingle",                       191, NULL },
+  { "bar",                               260, NULL },
+  { "agrave",                            556, NULL },
+  { "ellipsis",                         1000, NULL },
+  { "Aring",                             667, NULL },
+  { "t",                                 278, NULL },
+  { "quotedbl",                          355, NULL },
+  { "Oacute",                            778, NULL },
+  { "egrave",                            556, NULL },
+  { "uring",                             556, NULL },
+  { "s",                                 500, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "z",                                 500, NULL },
   { "eight",                             556, NULL },
+  { "I",                                 278, NULL },
+  { "one",                               556, NULL },
+  { "periodcentered",                    278, NULL },
+  { "c",                                 500, NULL },
+  { "d",                                 556, NULL },
+  { "zacute",                            500, NULL },
+  { "Umacron",                           722, NULL },
+  { "ncaron",                            556, NULL },
+  { "adieresis",                         556, NULL },
+  { "lozenge",                           471, NULL },
+  { "V",                                 667, NULL },
+  { "Q",                                 778, NULL },
   { "exclamdown",                        333, NULL },
-  { "endash",                            556, NULL },
-  { "oe",                                944, NULL },
-  { "Abreve",                            667, NULL },
-  { "Umacron",                           722, NULL },
-  { "ecircumflex",                       556, NULL },
-  { "Adieresis",                         667, NULL },
-  { "copyright",                         737, NULL },
-  { "Egrave",                            667, NULL },
+  { "quoteright",                        222, NULL },
+  { "uogonek",                           556, NULL },
+  { "semicolon",                         278, NULL },
+  { "guilsinglright",                    333, NULL },
+  { "Eogonek",                           667, NULL },
+  { "macron",                            333, NULL },
+  { "ordmasculine",                      365, NULL },
+  { "Lcaron",                            556, NULL },
+  { "backslash",                         278, NULL },
+  { "questiondown",                      611, NULL },
+  { "three",                             556, NULL },
   { "slash",                             278, NULL },
-  { "Edieresis",                         667, NULL },
-  { "otilde",                            556, NULL },
-  { "Idieresis",                         278, NULL },
-  { "parenleft",                         333, NULL },
-  { "one",                               556, NULL },
-  { "emacron",                           556, NULL },
-  { "Odieresis",                         778, NULL },
   { "ucircumflex",                       556, NULL },
+  { "r",                                 333, NULL },
+  { "f",                                 278, NULL },
+  { "gcommaaccent",                      556, NULL },
+  { "Ohungarumlaut",                     778, NULL },
   { "bracketleft",                       278, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        222, NULL },
-  { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         667, NULL },
-  { "umacron",                           556, NULL },
-  { "abreve",                            556, NULL },
-  { "Eacute",                            667, NULL },
-  { "adieresis",                         556, NULL },
-  { "egrave",                            556, NULL },
-  { "edieresis",                         556, NULL },
-  { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
-  { "ae",                                889, NULL },
-  { "asterisk",                          389, NULL },
-  { "odieresis",                         556, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            556, NULL },
-  { "nine",                              556, NULL },
-  { "five",                              556, NULL },
-  { "udieresis",                         556, NULL },
-  { "Zcaron",                            611, NULL },
-  { "Scommaaccent",                      667, NULL },
-  { "threequarters",                     834, NULL },
-  { "guillemotright",                    556, NULL },
-  { "Ccedilla",                          722, NULL },
-  { "ydieresis",                         500, NULL },
-  { "tilde",                             333, NULL },
-  { "at",                               1015, NULL },
-  { "eacute",                            556, NULL },
-  { "underscore",                        556, NULL },
-  { "Euro",                              556, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          584, NULL },
-  { "zero",                              556, NULL },
-  { "eth",                               556, NULL },
-  { "Scedilla",                          667, NULL },
-  { "Ograve",                            778, NULL },
-  { "Racute",                            722, NULL },
-  { "partialdiff",                       476, NULL },
-  { "uacute",                            556, NULL },
-  { "braceleft",                         334, NULL },
-  { "Thorn",                             667, NULL },
-  { "zcaron",                            500, NULL },
-  { "scommaaccent",                      500, NULL },
-  { "ccedilla",                          500, NULL },
-  { "Dcaron",                            722, NULL },
-  { "dcroat",                            556, NULL },
-  { "Ocircumflex",                       778, NULL },
-  { "Oacute",                            778, NULL },
-  { "scedilla",                          500, NULL },
-  { "ogonek",                            333, NULL },
+  { "otilde",                            556, NULL },
+  { "parenright",                        333, NULL },
+  { "Rcommaaccent",                      722, NULL },
   { "ograve",                            556, NULL },
-  { "racute",                            333, NULL },
-  { "Tcaron",                            611, NULL },
-  { "Eogonek",                           667, NULL },
-  { "thorn",                             556, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        737, NULL },
-  { "radical",                           453, NULL },
-  { "Aring",                             667, NULL },
-  { "percent",                           889, NULL },
-  { "six",                               556, NULL },
-  { "paragraph",                         537, NULL },
-  { "dcaron",                            643, NULL },
+  { "Lacute",                            556, NULL },
+  { "sacute",                            500, NULL },
+  { "Idieresis",                         278, NULL },
   { "Uogonek",                           722, NULL },
-  { "two",                               556, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            278, NULL },
-  { "Lacute",                            556, NULL },
-  { "ocircumflex",                       556, NULL },
-  { "oacute",                            556, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      556, NULL },
-  { "tcaron",                            317, NULL },
-  { "eogonek",                           556, NULL },
-  { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     778, NULL },
-  { "asciicircum",                       469, NULL },
-  { "aring",                             556, NULL },
-  { "grave",                             333, NULL },
-  { "uogonek",                           556, NULL },
-  { "bracketright",                      278, NULL },
-  { "Iacute",                            278, NULL },
-  { "ampersand",                         667, NULL },
-  { "igrave",                            278, NULL },
+  { "Lslash",                            556, NULL },
+  { "caron",                             333, NULL },
   { "lacute",                            222, NULL },
-  { "Ncaron",                            722, NULL },
-  { "plus",                              584, NULL },
-  { "uring",                             556, NULL },
-  { "quotesinglbase",                    222, NULL },
-  { "lcommaaccent",                      222, NULL },
-  { "Yacute",                            667, NULL },
+  { "sterling",                          556, NULL },
+  { "H",                                 722, NULL },
+  { "at",                               1015, NULL },
+  { "greaterequal",                      549, NULL },
+  { "threequarters",                     834, NULL },
+  { "J",                                 500, NULL },
+  { "L",                                 556, NULL },
   { "ohungarumlaut",                     556, NULL },
-  { "threesuperior",                     333, NULL },
-  { "acute",                             333, NULL },
-  { "section",                           556, NULL },
-  { "dieresis",                          333, NULL },
-  { "iacute",                            278, NULL },
-  { "quotedblbase",                      333, NULL },
-  { "ncaron",                            556, NULL },
-  { "florin",                            556, NULL },
-  { "yacute",                            500, NULL },
-  { "Rcommaaccent",                      722, NULL },
-  { "fi",                                500, NULL },
-  { "fl",                                500, NULL },
-  { "Acircumflex",                       667, NULL },
-  { "Cacute",                            722, NULL },
-  { "Icircumflex",                       278, NULL },
-  { "guillemotleft",                     556, NULL },
-  { "germandbls",                        611, NULL },
-  { "Amacron",                           667, NULL },
-  { "seven",                             556, NULL },
-  { "Sacute",                            667, NULL },
-  { "ordmasculine",                      365, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          556, NULL },
+  { "Ecircumflex",                       667, NULL },
   { "notequal",                          549, NULL },
-  { "Imacron",                           278, NULL },
-  { "rcommaaccent",                      333, NULL },
-  { "Zdotaccent",                        611, NULL },
-  { "acircumflex",                       556, NULL },
-  { "cacute",                            500, NULL },
-  { "Ecaron",                            667, NULL },
-  { "icircumflex",                       278, NULL },
-  { "braceright",                        334, NULL },
-  { "quotedblright",                     333, NULL },
-  { "amacron",                           556, NULL },
-  { "sacute",                            500, NULL },
-  { "imacron",                           278, NULL },
-  { "cent",                              556, NULL },
-  { "currency",                          556, NULL },
-  { "logicalnot",                        584, NULL },
-  { "zdotaccent",                        500, NULL },
-  { "Atilde",                            667, NULL },
-  { "breve",                             333, NULL },
-  { "bar",                               260, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              584, NULL },
-  { "ecaron",                            556, NULL },
-  { "guilsinglleft",                     333, NULL },
   { "exclam",                            278, NULL },
-  { "period",                            278, NULL },
-  { "Rcaron",                            722, NULL },
-  { "Kcommaaccent",                      667, NULL },
-  { "greater",                           584, NULL },
+  { "Agrave",                            667, NULL },
+  { "AE",                               1000, NULL },
+  { "Acircumflex",                       667, NULL },
+  { "oslash",                            611, NULL },
+  { "Uacute",                            722, NULL },
   { "atilde",                            556, NULL },
-  { "brokenbar",                         260, NULL },
-  { "quoteleft",                         222, NULL },
-  { "Edotaccent",                        667, NULL },
-  { "onesuperior",                       333, NULL }
+  { "Zacute",                            611, NULL },
+  { "fraction",                          167, NULL },
+  { "Sacute",                            667, NULL },
+  { "Adieresis",                         667, NULL },
+  { "asciitilde",                        584, NULL }
 };
 
 static BuiltinFontWidth helveticaBoldWidthsTab[] = {
-  { "Ntilde",                            722, NULL },
-  { "rcaron",                            389, NULL },
-  { "kcommaaccent",                      556, NULL },
-  { "Ncommaaccent",                      722, NULL },
-  { "Zacute",                            611, NULL },
-  { "comma",                             278, NULL },
-  { "cedilla",                           333, NULL },
-  { "plusminus",                         584, NULL },
-  { "circumflex",                        333, NULL },
-  { "dotaccent",                         333, NULL },
-  { "edotaccent",                        556, NULL },
-  { "asciitilde",                        584, NULL },
-  { "colon",                             333, NULL },
-  { "onehalf",                           834, NULL },
-  { "dollar",                            556, NULL },
+  { "uogonek",                           611, NULL },
+  { "quoteright",                        278, NULL },
+  { "guilsinglright",                    333, NULL },
+  { "semicolon",                         333, NULL },
+  { "V",                                 667, NULL },
+  { "lozenge",                           494, NULL },
+  { "exclamdown",                        333, NULL },
+  { "Q",                                 778, NULL },
+  { "zacute",                            500, NULL },
+  { "Umacron",                           722, NULL },
+  { "adieresis",                         556, NULL },
+  { "ncaron",                            611, NULL },
+  { "slash",                             278, NULL },
+  { "r",                                 389, NULL },
+  { "ucircumflex",                       611, NULL },
+  { "three",                             556, NULL },
+  { "ordmasculine",                      365, NULL },
   { "Lcaron",                            611, NULL },
-  { "ntilde",                            611, NULL },
-  { "Aogonek",                           722, NULL },
-  { "ncommaaccent",                      611, NULL },
-  { "minus",                             584, NULL },
-  { "Iogonek",                           278, NULL },
-  { "zacute",                            500, NULL },
-  { "yen",                               556, NULL },
-  { "space",                             278, NULL },
-  { "Omacron",                           778, NULL },
+  { "backslash",                         278, NULL },
   { "questiondown",                      611, NULL },
-  { "emdash",                           1000, NULL },
+  { "macron",                            333, NULL },
+  { "Eogonek",                           667, NULL },
+  { "Oacute",                            778, NULL },
+  { "t",                                 333, NULL },
+  { "quotedbl",                          474, NULL },
+  { "ellipsis",                         1000, NULL },
+  { "Aring",                             722, NULL },
+  { "agrave",                            556, NULL },
+  { "d",                                 611, NULL },
+  { "c",                                 556, NULL },
+  { "I",                                 278, NULL },
+  { "one",                               556, NULL },
+  { "eight",                             556, NULL },
+  { "periodcentered",                    278, NULL },
+  { "z",                                 500, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "egrave",                            556, NULL },
+  { "s",                                 556, NULL },
+  { "uring",                             611, NULL },
   { "Agrave",                            722, NULL },
-  { "three",                             556, NULL },
-  { "numbersign",                        556, NULL },
-  { "lcaron",                            400, NULL },
-  { "A",                                 722, NULL },
-  { "B",                                 722, NULL },
-  { "C",                                 722, NULL },
-  { "aogonek",                           556, NULL },
-  { "D",                                 722, NULL },
-  { "E",                                 667, NULL },
-  { "onequarter",                        834, NULL },
-  { "F",                                 611, NULL },
-  { "G",                                 778, NULL },
-  { "H",                                 722, NULL },
-  { "I",                                 278, NULL },
+  { "AE",                               1000, NULL },
+  { "exclam",                            333, NULL },
+  { "notequal",                          549, NULL },
+  { "oslash",                            611, NULL },
+  { "Acircumflex",                       722, NULL },
   { "J",                                 556, NULL },
-  { "K",                                 722, NULL },
-  { "iogonek",                           278, NULL },
-  { "backslash",                         278, NULL },
+  { "threequarters",                     834, NULL },
+  { "ohungarumlaut",                     611, NULL },
   { "L",                                 611, NULL },
-  { "periodcentered",                    278, NULL },
-  { "M",                                 833, NULL },
-  { "N",                                 722, NULL },
-  { "omacron",                           611, NULL },
-  { "Tcommaaccent",                      611, NULL },
-  { "O",                                 778, NULL },
-  { "P",                                 667, NULL },
-  { "Q",                                 778, NULL },
-  { "Uhungarumlaut",                     722, NULL },
-  { "R",                                 722, NULL },
-  { "Aacute",                            722, NULL },
+  { "Ecircumflex",                       667, NULL },
+  { "H",                                 722, NULL },
+  { "sterling",                          556, NULL },
+  { "greaterequal",                      549, NULL },
+  { "at",                                975, NULL },
+  { "lacute",                            278, NULL },
+  { "Uogonek",                           722, NULL },
   { "caron",                             333, NULL },
+  { "Lslash",                            611, NULL },
+  { "asciitilde",                        584, NULL },
+  { "fraction",                          167, NULL },
+  { "Adieresis",                         722, NULL },
+  { "Sacute",                            667, NULL },
+  { "Uacute",                            722, NULL },
+  { "Zacute",                            611, NULL },
+  { "atilde",                            556, NULL },
+  { "otilde",                            611, NULL },
+  { "parenright",                        333, NULL },
+  { "gcommaaccent",                      611, NULL },
+  { "bracketleft",                       333, NULL },
+  { "Ohungarumlaut",                     778, NULL },
+  { "f",                                 333, NULL },
+  { "Lacute",                            611, NULL },
+  { "sacute",                            556, NULL },
+  { "Idieresis",                         278, NULL },
+  { "ograve",                            611, NULL },
+  { "Rcommaaccent",                      722, NULL },
+  { "ordfeminine",                       370, NULL },
+  { "quotedblleft",                      500, NULL },
   { "S",                                 667, NULL },
-  { "T",                                 611, NULL },
-  { "U",                                 722, NULL },
-  { "agrave",                            556, NULL },
-  { "V",                                 667, NULL },
-  { "W",                                 944, NULL },
-  { "X",                                 667, NULL },
-  { "question",                          611, NULL },
-  { "equal",                             584, NULL },
-  { "Y",                                 667, NULL },
-  { "Z",                                 611, NULL },
-  { "four",                              556, NULL },
+  { "comma",                             278, NULL },
+  { "Delta",                             612, NULL },
+  { "omacron",                           611, NULL },
+  { "Gbreve",                            778, NULL },
+  { "dcaron",                            743, NULL },
+  { "ugrave",                            611, NULL },
   { "a",                                 556, NULL },
-  { "Gcommaaccent",                      778, NULL },
-  { "b",                                 611, NULL },
-  { "c",                                 556, NULL },
-  { "d",                                 611, NULL },
-  { "e",                                 556, NULL },
-  { "f",                                 333, NULL },
-  { "g",                                 611, NULL },
-  { "bullet",                            350, NULL },
-  { "h",                                 611, NULL },
-  { "i",                                 278, NULL },
+  { "hyphen",                            333, NULL },
   { "Oslash",                            778, NULL },
-  { "dagger",                            556, NULL },
-  { "j",                                 278, NULL },
-  { "k",                                 556, NULL },
-  { "l",                                 278, NULL },
-  { "m",                                 889, NULL },
-  { "n",                                 611, NULL },
-  { "tcommaaccent",                      333, NULL },
-  { "o",                                 611, NULL },
-  { "ordfeminine",                       370, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 611, NULL },
-  { "q",                                 611, NULL },
-  { "uhungarumlaut",                     611, NULL },
-  { "r",                                 389, NULL },
-  { "twosuperior",                       333, NULL },
+  { "B",                                 722, NULL },
+  { "R",                                 722, NULL },
+  { "ydieresis",                         556, NULL },
+  { "yacute",                            556, NULL },
+  { "kcommaaccent",                      556, NULL },
+  { "Rcaron",                            722, NULL },
   { "aacute",                            556, NULL },
-  { "s",                                 556, NULL },
-  { "OE",                               1000, NULL },
-  { "t",                                 333, NULL },
-  { "divide",                            584, NULL },
-  { "u",                                 611, NULL },
-  { "Ccaron",                            722, NULL },
-  { "v",                                 556, NULL },
-  { "w",                                 778, NULL },
-  { "x",                                 556, NULL },
-  { "y",                                 556, NULL },
-  { "z",                                 500, NULL },
-  { "Gbreve",                            778, NULL },
-  { "commaaccent",                       250, NULL },
-  { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        278, NULL },
-  { "Nacute",                            722, NULL },
-  { "quotedbl",                          474, NULL },
-  { "gcommaaccent",                      611, NULL },
-  { "mu",                                611, NULL },
-  { "greaterequal",                      549, NULL },
-  { "Scaron",                            667, NULL },
-  { "Lslash",                            611, NULL },
-  { "semicolon",                         333, NULL },
-  { "oslash",                            611, NULL },
-  { "lessequal",                         549, NULL },
-  { "lozenge",                           494, NULL },
-  { "parenright",                        333, NULL },
-  { "ccaron",                            556, NULL },
-  { "Ecircumflex",                       667, NULL },
-  { "gbreve",                            611, NULL },
-  { "trademark",                        1000, NULL },
-  { "daggerdbl",                         556, NULL },
-  { "nacute",                            611, NULL },
-  { "macron",                            333, NULL },
   { "Otilde",                            778, NULL },
-  { "Emacron",                           667, NULL },
-  { "ellipsis",                         1000, NULL },
+  { "umacron",                           611, NULL },
+  { "Tcaron",                            611, NULL },
+  { "bullet",                            350, NULL },
+  { "eogonek",                           556, NULL },
+  { "eacute",                            556, NULL },
+  { "Zdotaccent",                        611, NULL },
   { "scaron",                            556, NULL },
-  { "AE",                               1000, NULL },
-  { "Ucircumflex",                       722, NULL },
-  { "lslash",                            278, NULL },
-  { "quotedblleft",                      500, NULL },
-  { "guilsinglright",                    333, NULL },
-  { "hyphen",                            333, NULL },
-  { "quotesingle",                       238, NULL },
-  { "eight",                             556, NULL },
-  { "exclamdown",                        333, NULL },
-  { "endash",                            556, NULL },
-  { "oe",                                944, NULL },
+  { "guillemotright",                    556, NULL },
+  { "uacute",                            611, NULL },
+  { "two",                               556, NULL },
+  { "seven",                             556, NULL },
   { "Abreve",                            722, NULL },
-  { "Umacron",                           722, NULL },
-  { "ecircumflex",                       556, NULL },
-  { "Adieresis",                         722, NULL },
-  { "copyright",                         737, NULL },
-  { "Egrave",                            667, NULL },
-  { "slash",                             278, NULL },
-  { "Edieresis",                         667, NULL },
-  { "otilde",                            611, NULL },
-  { "Idieresis",                         278, NULL },
-  { "parenleft",                         333, NULL },
-  { "one",                               556, NULL },
-  { "emacron",                           556, NULL },
-  { "Odieresis",                         778, NULL },
-  { "ucircumflex",                       611, NULL },
-  { "bracketleft",                       333, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        278, NULL },
   { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         667, NULL },
-  { "umacron",                           611, NULL },
-  { "abreve",                            556, NULL },
+  { "Iacute",                            278, NULL },
+  { "nacute",                            611, NULL },
+  { "O",                                 778, NULL },
+  { "Icircumflex",                       278, NULL },
+  { "dieresis",                          333, NULL },
   { "Eacute",                            667, NULL },
-  { "adieresis",                         556, NULL },
-  { "egrave",                            556, NULL },
+  { "ntilde",                            611, NULL },
+  { "fi",                                611, NULL },
+  { "ampersand",                         722, NULL },
+  { "trademark",                        1000, NULL },
+  { "Lcommaaccent",                      611, NULL },
+  { "Yacute",                            667, NULL },
+  { "oacute",                            611, NULL },
+  { "daggerdbl",                         556, NULL },
+  { "Atilde",                            722, NULL },
+  { "Edieresis",                         667, NULL },
+  { "onequarter",                        834, NULL },
+  { "acute",                             333, NULL },
+  { "braceright",                        389, NULL },
+  { "braceleft",                         389, NULL },
+  { "quotesingle",                       238, NULL },
+  { "bar",                               280, NULL },
+  { "i",                                 278, NULL },
+  { "multiply",                          584, NULL },
+  { "lslash",                            278, NULL },
+  { "P",                                 667, NULL },
+  { "edotaccent",                        556, NULL },
+  { "six",                               556, NULL },
+  { "Cacute",                            722, NULL },
+  { "h",                                 611, NULL },
+  { "guilsinglleft",                     333, NULL },
+  { "plus",                              584, NULL },
+  { "summation",                         600, NULL },
+  { "question",                          611, NULL },
+  { "A",                                 722, NULL },
+  { "dcroat",                            611, NULL },
+  { "igrave",                            278, NULL },
+  { "OE",                               1000, NULL },
+  { "m",                                 889, NULL },
+  { "U",                                 722, NULL },
+  { "partialdiff",                       494, NULL },
+  { "y",                                 556, NULL },
+  { "Iogonek",                           278, NULL },
   { "edieresis",                         556, NULL },
+  { "x",                                 556, NULL },
+  { "Ncaron",                            722, NULL },
+  { "Dcroat",                            722, NULL },
+  { "cacute",                            556, NULL },
+  { "tcaron",                            389, NULL },
+  { "rcaron",                            389, NULL },
+  { "ncommaaccent",                      611, NULL },
+  { "logicalnot",                        584, NULL },
+  { "tcommaaccent",                      333, NULL },
+  { "underscore",                        556, NULL },
+  { "racute",                            389, NULL },
+  { "D",                                 722, NULL },
+  { "mu",                                611, NULL },
+  { "Kcommaaccent",                      722, NULL },
+  { "imacron",                           278, NULL },
+  { "rcommaaccent",                      389, NULL },
+  { "tilde",                             333, NULL },
+  { "dollar",                            556, NULL },
+  { "Tcommaaccent",                      611, NULL },
+  { "dotaccent",                         333, NULL },
+  { "Nacute",                            722, NULL },
+  { "v",                                 556, NULL },
+  { "less",                              584, NULL },
+  { "ocircumflex",                       611, NULL },
+  { "four",                              556, NULL },
+  { "minus",                             584, NULL },
+  { "ae",                                889, NULL },
+  { "cent",                              556, NULL },
+  { "ogonek",                            333, NULL },
   { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
-  { "ae",                                889, NULL },
-  { "asterisk",                          389, NULL },
-  { "odieresis",                         611, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            611, NULL },
+  { "circumflex",                        333, NULL },
+  { "Zcaron",                            611, NULL },
   { "nine",                              556, NULL },
-  { "five",                              556, NULL },
-  { "udieresis",                         611, NULL },
-  { "Zcaron",                            611, NULL },
-  { "Scommaaccent",                      667, NULL },
-  { "threequarters",                     834, NULL },
-  { "guillemotright",                    556, NULL },
-  { "Ccedilla",                          722, NULL },
-  { "ydieresis",                         556, NULL },
-  { "tilde",                             333, NULL },
-  { "dbldaggerumlaut",                   556, NULL },
-  { "at",                                975, NULL },
-  { "eacute",                            556, NULL },
-  { "underscore",                        556, NULL },
-  { "Euro",                              556, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          584, NULL },
-  { "zero",                              556, NULL },
+  { "currency",                          556, NULL },
+  { "parenleft",                         333, NULL },
+  { "Scedilla",                          667, NULL },
+  { "grave",                             333, NULL },
+  { "quotesinglbase",                    278, NULL },
+  { "Ucircumflex",                       722, NULL },
+  { "lessequal",                         549, NULL },
+  { "Omacron",                           778, NULL },
+  { "ccaron",                            556, NULL },
+  { "Y",                                 667, NULL },
+  { "yen",                               556, NULL },
+  { "Ccaron",                            722, NULL },
+  { "j",                                 278, NULL },
+  { "hungarumlaut",                      333, NULL },
+  { "ecaron",                            556, NULL },
+  { "brokenbar",                         280, NULL },
+  { "Aogonek",                           722, NULL },
+  { "w",                                 778, NULL },
+  { "twosuperior",                       333, NULL },
   { "eth",                               611, NULL },
-  { "Scedilla",                          667, NULL },
+  { "Thorn",                             667, NULL },
+  { "space",                             278, NULL },
+  { "guillemotleft",                     556, NULL },
+  { "endash",                            556, NULL },
+  { "fl",                                611, NULL },
+  { "E",                                 667, NULL },
+  { "quotedblbase",                      500, NULL },
+  { "numbersign",                        556, NULL },
+  { "emacron",                           556, NULL },
+  { "divide",                            584, NULL },
+  { "amacron",                           556, NULL },
+  { "Ncommaaccent",                      722, NULL },
+  { "T",                                 611, NULL },
+  { "odieresis",                         611, NULL },
+  { "M",                                 833, NULL },
   { "Ograve",                            778, NULL },
-  { "Racute",                            722, NULL },
-  { "partialdiff",                       494, NULL },
-  { "uacute",                            611, NULL },
-  { "braceleft",                         389, NULL },
-  { "Thorn",                             667, NULL },
-  { "zcaron",                            500, NULL },
-  { "scommaaccent",                      556, NULL },
-  { "ccedilla",                          556, NULL },
-  { "Dcaron",                            722, NULL },
-  { "dcroat",                            611, NULL },
+  { "G",                                 778, NULL },
+  { "perthousand",                      1000, NULL },
+  { "Edotaccent",                        667, NULL },
+  { "acircumflex",                       556, NULL },
+  { "F",                                 611, NULL },
   { "Ocircumflex",                       778, NULL },
-  { "Oacute",                            778, NULL },
+  { "Uring",                             722, NULL },
+  { "Ccedilla",                          722, NULL },
+  { "Igrave",                            278, NULL },
+  { "zero",                              556, NULL },
+  { "udieresis",                         611, NULL },
+  { "period",                            278, NULL },
   { "scedilla",                          556, NULL },
-  { "ogonek",                            333, NULL },
-  { "ograve",                            611, NULL },
-  { "racute",                            389, NULL },
-  { "Tcaron",                            611, NULL },
-  { "Eogonek",                           667, NULL },
+  { "germandbls",                        611, NULL },
+  { "Ugrave",                            722, NULL },
   { "thorn",                             611, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        737, NULL },
-  { "radical",                           549, NULL },
-  { "Aring",                             722, NULL },
-  { "percent",                           889, NULL },
-  { "six",                               556, NULL },
-  { "paragraph",                         556, NULL },
-  { "dcaron",                            743, NULL },
-  { "Uogonek",                           722, NULL },
-  { "two",                               556, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            278, NULL },
-  { "Lacute",                            611, NULL },
-  { "ocircumflex",                       611, NULL },
-  { "oacute",                            611, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      611, NULL },
-  { "tcaron",                            389, NULL },
-  { "eogonek",                           556, NULL },
-  { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     778, NULL },
-  { "asciicircum",                       584, NULL },
-  { "aring",                             556, NULL },
-  { "grave",                             333, NULL },
-  { "uogonek",                           611, NULL },
+  { "commaaccent",                       250, NULL },
+  { "W",                                 944, NULL },
   { "bracketright",                      333, NULL },
-  { "Iacute",                            278, NULL },
-  { "ampersand",                         722, NULL },
-  { "igrave",                            278, NULL },
-  { "lacute",                            278, NULL },
-  { "Ncaron",                            722, NULL },
-  { "plus",                              584, NULL },
-  { "uring",                             611, NULL },
-  { "quotesinglbase",                    278, NULL },
-  { "lcommaaccent",                      278, NULL },
-  { "Yacute",                            667, NULL },
-  { "ohungarumlaut",                     611, NULL },
-  { "threesuperior",                     333, NULL },
-  { "acute",                             333, NULL },
-  { "section",                           556, NULL },
-  { "dieresis",                          333, NULL },
+  { "l",                                 278, NULL },
+  { "q",                                 611, NULL },
+  { "N",                                 722, NULL },
+  { "dagger",                            556, NULL },
+  { "equal",                             584, NULL },
+  { "u",                                 611, NULL },
+  { "C",                                 722, NULL },
   { "iacute",                            278, NULL },
-  { "quotedblbase",                      500, NULL },
-  { "ncaron",                            611, NULL },
-  { "florin",                            556, NULL },
-  { "yacute",                            556, NULL },
-  { "Rcommaaccent",                      722, NULL },
-  { "fi",                                611, NULL },
-  { "fl",                                611, NULL },
-  { "Acircumflex",                       722, NULL },
-  { "Cacute",                            722, NULL },
-  { "Icircumflex",                       278, NULL },
-  { "guillemotleft",                     556, NULL },
-  { "germandbls",                        611, NULL },
-  { "Amacron",                           722, NULL },
-  { "seven",                             556, NULL },
-  { "Sacute",                            667, NULL },
-  { "ordmasculine",                      365, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          556, NULL },
-  { "notequal",                          549, NULL },
+  { "e",                                 556, NULL },
   { "Imacron",                           278, NULL },
-  { "rcommaaccent",                      389, NULL },
-  { "Zdotaccent",                        611, NULL },
-  { "acircumflex",                       556, NULL },
-  { "cacute",                            556, NULL },
+  { "abreve",                            556, NULL },
+  { "icircumflex",                       278, NULL },
+  { "percent",                           889, NULL },
+  { "o",                                 611, NULL },
+  { "asterisk",                          389, NULL },
+  { "Emacron",                           667, NULL },
+  { "scommaaccent",                      556, NULL },
+  { "onesuperior",                       333, NULL },
+  { "greater",                           584, NULL },
   { "Ecaron",                            667, NULL },
-  { "icircumflex",                       278, NULL },
-  { "braceright",                        389, NULL },
+  { "zdotaccent",                        500, NULL },
+  { "threesuperior",                     333, NULL },
+  { "n",                                 611, NULL },
+  { "dbldaggerumlaut",                   556, NULL },
+  { "onehalf",                           834, NULL },
+  { "lcommaaccent",                      278, NULL },
+  { "uhungarumlaut",                     611, NULL },
+  { "gbreve",                            611, NULL },
+  { "k",                                 556, NULL },
+  { "copyright",                         737, NULL },
+  { "Racute",                            722, NULL },
+  { "Gcommaaccent",                      778, NULL },
+  { "quoteleft",                         278, NULL },
+  { "registered",                        737, NULL },
+  { "aogonek",                           556, NULL },
+  { "Egrave",                            667, NULL },
+  { "ring",                              333, NULL },
+  { "emdash",                           1000, NULL },
+  { "five",                              556, NULL },
+  { "asciicircum",                       584, NULL },
+  { "X",                                 667, NULL },
+  { "oe",                                944, NULL },
+  { "Odieresis",                         778, NULL },
+  { "ccedilla",                          556, NULL },
+  { "g",                                 611, NULL },
+  { "colon",                             333, NULL },
+  { "Idotaccent",                        278, NULL },
+  { "cedilla",                           333, NULL },
+  { "plusminus",                         584, NULL },
+  { "Eth",                               722, NULL },
   { "quotedblright",                     500, NULL },
-  { "amacron",                           556, NULL },
-  { "sacute",                            556, NULL },
-  { "imacron",                           278, NULL },
-  { "cent",                              556, NULL },
-  { "currency",                          556, NULL },
-  { "logicalnot",                        584, NULL },
-  { "zdotaccent",                        500, NULL },
-  { "Atilde",                            722, NULL },
+  { "p",                                 611, NULL },
+  { "dotlessi",                          278, NULL },
+  { "radical",                           549, NULL },
+  { "Ntilde",                            722, NULL },
+  { "Aacute",                            722, NULL },
+  { "Scommaaccent",                      667, NULL },
+  { "b",                                 611, NULL },
+  { "K",                                 722, NULL },
+  { "Scaron",                            667, NULL },
+  { "degree",                            400, NULL },
+  { "section",                           556, NULL },
+  { "florin",                            556, NULL },
+  { "iogonek",                           278, NULL },
+  { "Euro",                              556, NULL },
+  { "paragraph",                         556, NULL },
+  { "zcaron",                            500, NULL },
+  { "lcaron",                            400, NULL },
+  { "Ydieresis",                         667, NULL },
+  { "aring",                             556, NULL },
   { "breve",                             333, NULL },
-  { "bar",                               280, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              584, NULL },
-  { "ecaron",                            556, NULL },
-  { "guilsinglleft",                     333, NULL },
-  { "exclam",                            333, NULL },
-  { "period",                            278, NULL },
-  { "Rcaron",                            722, NULL },
-  { "Kcommaaccent",                      722, NULL },
-  { "greater",                           584, NULL },
-  { "atilde",                            556, NULL },
-  { "brokenbar",                         280, NULL },
-  { "quoteleft",                         278, NULL },
-  { "Edotaccent",                        667, NULL },
-  { "onesuperior",                       333, NULL }
+  { "Amacron",                           722, NULL },
+  { "Dcaron",                            722, NULL },
+  { "ecircumflex",                       556, NULL },
+  { "Z",                                 611, NULL }
 };
 
 static BuiltinFontWidth helveticaBoldObliqueWidthsTab[] = {
-  { "Ntilde",                            722, NULL },
-  { "rcaron",                            389, NULL },
-  { "kcommaaccent",                      556, NULL },
+  { "divide",                            584, NULL },
+  { "emacron",                           556, NULL },
+  { "numbersign",                        556, NULL },
   { "Ncommaaccent",                      722, NULL },
-  { "Zacute",                            611, NULL },
-  { "comma",                             278, NULL },
-  { "cedilla",                           333, NULL },
-  { "plusminus",                         584, NULL },
+  { "amacron",                           556, NULL },
+  { "T",                                 611, NULL },
+  { "Ograve",                            778, NULL },
+  { "M",                                 833, NULL },
+  { "odieresis",                         611, NULL },
+  { "Aogonek",                           722, NULL },
+  { "brokenbar",                         280, NULL },
+  { "ecaron",                            556, NULL },
+  { "Thorn",                             667, NULL },
+  { "space",                             278, NULL },
+  { "twosuperior",                       333, NULL },
+  { "eth",                               611, NULL },
+  { "w",                                 778, NULL },
+  { "endash",                            556, NULL },
+  { "guillemotleft",                     556, NULL },
+  { "E",                                 667, NULL },
+  { "quotedblbase",                      500, NULL },
+  { "fl",                                611, NULL },
+  { "Igrave",                            278, NULL },
+  { "Ccedilla",                          722, NULL },
+  { "period",                            278, NULL },
+  { "scedilla",                          556, NULL },
+  { "udieresis",                         611, NULL },
+  { "zero",                              556, NULL },
+  { "thorn",                             611, NULL },
+  { "Ugrave",                            722, NULL },
+  { "germandbls",                        611, NULL },
+  { "bracketright",                      333, NULL },
+  { "W",                                 944, NULL },
+  { "commaaccent",                       250, NULL },
+  { "G",                                 778, NULL },
+  { "acircumflex",                       556, NULL },
+  { "Edotaccent",                        667, NULL },
+  { "perthousand",                      1000, NULL },
+  { "Uring",                             722, NULL },
+  { "F",                                 611, NULL },
+  { "Ocircumflex",                       778, NULL },
+  { "minus",                             584, NULL },
+  { "four",                              556, NULL },
+  { "ocircumflex",                       611, NULL },
+  { "less",                              584, NULL },
+  { "ae",                                889, NULL },
+  { "cent",                              556, NULL },
+  { "idieresis",                         278, NULL },
+  { "ogonek",                            333, NULL },
+  { "Zcaron",                            611, NULL },
   { "circumflex",                        333, NULL },
+  { "D",                                 722, NULL },
+  { "mu",                                611, NULL },
+  { "racute",                            389, NULL },
+  { "underscore",                        556, NULL },
+  { "tilde",                             333, NULL },
+  { "rcommaaccent",                      389, NULL },
+  { "Kcommaaccent",                      722, NULL },
+  { "imacron",                           278, NULL },
+  { "Nacute",                            722, NULL },
+  { "v",                                 556, NULL },
   { "dotaccent",                         333, NULL },
-  { "edotaccent",                        556, NULL },
-  { "asciitilde",                        584, NULL },
-  { "colon",                             333, NULL },
-  { "onehalf",                           834, NULL },
+  { "Tcommaaccent",                      611, NULL },
   { "dollar",                            556, NULL },
-  { "Lcaron",                            611, NULL },
-  { "ntilde",                            611, NULL },
-  { "Aogonek",                           722, NULL },
-  { "ncommaaccent",                      611, NULL },
-  { "minus",                             584, NULL },
-  { "Iogonek",                           278, NULL },
-  { "zacute",                            500, NULL },
+  { "lessequal",                         549, NULL },
+  { "Ucircumflex",                       722, NULL },
+  { "Omacron",                           778, NULL },
+  { "ccaron",                            556, NULL },
   { "yen",                               556, NULL },
-  { "space",                             278, NULL },
-  { "Omacron",                           778, NULL },
-  { "questiondown",                      611, NULL },
+  { "Y",                                 667, NULL },
+  { "hungarumlaut",                      333, NULL },
+  { "Ccaron",                            722, NULL },
+  { "j",                                 278, NULL },
+  { "currency",                          556, NULL },
+  { "nine",                              556, NULL },
+  { "parenleft",                         333, NULL },
+  { "grave",                             333, NULL },
+  { "Scedilla",                          667, NULL },
+  { "quotesinglbase",                    278, NULL },
+  { "g",                                 611, NULL },
+  { "colon",                             333, NULL },
+  { "ccedilla",                          556, NULL },
+  { "quotedblright",                     500, NULL },
+  { "Eth",                               722, NULL },
+  { "plusminus",                         584, NULL },
+  { "cedilla",                           333, NULL },
+  { "Idotaccent",                        278, NULL },
+  { "dotlessi",                          278, NULL },
+  { "p",                                 611, NULL },
+  { "Ntilde",                            722, NULL },
+  { "radical",                           549, NULL },
+  { "ring",                              333, NULL },
+  { "Egrave",                            667, NULL },
+  { "aogonek",                           556, NULL },
   { "emdash",                           1000, NULL },
-  { "Agrave",                            722, NULL },
-  { "three",                             556, NULL },
-  { "numbersign",                        556, NULL },
+  { "X",                                 667, NULL },
+  { "asciicircum",                       584, NULL },
+  { "five",                              556, NULL },
+  { "Odieresis",                         778, NULL },
+  { "oe",                                944, NULL },
+  { "aring",                             556, NULL },
+  { "Ydieresis",                         667, NULL },
   { "lcaron",                            400, NULL },
-  { "A",                                 722, NULL },
-  { "B",                                 722, NULL },
-  { "C",                                 722, NULL },
-  { "aogonek",                           556, NULL },
-  { "D",                                 722, NULL },
-  { "E",                                 667, NULL },
-  { "onequarter",                        834, NULL },
-  { "F",                                 611, NULL },
-  { "G",                                 778, NULL },
-  { "H",                                 722, NULL },
-  { "I",                                 278, NULL },
-  { "J",                                 556, NULL },
+  { "zcaron",                            500, NULL },
+  { "paragraph",                         556, NULL },
+  { "Amacron",                           722, NULL },
+  { "breve",                             333, NULL },
+  { "Z",                                 611, NULL },
+  { "ecircumflex",                       556, NULL },
+  { "Dcaron",                            722, NULL },
+  { "b",                                 611, NULL },
+  { "Scommaaccent",                      667, NULL },
+  { "Aacute",                            722, NULL },
   { "K",                                 722, NULL },
+  { "section",                           556, NULL },
+  { "Scaron",                            667, NULL },
+  { "degree",                            400, NULL },
+  { "Euro",                              556, NULL },
+  { "florin",                            556, NULL },
   { "iogonek",                           278, NULL },
-  { "backslash",                         278, NULL },
-  { "L",                                 611, NULL },
-  { "periodcentered",                    278, NULL },
-  { "M",                                 833, NULL },
+  { "o",                                 611, NULL },
+  { "percent",                           889, NULL },
+  { "onesuperior",                       333, NULL },
+  { "scommaaccent",                      556, NULL },
+  { "Emacron",                           667, NULL },
+  { "asterisk",                          389, NULL },
+  { "greater",                           584, NULL },
+  { "q",                                 611, NULL },
+  { "l",                                 278, NULL },
+  { "C",                                 722, NULL },
+  { "u",                                 611, NULL },
+  { "dagger",                            556, NULL },
+  { "equal",                             584, NULL },
   { "N",                                 722, NULL },
-  { "omacron",                           611, NULL },
-  { "Tcommaaccent",                      611, NULL },
-  { "O",                                 778, NULL },
-  { "P",                                 667, NULL },
-  { "Q",                                 778, NULL },
-  { "Uhungarumlaut",                     722, NULL },
-  { "R",                                 722, NULL },
-  { "Aacute",                            722, NULL },
-  { "caron",                             333, NULL },
-  { "S",                                 667, NULL },
-  { "T",                                 611, NULL },
-  { "U",                                 722, NULL },
-  { "agrave",                            556, NULL },
-  { "V",                                 667, NULL },
-  { "W",                                 944, NULL },
-  { "X",                                 667, NULL },
-  { "question",                          611, NULL },
-  { "equal",                             584, NULL },
-  { "Y",                                 667, NULL },
-  { "Z",                                 611, NULL },
-  { "four",                              556, NULL },
-  { "a",                                 556, NULL },
-  { "Gcommaaccent",                      778, NULL },
-  { "b",                                 611, NULL },
-  { "c",                                 556, NULL },
-  { "d",                                 611, NULL },
+  { "Imacron",                           278, NULL },
+  { "abreve",                            556, NULL },
+  { "iacute",                            278, NULL },
   { "e",                                 556, NULL },
-  { "f",                                 333, NULL },
-  { "g",                                 611, NULL },
-  { "bullet",                            350, NULL },
-  { "h",                                 611, NULL },
-  { "i",                                 278, NULL },
-  { "Oslash",                            778, NULL },
-  { "dagger",                            556, NULL },
-  { "j",                                 278, NULL },
+  { "icircumflex",                       278, NULL },
+  { "copyright",                         737, NULL },
   { "k",                                 556, NULL },
-  { "l",                                 278, NULL },
-  { "m",                                 889, NULL },
+  { "Racute",                            722, NULL },
+  { "Gcommaaccent",                      778, NULL },
+  { "registered",                        737, NULL },
+  { "quoteleft",                         278, NULL },
+  { "threesuperior",                     333, NULL },
+  { "zdotaccent",                        500, NULL },
+  { "Ecaron",                            667, NULL },
   { "n",                                 611, NULL },
-  { "tcommaaccent",                      333, NULL },
-  { "o",                                 611, NULL },
-  { "ordfeminine",                       370, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 611, NULL },
-  { "q",                                 611, NULL },
+  { "gbreve",                            611, NULL },
   { "uhungarumlaut",                     611, NULL },
-  { "r",                                 389, NULL },
-  { "twosuperior",                       333, NULL },
-  { "aacute",                            556, NULL },
-  { "s",                                 556, NULL },
-  { "OE",                               1000, NULL },
-  { "t",                                 333, NULL },
-  { "divide",                            584, NULL },
-  { "u",                                 611, NULL },
-  { "Ccaron",                            722, NULL },
-  { "v",                                 556, NULL },
-  { "w",                                 778, NULL },
-  { "x",                                 556, NULL },
-  { "y",                                 556, NULL },
-  { "z",                                 500, NULL },
-  { "Gbreve",                            778, NULL },
-  { "commaaccent",                       250, NULL },
-  { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        278, NULL },
-  { "Nacute",                            722, NULL },
-  { "quotedbl",                          474, NULL },
-  { "gcommaaccent",                      611, NULL },
-  { "mu",                                611, NULL },
+  { "lcommaaccent",                      278, NULL },
+  { "onehalf",                           834, NULL },
+  { "asciitilde",                        584, NULL },
+  { "Adieresis",                         722, NULL },
+  { "Sacute",                            667, NULL },
+  { "fraction",                          167, NULL },
+  { "atilde",                            556, NULL },
+  { "Zacute",                            611, NULL },
+  { "Uacute",                            722, NULL },
+  { "Acircumflex",                       722, NULL },
+  { "oslash",                            611, NULL },
+  { "notequal",                          549, NULL },
+  { "AE",                               1000, NULL },
+  { "Agrave",                            722, NULL },
+  { "exclam",                            333, NULL },
+  { "L",                                 611, NULL },
+  { "ohungarumlaut",                     611, NULL },
+  { "Ecircumflex",                       667, NULL },
+  { "threequarters",                     834, NULL },
+  { "J",                                 556, NULL },
   { "greaterequal",                      549, NULL },
-  { "Scaron",                            667, NULL },
+  { "at",                                975, NULL },
+  { "sterling",                          556, NULL },
+  { "H",                                 722, NULL },
   { "Lslash",                            611, NULL },
-  { "semicolon",                         333, NULL },
-  { "oslash",                            611, NULL },
-  { "lessequal",                         549, NULL },
-  { "lozenge",                           494, NULL },
+  { "Uogonek",                           722, NULL },
+  { "caron",                             333, NULL },
+  { "lacute",                            278, NULL },
+  { "sacute",                            556, NULL },
+  { "Idieresis",                         278, NULL },
+  { "Lacute",                            611, NULL },
+  { "Rcommaaccent",                      722, NULL },
+  { "ograve",                            611, NULL },
   { "parenright",                        333, NULL },
-  { "ccaron",                            556, NULL },
-  { "Ecircumflex",                       667, NULL },
-  { "gbreve",                            611, NULL },
-  { "trademark",                        1000, NULL },
-  { "daggerdbl",                         556, NULL },
-  { "nacute",                            611, NULL },
+  { "otilde",                            611, NULL },
+  { "Ohungarumlaut",                     778, NULL },
+  { "bracketleft",                       333, NULL },
+  { "gcommaaccent",                      611, NULL },
+  { "f",                                 333, NULL },
+  { "r",                                 389, NULL },
+  { "ucircumflex",                       611, NULL },
+  { "slash",                             278, NULL },
+  { "three",                             556, NULL },
+  { "Eogonek",                           667, NULL },
   { "macron",                            333, NULL },
-  { "Otilde",                            778, NULL },
-  { "Emacron",                           667, NULL },
-  { "ellipsis",                         1000, NULL },
-  { "scaron",                            556, NULL },
-  { "AE",                               1000, NULL },
-  { "Ucircumflex",                       722, NULL },
-  { "lslash",                            278, NULL },
-  { "quotedblleft",                      500, NULL },
+  { "Lcaron",                            611, NULL },
+  { "ordmasculine",                      365, NULL },
+  { "backslash",                         278, NULL },
+  { "questiondown",                      611, NULL },
+  { "semicolon",                         333, NULL },
   { "guilsinglright",                    333, NULL },
-  { "hyphen",                            333, NULL },
-  { "quotesingle",                       238, NULL },
-  { "eight",                             556, NULL },
+  { "uogonek",                           611, NULL },
+  { "quoteright",                        278, NULL },
+  { "Q",                                 778, NULL },
   { "exclamdown",                        333, NULL },
-  { "endash",                            556, NULL },
-  { "oe",                                944, NULL },
-  { "Abreve",                            722, NULL },
+  { "lozenge",                           494, NULL },
+  { "V",                                 667, NULL },
+  { "ncaron",                            611, NULL },
+  { "adieresis",                         556, NULL },
+  { "zacute",                            500, NULL },
   { "Umacron",                           722, NULL },
-  { "ecircumflex",                       556, NULL },
-  { "Adieresis",                         722, NULL },
-  { "copyright",                         737, NULL },
-  { "Egrave",                            667, NULL },
-  { "slash",                             278, NULL },
-  { "Edieresis",                         667, NULL },
-  { "otilde",                            611, NULL },
-  { "Idieresis",                         278, NULL },
-  { "parenleft",                         333, NULL },
+  { "c",                                 556, NULL },
+  { "d",                                 611, NULL },
+  { "periodcentered",                    278, NULL },
+  { "eight",                             556, NULL },
+  { "I",                                 278, NULL },
   { "one",                               556, NULL },
-  { "emacron",                           556, NULL },
-  { "Odieresis",                         778, NULL },
-  { "ucircumflex",                       611, NULL },
-  { "bracketleft",                       333, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        278, NULL },
-  { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         667, NULL },
-  { "umacron",                           611, NULL },
-  { "abreve",                            556, NULL },
-  { "Eacute",                            667, NULL },
-  { "adieresis",                         556, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "z",                                 500, NULL },
+  { "uring",                             611, NULL },
+  { "s",                                 556, NULL },
   { "egrave",                            556, NULL },
-  { "edieresis",                         556, NULL },
-  { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
-  { "ae",                                889, NULL },
-  { "asterisk",                          389, NULL },
-  { "odieresis",                         611, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            611, NULL },
-  { "nine",                              556, NULL },
-  { "five",                              556, NULL },
-  { "udieresis",                         611, NULL },
-  { "Zcaron",                            611, NULL },
-  { "Scommaaccent",                      667, NULL },
-  { "threequarters",                     834, NULL },
-  { "guillemotright",                    556, NULL },
-  { "Ccedilla",                          722, NULL },
-  { "ydieresis",                         556, NULL },
-  { "tilde",                             333, NULL },
-  { "at",                                975, NULL },
-  { "eacute",                            556, NULL },
-  { "underscore",                        556, NULL },
-  { "Euro",                              556, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          584, NULL },
-  { "zero",                              556, NULL },
-  { "eth",                               611, NULL },
-  { "Scedilla",                          667, NULL },
-  { "Ograve",                            778, NULL },
-  { "Racute",                            722, NULL },
-  { "partialdiff",                       494, NULL },
-  { "uacute",                            611, NULL },
-  { "braceleft",                         389, NULL },
-  { "Thorn",                             667, NULL },
-  { "zcaron",                            500, NULL },
-  { "scommaaccent",                      556, NULL },
-  { "ccedilla",                          556, NULL },
-  { "Dcaron",                            722, NULL },
-  { "dcroat",                            611, NULL },
-  { "Ocircumflex",                       778, NULL },
   { "Oacute",                            778, NULL },
-  { "scedilla",                          556, NULL },
-  { "ogonek",                            333, NULL },
-  { "ograve",                            611, NULL },
-  { "racute",                            389, NULL },
-  { "Tcaron",                            611, NULL },
-  { "Eogonek",                           667, NULL },
-  { "thorn",                             611, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        737, NULL },
-  { "radical",                           549, NULL },
+  { "quotedbl",                          474, NULL },
+  { "t",                                 333, NULL },
   { "Aring",                             722, NULL },
-  { "percent",                           889, NULL },
+  { "ellipsis",                         1000, NULL },
+  { "agrave",                            556, NULL },
+  { "bar",                               280, NULL },
+  { "quotesingle",                       238, NULL },
+  { "multiply",                          584, NULL },
+  { "i",                                 278, NULL },
+  { "P",                                 667, NULL },
+  { "lslash",                            278, NULL },
   { "six",                               556, NULL },
-  { "paragraph",                         556, NULL },
-  { "dcaron",                            743, NULL },
-  { "Uogonek",                           722, NULL },
-  { "two",                               556, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            278, NULL },
-  { "Lacute",                            611, NULL },
-  { "ocircumflex",                       611, NULL },
+  { "edotaccent",                        556, NULL },
+  { "daggerdbl",                         556, NULL },
+  { "Yacute",                            667, NULL },
   { "oacute",                            611, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      611, NULL },
+  { "Edieresis",                         667, NULL },
+  { "Atilde",                            722, NULL },
+  { "onequarter",                        834, NULL },
+  { "braceright",                        389, NULL },
+  { "braceleft",                         389, NULL },
+  { "acute",                             333, NULL },
+  { "partialdiff",                       494, NULL },
+  { "U",                                 722, NULL },
+  { "m",                                 889, NULL },
+  { "OE",                               1000, NULL },
+  { "Ncaron",                            722, NULL },
+  { "x",                                 556, NULL },
+  { "edieresis",                         556, NULL },
+  { "Iogonek",                           278, NULL },
+  { "y",                                 556, NULL },
   { "tcaron",                            389, NULL },
-  { "eogonek",                           556, NULL },
+  { "rcaron",                            389, NULL },
+  { "cacute",                            556, NULL },
+  { "Dcroat",                            722, NULL },
+  { "tcommaaccent",                      333, NULL },
+  { "logicalnot",                        584, NULL },
+  { "ncommaaccent",                      611, NULL },
+  { "plus",                              584, NULL },
+  { "guilsinglleft",                     333, NULL },
+  { "h",                                 611, NULL },
+  { "Cacute",                            722, NULL },
+  { "A",                                 722, NULL },
+  { "question",                          611, NULL },
+  { "summation",                         600, NULL },
+  { "igrave",                            278, NULL },
+  { "dcroat",                            611, NULL },
+  { "Oslash",                            778, NULL },
+  { "hyphen",                            333, NULL },
+  { "a",                                 556, NULL },
+  { "ugrave",                            611, NULL },
+  { "dcaron",                            743, NULL },
+  { "Rcaron",                            722, NULL },
+  { "kcommaaccent",                      556, NULL },
+  { "yacute",                            556, NULL },
+  { "ydieresis",                         556, NULL },
+  { "R",                                 722, NULL },
+  { "B",                                 722, NULL },
+  { "aacute",                            556, NULL },
+  { "Tcaron",                            611, NULL },
+  { "Otilde",                            778, NULL },
+  { "umacron",                           611, NULL },
+  { "ordfeminine",                       370, NULL },
+  { "quotedblleft",                      500, NULL },
+  { "S",                                 667, NULL },
+  { "Gbreve",                            778, NULL },
+  { "omacron",                           611, NULL },
   { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     778, NULL },
-  { "asciicircum",                       584, NULL },
-  { "aring",                             556, NULL },
-  { "grave",                             333, NULL },
-  { "uogonek",                           611, NULL },
-  { "bracketright",                      333, NULL },
-  { "Iacute",                            278, NULL },
-  { "ampersand",                         722, NULL },
-  { "igrave",                            278, NULL },
-  { "lacute",                            278, NULL },
-  { "Ncaron",                            722, NULL },
-  { "plus",                              584, NULL },
-  { "uring",                             611, NULL },
-  { "quotesinglbase",                    278, NULL },
-  { "lcommaaccent",                      278, NULL },
-  { "Yacute",                            667, NULL },
-  { "ohungarumlaut",                     611, NULL },
-  { "threesuperior",                     333, NULL },
-  { "acute",                             333, NULL },
-  { "section",                           556, NULL },
+  { "comma",                             278, NULL },
+  { "O",                                 778, NULL },
+  { "Icircumflex",                       278, NULL },
+  { "nacute",                            611, NULL },
+  { "Eacute",                            667, NULL },
   { "dieresis",                          333, NULL },
-  { "iacute",                            278, NULL },
-  { "quotedblbase",                      500, NULL },
-  { "ncaron",                            611, NULL },
-  { "florin",                            556, NULL },
-  { "yacute",                            556, NULL },
-  { "Rcommaaccent",                      722, NULL },
   { "fi",                                611, NULL },
-  { "fl",                                611, NULL },
-  { "Acircumflex",                       722, NULL },
-  { "Cacute",                            722, NULL },
-  { "Icircumflex",                       278, NULL },
-  { "guillemotleft",                     556, NULL },
-  { "germandbls",                        611, NULL },
-  { "Amacron",                           722, NULL },
+  { "ntilde",                            611, NULL },
+  { "Lcommaaccent",                      611, NULL },
+  { "trademark",                        1000, NULL },
+  { "ampersand",                         722, NULL },
+  { "Zdotaccent",                        611, NULL },
+  { "bullet",                            350, NULL },
+  { "eogonek",                           556, NULL },
+  { "eacute",                            556, NULL },
+  { "guillemotright",                    556, NULL },
+  { "scaron",                            556, NULL },
   { "seven",                             556, NULL },
-  { "Sacute",                            667, NULL },
-  { "ordmasculine",                      365, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          556, NULL },
-  { "notequal",                          549, NULL },
-  { "Imacron",                           278, NULL },
-  { "rcommaaccent",                      389, NULL },
-  { "Zdotaccent",                        611, NULL },
-  { "acircumflex",                       556, NULL },
-  { "cacute",                            556, NULL },
-  { "Ecaron",                            667, NULL },
-  { "icircumflex",                       278, NULL },
-  { "braceright",                        389, NULL },
-  { "quotedblright",                     500, NULL },
-  { "amacron",                           556, NULL },
-  { "sacute",                            556, NULL },
-  { "imacron",                           278, NULL },
-  { "cent",                              556, NULL },
-  { "currency",                          556, NULL },
-  { "logicalnot",                        584, NULL },
-  { "zdotaccent",                        500, NULL },
-  { "Atilde",                            722, NULL },
-  { "breve",                             333, NULL },
-  { "bar",                               280, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              584, NULL },
-  { "ecaron",                            556, NULL },
-  { "guilsinglleft",                     333, NULL },
-  { "exclam",                            333, NULL },
-  { "period",                            278, NULL },
-  { "Rcaron",                            722, NULL },
-  { "Kcommaaccent",                      722, NULL },
-  { "greater",                           584, NULL },
-  { "atilde",                            556, NULL },
-  { "brokenbar",                         280, NULL },
-  { "quoteleft",                         278, NULL },
-  { "Edotaccent",                        667, NULL },
-  { "onesuperior",                       333, NULL }
+  { "two",                               556, NULL },
+  { "uacute",                            611, NULL },
+  { "Iacute",                            278, NULL },
+  { "Udieresis",                         722, NULL },
+  { "Abreve",                            722, NULL }
 };
 
 static BuiltinFontWidth helveticaObliqueWidthsTab[] = {
-  { "Ntilde",                            722, NULL },
-  { "rcaron",                            333, NULL },
+  { "dieresis",                          333, NULL },
+  { "Eacute",                            667, NULL },
+  { "Icircumflex",                       278, NULL },
+  { "O",                                 778, NULL },
+  { "nacute",                            556, NULL },
+  { "trademark",                        1000, NULL },
+  { "ampersand",                         667, NULL },
+  { "Lcommaaccent",                      556, NULL },
+  { "ntilde",                            556, NULL },
+  { "fi",                                500, NULL },
+  { "scaron",                            500, NULL },
+  { "guillemotright",                    556, NULL },
+  { "eacute",                            556, NULL },
+  { "eogonek",                           556, NULL },
+  { "bullet",                            350, NULL },
+  { "Zdotaccent",                        611, NULL },
+  { "Abreve",                            667, NULL },
+  { "Udieresis",                         722, NULL },
+  { "Iacute",                            278, NULL },
+  { "two",                               556, NULL },
+  { "uacute",                            556, NULL },
+  { "seven",                             556, NULL },
+  { "B",                                 667, NULL },
+  { "Rcaron",                            722, NULL },
   { "kcommaaccent",                      500, NULL },
-  { "Ncommaaccent",                      722, NULL },
-  { "Zacute",                            611, NULL },
+  { "yacute",                            500, NULL },
+  { "R",                                 722, NULL },
+  { "ydieresis",                         500, NULL },
+  { "ugrave",                            556, NULL },
+  { "dcaron",                            643, NULL },
+  { "Oslash",                            778, NULL },
+  { "hyphen",                            333, NULL },
+  { "a",                                 556, NULL },
+  { "umacron",                           556, NULL },
+  { "Otilde",                            778, NULL },
+  { "Tcaron",                            611, NULL },
+  { "aacute",                            556, NULL },
+  { "quotedblleft",                      333, NULL },
+  { "ordfeminine",                       370, NULL },
+  { "omacron",                           556, NULL },
+  { "Delta",                             612, NULL },
   { "comma",                             278, NULL },
-  { "cedilla",                           333, NULL },
-  { "plusminus",                         584, NULL },
-  { "circumflex",                        333, NULL },
-  { "dotaccent",                         333, NULL },
-  { "edotaccent",                        556, NULL },
-  { "asciitilde",                        584, NULL },
-  { "colon",                             278, NULL },
-  { "onehalf",                           834, NULL },
-  { "dollar",                            556, NULL },
-  { "Lcaron",                            556, NULL },
-  { "ntilde",                            556, NULL },
-  { "Aogonek",                           667, NULL },
+  { "Gbreve",                            778, NULL },
+  { "S",                                 667, NULL },
+  { "x",                                 500, NULL },
+  { "y",                                 500, NULL },
+  { "Iogonek",                           278, NULL },
+  { "edieresis",                         556, NULL },
+  { "Ncaron",                            722, NULL },
+  { "m",                                 833, NULL },
+  { "OE",                               1000, NULL },
+  { "partialdiff",                       476, NULL },
+  { "U",                                 722, NULL },
   { "ncommaaccent",                      556, NULL },
-  { "minus",                             584, NULL },
-  { "Iogonek",                           278, NULL },
-  { "zacute",                            500, NULL },
-  { "yen",                               556, NULL },
-  { "space",                             278, NULL },
-  { "Omacron",                           778, NULL },
-  { "questiondown",                      611, NULL },
-  { "emdash",                           1000, NULL },
-  { "Agrave",                            667, NULL },
-  { "three",                             556, NULL },
-  { "numbersign",                        556, NULL },
-  { "lcaron",                            299, NULL },
+  { "tcommaaccent",                      278, NULL },
+  { "logicalnot",                        584, NULL },
+  { "cacute",                            500, NULL },
+  { "Dcroat",                            722, NULL },
+  { "tcaron",                            317, NULL },
+  { "rcaron",                            333, NULL },
+  { "guilsinglleft",                     333, NULL },
+  { "Cacute",                            722, NULL },
+  { "h",                                 556, NULL },
+  { "plus",                              584, NULL },
+  { "igrave",                            278, NULL },
+  { "dcroat",                            556, NULL },
+  { "question",                          556, NULL },
+  { "summation",                         600, NULL },
   { "A",                                 667, NULL },
-  { "B",                                 667, NULL },
-  { "C",                                 722, NULL },
-  { "aogonek",                           556, NULL },
-  { "D",                                 722, NULL },
-  { "E",                                 667, NULL },
+  { "multiply",                          584, NULL },
+  { "i",                                 222, NULL },
+  { "quotesingle",                       191, NULL },
+  { "bar",                               260, NULL },
+  { "six",                               556, NULL },
+  { "edotaccent",                        556, NULL },
+  { "lslash",                            222, NULL },
+  { "P",                                 667, NULL },
+  { "Atilde",                            667, NULL },
+  { "Edieresis",                         667, NULL },
+  { "oacute",                            556, NULL },
+  { "Yacute",                            667, NULL },
+  { "daggerdbl",                         556, NULL },
+  { "braceleft",                         334, NULL },
+  { "braceright",                        334, NULL },
+  { "acute",                             333, NULL },
   { "onequarter",                        834, NULL },
-  { "F",                                 611, NULL },
-  { "G",                                 778, NULL },
-  { "H",                                 722, NULL },
+  { "one",                               556, NULL },
   { "I",                                 278, NULL },
-  { "J",                                 500, NULL },
-  { "K",                                 667, NULL },
-  { "iogonek",                           222, NULL },
-  { "backslash",                         278, NULL },
-  { "L",                                 556, NULL },
+  { "eight",                             556, NULL },
   { "periodcentered",                    278, NULL },
-  { "M",                                 833, NULL },
-  { "N",                                 722, NULL },
-  { "omacron",                           556, NULL },
-  { "Tcommaaccent",                      611, NULL },
-  { "O",                                 778, NULL },
-  { "P",                                 667, NULL },
-  { "Q",                                 778, NULL },
-  { "Uhungarumlaut",                     722, NULL },
-  { "R",                                 722, NULL },
-  { "Aacute",                            667, NULL },
-  { "caron",                             333, NULL },
-  { "S",                                 667, NULL },
-  { "T",                                 611, NULL },
-  { "U",                                 722, NULL },
-  { "agrave",                            556, NULL },
-  { "V",                                 667, NULL },
-  { "W",                                 944, NULL },
-  { "X",                                 667, NULL },
-  { "question",                          556, NULL },
-  { "equal",                             584, NULL },
-  { "Y",                                 667, NULL },
-  { "Z",                                 611, NULL },
-  { "four",                              556, NULL },
-  { "a",                                 556, NULL },
-  { "Gcommaaccent",                      778, NULL },
-  { "b",                                 556, NULL },
   { "c",                                 500, NULL },
   { "d",                                 556, NULL },
-  { "e",                                 556, NULL },
-  { "f",                                 278, NULL },
-  { "g",                                 556, NULL },
-  { "bullet",                            350, NULL },
-  { "h",                                 556, NULL },
-  { "i",                                 222, NULL },
-  { "Oslash",                            778, NULL },
-  { "dagger",                            556, NULL },
-  { "j",                                 222, NULL },
-  { "k",                                 500, NULL },
-  { "l",                                 222, NULL },
-  { "m",                                 833, NULL },
-  { "n",                                 556, NULL },
-  { "tcommaaccent",                      278, NULL },
-  { "o",                                 556, NULL },
-  { "ordfeminine",                       370, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 556, NULL },
-  { "q",                                 556, NULL },
-  { "uhungarumlaut",                     556, NULL },
-  { "r",                                 333, NULL },
-  { "twosuperior",                       333, NULL },
-  { "aacute",                            556, NULL },
+  { "egrave",                            556, NULL },
+  { "uring",                             556, NULL },
   { "s",                                 500, NULL },
-  { "OE",                               1000, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "z",                                 500, NULL },
   { "t",                                 278, NULL },
-  { "divide",                            584, NULL },
-  { "u",                                 556, NULL },
-  { "Ccaron",                            722, NULL },
-  { "v",                                 500, NULL },
-  { "w",                                 722, NULL },
-  { "x",                                 500, NULL },
-  { "y",                                 500, NULL },
-  { "z",                                 500, NULL },
-  { "Gbreve",                            778, NULL },
-  { "commaaccent",                       250, NULL },
-  { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        278, NULL },
-  { "Nacute",                            722, NULL },
   { "quotedbl",                          355, NULL },
-  { "gcommaaccent",                      556, NULL },
-  { "mu",                                556, NULL },
-  { "greaterequal",                      549, NULL },
-  { "Scaron",                            667, NULL },
-  { "Lslash",                            556, NULL },
+  { "Oacute",                            778, NULL },
+  { "agrave",                            556, NULL },
+  { "ellipsis",                         1000, NULL },
+  { "Aring",                             667, NULL },
+  { "three",                             556, NULL },
+  { "slash",                             278, NULL },
+  { "ucircumflex",                       556, NULL },
+  { "r",                                 333, NULL },
+  { "macron",                            333, NULL },
+  { "Eogonek",                           667, NULL },
+  { "Lcaron",                            556, NULL },
+  { "questiondown",                      611, NULL },
+  { "ordmasculine",                      365, NULL },
+  { "backslash",                         278, NULL },
+  { "uogonek",                           556, NULL },
+  { "quoteright",                        222, NULL },
   { "semicolon",                         278, NULL },
-  { "oslash",                            611, NULL },
-  { "lessequal",                         549, NULL },
+  { "guilsinglright",                    333, NULL },
+  { "Umacron",                           722, NULL },
+  { "zacute",                            500, NULL },
+  { "ncaron",                            556, NULL },
+  { "adieresis",                         556, NULL },
   { "lozenge",                           471, NULL },
+  { "V",                                 667, NULL },
+  { "Q",                                 778, NULL },
+  { "exclamdown",                        333, NULL },
+  { "Lacute",                            556, NULL },
+  { "sacute",                            500, NULL },
+  { "Idieresis",                         278, NULL },
+  { "ograve",                            556, NULL },
+  { "Rcommaaccent",                      722, NULL },
+  { "gcommaaccent",                      556, NULL },
+  { "Ohungarumlaut",                     778, NULL },
+  { "bracketleft",                       278, NULL },
+  { "otilde",                            556, NULL },
   { "parenright",                        333, NULL },
-  { "ccaron",                            500, NULL },
+  { "f",                                 278, NULL },
+  { "asciitilde",                        584, NULL },
+  { "Uacute",                            722, NULL },
+  { "atilde",                            556, NULL },
+  { "Zacute",                            611, NULL },
+  { "fraction",                          167, NULL },
+  { "Sacute",                            667, NULL },
+  { "Adieresis",                         667, NULL },
+  { "threequarters",                     834, NULL },
+  { "J",                                 500, NULL },
+  { "ohungarumlaut",                     556, NULL },
   { "Ecircumflex",                       667, NULL },
+  { "L",                                 556, NULL },
+  { "notequal",                          549, NULL },
+  { "exclam",                            278, NULL },
+  { "Agrave",                            667, NULL },
+  { "AE",                               1000, NULL },
+  { "Acircumflex",                       667, NULL },
+  { "oslash",                            611, NULL },
+  { "Uogonek",                           722, NULL },
+  { "caron",                             333, NULL },
+  { "Lslash",                            556, NULL },
+  { "lacute",                            222, NULL },
+  { "sterling",                          556, NULL },
+  { "H",                                 722, NULL },
+  { "at",                               1015, NULL },
+  { "greaterequal",                      549, NULL },
+  { "Racute",                            722, NULL },
+  { "k",                                 500, NULL },
+  { "copyright",                         737, NULL },
+  { "quoteleft",                         222, NULL },
+  { "registered",                        737, NULL },
+  { "Gcommaaccent",                      778, NULL },
+  { "n",                                 556, NULL },
+  { "Ecaron",                            667, NULL },
+  { "threesuperior",                     333, NULL },
+  { "zdotaccent",                        500, NULL },
+  { "lcommaaccent",                      222, NULL },
+  { "onehalf",                           834, NULL },
   { "gbreve",                            556, NULL },
-  { "trademark",                        1000, NULL },
-  { "daggerdbl",                         556, NULL },
-  { "nacute",                            556, NULL },
-  { "macron",                            333, NULL },
-  { "Otilde",                            778, NULL },
+  { "uhungarumlaut",                     556, NULL },
+  { "percent",                           889, NULL },
+  { "o",                                 556, NULL },
+  { "greater",                           584, NULL },
+  { "asterisk",                          389, NULL },
   { "Emacron",                           667, NULL },
-  { "ellipsis",                         1000, NULL },
-  { "scaron",                            500, NULL },
-  { "AE",                               1000, NULL },
-  { "Ucircumflex",                       722, NULL },
-  { "lslash",                            222, NULL },
-  { "quotedblleft",                      333, NULL },
-  { "guilsinglright",                    333, NULL },
-  { "hyphen",                            333, NULL },
-  { "quotesingle",                       191, NULL },
-  { "eight",                             556, NULL },
-  { "exclamdown",                        333, NULL },
-  { "endash",                            556, NULL },
-  { "oe",                                944, NULL },
-  { "Abreve",                            667, NULL },
-  { "Umacron",                           722, NULL },
+  { "scommaaccent",                      500, NULL },
+  { "onesuperior",                       333, NULL },
+  { "dagger",                            556, NULL },
+  { "equal",                             584, NULL },
+  { "N",                                 722, NULL },
+  { "C",                                 722, NULL },
+  { "u",                                 556, NULL },
+  { "q",                                 556, NULL },
+  { "l",                                 222, NULL },
+  { "icircumflex",                       278, NULL },
+  { "Imacron",                           278, NULL },
+  { "abreve",                            556, NULL },
+  { "iacute",                            278, NULL },
+  { "e",                                 556, NULL },
+  { "lcaron",                            299, NULL },
+  { "paragraph",                         537, NULL },
+  { "zcaron",                            500, NULL },
+  { "aring",                             556, NULL },
+  { "Ydieresis",                         667, NULL },
+  { "Dcaron",                            722, NULL },
+  { "Z",                                 611, NULL },
   { "ecircumflex",                       556, NULL },
-  { "Adieresis",                         667, NULL },
-  { "copyright",                         737, NULL },
+  { "Amacron",                           667, NULL },
+  { "breve",                             333, NULL },
+  { "K",                                 667, NULL },
+  { "Scommaaccent",                      667, NULL },
+  { "Aacute",                            667, NULL },
+  { "b",                                 556, NULL },
+  { "Euro",                              556, NULL },
+  { "iogonek",                           222, NULL },
+  { "florin",                            556, NULL },
+  { "section",                           556, NULL },
+  { "Scaron",                            667, NULL },
+  { "degree",                            400, NULL },
+  { "plusminus",                         584, NULL },
+  { "cedilla",                           333, NULL },
+  { "Idotaccent",                        278, NULL },
+  { "quotedblright",                     333, NULL },
+  { "Eth",                               722, NULL },
+  { "colon",                             278, NULL },
+  { "g",                                 556, NULL },
+  { "ccedilla",                          500, NULL },
+  { "Ntilde",                            722, NULL },
+  { "radical",                           453, NULL },
+  { "dotlessi",                          278, NULL },
+  { "p",                                 556, NULL },
+  { "emdash",                           1000, NULL },
+  { "aogonek",                           556, NULL },
   { "Egrave",                            667, NULL },
-  { "slash",                             278, NULL },
-  { "Edieresis",                         667, NULL },
-  { "otilde",                            556, NULL },
-  { "Idieresis",                         278, NULL },
+  { "ring",                              333, NULL },
+  { "Odieresis",                         778, NULL },
+  { "oe",                                944, NULL },
+  { "five",                              556, NULL },
+  { "X",                                 667, NULL },
+  { "asciicircum",                       469, NULL },
+  { "ccaron",                            500, NULL },
+  { "Omacron",                           778, NULL },
+  { "lessequal",                         549, NULL },
+  { "Ucircumflex",                       722, NULL },
+  { "hungarumlaut",                      333, NULL },
+  { "j",                                 222, NULL },
+  { "Ccaron",                            722, NULL },
+  { "yen",                               556, NULL },
+  { "Y",                                 667, NULL },
   { "parenleft",                         333, NULL },
-  { "one",                               556, NULL },
-  { "emacron",                           556, NULL },
-  { "Odieresis",                         778, NULL },
-  { "ucircumflex",                       556, NULL },
-  { "bracketleft",                       278, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        222, NULL },
-  { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         667, NULL },
-  { "umacron",                           556, NULL },
-  { "abreve",                            556, NULL },
-  { "Eacute",                            667, NULL },
-  { "adieresis",                         556, NULL },
-  { "egrave",                            556, NULL },
-  { "edieresis",                         556, NULL },
-  { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
+  { "currency",                          556, NULL },
+  { "nine",                              556, NULL },
+  { "quotesinglbase",                    222, NULL },
+  { "grave",                             333, NULL },
+  { "Scedilla",                          667, NULL },
   { "ae",                                889, NULL },
-  { "asterisk",                          389, NULL },
-  { "odieresis",                         556, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            556, NULL },
-  { "nine",                              556, NULL },
-  { "five",                              556, NULL },
-  { "udieresis",                         556, NULL },
+  { "cent",                              556, NULL },
+  { "ocircumflex",                       556, NULL },
+  { "less",                              584, NULL },
+  { "minus",                             584, NULL },
+  { "four",                              556, NULL },
+  { "circumflex",                        333, NULL },
   { "Zcaron",                            611, NULL },
-  { "Scommaaccent",                      667, NULL },
-  { "threequarters",                     834, NULL },
-  { "guillemotright",                    556, NULL },
-  { "Ccedilla",                          722, NULL },
-  { "ydieresis",                         500, NULL },
+  { "ogonek",                            333, NULL },
+  { "idieresis",                         278, NULL },
+  { "rcommaaccent",                      333, NULL },
+  { "Kcommaaccent",                      667, NULL },
+  { "imacron",                           278, NULL },
   { "tilde",                             333, NULL },
-  { "at",                               1015, NULL },
-  { "eacute",                            556, NULL },
   { "underscore",                        556, NULL },
-  { "Euro",                              556, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          584, NULL },
+  { "D",                                 722, NULL },
+  { "mu",                                556, NULL },
+  { "racute",                            333, NULL },
+  { "Tcommaaccent",                      611, NULL },
+  { "dollar",                            556, NULL },
+  { "v",                                 500, NULL },
+  { "Nacute",                            722, NULL },
+  { "dotaccent",                         333, NULL },
   { "zero",                              556, NULL },
-  { "eth",                               556, NULL },
-  { "Scedilla",                          667, NULL },
-  { "Ograve",                            778, NULL },
-  { "Racute",                            722, NULL },
-  { "partialdiff",                       476, NULL },
-  { "uacute",                            556, NULL },
-  { "braceleft",                         334, NULL },
-  { "Thorn",                             667, NULL },
-  { "zcaron",                            500, NULL },
-  { "scommaaccent",                      500, NULL },
-  { "ccedilla",                          500, NULL },
-  { "Dcaron",                            722, NULL },
-  { "dcroat",                            556, NULL },
-  { "Ocircumflex",                       778, NULL },
-  { "Oacute",                            778, NULL },
   { "scedilla",                          500, NULL },
-  { "ogonek",                            333, NULL },
-  { "ograve",                            556, NULL },
-  { "racute",                            333, NULL },
-  { "Tcaron",                            611, NULL },
-  { "Eogonek",                           667, NULL },
-  { "thorn",                             556, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        737, NULL },
-  { "radical",                           453, NULL },
-  { "Aring",                             667, NULL },
-  { "percent",                           889, NULL },
-  { "six",                               556, NULL },
-  { "paragraph",                         537, NULL },
-  { "dcaron",                            643, NULL },
-  { "Uogonek",                           722, NULL },
-  { "two",                               556, NULL },
-  { "summation",                         600, NULL },
+  { "period",                            278, NULL },
+  { "udieresis",                         556, NULL },
+  { "Ccedilla",                          722, NULL },
   { "Igrave",                            278, NULL },
-  { "Lacute",                            556, NULL },
-  { "ocircumflex",                       556, NULL },
-  { "oacute",                            556, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      556, NULL },
-  { "tcaron",                            317, NULL },
-  { "eogonek",                           556, NULL },
-  { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     778, NULL },
-  { "asciicircum",                       469, NULL },
-  { "aring",                             556, NULL },
-  { "grave",                             333, NULL },
-  { "uogonek",                           556, NULL },
+  { "commaaccent",                       250, NULL },
+  { "W",                                 944, NULL },
   { "bracketright",                      278, NULL },
-  { "Iacute",                            278, NULL },
-  { "ampersand",                         667, NULL },
-  { "igrave",                            278, NULL },
-  { "lacute",                            222, NULL },
-  { "Ncaron",                            722, NULL },
-  { "plus",                              584, NULL },
-  { "uring",                             556, NULL },
-  { "quotesinglbase",                    222, NULL },
-  { "lcommaaccent",                      222, NULL },
-  { "Yacute",                            667, NULL },
-  { "ohungarumlaut",                     556, NULL },
-  { "threesuperior",                     333, NULL },
-  { "acute",                             333, NULL },
-  { "section",                           556, NULL },
-  { "dieresis",                          333, NULL },
-  { "iacute",                            278, NULL },
-  { "quotedblbase",                      333, NULL },
-  { "ncaron",                            556, NULL },
-  { "florin",                            556, NULL },
-  { "yacute",                            500, NULL },
-  { "Rcommaaccent",                      722, NULL },
-  { "fi",                                500, NULL },
-  { "fl",                                500, NULL },
-  { "Acircumflex",                       667, NULL },
-  { "Cacute",                            722, NULL },
-  { "Icircumflex",                       278, NULL },
-  { "guillemotleft",                     556, NULL },
+  { "Ugrave",                            722, NULL },
   { "germandbls",                        611, NULL },
-  { "Amacron",                           667, NULL },
-  { "seven",                             556, NULL },
-  { "Sacute",                            667, NULL },
-  { "ordmasculine",                      365, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          556, NULL },
-  { "notequal",                          549, NULL },
-  { "Imacron",                           278, NULL },
-  { "rcommaaccent",                      333, NULL },
-  { "Zdotaccent",                        611, NULL },
+  { "thorn",                             556, NULL },
+  { "G",                                 778, NULL },
+  { "Ocircumflex",                       778, NULL },
+  { "F",                                 611, NULL },
+  { "Uring",                             722, NULL },
+  { "perthousand",                      1000, NULL },
+  { "Edotaccent",                        667, NULL },
   { "acircumflex",                       556, NULL },
-  { "cacute",                            500, NULL },
-  { "Ecaron",                            667, NULL },
-  { "icircumflex",                       278, NULL },
-  { "braceright",                        334, NULL },
-  { "quotedblright",                     333, NULL },
   { "amacron",                           556, NULL },
-  { "sacute",                            500, NULL },
-  { "imacron",                           278, NULL },
-  { "cent",                              556, NULL },
-  { "currency",                          556, NULL },
-  { "logicalnot",                        584, NULL },
-  { "zdotaccent",                        500, NULL },
-  { "Atilde",                            667, NULL },
-  { "breve",                             333, NULL },
-  { "bar",                               260, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              584, NULL },
+  { "Ncommaaccent",                      722, NULL },
+  { "numbersign",                        556, NULL },
+  { "divide",                            584, NULL },
+  { "emacron",                           556, NULL },
+  { "M",                                 833, NULL },
+  { "odieresis",                         556, NULL },
+  { "Ograve",                            778, NULL },
+  { "T",                                 611, NULL },
+  { "w",                                 722, NULL },
+  { "Thorn",                             667, NULL },
+  { "space",                             278, NULL },
+  { "twosuperior",                       333, NULL },
+  { "eth",                               556, NULL },
   { "ecaron",                            556, NULL },
-  { "guilsinglleft",                     333, NULL },
-  { "exclam",                            278, NULL },
-  { "period",                            278, NULL },
-  { "Rcaron",                            722, NULL },
-  { "Kcommaaccent",                      667, NULL },
-  { "greater",                           584, NULL },
-  { "atilde",                            556, NULL },
   { "brokenbar",                         260, NULL },
-  { "quoteleft",                         222, NULL },
-  { "Edotaccent",                        667, NULL },
-  { "onesuperior",                       333, NULL }
+  { "Aogonek",                           667, NULL },
+  { "fl",                                500, NULL },
+  { "E",                                 667, NULL },
+  { "quotedblbase",                      333, NULL },
+  { "guillemotleft",                     556, NULL },
+  { "endash",                            556, NULL }
 };
 
 static BuiltinFontWidth symbolWidthsTab[] = {
-  { "bracketleftex",                     384, NULL },
-  { "alpha",                             631, NULL },
-  { "union",                             768, NULL },
-  { "infinity",                          713, NULL },
-  { "comma",                             250, NULL },
   { "copyrightsans",                     790, NULL },
+  { "Upsilon",                           690, NULL },
+  { "sigma",                             603, NULL },
+  { "kappa",                             549, NULL },
+  { "circleplus",                        768, NULL },
+  { "degree",                            400, NULL },
+  { "florin",                            500, NULL },
+  { "Euro",                              750, NULL },
+  { "phi1",                              603, NULL },
+  { "club",                              753, NULL },
+  { "radicalex",                         500, NULL },
+  { "theta",                             521, NULL },
+  { "Upsilon1",                          620, NULL },
+  { "radical",                           549, NULL },
+  { "angle",                             768, NULL },
+  { "colon",                             278, NULL },
   { "plusminus",                         549, NULL },
-  { "arrowup",                           603, NULL },
-  { "apple",                             790, NULL },
-  { "parenleftbt",                       384, NULL },
-  { "notelement",                        713, NULL },
-  { "colon",                             278, NULL },
-  { "beta",                              549, NULL },
-  { "braceleftbt",                       494, NULL },
-  { "Lambda",                            686, NULL },
-  { "Phi",                               763, NULL },
-  { "minus",                             549, NULL },
-  { "space",                             250, NULL },
-  { "Sigma",                             592, NULL },
-  { "approxequal",                       549, NULL },
+  { "five",                              500, NULL },
+  { "weierstrass",                       987, NULL },
+  { "gamma",                             411, NULL },
+  { "theta1",                            631, NULL },
+  { "Zeta",                              611, NULL },
+  { "angleleft",                         329, NULL },
+  { "copyrightserif",                    790, NULL },
+  { "logicaland",                        603, NULL },
+  { "arrowvertex",                       603, NULL },
+  { "arrowleft",                         987, NULL },
+  { "Omicron",                           722, NULL },
+  { "propersubset",                      713, NULL },
+  { "equivalence",                       549, NULL },
+  { "circlemultiply",                    768, NULL },
+  { "greater",                           549, NULL },
   { "minute",                            247, NULL },
-  { "circleplus",                        768, NULL },
-  { "Omicron",                           722, NULL },
-  { "three",                             500, NULL },
-  { "numbersign",                        500, NULL },
-  { "lambda",                            549, NULL },
-  { "phi",                               521, NULL },
-  { "aleph",                             823, NULL },
-  { "Tau",                               611, NULL },
-  { "spade",                             753, NULL },
-  { "logicaland",                        603, NULL },
-  { "sigma",                             603, NULL },
-  { "propersuperset",                    713, NULL },
+  { "integral",                          274, NULL },
+  { "percent",                           833, NULL },
+  { "omega",                             686, NULL },
+  { "Beta",                              667, NULL },
+  { "equal",                             549, NULL },
+  { "therefore",                         863, NULL },
+  { "braceleftmid",                      494, NULL },
+  { "parenrighttp",                      384, NULL },
+  { "bracketright",                      333, NULL },
   { "omicron",                           549, NULL },
-  { "question",                          444, NULL },
-  { "equal",                             549, NULL },
   { "Epsilon",                           611, NULL },
-  { "emptyset",                          823, NULL },
-  { "diamond",                           753, NULL },
-  { "four",                              500, NULL },
-  { "Mu",                                889, NULL },
-  { "parenlefttp",                       384, NULL },
-  { "club",                              753, NULL },
-  { "bullet",                            460, NULL },
-  { "Omega",                             768, NULL },
-  { "tau",                               439, NULL },
-  { "Upsilon",                           690, NULL },
-  { "bracelefttp",                       494, NULL },
+  { "Nu",                                722, NULL },
+  { "zero",                              500, NULL },
+  { "period",                            250, NULL },
+  { "Gamma",                             603, NULL },
+  { "product",                           823, NULL },
+  { "arrowboth",                        1042, NULL },
+  { "Ifraktur",                          686, NULL },
+  { "infinity",                          713, NULL },
   { "heart",                             753, NULL },
+  { "parenrightex",                      384, NULL },
+  { "arrowdown",                         603, NULL },
+  { "bracketleftbt",                     384, NULL },
+  { "logicalor",                         603, NULL },
+  { "numbersign",                        500, NULL },
   { "divide",                            549, NULL },
-  { "epsilon",                           439, NULL },
-  { "logicalor",                         603, NULL },
+  { "nu",                                521, NULL },
+  { "spade",                             753, NULL },
+  { "rho",                               549, NULL },
+  { "Sigma",                             592, NULL },
+  { "integralex",                        686, NULL },
+  { "space",                             250, NULL },
+  { "reflexsuperset",                    713, NULL },
+  { "alpha",                             631, NULL },
   { "parenleftex",                       384, NULL },
-  { "greaterequal",                      549, NULL },
-  { "mu",                                576, NULL },
-  { "Nu",                                722, NULL },
-  { "therefore",                         863, NULL },
-  { "notsubset",                         713, NULL },
-  { "omega",                             686, NULL },
-  { "semicolon",                         278, NULL },
-  { "element",                           713, NULL },
-  { "upsilon",                           576, NULL },
+  { "lessequal",                         549, NULL },
+  { "second",                            411, NULL },
+  { "integraltp",                        686, NULL },
+  { "approxequal",                       549, NULL },
   { "existential",                       549, NULL },
+  { "diamond",                           753, NULL },
+  { "phi",                               521, NULL },
+  { "nine",                              500, NULL },
+  { "Iota",                              333, NULL },
+  { "parenleft",                         333, NULL },
+  { "tau",                               439, NULL },
+  { "Tau",                               611, NULL },
+  { "less",                              549, NULL },
+  { "Eta",                               722, NULL },
+  { "minus",                             549, NULL },
+  { "four",                              500, NULL },
+  { "bracketleftex",                     384, NULL },
+  { "arrowdblboth",                     1042, NULL },
+  { "arrowup",                           603, NULL },
+  { "arrowright",                        987, NULL },
   { "integralbt",                        686, NULL },
-  { "lessequal",                         549, NULL },
-  { "phi1",                              603, NULL },
-  { "lozenge",                           494, NULL },
+  { "similar",                           549, NULL },
+  { "underscore",                        500, NULL },
+  { "dotmath",                           250, NULL },
+  { "mu",                                576, NULL },
   { "trademarkserif",                    890, NULL },
-  { "parenright",                        333, NULL },
-  { "reflexsuperset",                    713, NULL },
-  { "sigma1",                            439, NULL },
-  { "nu",                                521, NULL },
-  { "Gamma",                             603, NULL },
+  { "Chi",                               722, NULL },
   { "angleright",                        329, NULL },
-  { "ellipsis",                         1000, NULL },
-  { "Rho",                               556, NULL },
-  { "parenrightbt",                      384, NULL },
-  { "radicalex",                         500, NULL },
-  { "eight",                             500, NULL },
-  { "angleleft",                         329, NULL },
+  { "logicalnot",                        713, NULL },
+  { "parenlefttp",                       384, NULL },
+  { "partialdiff",                       494, NULL },
+  { "arrowdblright",                     987, NULL },
+  { "summation",                         713, NULL },
+  { "question",                          444, NULL },
+  { "apple",                             790, NULL },
+  { "plus",                              549, NULL },
+  { "epsilon",                           439, NULL },
+  { "reflexsubset",                      713, NULL },
+  { "six",                               500, NULL },
   { "arrowdbldown",                      603, NULL },
-  { "congruent",                         549, NULL },
-  { "Theta",                             741, NULL },
-  { "intersection",                      768, NULL },
-  { "Pi",                                768, NULL },
-  { "slash",                             278, NULL },
-  { "registerserif",                     790, NULL },
-  { "parenleft",                         333, NULL },
-  { "one",                               500, NULL },
-  { "gamma",                             411, NULL },
-  { "bracketleft",                       333, NULL },
-  { "rho",                               549, NULL },
-  { "circlemultiply",                    768, NULL },
-  { "Chi",                               722, NULL },
-  { "theta",                             521, NULL },
-  { "pi",                                549, NULL },
-  { "integraltp",                        686, NULL },
-  { "Eta",                               722, NULL },
-  { "product",                           823, NULL },
-  { "nine",                              500, NULL },
-  { "five",                              500, NULL },
-  { "propersubset",                      713, NULL },
-  { "bracketrightbt",                    384, NULL },
-  { "trademarksans",                     786, NULL },
-  { "dotmath",                           250, NULL },
-  { "integralex",                        686, NULL },
-  { "chi",                               549, NULL },
-  { "parenrighttp",                      384, NULL },
-  { "eta",                               603, NULL },
-  { "underscore",                        500, NULL },
-  { "Euro",                              750, NULL },
+  { "Omega",                             768, NULL },
+  { "bar",                               200, NULL },
   { "multiply",                          549, NULL },
-  { "zero",                              500, NULL },
-  { "partialdiff",                       494, NULL },
-  { "angle",                             768, NULL },
+  { "braceright",                        480, NULL },
+  { "braceleft",                         480, NULL },
+  { "braceleftbt",                       494, NULL },
+  { "delta",                             494, NULL },
   { "arrowdblleft",                      987, NULL },
-  { "braceleft",                         480, NULL },
-  { "parenrightex",                      384, NULL },
-  { "Rfraktur",                          795, NULL },
-  { "Zeta",                              611, NULL },
-  { "braceex",                           494, NULL },
+  { "ampersand",                         778, NULL },
   { "arrowdblup",                        603, NULL },
-  { "arrowdown",                         603, NULL },
-  { "Ifraktur",                          686, NULL },
-  { "degree",                            400, NULL },
-  { "Iota",                              333, NULL },
+  { "aleph",                             823, NULL },
+  { "two",                               500, NULL },
+  { "bracerighttp",                      494, NULL },
+  { "seven",                             500, NULL },
+  { "propersuperset",                    713, NULL },
+  { "bullet",                            460, NULL },
   { "perpendicular",                     658, NULL },
-  { "radical",                           549, NULL },
-  { "asteriskmath",                      500, NULL },
-  { "percent",                           833, NULL },
-  { "zeta",                              494, NULL },
-  { "six",                               500, NULL },
-  { "two",                               500, NULL },
-  { "weierstrass",                       987, NULL },
-  { "summation",                         713, NULL },
-  { "bracketrighttp",                    384, NULL },
+  { "Lambda",                            686, NULL },
+  { "parenrightbt",                      384, NULL },
+  { "bracerightmid",                     494, NULL },
+  { "comma",                             250, NULL },
+  { "Delta",                             612, NULL },
+  { "bracerightbt",                      494, NULL },
+  { "union",                             768, NULL },
+  { "arrowhorizex",                     1000, NULL },
+  { "omega1",                            713, NULL },
+  { "proportional",                      713, NULL },
+  { "sigma1",                            439, NULL },
   { "carriagereturn",                    658, NULL },
   { "suchthat",                          439, NULL },
-  { "arrowvertex",                       603, NULL },
-  { "Delta",                             612, NULL },
-  { "iota",                              329, NULL },
-  { "arrowhorizex",                     1000, NULL },
+  { "notelement",                        713, NULL },
+  { "beta",                              549, NULL },
+  { "parenright",                        333, NULL },
+  { "bracketleft",                       333, NULL },
+  { "fraction",                          167, NULL },
+  { "Xi",                                645, NULL },
+  { "pi",                                549, NULL },
+  { "braceex",                           494, NULL },
+  { "bracketlefttp",                     384, NULL },
+  { "notsubset",                         713, NULL },
+  { "asteriskmath",                      500, NULL },
+  { "greaterequal",                      549, NULL },
+  { "emptyset",                          823, NULL },
   { "bracketrightex",                    384, NULL },
-  { "bracketright",                      333, NULL },
-  { "ampersand",                         778, NULL },
-  { "plus",                              549, NULL },
-  { "proportional",                      713, NULL },
-  { "delta",                             494, NULL },
-  { "copyrightserif",                    790, NULL },
-  { "bracerightmid",                     494, NULL },
-  { "arrowleft",                         987, NULL },
-  { "second",                            411, NULL },
-  { "arrowdblboth",                     1042, NULL },
-  { "florin",                            500, NULL },
-  { "Psi",                               795, NULL },
-  { "bracerightbt",                      494, NULL },
-  { "bracketleftbt",                     384, NULL },
-  { "seven",                             500, NULL },
-  { "braceleftmid",                      494, NULL },
+  { "gradient",                          713, NULL },
+  { "exclam",                            333, NULL },
   { "notequal",                          549, NULL },
+  { "congruent",                         549, NULL },
+  { "Pi",                                768, NULL },
+  { "Theta",                             741, NULL },
+  { "Rfraktur",                          795, NULL },
+  { "bracketrighttp",                    384, NULL },
+  { "parenleftbt",                       384, NULL },
+  { "universal",                         713, NULL },
+  { "upsilon",                           576, NULL },
   { "psi",                               686, NULL },
-  { "equivalence",                       549, NULL },
-  { "universal",                         713, NULL },
-  { "arrowdblright",                     987, NULL },
-  { "braceright",                        480, NULL },
-  { "reflexsubset",                      713, NULL },
-  { "Xi",                                645, NULL },
-  { "theta1",                            631, NULL },
-  { "logicalnot",                        713, NULL },
+  { "eight",                             500, NULL },
+  { "one",                               500, NULL },
   { "Kappa",                             722, NULL },
-  { "similar",                           549, NULL },
-  { "bar",                               200, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              549, NULL },
+  { "ellipsis",                         1000, NULL },
+  { "chi",                               549, NULL },
+  { "trademarksans",                     786, NULL },
+  { "Rho",                               556, NULL },
+  { "Alpha",                             722, NULL },
+  { "bracketrightbt",                    384, NULL },
+  { "intersection",                      768, NULL },
+  { "xi",                                493, NULL },
+  { "slash",                             278, NULL },
+  { "registerserif",                     790, NULL },
+  { "iota",                              329, NULL },
+  { "Psi",                               795, NULL },
+  { "three",                             500, NULL },
+  { "lozenge",                           494, NULL },
+  { "Phi",                               763, NULL },
+  { "zeta",                              494, NULL },
+  { "lambda",                            549, NULL },
+  { "Mu",                                889, NULL },
+  { "bracelefttp",                       494, NULL },
+  { "eta",                               603, NULL },
   { "registersans",                      790, NULL },
-  { "omega1",                            713, NULL },
-  { "exclam",                            333, NULL },
-  { "Upsilon1",                          620, NULL },
-  { "bracerighttp",                      494, NULL },
-  { "xi",                                493, NULL },
-  { "period",                            250, NULL },
-  { "Alpha",                             722, NULL },
-  { "arrowright",                        987, NULL },
-  { "greater",                           549, NULL },
-  { "bracketlefttp",                     384, NULL },
-  { "kappa",                             549, NULL },
-  { "gradient",                          713, NULL },
-  { "integral",                          274, NULL },
-  { "arrowboth",                        1042, NULL },
-  { "Beta",                              667, NULL }
+  { "element",                           713, NULL },
+  { "semicolon",                         278, NULL }
 };
 
 static BuiltinFontWidth timesBoldWidthsTab[] = {
-  { "Ntilde",                            722, NULL },
+  { "cacute",                            444, NULL },
+  { "Dcroat",                            722, NULL },
+  { "tcaron",                            416, NULL },
   { "rcaron",                            444, NULL },
-  { "kcommaaccent",                      556, NULL },
-  { "Ncommaaccent",                      722, NULL },
-  { "Zacute",                            667, NULL },
-  { "comma",                             250, NULL },
-  { "cedilla",                           333, NULL },
-  { "plusminus",                         570, NULL },
-  { "circumflex",                        333, NULL },
-  { "dotaccent",                         333, NULL },
-  { "edotaccent",                        444, NULL },
-  { "asciitilde",                        520, NULL },
-  { "colon",                             333, NULL },
-  { "onehalf",                           750, NULL },
-  { "dollar",                            500, NULL },
-  { "Lcaron",                            667, NULL },
-  { "ntilde",                            556, NULL },
-  { "Aogonek",                           722, NULL },
   { "ncommaaccent",                      556, NULL },
-  { "minus",                             570, NULL },
+  { "tcommaaccent",                      333, NULL },
+  { "logicalnot",                        570, NULL },
+  { "m",                                 833, NULL },
+  { "OE",                               1000, NULL },
+  { "partialdiff",                       494, NULL },
+  { "U",                                 722, NULL },
+  { "x",                                 500, NULL },
+  { "y",                                 500, NULL },
   { "Iogonek",                           389, NULL },
-  { "zacute",                            444, NULL },
-  { "yen",                               500, NULL },
-  { "space",                             250, NULL },
-  { "Omacron",                           778, NULL },
-  { "questiondown",                      500, NULL },
-  { "emdash",                           1000, NULL },
-  { "Agrave",                            722, NULL },
-  { "three",                             500, NULL },
-  { "numbersign",                        500, NULL },
-  { "lcaron",                            394, NULL },
+  { "edieresis",                         444, NULL },
+  { "Ncaron",                            722, NULL },
+  { "question",                          500, NULL },
+  { "summation",                         600, NULL },
   { "A",                                 722, NULL },
+  { "igrave",                            278, NULL },
+  { "dcroat",                            556, NULL },
+  { "guilsinglleft",                     333, NULL },
+  { "h",                                 556, NULL },
+  { "Cacute",                            722, NULL },
+  { "plus",                              570, NULL },
+  { "P",                                 611, NULL },
+  { "lslash",                            278, NULL },
+  { "six",                               500, NULL },
+  { "edotaccent",                        444, NULL },
+  { "bar",                               220, NULL },
+  { "quotesingle",                       278, NULL },
+  { "multiply",                          570, NULL },
+  { "i",                                 278, NULL },
+  { "onequarter",                        750, NULL },
+  { "braceright",                        394, NULL },
+  { "braceleft",                         394, NULL },
+  { "acute",                             333, NULL },
+  { "oacute",                            500, NULL },
+  { "Yacute",                            722, NULL },
+  { "daggerdbl",                         500, NULL },
+  { "Atilde",                            722, NULL },
+  { "Edieresis",                         667, NULL },
+  { "ntilde",                            556, NULL },
+  { "fi",                                556, NULL },
+  { "trademark",                        1000, NULL },
+  { "ampersand",                         833, NULL },
+  { "Lcommaaccent",                      667, NULL },
+  { "O",                                 778, NULL },
+  { "Icircumflex",                       389, NULL },
+  { "nacute",                            556, NULL },
+  { "dieresis",                          333, NULL },
+  { "Eacute",                            667, NULL },
+  { "two",                               500, NULL },
+  { "uacute",                            556, NULL },
+  { "seven",                             500, NULL },
+  { "Udieresis",                         722, NULL },
+  { "Abreve",                            722, NULL },
+  { "Iacute",                            389, NULL },
+  { "bullet",                            350, NULL },
+  { "eogonek",                           444, NULL },
+  { "eacute",                            444, NULL },
+  { "Zdotaccent",                        667, NULL },
+  { "scaron",                            389, NULL },
+  { "guillemotright",                    500, NULL },
+  { "aacute",                            500, NULL },
+  { "Otilde",                            778, NULL },
+  { "umacron",                           556, NULL },
+  { "Tcaron",                            667, NULL },
+  { "ugrave",                            556, NULL },
+  { "dcaron",                            672, NULL },
+  { "hyphen",                            333, NULL },
+  { "Oslash",                            778, NULL },
+  { "a",                                 500, NULL },
   { "B",                                 667, NULL },
-  { "C",                                 722, NULL },
-  { "aogonek",                           500, NULL },
-  { "D",                                 722, NULL },
-  { "E",                                 667, NULL },
-  { "onequarter",                        750, NULL },
-  { "F",                                 611, NULL },
-  { "G",                                 778, NULL },
+  { "yacute",                            500, NULL },
+  { "kcommaaccent",                      556, NULL },
+  { "Rcaron",                            722, NULL },
+  { "R",                                 722, NULL },
+  { "ydieresis",                         500, NULL },
+  { "S",                                 556, NULL },
+  { "omacron",                           500, NULL },
+  { "comma",                             250, NULL },
+  { "Delta",                             612, NULL },
+  { "Gbreve",                            778, NULL },
+  { "ordfeminine",                       300, NULL },
+  { "quotedblleft",                      500, NULL },
+  { "Rcommaaccent",                      722, NULL },
+  { "ograve",                            500, NULL },
+  { "Lacute",                            667, NULL },
+  { "Idieresis",                         389, NULL },
+  { "sacute",                            389, NULL },
+  { "f",                                 333, NULL },
+  { "otilde",                            500, NULL },
+  { "parenright",                        333, NULL },
+  { "gcommaaccent",                      500, NULL },
+  { "Ohungarumlaut",                     778, NULL },
+  { "bracketleft",                       333, NULL },
+  { "fraction",                          167, NULL },
+  { "Sacute",                            556, NULL },
+  { "Adieresis",                         722, NULL },
+  { "Uacute",                            722, NULL },
+  { "atilde",                            500, NULL },
+  { "Zacute",                            667, NULL },
+  { "asciitilde",                        520, NULL },
   { "H",                                 778, NULL },
-  { "I",                                 389, NULL },
+  { "sterling",                          500, NULL },
+  { "greaterequal",                      549, NULL },
+  { "at",                                930, NULL },
+  { "Lslash",                            667, NULL },
+  { "Uogonek",                           722, NULL },
+  { "caron",                             333, NULL },
+  { "lacute",                            278, NULL },
+  { "notequal",                          549, NULL },
+  { "Agrave",                            722, NULL },
+  { "AE",                               1000, NULL },
+  { "exclam",                            333, NULL },
+  { "Acircumflex",                       722, NULL },
+  { "oslash",                            500, NULL },
+  { "threequarters",                     750, NULL },
   { "J",                                 500, NULL },
-  { "K",                                 778, NULL },
-  { "iogonek",                           278, NULL },
-  { "backslash",                         278, NULL },
+  { "ohungarumlaut",                     500, NULL },
+  { "Ecircumflex",                       667, NULL },
   { "L",                                 667, NULL },
+  { "z",                                 444, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "egrave",                            444, NULL },
+  { "uring",                             556, NULL },
+  { "s",                                 389, NULL },
+  { "c",                                 444, NULL },
+  { "d",                                 556, NULL },
+  { "eight",                             500, NULL },
+  { "I",                                 389, NULL },
+  { "one",                               500, NULL },
   { "periodcentered",                    250, NULL },
-  { "M",                                 944, NULL },
-  { "N",                                 722, NULL },
-  { "omacron",                           500, NULL },
-  { "Tcommaaccent",                      667, NULL },
-  { "O",                                 778, NULL },
-  { "P",                                 611, NULL },
-  { "Q",                                 778, NULL },
-  { "Uhungarumlaut",                     722, NULL },
-  { "R",                                 722, NULL },
-  { "Aacute",                            722, NULL },
-  { "caron",                             333, NULL },
-  { "S",                                 556, NULL },
-  { "T",                                 667, NULL },
-  { "U",                                 722, NULL },
+  { "ellipsis",                         1000, NULL },
+  { "Aring",                             722, NULL },
   { "agrave",                            500, NULL },
+  { "Oacute",                            778, NULL },
+  { "t",                                 333, NULL },
+  { "quotedbl",                          555, NULL },
+  { "Eogonek",                           667, NULL },
+  { "macron",                            333, NULL },
+  { "Lcaron",                            667, NULL },
+  { "ordmasculine",                      330, NULL },
+  { "questiondown",                      500, NULL },
+  { "backslash",                         278, NULL },
+  { "slash",                             278, NULL },
+  { "r",                                 444, NULL },
+  { "ucircumflex",                       556, NULL },
+  { "three",                             500, NULL },
+  { "lozenge",                           494, NULL },
   { "V",                                 722, NULL },
-  { "W",                                1000, NULL },
-  { "X",                                 722, NULL },
-  { "question",                          500, NULL },
-  { "equal",                             570, NULL },
-  { "Y",                                 722, NULL },
+  { "Q",                                 778, NULL },
+  { "exclamdown",                        333, NULL },
+  { "Umacron",                           722, NULL },
+  { "zacute",                            444, NULL },
+  { "ncaron",                            556, NULL },
+  { "adieresis",                         500, NULL },
+  { "quoteright",                        333, NULL },
+  { "uogonek",                           556, NULL },
+  { "semicolon",                         333, NULL },
+  { "guilsinglright",                    333, NULL },
+  { "Amacron",                           722, NULL },
+  { "breve",                             333, NULL },
+  { "Dcaron",                            722, NULL },
   { "Z",                                 667, NULL },
-  { "four",                              500, NULL },
-  { "a",                                 500, NULL },
-  { "Gcommaaccent",                      778, NULL },
+  { "ecircumflex",                       444, NULL },
+  { "lcaron",                            394, NULL },
+  { "paragraph",                         540, NULL },
+  { "zcaron",                            444, NULL },
+  { "aring",                             500, NULL },
+  { "Ydieresis",                         722, NULL },
+  { "section",                           500, NULL },
+  { "Scaron",                            556, NULL },
+  { "degree",                            400, NULL },
+  { "Euro",                              500, NULL },
+  { "florin",                            500, NULL },
+  { "iogonek",                           278, NULL },
+  { "Scommaaccent",                      556, NULL },
+  { "Aacute",                            722, NULL },
   { "b",                                 556, NULL },
-  { "c",                                 444, NULL },
-  { "d",                                 556, NULL },
-  { "e",                                 444, NULL },
-  { "f",                                 333, NULL },
+  { "K",                                 778, NULL },
+  { "dotlessi",                          278, NULL },
+  { "p",                                 556, NULL },
+  { "Ntilde",                            722, NULL },
+  { "radical",                           549, NULL },
   { "g",                                 500, NULL },
-  { "bullet",                            350, NULL },
-  { "h",                                 556, NULL },
-  { "i",                                 278, NULL },
-  { "Oslash",                            778, NULL },
-  { "dagger",                            500, NULL },
-  { "j",                                 333, NULL },
+  { "colon",                             333, NULL },
+  { "ccedilla",                          444, NULL },
+  { "plusminus",                         570, NULL },
+  { "cedilla",                           333, NULL },
+  { "Idotaccent",                        389, NULL },
+  { "quotedblright",                     500, NULL },
+  { "Eth",                               722, NULL },
+  { "five",                              500, NULL },
+  { "X",                                 722, NULL },
+  { "asciicircum",                       581, NULL },
+  { "Odieresis",                         778, NULL },
+  { "oe",                                722, NULL },
+  { "aogonek",                           500, NULL },
+  { "Egrave",                            667, NULL },
+  { "ring",                              333, NULL },
+  { "emdash",                           1000, NULL },
+  { "Gcommaaccent",                      778, NULL },
+  { "quoteleft",                         333, NULL },
+  { "registered",                        747, NULL },
   { "k",                                 556, NULL },
-  { "l",                                 278, NULL },
-  { "m",                                 833, NULL },
+  { "copyright",                         747, NULL },
+  { "Racute",                            722, NULL },
+  { "lcommaaccent",                      278, NULL },
+  { "onehalf",                           750, NULL },
+  { "uhungarumlaut",                     556, NULL },
+  { "gbreve",                            500, NULL },
+  { "Ecaron",                            667, NULL },
+  { "threesuperior",                     300, NULL },
+  { "zdotaccent",                        444, NULL },
   { "n",                                 556, NULL },
-  { "tcommaaccent",                      333, NULL },
+  { "Emacron",                           667, NULL },
+  { "asterisk",                          500, NULL },
+  { "scommaaccent",                      389, NULL },
+  { "onesuperior",                       300, NULL },
+  { "greater",                           570, NULL },
+  { "percent",                          1000, NULL },
   { "o",                                 500, NULL },
-  { "ordfeminine",                       300, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 556, NULL },
+  { "abreve",                            500, NULL },
+  { "Imacron",                           389, NULL },
+  { "iacute",                            278, NULL },
+  { "e",                                 444, NULL },
+  { "icircumflex",                       278, NULL },
   { "q",                                 556, NULL },
-  { "uhungarumlaut",                     556, NULL },
-  { "r",                                 444, NULL },
-  { "twosuperior",                       300, NULL },
-  { "aacute",                            500, NULL },
-  { "s",                                 389, NULL },
-  { "OE",                               1000, NULL },
-  { "t",                                 333, NULL },
+  { "l",                                 278, NULL },
+  { "dagger",                            500, NULL },
+  { "equal",                             570, NULL },
+  { "N",                                 722, NULL },
+  { "C",                                 722, NULL },
+  { "u",                                 556, NULL },
+  { "Ugrave",                            722, NULL },
+  { "germandbls",                        556, NULL },
+  { "thorn",                             556, NULL },
+  { "commaaccent",                       250, NULL },
+  { "bracketright",                      333, NULL },
+  { "W",                                1000, NULL },
+  { "Ccedilla",                          722, NULL },
+  { "Igrave",                            389, NULL },
+  { "zero",                              500, NULL },
+  { "period",                            250, NULL },
+  { "scedilla",                          389, NULL },
+  { "udieresis",                         556, NULL },
+  { "perthousand",                      1000, NULL },
+  { "Edotaccent",                        667, NULL },
+  { "acircumflex",                       500, NULL },
+  { "Ocircumflex",                       778, NULL },
+  { "F",                                 611, NULL },
+  { "Uring",                             722, NULL },
+  { "G",                                 778, NULL },
+  { "T",                                 667, NULL },
+  { "M",                                 944, NULL },
+  { "odieresis",                         500, NULL },
+  { "Ograve",                            778, NULL },
+  { "numbersign",                        500, NULL },
   { "divide",                            570, NULL },
-  { "u",                                 556, NULL },
-  { "Ccaron",                            722, NULL },
-  { "v",                                 500, NULL },
+  { "emacron",                           444, NULL },
+  { "amacron",                           500, NULL },
+  { "Ncommaaccent",                      722, NULL },
+  { "endash",                            500, NULL },
+  { "guillemotleft",                     500, NULL },
+  { "fl",                                556, NULL },
+  { "E",                                 667, NULL },
+  { "quotedblbase",                      500, NULL },
+  { "ecaron",                            444, NULL },
+  { "Aogonek",                           722, NULL },
+  { "brokenbar",                         220, NULL },
   { "w",                                 722, NULL },
-  { "x",                                 500, NULL },
-  { "y",                                 500, NULL },
-  { "z",                                 444, NULL },
-  { "Gbreve",                            778, NULL },
-  { "commaaccent",                       250, NULL },
+  { "Thorn",                             611, NULL },
+  { "space",                             250, NULL },
+  { "eth",                               500, NULL },
+  { "twosuperior",                       300, NULL },
+  { "Y",                                 722, NULL },
+  { "yen",                               500, NULL },
   { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        389, NULL },
-  { "Nacute",                            722, NULL },
-  { "quotedbl",                          555, NULL },
-  { "gcommaaccent",                      500, NULL },
-  { "mu",                                556, NULL },
-  { "greaterequal",                      549, NULL },
-  { "Scaron",                            556, NULL },
-  { "Lslash",                            667, NULL },
-  { "semicolon",                         333, NULL },
-  { "oslash",                            500, NULL },
+  { "Ccaron",                            722, NULL },
+  { "j",                                 333, NULL },
+  { "Omacron",                           778, NULL },
   { "lessequal",                         549, NULL },
-  { "lozenge",                           494, NULL },
-  { "parenright",                        333, NULL },
+  { "Ucircumflex",                       722, NULL },
   { "ccaron",                            444, NULL },
-  { "Ecircumflex",                       667, NULL },
-  { "gbreve",                            500, NULL },
-  { "trademark",                        1000, NULL },
-  { "daggerdbl",                         500, NULL },
-  { "nacute",                            556, NULL },
-  { "macron",                            333, NULL },
-  { "Otilde",                            778, NULL },
-  { "Emacron",                           667, NULL },
-  { "ellipsis",                         1000, NULL },
-  { "scaron",                            389, NULL },
-  { "AE",                               1000, NULL },
-  { "Ucircumflex",                       722, NULL },
-  { "lslash",                            278, NULL },
-  { "quotedblleft",                      500, NULL },
-  { "guilsinglright",                    333, NULL },
-  { "hyphen",                            333, NULL },
-  { "quotesingle",                       278, NULL },
-  { "eight",                             500, NULL },
-  { "exclamdown",                        333, NULL },
-  { "endash",                            500, NULL },
-  { "oe",                                722, NULL },
-  { "Abreve",                            722, NULL },
-  { "Umacron",                           722, NULL },
-  { "ecircumflex",                       444, NULL },
-  { "Adieresis",                         722, NULL },
-  { "copyright",                         747, NULL },
-  { "Egrave",                            667, NULL },
-  { "slash",                             278, NULL },
-  { "Edieresis",                         667, NULL },
-  { "otilde",                            500, NULL },
-  { "Idieresis",                         389, NULL },
+  { "grave",                             333, NULL },
+  { "Scedilla",                          556, NULL },
+  { "quotesinglbase",                    333, NULL },
+  { "currency",                          500, NULL },
+  { "nine",                              500, NULL },
   { "parenleft",                         333, NULL },
-  { "one",                               500, NULL },
-  { "emacron",                           444, NULL },
-  { "Odieresis",                         778, NULL },
-  { "ucircumflex",                       556, NULL },
-  { "bracketleft",                       333, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        333, NULL },
-  { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         722, NULL },
-  { "umacron",                           556, NULL },
-  { "abreve",                            500, NULL },
-  { "Eacute",                            667, NULL },
-  { "adieresis",                         500, NULL },
-  { "egrave",                            444, NULL },
-  { "edieresis",                         444, NULL },
+  { "ogonek",                            333, NULL },
   { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
+  { "circumflex",                        333, NULL },
+  { "Zcaron",                            667, NULL },
+  { "ocircumflex",                       500, NULL },
+  { "less",                              570, NULL },
+  { "minus",                             570, NULL },
+  { "four",                              500, NULL },
   { "ae",                                722, NULL },
-  { "asterisk",                          500, NULL },
-  { "odieresis",                         500, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            556, NULL },
-  { "nine",                              500, NULL },
-  { "five",                              500, NULL },
-  { "udieresis",                         556, NULL },
-  { "Zcaron",                            667, NULL },
-  { "Scommaaccent",                      556, NULL },
-  { "threequarters",                     750, NULL },
-  { "guillemotright",                    500, NULL },
-  { "Ccedilla",                          722, NULL },
-  { "ydieresis",                         500, NULL },
-  { "tilde",                             333, NULL },
-  { "at",                                930, NULL },
-  { "eacute",                            444, NULL },
+  { "cent",                              500, NULL },
+  { "Tcommaaccent",                      667, NULL },
+  { "dollar",                            500, NULL },
+  { "v",                                 500, NULL },
+  { "Nacute",                            722, NULL },
+  { "dotaccent",                         333, NULL },
   { "underscore",                        500, NULL },
-  { "Euro",                              500, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          570, NULL },
-  { "zero",                              500, NULL },
-  { "eth",                               500, NULL },
-  { "Scedilla",                          556, NULL },
-  { "Ograve",                            778, NULL },
-  { "Racute",                            722, NULL },
-  { "partialdiff",                       494, NULL },
-  { "uacute",                            556, NULL },
-  { "braceleft",                         394, NULL },
-  { "Thorn",                             611, NULL },
-  { "zcaron",                            444, NULL },
-  { "scommaaccent",                      389, NULL },
-  { "ccedilla",                          444, NULL },
-  { "Dcaron",                            722, NULL },
-  { "dcroat",                            556, NULL },
-  { "Ocircumflex",                       778, NULL },
-  { "Oacute",                            778, NULL },
-  { "scedilla",                          389, NULL },
-  { "ogonek",                            333, NULL },
-  { "ograve",                            500, NULL },
+  { "D",                                 722, NULL },
+  { "mu",                                556, NULL },
   { "racute",                            444, NULL },
-  { "Tcaron",                            667, NULL },
-  { "Eogonek",                           667, NULL },
-  { "thorn",                             556, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        747, NULL },
-  { "radical",                           549, NULL },
-  { "Aring",                             722, NULL },
-  { "percent",                          1000, NULL },
-  { "six",                               500, NULL },
-  { "paragraph",                         540, NULL },
-  { "dcaron",                            672, NULL },
-  { "Uogonek",                           722, NULL },
-  { "two",                               500, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            389, NULL },
-  { "Lacute",                            667, NULL },
-  { "ocircumflex",                       500, NULL },
-  { "oacute",                            500, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      667, NULL },
-  { "tcaron",                            416, NULL },
-  { "eogonek",                           444, NULL },
-  { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     778, NULL },
-  { "asciicircum",                       581, NULL },
-  { "aring",                             500, NULL },
-  { "grave",                             333, NULL },
-  { "uogonek",                           556, NULL },
-  { "bracketright",                      333, NULL },
-  { "Iacute",                            389, NULL },
-  { "ampersand",                         833, NULL },
-  { "igrave",                            278, NULL },
-  { "lacute",                            278, NULL },
-  { "Ncaron",                            722, NULL },
-  { "plus",                              570, NULL },
-  { "uring",                             556, NULL },
-  { "quotesinglbase",                    333, NULL },
-  { "lcommaaccent",                      278, NULL },
-  { "Yacute",                            722, NULL },
-  { "ohungarumlaut",                     500, NULL },
-  { "threesuperior",                     300, NULL },
-  { "acute",                             333, NULL },
-  { "section",                           500, NULL },
-  { "dieresis",                          333, NULL },
-  { "iacute",                            278, NULL },
-  { "quotedblbase",                      500, NULL },
-  { "ncaron",                            556, NULL },
-  { "florin",                            500, NULL },
-  { "yacute",                            500, NULL },
-  { "Rcommaaccent",                      722, NULL },
-  { "fi",                                556, NULL },
-  { "fl",                                556, NULL },
-  { "Acircumflex",                       722, NULL },
-  { "Cacute",                            722, NULL },
-  { "Icircumflex",                       389, NULL },
-  { "guillemotleft",                     500, NULL },
-  { "germandbls",                        556, NULL },
-  { "Amacron",                           722, NULL },
-  { "seven",                             500, NULL },
-  { "Sacute",                            556, NULL },
-  { "ordmasculine",                      330, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          500, NULL },
-  { "notequal",                          549, NULL },
-  { "Imacron",                           389, NULL },
   { "rcommaaccent",                      444, NULL },
-  { "Zdotaccent",                        667, NULL },
-  { "acircumflex",                       500, NULL },
-  { "cacute",                            444, NULL },
-  { "Ecaron",                            667, NULL },
-  { "icircumflex",                       278, NULL },
-  { "braceright",                        394, NULL },
-  { "quotedblright",                     500, NULL },
-  { "amacron",                           500, NULL },
-  { "sacute",                            389, NULL },
   { "imacron",                           278, NULL },
-  { "cent",                              500, NULL },
-  { "currency",                          500, NULL },
-  { "logicalnot",                        570, NULL },
-  { "zdotaccent",                        444, NULL },
-  { "Atilde",                            722, NULL },
-  { "breve",                             333, NULL },
-  { "bar",                               220, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              570, NULL },
-  { "ecaron",                            444, NULL },
-  { "guilsinglleft",                     333, NULL },
-  { "exclam",                            333, NULL },
-  { "period",                            250, NULL },
-  { "Rcaron",                            722, NULL },
   { "Kcommaaccent",                      778, NULL },
-  { "greater",                           570, NULL },
-  { "atilde",                            500, NULL },
-  { "brokenbar",                         220, NULL },
-  { "quoteleft",                         333, NULL },
-  { "Edotaccent",                        667, NULL },
-  { "onesuperior",                       300, NULL }
+  { "tilde",                             333, NULL }
 };
 
 static BuiltinFontWidth timesBoldItalicWidthsTab[] = {
-  { "Ntilde",                            722, NULL },
-  { "rcaron",                            389, NULL },
-  { "kcommaaccent",                      500, NULL },
+  { "M",                                 889, NULL },
+  { "odieresis",                         500, NULL },
+  { "Ograve",                            722, NULL },
+  { "T",                                 611, NULL },
+  { "amacron",                           500, NULL },
   { "Ncommaaccent",                      722, NULL },
-  { "Zacute",                            611, NULL },
-  { "comma",                             250, NULL },
-  { "cedilla",                           333, NULL },
-  { "plusminus",                         570, NULL },
+  { "numbersign",                        500, NULL },
+  { "divide",                            570, NULL },
+  { "emacron",                           444, NULL },
+  { "fl",                                556, NULL },
+  { "E",                                 667, NULL },
+  { "quotedblbase",                      500, NULL },
+  { "endash",                            500, NULL },
+  { "guillemotleft",                     500, NULL },
+  { "w",                                 667, NULL },
+  { "Thorn",                             611, NULL },
+  { "space",                             250, NULL },
+  { "eth",                               500, NULL },
+  { "twosuperior",                       300, NULL },
+  { "ecaron",                            444, NULL },
+  { "Aogonek",                           667, NULL },
+  { "brokenbar",                         220, NULL },
+  { "commaaccent",                       250, NULL },
+  { "bracketright",                      333, NULL },
+  { "W",                                 889, NULL },
+  { "Ugrave",                            722, NULL },
+  { "germandbls",                        500, NULL },
+  { "thorn",                             500, NULL },
+  { "zero",                              500, NULL },
+  { "period",                            250, NULL },
+  { "scedilla",                          389, NULL },
+  { "udieresis",                         556, NULL },
+  { "Ccedilla",                          667, NULL },
+  { "Igrave",                            389, NULL },
+  { "Ocircumflex",                       722, NULL },
+  { "F",                                 667, NULL },
+  { "Uring",                             722, NULL },
+  { "Edotaccent",                        667, NULL },
+  { "perthousand",                      1000, NULL },
+  { "acircumflex",                       500, NULL },
+  { "G",                                 722, NULL },
   { "circumflex",                        333, NULL },
+  { "Zcaron",                            611, NULL },
+  { "ogonek",                            333, NULL },
+  { "idieresis",                         278, NULL },
+  { "ae",                                722, NULL },
+  { "cent",                              500, NULL },
+  { "ocircumflex",                       500, NULL },
+  { "less",                              570, NULL },
+  { "minus",                             606, NULL },
+  { "four",                              500, NULL },
+  { "dollar",                            500, NULL },
+  { "Tcommaaccent",                      611, NULL },
+  { "v",                                 444, NULL },
+  { "Nacute",                            722, NULL },
   { "dotaccent",                         333, NULL },
-  { "edotaccent",                        444, NULL },
-  { "asciitilde",                        570, NULL },
-  { "colon",                             333, NULL },
-  { "onehalf",                           750, NULL },
-  { "dollar",                            500, NULL },
-  { "Lcaron",                            611, NULL },
-  { "ntilde",                            556, NULL },
-  { "Aogonek",                           667, NULL },
-  { "ncommaaccent",                      556, NULL },
-  { "minus",                             606, NULL },
-  { "Iogonek",                           389, NULL },
-  { "zacute",                            389, NULL },
+  { "rcommaaccent",                      389, NULL },
+  { "Kcommaaccent",                      667, NULL },
+  { "imacron",                           278, NULL },
+  { "tilde",                             333, NULL },
+  { "underscore",                        500, NULL },
+  { "mu",                                576, NULL },
+  { "D",                                 722, NULL },
+  { "racute",                            389, NULL },
+  { "hungarumlaut",                      333, NULL },
+  { "j",                                 278, NULL },
+  { "Ccaron",                            667, NULL },
   { "yen",                               500, NULL },
-  { "space",                             250, NULL },
+  { "Y",                                 611, NULL },
+  { "ccaron",                            444, NULL },
+  { "lessequal",                         549, NULL },
+  { "Ucircumflex",                       722, NULL },
   { "Omacron",                           722, NULL },
-  { "questiondown",                      500, NULL },
+  { "quotesinglbase",                    333, NULL },
+  { "grave",                             333, NULL },
+  { "Scedilla",                          556, NULL },
+  { "parenleft",                         333, NULL },
+  { "currency",                          500, NULL },
+  { "nine",                              500, NULL },
+  { "Ntilde",                            722, NULL },
+  { "radical",                           549, NULL },
+  { "dotlessi",                          278, NULL },
+  { "p",                                 500, NULL },
+  { "plusminus",                         570, NULL },
+  { "Idotaccent",                        389, NULL },
+  { "cedilla",                           333, NULL },
+  { "quotedblright",                     500, NULL },
+  { "Eth",                               722, NULL },
+  { "colon",                             333, NULL },
+  { "g",                                 500, NULL },
+  { "ccedilla",                          444, NULL },
+  { "Odieresis",                         722, NULL },
+  { "oe",                                722, NULL },
+  { "five",                              500, NULL },
+  { "X",                                 667, NULL },
+  { "asciicircum",                       570, NULL },
   { "emdash",                           1000, NULL },
-  { "Agrave",                            667, NULL },
-  { "three",                             500, NULL },
-  { "numbersign",                        500, NULL },
+  { "aogonek",                           500, NULL },
+  { "Egrave",                            667, NULL },
+  { "ring",                              333, NULL },
+  { "Dcaron",                            722, NULL },
+  { "Z",                                 611, NULL },
+  { "ecircumflex",                       444, NULL },
+  { "Amacron",                           667, NULL },
+  { "breve",                             333, NULL },
   { "lcaron",                            382, NULL },
-  { "A",                                 667, NULL },
-  { "B",                                 667, NULL },
-  { "C",                                 667, NULL },
-  { "aogonek",                           500, NULL },
-  { "D",                                 722, NULL },
-  { "E",                                 667, NULL },
-  { "onequarter",                        750, NULL },
-  { "F",                                 667, NULL },
-  { "G",                                 722, NULL },
-  { "H",                                 778, NULL },
-  { "I",                                 389, NULL },
-  { "J",                                 500, NULL },
+  { "paragraph",                         500, NULL },
+  { "zcaron",                            389, NULL },
+  { "aring",                             500, NULL },
+  { "Ydieresis",                         611, NULL },
+  { "Euro",                              500, NULL },
+  { "iogonek",                           278, NULL },
+  { "florin",                            500, NULL },
+  { "section",                           500, NULL },
+  { "Scaron",                            556, NULL },
+  { "degree",                            400, NULL },
   { "K",                                 667, NULL },
-  { "iogonek",                           278, NULL },
-  { "backslash",                         278, NULL },
-  { "L",                                 611, NULL },
-  { "periodcentered",                    250, NULL },
-  { "M",                                 889, NULL },
-  { "N",                                 722, NULL },
-  { "omacron",                           500, NULL },
-  { "Tcommaaccent",                      611, NULL },
-  { "O",                                 722, NULL },
-  { "P",                                 611, NULL },
-  { "Q",                                 722, NULL },
-  { "Uhungarumlaut",                     722, NULL },
-  { "R",                                 667, NULL },
+  { "Scommaaccent",                      556, NULL },
   { "Aacute",                            667, NULL },
-  { "caron",                             333, NULL },
-  { "S",                                 556, NULL },
-  { "T",                                 611, NULL },
-  { "U",                                 722, NULL },
-  { "agrave",                            500, NULL },
-  { "V",                                 667, NULL },
-  { "W",                                 889, NULL },
-  { "X",                                 667, NULL },
-  { "question",                          500, NULL },
-  { "equal",                             570, NULL },
-  { "Y",                                 611, NULL },
-  { "Z",                                 611, NULL },
-  { "four",                              500, NULL },
-  { "a",                                 500, NULL },
-  { "Gcommaaccent",                      722, NULL },
   { "b",                                 500, NULL },
-  { "c",                                 444, NULL },
-  { "d",                                 500, NULL },
+  { "greater",                           570, NULL },
+  { "asterisk",                          500, NULL },
+  { "Emacron",                           667, NULL },
+  { "scommaaccent",                      389, NULL },
+  { "onesuperior",                       300, NULL },
+  { "percent",                           833, NULL },
+  { "o",                                 500, NULL },
+  { "icircumflex",                       278, NULL },
+  { "abreve",                            500, NULL },
+  { "Imacron",                           389, NULL },
   { "e",                                 444, NULL },
-  { "f",                                 333, NULL },
-  { "g",                                 500, NULL },
-  { "bullet",                            350, NULL },
-  { "h",                                 556, NULL },
-  { "i",                                 278, NULL },
-  { "Oslash",                            722, NULL },
+  { "iacute",                            278, NULL },
   { "dagger",                            500, NULL },
-  { "j",                                 278, NULL },
+  { "equal",                             570, NULL },
+  { "N",                                 722, NULL },
+  { "C",                                 667, NULL },
+  { "u",                                 556, NULL },
+  { "q",                                 500, NULL },
+  { "l",                                 278, NULL },
+  { "quoteleft",                         333, NULL },
+  { "registered",                        747, NULL },
+  { "Gcommaaccent",                      722, NULL },
+  { "Racute",                            667, NULL },
   { "k",                                 500, NULL },
-  { "l",                                 278, NULL },
-  { "m",                                 778, NULL },
+  { "copyright",                         747, NULL },
+  { "lcommaaccent",                      278, NULL },
+  { "onehalf",                           750, NULL },
+  { "gbreve",                            500, NULL },
+  { "uhungarumlaut",                     556, NULL },
   { "n",                                 556, NULL },
-  { "tcommaaccent",                      278, NULL },
-  { "o",                                 500, NULL },
-  { "ordfeminine",                       266, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 500, NULL },
-  { "q",                                 500, NULL },
-  { "uhungarumlaut",                     556, NULL },
-  { "r",                                 389, NULL },
-  { "twosuperior",                       300, NULL },
-  { "aacute",                            500, NULL },
-  { "s",                                 389, NULL },
-  { "OE",                                944, NULL },
-  { "t",                                 278, NULL },
-  { "divide",                            570, NULL },
-  { "u",                                 556, NULL },
-  { "Ccaron",                            667, NULL },
-  { "v",                                 444, NULL },
-  { "w",                                 667, NULL },
-  { "x",                                 500, NULL },
-  { "y",                                 444, NULL },
-  { "z",                                 389, NULL },
-  { "Gbreve",                            722, NULL },
-  { "commaaccent",                       250, NULL },
-  { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        389, NULL },
-  { "Nacute",                            722, NULL },
-  { "quotedbl",                          555, NULL },
-  { "gcommaaccent",                      500, NULL },
-  { "mu",                                576, NULL },
+  { "Ecaron",                            667, NULL },
+  { "threesuperior",                     300, NULL },
+  { "zdotaccent",                        389, NULL },
+  { "Uacute",                            722, NULL },
+  { "atilde",                            500, NULL },
+  { "Zacute",                            611, NULL },
+  { "fraction",                          167, NULL },
+  { "Sacute",                            556, NULL },
+  { "Adieresis",                         667, NULL },
+  { "asciitilde",                        570, NULL },
+  { "Uogonek",                           722, NULL },
+  { "Lslash",                            611, NULL },
+  { "caron",                             333, NULL },
+  { "lacute",                            278, NULL },
+  { "H",                                 778, NULL },
+  { "sterling",                          500, NULL },
   { "greaterequal",                      549, NULL },
-  { "Scaron",                            556, NULL },
-  { "Lslash",                            611, NULL },
-  { "semicolon",                         333, NULL },
+  { "at",                                832, NULL },
+  { "threequarters",                     750, NULL },
+  { "J",                                 500, NULL },
+  { "ohungarumlaut",                     500, NULL },
+  { "Ecircumflex",                       667, NULL },
+  { "L",                                 611, NULL },
+  { "notequal",                          549, NULL },
+  { "Agrave",                            667, NULL },
+  { "exclam",                            389, NULL },
+  { "AE",                                944, NULL },
+  { "Acircumflex",                       667, NULL },
   { "oslash",                            500, NULL },
-  { "lessequal",                         549, NULL },
-  { "lozenge",                           494, NULL },
+  { "ograve",                            500, NULL },
+  { "Rcommaaccent",                      667, NULL },
+  { "Lacute",                            611, NULL },
+  { "sacute",                            389, NULL },
+  { "Idieresis",                         389, NULL },
+  { "f",                                 333, NULL },
+  { "gcommaaccent",                      500, NULL },
+  { "Ohungarumlaut",                     722, NULL },
+  { "bracketleft",                       333, NULL },
+  { "otilde",                            500, NULL },
   { "parenright",                        333, NULL },
-  { "ccaron",                            444, NULL },
-  { "Ecircumflex",                       667, NULL },
-  { "gbreve",                            500, NULL },
-  { "trademark",                        1000, NULL },
-  { "daggerdbl",                         500, NULL },
-  { "nacute",                            556, NULL },
+  { "Eogonek",                           667, NULL },
   { "macron",                            333, NULL },
-  { "Otilde",                            722, NULL },
-  { "Emacron",                           667, NULL },
+  { "backslash",                         278, NULL },
+  { "Lcaron",                            611, NULL },
+  { "ordmasculine",                      300, NULL },
+  { "questiondown",                      500, NULL },
+  { "three",                             500, NULL },
+  { "slash",                             278, NULL },
+  { "r",                                 389, NULL },
+  { "ucircumflex",                       556, NULL },
+  { "zacute",                            389, NULL },
+  { "Umacron",                           722, NULL },
+  { "ncaron",                            556, NULL },
+  { "adieresis",                         500, NULL },
+  { "lozenge",                           494, NULL },
+  { "V",                                 667, NULL },
+  { "Q",                                 722, NULL },
+  { "exclamdown",                        389, NULL },
+  { "quoteright",                        333, NULL },
+  { "uogonek",                           556, NULL },
+  { "semicolon",                         333, NULL },
+  { "guilsinglright",                    333, NULL },
+  { "egrave",                            444, NULL },
+  { "uring",                             556, NULL },
+  { "s",                                 389, NULL },
+  { "z",                                 389, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "one",                               500, NULL },
+  { "I",                                 389, NULL },
+  { "eight",                             500, NULL },
+  { "periodcentered",                    250, NULL },
+  { "c",                                 444, NULL },
+  { "d",                                 500, NULL },
+  { "agrave",                            500, NULL },
   { "ellipsis",                         1000, NULL },
-  { "scaron",                            389, NULL },
-  { "AE",                                944, NULL },
-  { "Ucircumflex",                       722, NULL },
+  { "Aring",                             667, NULL },
+  { "t",                                 278, NULL },
+  { "quotedbl",                          555, NULL },
+  { "Oacute",                            722, NULL },
+  { "six",                               500, NULL },
+  { "edotaccent",                        444, NULL },
   { "lslash",                            278, NULL },
-  { "quotedblleft",                      500, NULL },
-  { "guilsinglright",                    333, NULL },
-  { "hyphen",                            333, NULL },
+  { "P",                                 611, NULL },
+  { "i",                                 278, NULL },
+  { "multiply",                          570, NULL },
+  { "bar",                               220, NULL },
   { "quotesingle",                       278, NULL },
-  { "eight",                             500, NULL },
-  { "exclamdown",                        389, NULL },
-  { "endash",                            500, NULL },
-  { "oe",                                722, NULL },
-  { "Abreve",                            667, NULL },
-  { "Umacron",                           722, NULL },
-  { "ecircumflex",                       444, NULL },
-  { "Adieresis",                         667, NULL },
-  { "copyright",                         747, NULL },
-  { "Egrave",                            667, NULL },
-  { "slash",                             278, NULL },
+  { "braceleft",                         348, NULL },
+  { "braceright",                        348, NULL },
+  { "acute",                             333, NULL },
+  { "onequarter",                        750, NULL },
+  { "Atilde",                            667, NULL },
   { "Edieresis",                         667, NULL },
-  { "otilde",                            500, NULL },
-  { "Idieresis",                         389, NULL },
-  { "parenleft",                         333, NULL },
-  { "one",                               500, NULL },
-  { "emacron",                           444, NULL },
-  { "Odieresis",                         722, NULL },
-  { "ucircumflex",                       556, NULL },
-  { "bracketleft",                       333, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        333, NULL },
-  { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         611, NULL },
-  { "umacron",                           556, NULL },
-  { "abreve",                            500, NULL },
-  { "Eacute",                            667, NULL },
-  { "adieresis",                         500, NULL },
-  { "egrave",                            444, NULL },
+  { "oacute",                            500, NULL },
+  { "Yacute",                            611, NULL },
+  { "daggerdbl",                         500, NULL },
+  { "ncommaaccent",                      556, NULL },
+  { "tcommaaccent",                      278, NULL },
+  { "logicalnot",                        606, NULL },
+  { "cacute",                            444, NULL },
+  { "Dcroat",                            722, NULL },
+  { "tcaron",                            366, NULL },
+  { "rcaron",                            389, NULL },
+  { "x",                                 500, NULL },
+  { "Iogonek",                           389, NULL },
   { "edieresis",                         444, NULL },
-  { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
-  { "ae",                                722, NULL },
-  { "asterisk",                          500, NULL },
-  { "odieresis",                         500, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            556, NULL },
-  { "nine",                              500, NULL },
-  { "five",                              500, NULL },
-  { "udieresis",                         556, NULL },
-  { "Zcaron",                            611, NULL },
-  { "Scommaaccent",                      556, NULL },
-  { "threequarters",                     750, NULL },
-  { "guillemotright",                    500, NULL },
-  { "Ccedilla",                          667, NULL },
-  { "ydieresis",                         444, NULL },
-  { "tilde",                             333, NULL },
-  { "at",                                832, NULL },
-  { "eacute",                            444, NULL },
-  { "underscore",                        500, NULL },
-  { "Euro",                              500, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          570, NULL },
-  { "zero",                              500, NULL },
-  { "eth",                               500, NULL },
-  { "Scedilla",                          556, NULL },
-  { "Ograve",                            722, NULL },
-  { "Racute",                            667, NULL },
+  { "y",                                 444, NULL },
+  { "Ncaron",                            722, NULL },
+  { "m",                                 778, NULL },
+  { "OE",                                944, NULL },
+  { "U",                                 722, NULL },
   { "partialdiff",                       494, NULL },
-  { "uacute",                            556, NULL },
-  { "braceleft",                         348, NULL },
-  { "Thorn",                             611, NULL },
-  { "zcaron",                            389, NULL },
-  { "scommaaccent",                      389, NULL },
-  { "ccedilla",                          444, NULL },
-  { "Dcaron",                            722, NULL },
+  { "igrave",                            278, NULL },
   { "dcroat",                            500, NULL },
-  { "Ocircumflex",                       722, NULL },
-  { "Oacute",                            722, NULL },
-  { "scedilla",                          389, NULL },
-  { "ogonek",                            333, NULL },
-  { "ograve",                            500, NULL },
-  { "racute",                            389, NULL },
+  { "question",                          500, NULL },
+  { "summation",                         600, NULL },
+  { "A",                                 667, NULL },
+  { "guilsinglleft",                     333, NULL },
+  { "Cacute",                            667, NULL },
+  { "h",                                 556, NULL },
+  { "plus",                              570, NULL },
+  { "Otilde",                            722, NULL },
+  { "umacron",                           556, NULL },
   { "Tcaron",                            611, NULL },
-  { "Eogonek",                           667, NULL },
-  { "thorn",                             500, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        747, NULL },
-  { "radical",                           549, NULL },
-  { "Aring",                             667, NULL },
-  { "percent",                           833, NULL },
-  { "six",                               500, NULL },
-  { "paragraph",                         500, NULL },
+  { "aacute",                            500, NULL },
+  { "B",                                 667, NULL },
+  { "kcommaaccent",                      500, NULL },
+  { "Rcaron",                            667, NULL },
+  { "yacute",                            444, NULL },
+  { "ydieresis",                         444, NULL },
+  { "R",                                 667, NULL },
+  { "ugrave",                            556, NULL },
   { "dcaron",                            608, NULL },
-  { "Uogonek",                           722, NULL },
-  { "two",                               500, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            389, NULL },
-  { "Lacute",                            611, NULL },
-  { "ocircumflex",                       500, NULL },
-  { "oacute",                            500, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      611, NULL },
-  { "tcaron",                            366, NULL },
-  { "eogonek",                           444, NULL },
+  { "Oslash",                            722, NULL },
+  { "hyphen",                            333, NULL },
+  { "a",                                 500, NULL },
+  { "omacron",                           500, NULL },
   { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     722, NULL },
-  { "asciicircum",                       570, NULL },
-  { "aring",                             500, NULL },
-  { "grave",                             333, NULL },
-  { "uogonek",                           556, NULL },
-  { "bracketright",                      333, NULL },
-  { "Iacute",                            389, NULL },
+  { "comma",                             250, NULL },
+  { "Gbreve",                            722, NULL },
+  { "S",                                 556, NULL },
+  { "quotedblleft",                      500, NULL },
+  { "ordfeminine",                       266, NULL },
+  { "trademark",                        1000, NULL },
   { "ampersand",                         778, NULL },
-  { "igrave",                            278, NULL },
-  { "lacute",                            278, NULL },
-  { "Ncaron",                            722, NULL },
-  { "plus",                              570, NULL },
-  { "uring",                             556, NULL },
-  { "quotesinglbase",                    333, NULL },
-  { "lcommaaccent",                      278, NULL },
-  { "Yacute",                            611, NULL },
-  { "ohungarumlaut",                     500, NULL },
-  { "threesuperior",                     300, NULL },
-  { "acute",                             333, NULL },
-  { "section",                           500, NULL },
+  { "Lcommaaccent",                      611, NULL },
+  { "ntilde",                            556, NULL },
+  { "fi",                                556, NULL },
   { "dieresis",                          333, NULL },
-  { "iacute",                            278, NULL },
-  { "quotedblbase",                      500, NULL },
-  { "ncaron",                            556, NULL },
-  { "florin",                            500, NULL },
-  { "yacute",                            444, NULL },
-  { "Rcommaaccent",                      667, NULL },
-  { "fi",                                556, NULL },
-  { "fl",                                556, NULL },
-  { "Acircumflex",                       667, NULL },
-  { "Cacute",                            667, NULL },
+  { "Eacute",                            667, NULL },
+  { "O",                                 722, NULL },
   { "Icircumflex",                       389, NULL },
-  { "guillemotleft",                     500, NULL },
-  { "germandbls",                        500, NULL },
-  { "Amacron",                           667, NULL },
+  { "nacute",                            556, NULL },
+  { "Abreve",                            667, NULL },
+  { "Udieresis",                         722, NULL },
+  { "Iacute",                            389, NULL },
+  { "two",                               500, NULL },
+  { "uacute",                            556, NULL },
   { "seven",                             500, NULL },
-  { "Sacute",                            556, NULL },
-  { "ordmasculine",                      300, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          500, NULL },
-  { "notequal",                          549, NULL },
-  { "Imacron",                           389, NULL },
-  { "rcommaaccent",                      389, NULL },
-  { "Zdotaccent",                        611, NULL },
-  { "acircumflex",                       500, NULL },
-  { "cacute",                            444, NULL },
-  { "Ecaron",                            667, NULL },
-  { "icircumflex",                       278, NULL },
-  { "braceright",                        348, NULL },
-  { "quotedblright",                     500, NULL },
-  { "amacron",                           500, NULL },
-  { "sacute",                            389, NULL },
-  { "imacron",                           278, NULL },
-  { "cent",                              500, NULL },
-  { "currency",                          500, NULL },
-  { "logicalnot",                        606, NULL },
-  { "zdotaccent",                        389, NULL },
-  { "Atilde",                            667, NULL },
-  { "breve",                             333, NULL },
-  { "bar",                               220, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              570, NULL },
-  { "ecaron",                            444, NULL },
-  { "guilsinglleft",                     333, NULL },
-  { "exclam",                            389, NULL },
-  { "period",                            250, NULL },
-  { "Rcaron",                            667, NULL },
-  { "Kcommaaccent",                      667, NULL },
-  { "greater",                           570, NULL },
-  { "atilde",                            500, NULL },
-  { "brokenbar",                         220, NULL },
-  { "quoteleft",                         333, NULL },
-  { "Edotaccent",                        667, NULL },
-  { "onesuperior",                       300, NULL }
+  { "scaron",                            389, NULL },
+  { "guillemotright",                    500, NULL },
+  { "bullet",                            350, NULL },
+  { "eogonek",                           444, NULL },
+  { "eacute",                            444, NULL },
+  { "Zdotaccent",                        611, NULL }
 };
 
 static BuiltinFontWidth timesItalicWidthsTab[] = {
-  { "Ntilde",                            667, NULL },
-  { "rcaron",                            389, NULL },
-  { "kcommaaccent",                      444, NULL },
-  { "Ncommaaccent",                      667, NULL },
-  { "Zacute",                            556, NULL },
-  { "comma",                             250, NULL },
-  { "cedilla",                           333, NULL },
-  { "plusminus",                         675, NULL },
-  { "circumflex",                        333, NULL },
-  { "dotaccent",                         333, NULL },
-  { "edotaccent",                        444, NULL },
-  { "asciitilde",                        541, NULL },
-  { "colon",                             333, NULL },
-  { "onehalf",                           750, NULL },
-  { "dollar",                            500, NULL },
+  { "quoteright",                        333, NULL },
+  { "uogonek",                           500, NULL },
+  { "semicolon",                         333, NULL },
+  { "guilsinglright",                    333, NULL },
+  { "Umacron",                           722, NULL },
+  { "zacute",                            389, NULL },
+  { "ncaron",                            500, NULL },
+  { "adieresis",                         500, NULL },
+  { "lozenge",                           471, NULL },
+  { "V",                                 611, NULL },
+  { "Q",                                 722, NULL },
+  { "exclamdown",                        389, NULL },
+  { "three",                             500, NULL },
+  { "slash",                             278, NULL },
+  { "r",                                 389, NULL },
+  { "ucircumflex",                       500, NULL },
+  { "Eogonek",                           611, NULL },
+  { "macron",                            333, NULL },
+  { "ordmasculine",                      310, NULL },
   { "Lcaron",                            611, NULL },
-  { "ntilde",                            500, NULL },
-  { "Aogonek",                           611, NULL },
-  { "ncommaaccent",                      500, NULL },
-  { "minus",                             675, NULL },
-  { "Iogonek",                           333, NULL },
-  { "zacute",                            389, NULL },
-  { "yen",                               500, NULL },
-  { "space",                             250, NULL },
-  { "Omacron",                           722, NULL },
   { "questiondown",                      500, NULL },
-  { "emdash",                            889, NULL },
-  { "Agrave",                            611, NULL },
-  { "three",                             500, NULL },
-  { "numbersign",                        500, NULL },
-  { "lcaron",                            300, NULL },
-  { "A",                                 611, NULL },
-  { "B",                                 611, NULL },
-  { "C",                                 667, NULL },
-  { "aogonek",                           500, NULL },
-  { "D",                                 722, NULL },
-  { "E",                                 611, NULL },
-  { "onequarter",                        750, NULL },
-  { "F",                                 611, NULL },
-  { "G",                                 722, NULL },
-  { "H",                                 722, NULL },
+  { "backslash",                         278, NULL },
+  { "t",                                 278, NULL },
+  { "quotedbl",                          420, NULL },
+  { "Oacute",                            722, NULL },
+  { "agrave",                            500, NULL },
+  { "ellipsis",                          889, NULL },
+  { "Aring",                             611, NULL },
   { "I",                                 333, NULL },
+  { "one",                               500, NULL },
+  { "eight",                             500, NULL },
+  { "periodcentered",                    250, NULL },
+  { "c",                                 444, NULL },
+  { "d",                                 500, NULL },
+  { "egrave",                            444, NULL },
+  { "uring",                             500, NULL },
+  { "s",                                 389, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "z",                                 389, NULL },
+  { "threequarters",                     750, NULL },
   { "J",                                 444, NULL },
-  { "K",                                 667, NULL },
-  { "iogonek",                           278, NULL },
-  { "backslash",                         278, NULL },
+  { "ohungarumlaut",                     500, NULL },
+  { "Ecircumflex",                       611, NULL },
   { "L",                                 556, NULL },
-  { "periodcentered",                    250, NULL },
-  { "M",                                 833, NULL },
-  { "N",                                 667, NULL },
+  { "notequal",                          549, NULL },
+  { "Agrave",                            611, NULL },
+  { "AE",                                889, NULL },
+  { "exclam",                            333, NULL },
+  { "Acircumflex",                       611, NULL },
+  { "oslash",                            500, NULL },
+  { "caron",                             333, NULL },
+  { "Uogonek",                           722, NULL },
+  { "Lslash",                            556, NULL },
+  { "lacute",                            278, NULL },
+  { "H",                                 722, NULL },
+  { "sterling",                          500, NULL },
+  { "at",                                920, NULL },
+  { "greaterequal",                      549, NULL },
+  { "asciitilde",                        541, NULL },
+  { "Uacute",                            722, NULL },
+  { "atilde",                            500, NULL },
+  { "Zacute",                            556, NULL },
+  { "fraction",                          167, NULL },
+  { "Adieresis",                         611, NULL },
+  { "Sacute",                            500, NULL },
+  { "gcommaaccent",                      500, NULL },
+  { "Ohungarumlaut",                     722, NULL },
+  { "bracketleft",                       389, NULL },
+  { "otilde",                            500, NULL },
+  { "parenright",                        333, NULL },
+  { "f",                                 278, NULL },
+  { "Lacute",                            556, NULL },
+  { "sacute",                            389, NULL },
+  { "Idieresis",                         333, NULL },
+  { "ograve",                            500, NULL },
+  { "Rcommaaccent",                      611, NULL },
+  { "quotedblleft",                      556, NULL },
+  { "ordfeminine",                       276, NULL },
   { "omacron",                           500, NULL },
-  { "Tcommaaccent",                      556, NULL },
-  { "O",                                 722, NULL },
-  { "P",                                 611, NULL },
-  { "Q",                                 722, NULL },
-  { "Uhungarumlaut",                     722, NULL },
+  { "Delta",                             612, NULL },
+  { "comma",                             250, NULL },
+  { "Gbreve",                            722, NULL },
+  { "S",                                 500, NULL },
+  { "B",                                 611, NULL },
+  { "kcommaaccent",                      444, NULL },
+  { "yacute",                            444, NULL },
+  { "Rcaron",                            611, NULL },
   { "R",                                 611, NULL },
-  { "Aacute",                            611, NULL },
-  { "caron",                             333, NULL },
-  { "S",                                 500, NULL },
-  { "T",                                 556, NULL },
-  { "U",                                 722, NULL },
-  { "agrave",                            500, NULL },
-  { "V",                                 611, NULL },
-  { "W",                                 833, NULL },
-  { "X",                                 611, NULL },
-  { "question",                          500, NULL },
-  { "equal",                             675, NULL },
-  { "Y",                                 556, NULL },
-  { "Z",                                 556, NULL },
-  { "four",                              500, NULL },
+  { "ydieresis",                         444, NULL },
+  { "ugrave",                            500, NULL },
+  { "dcaron",                            544, NULL },
+  { "Oslash",                            722, NULL },
+  { "hyphen",                            333, NULL },
   { "a",                                 500, NULL },
-  { "Gcommaaccent",                      722, NULL },
-  { "b",                                 500, NULL },
-  { "c",                                 444, NULL },
-  { "d",                                 500, NULL },
-  { "e",                                 444, NULL },
-  { "f",                                 278, NULL },
-  { "g",                                 500, NULL },
+  { "umacron",                           500, NULL },
+  { "Otilde",                            722, NULL },
+  { "Tcaron",                            556, NULL },
+  { "aacute",                            500, NULL },
+  { "scaron",                            389, NULL },
+  { "guillemotright",                    500, NULL },
+  { "eogonek",                           444, NULL },
   { "bullet",                            350, NULL },
+  { "eacute",                            444, NULL },
+  { "Zdotaccent",                        556, NULL },
+  { "Udieresis",                         722, NULL },
+  { "Abreve",                            611, NULL },
+  { "Iacute",                            333, NULL },
+  { "two",                               500, NULL },
+  { "uacute",                            500, NULL },
+  { "seven",                             500, NULL },
+  { "dieresis",                          333, NULL },
+  { "Eacute",                            611, NULL },
+  { "O",                                 722, NULL },
+  { "Icircumflex",                       333, NULL },
+  { "nacute",                            500, NULL },
+  { "trademark",                         980, NULL },
+  { "ampersand",                         778, NULL },
+  { "Lcommaaccent",                      556, NULL },
+  { "ntilde",                            500, NULL },
+  { "fi",                                500, NULL },
+  { "Atilde",                            611, NULL },
+  { "Edieresis",                         611, NULL },
+  { "Yacute",                            556, NULL },
+  { "oacute",                            500, NULL },
+  { "daggerdbl",                         500, NULL },
+  { "braceleft",                         400, NULL },
+  { "braceright",                        400, NULL },
+  { "acute",                             333, NULL },
+  { "onequarter",                        750, NULL },
+  { "multiply",                          675, NULL },
+  { "i",                                 278, NULL },
+  { "bar",                               275, NULL },
+  { "quotesingle",                       214, NULL },
+  { "six",                               500, NULL },
+  { "edotaccent",                        444, NULL },
+  { "P",                                 611, NULL },
+  { "lslash",                            278, NULL },
+  { "guilsinglleft",                     333, NULL },
   { "h",                                 500, NULL },
-  { "i",                                 278, NULL },
-  { "Oslash",                            722, NULL },
-  { "dagger",                            500, NULL },
-  { "j",                                 278, NULL },
-  { "k",                                 444, NULL },
-  { "l",                                 278, NULL },
+  { "Cacute",                            667, NULL },
+  { "plus",                              675, NULL },
+  { "igrave",                            278, NULL },
+  { "dcroat",                            500, NULL },
+  { "question",                          500, NULL },
+  { "summation",                         600, NULL },
+  { "A",                                 611, NULL },
+  { "x",                                 444, NULL },
+  { "Iogonek",                           333, NULL },
+  { "y",                                 444, NULL },
+  { "edieresis",                         444, NULL },
+  { "Ncaron",                            667, NULL },
   { "m",                                 722, NULL },
-  { "n",                                 500, NULL },
+  { "OE",                                944, NULL },
+  { "U",                                 722, NULL },
+  { "partialdiff",                       476, NULL },
+  { "ncommaaccent",                      500, NULL },
   { "tcommaaccent",                      278, NULL },
-  { "o",                                 500, NULL },
-  { "ordfeminine",                       276, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 500, NULL },
-  { "q",                                 500, NULL },
-  { "uhungarumlaut",                     500, NULL },
-  { "r",                                 389, NULL },
-  { "twosuperior",                       300, NULL },
-  { "aacute",                            500, NULL },
-  { "s",                                 389, NULL },
-  { "OE",                                944, NULL },
-  { "t",                                 278, NULL },
-  { "divide",                            675, NULL },
-  { "u",                                 500, NULL },
-  { "Ccaron",                            667, NULL },
+  { "logicalnot",                        675, NULL },
+  { "cacute",                            444, NULL },
+  { "Dcroat",                            722, NULL },
+  { "tcaron",                            300, NULL },
+  { "rcaron",                            389, NULL },
+  { "rcommaaccent",                      389, NULL },
+  { "Kcommaaccent",                      667, NULL },
+  { "imacron",                           278, NULL },
+  { "tilde",                             333, NULL },
+  { "underscore",                        500, NULL },
+  { "mu",                                500, NULL },
+  { "D",                                 722, NULL },
+  { "racute",                            389, NULL },
+  { "Tcommaaccent",                      556, NULL },
+  { "dollar",                            500, NULL },
   { "v",                                 444, NULL },
-  { "w",                                 667, NULL },
-  { "x",                                 444, NULL },
-  { "y",                                 444, NULL },
-  { "z",                                 389, NULL },
-  { "Gbreve",                            722, NULL },
-  { "commaaccent",                       250, NULL },
-  { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        333, NULL },
   { "Nacute",                            667, NULL },
-  { "quotedbl",                          420, NULL },
-  { "gcommaaccent",                      500, NULL },
-  { "mu",                                500, NULL },
-  { "greaterequal",                      549, NULL },
-  { "Scaron",                            500, NULL },
-  { "Lslash",                            556, NULL },
-  { "semicolon",                         333, NULL },
-  { "oslash",                            500, NULL },
+  { "dotaccent",                         333, NULL },
+  { "ae",                                667, NULL },
+  { "cent",                              500, NULL },
+  { "ocircumflex",                       500, NULL },
+  { "less",                              675, NULL },
+  { "four",                              500, NULL },
+  { "minus",                             675, NULL },
+  { "circumflex",                        333, NULL },
+  { "Zcaron",                            556, NULL },
+  { "ogonek",                            333, NULL },
+  { "idieresis",                         278, NULL },
+  { "parenleft",                         333, NULL },
+  { "currency",                          500, NULL },
+  { "nine",                              500, NULL },
+  { "quotesinglbase",                    333, NULL },
+  { "grave",                             333, NULL },
+  { "Scedilla",                          500, NULL },
+  { "ccaron",                            444, NULL },
   { "lessequal",                         549, NULL },
-  { "lozenge",                           471, NULL },
-  { "parenright",                        333, NULL },
-  { "ccaron",                            444, NULL },
-  { "Ecircumflex",                       611, NULL },
-  { "gbreve",                            500, NULL },
-  { "trademark",                         980, NULL },
-  { "daggerdbl",                         500, NULL },
-  { "nacute",                            500, NULL },
-  { "macron",                            333, NULL },
-  { "Otilde",                            722, NULL },
-  { "Emacron",                           611, NULL },
-  { "ellipsis",                          889, NULL },
-  { "scaron",                            389, NULL },
-  { "AE",                                889, NULL },
+  { "Omacron",                           722, NULL },
   { "Ucircumflex",                       722, NULL },
-  { "lslash",                            278, NULL },
-  { "quotedblleft",                      556, NULL },
-  { "guilsinglright",                    333, NULL },
-  { "hyphen",                            333, NULL },
-  { "quotesingle",                       214, NULL },
-  { "eight",                             500, NULL },
-  { "exclamdown",                        389, NULL },
+  { "hungarumlaut",                      333, NULL },
+  { "j",                                 278, NULL },
+  { "Ccaron",                            667, NULL },
+  { "Y",                                 556, NULL },
+  { "yen",                               500, NULL },
+  { "w",                                 667, NULL },
+  { "space",                             250, NULL },
+  { "Thorn",                             611, NULL },
+  { "eth",                               500, NULL },
+  { "twosuperior",                       300, NULL },
+  { "ecaron",                            444, NULL },
+  { "brokenbar",                         275, NULL },
+  { "Aogonek",                           611, NULL },
+  { "fl",                                500, NULL },
+  { "quotedblbase",                      556, NULL },
+  { "E",                                 611, NULL },
   { "endash",                            500, NULL },
-  { "oe",                                667, NULL },
-  { "Abreve",                            611, NULL },
-  { "Umacron",                           722, NULL },
-  { "ecircumflex",                       444, NULL },
-  { "Adieresis",                         611, NULL },
-  { "copyright",                         760, NULL },
-  { "Egrave",                            611, NULL },
-  { "slash",                             278, NULL },
-  { "Edieresis",                         611, NULL },
-  { "otilde",                            500, NULL },
-  { "Idieresis",                         333, NULL },
-  { "parenleft",                         333, NULL },
-  { "one",                               500, NULL },
+  { "guillemotleft",                     500, NULL },
+  { "amacron",                           500, NULL },
+  { "Ncommaaccent",                      667, NULL },
+  { "numbersign",                        500, NULL },
+  { "divide",                            675, NULL },
   { "emacron",                           444, NULL },
-  { "Odieresis",                         722, NULL },
-  { "ucircumflex",                       500, NULL },
-  { "bracketleft",                       389, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        333, NULL },
-  { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         556, NULL },
-  { "umacron",                           500, NULL },
-  { "abreve",                            500, NULL },
-  { "Eacute",                            611, NULL },
-  { "adieresis",                         500, NULL },
-  { "egrave",                            444, NULL },
-  { "edieresis",                         444, NULL },
-  { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
-  { "ae",                                667, NULL },
-  { "asterisk",                          500, NULL },
+  { "M",                                 833, NULL },
   { "odieresis",                         500, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            500, NULL },
-  { "nine",                              500, NULL },
-  { "five",                              500, NULL },
-  { "udieresis",                         500, NULL },
-  { "Zcaron",                            556, NULL },
-  { "Scommaaccent",                      500, NULL },
-  { "threequarters",                     750, NULL },
-  { "guillemotright",                    500, NULL },
-  { "Ccedilla",                          667, NULL },
-  { "ydieresis",                         444, NULL },
-  { "tilde",                             333, NULL },
-  { "at",                                920, NULL },
-  { "eacute",                            444, NULL },
-  { "underscore",                        500, NULL },
-  { "Euro",                              500, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          675, NULL },
-  { "zero",                              500, NULL },
-  { "eth",                               500, NULL },
-  { "Scedilla",                          500, NULL },
   { "Ograve",                            722, NULL },
-  { "Racute",                            611, NULL },
-  { "partialdiff",                       476, NULL },
-  { "uacute",                            500, NULL },
-  { "braceleft",                         400, NULL },
-  { "Thorn",                             611, NULL },
-  { "zcaron",                            389, NULL },
-  { "scommaaccent",                      389, NULL },
-  { "ccedilla",                          444, NULL },
-  { "Dcaron",                            722, NULL },
-  { "dcroat",                            500, NULL },
+  { "T",                                 556, NULL },
+  { "G",                                 722, NULL },
+  { "F",                                 611, NULL },
   { "Ocircumflex",                       722, NULL },
-  { "Oacute",                            722, NULL },
+  { "Uring",                             722, NULL },
+  { "Edotaccent",                        611, NULL },
+  { "perthousand",                      1000, NULL },
+  { "acircumflex",                       500, NULL },
+  { "zero",                              500, NULL },
+  { "period",                            250, NULL },
   { "scedilla",                          389, NULL },
-  { "ogonek",                            333, NULL },
-  { "ograve",                            500, NULL },
-  { "racute",                            389, NULL },
-  { "Tcaron",                            556, NULL },
-  { "Eogonek",                           611, NULL },
-  { "thorn",                             500, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        760, NULL },
-  { "radical",                           453, NULL },
-  { "Aring",                             611, NULL },
-  { "percent",                           833, NULL },
-  { "six",                               500, NULL },
-  { "paragraph",                         523, NULL },
-  { "dcaron",                            544, NULL },
-  { "Uogonek",                           722, NULL },
-  { "two",                               500, NULL },
-  { "summation",                         600, NULL },
+  { "udieresis",                         500, NULL },
+  { "Ccedilla",                          667, NULL },
   { "Igrave",                            333, NULL },
-  { "Lacute",                            556, NULL },
-  { "ocircumflex",                       500, NULL },
-  { "oacute",                            500, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      556, NULL },
-  { "tcaron",                            300, NULL },
-  { "eogonek",                           444, NULL },
-  { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     722, NULL },
-  { "asciicircum",                       422, NULL },
-  { "aring",                             500, NULL },
-  { "grave",                             333, NULL },
-  { "uogonek",                           500, NULL },
+  { "commaaccent",                       250, NULL },
   { "bracketright",                      389, NULL },
-  { "Iacute",                            333, NULL },
-  { "ampersand",                         778, NULL },
-  { "igrave",                            278, NULL },
-  { "lacute",                            278, NULL },
-  { "Ncaron",                            667, NULL },
-  { "plus",                              675, NULL },
-  { "uring",                             500, NULL },
-  { "quotesinglbase",                    333, NULL },
-  { "lcommaaccent",                      278, NULL },
-  { "Yacute",                            556, NULL },
-  { "ohungarumlaut",                     500, NULL },
-  { "threesuperior",                     300, NULL },
-  { "acute",                             333, NULL },
-  { "section",                           500, NULL },
-  { "dieresis",                          333, NULL },
-  { "iacute",                            278, NULL },
-  { "quotedblbase",                      556, NULL },
-  { "ncaron",                            500, NULL },
-  { "florin",                            500, NULL },
-  { "yacute",                            444, NULL },
-  { "Rcommaaccent",                      611, NULL },
-  { "fi",                                500, NULL },
-  { "fl",                                500, NULL },
-  { "Acircumflex",                       611, NULL },
-  { "Cacute",                            667, NULL },
-  { "Icircumflex",                       333, NULL },
-  { "guillemotleft",                     500, NULL },
+  { "W",                                 833, NULL },
+  { "Ugrave",                            722, NULL },
   { "germandbls",                        500, NULL },
-  { "Amacron",                           611, NULL },
-  { "seven",                             500, NULL },
-  { "Sacute",                            500, NULL },
-  { "ordmasculine",                      310, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          500, NULL },
-  { "notequal",                          549, NULL },
+  { "thorn",                             500, NULL },
+  { "dagger",                            500, NULL },
+  { "equal",                             675, NULL },
+  { "N",                                 667, NULL },
+  { "C",                                 667, NULL },
+  { "u",                                 500, NULL },
+  { "q",                                 500, NULL },
+  { "l",                                 278, NULL },
+  { "icircumflex",                       278, NULL },
+  { "abreve",                            500, NULL },
   { "Imacron",                           333, NULL },
-  { "rcommaaccent",                      389, NULL },
-  { "Zdotaccent",                        556, NULL },
-  { "acircumflex",                       500, NULL },
-  { "cacute",                            444, NULL },
+  { "iacute",                            278, NULL },
+  { "e",                                 444, NULL },
+  { "percent",                           833, NULL },
+  { "o",                                 500, NULL },
+  { "greater",                           675, NULL },
+  { "Emacron",                           611, NULL },
+  { "scommaaccent",                      389, NULL },
+  { "asterisk",                          500, NULL },
+  { "onesuperior",                       300, NULL },
+  { "n",                                 500, NULL },
   { "Ecaron",                            611, NULL },
-  { "icircumflex",                       278, NULL },
-  { "braceright",                        400, NULL },
-  { "quotedblright",                     556, NULL },
-  { "amacron",                           500, NULL },
-  { "sacute",                            389, NULL },
-  { "imacron",                           278, NULL },
-  { "cent",                              500, NULL },
-  { "currency",                          500, NULL },
-  { "logicalnot",                        675, NULL },
+  { "threesuperior",                     300, NULL },
   { "zdotaccent",                        389, NULL },
-  { "Atilde",                            611, NULL },
-  { "breve",                             333, NULL },
-  { "bar",                               275, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              675, NULL },
-  { "ecaron",                            444, NULL },
-  { "guilsinglleft",                     333, NULL },
-  { "exclam",                            333, NULL },
-  { "period",                            250, NULL },
-  { "Rcaron",                            611, NULL },
-  { "Kcommaaccent",                      667, NULL },
-  { "greater",                           675, NULL },
-  { "atilde",                            500, NULL },
-  { "brokenbar",                         275, NULL },
+  { "lcommaaccent",                      278, NULL },
+  { "onehalf",                           750, NULL },
+  { "gbreve",                            500, NULL },
+  { "uhungarumlaut",                     500, NULL },
+  { "Racute",                            611, NULL },
+  { "k",                                 444, NULL },
+  { "copyright",                         760, NULL },
   { "quoteleft",                         333, NULL },
-  { "Edotaccent",                        611, NULL },
-  { "onesuperior",                       300, NULL }
+  { "registered",                        760, NULL },
+  { "Gcommaaccent",                      722, NULL },
+  { "emdash",                            889, NULL },
+  { "aogonek",                           500, NULL },
+  { "Egrave",                            611, NULL },
+  { "ring",                              333, NULL },
+  { "Odieresis",                         722, NULL },
+  { "oe",                                667, NULL },
+  { "five",                              500, NULL },
+  { "X",                                 611, NULL },
+  { "asciicircum",                       422, NULL },
+  { "plusminus",                         675, NULL },
+  { "Idotaccent",                        333, NULL },
+  { "cedilla",                           333, NULL },
+  { "quotedblright",                     556, NULL },
+  { "Eth",                               722, NULL },
+  { "g",                                 500, NULL },
+  { "colon",                             333, NULL },
+  { "ccedilla",                          444, NULL },
+  { "Ntilde",                            667, NULL },
+  { "radical",                           453, NULL },
+  { "dotlessi",                          278, NULL },
+  { "p",                                 500, NULL },
+  { "K",                                 667, NULL },
+  { "Scommaaccent",                      500, NULL },
+  { "Aacute",                            611, NULL },
+  { "b",                                 500, NULL },
+  { "Euro",                              500, NULL },
+  { "iogonek",                           278, NULL },
+  { "florin",                            500, NULL },
+  { "section",                           500, NULL },
+  { "Scaron",                            500, NULL },
+  { "degree",                            400, NULL },
+  { "lcaron",                            300, NULL },
+  { "paragraph",                         523, NULL },
+  { "zcaron",                            389, NULL },
+  { "aring",                             500, NULL },
+  { "Ydieresis",                         556, NULL },
+  { "Dcaron",                            722, NULL },
+  { "Z",                                 556, NULL },
+  { "ecircumflex",                       444, NULL },
+  { "Amacron",                           611, NULL },
+  { "breve",                             333, NULL }
 };
 
 static BuiltinFontWidth timesRomanWidthsTab[] = {
-  { "Ntilde",                            722, NULL },
-  { "rcaron",                            333, NULL },
-  { "kcommaaccent",                      500, NULL },
-  { "Ncommaaccent",                      722, NULL },
+  { "greaterequal",                      549, NULL },
+  { "at",                                921, NULL },
+  { "sterling",                          500, NULL },
+  { "H",                                 722, NULL },
+  { "caron",                             333, NULL },
+  { "Uogonek",                           722, NULL },
+  { "Lslash",                            611, NULL },
+  { "lacute",                            278, NULL },
+  { "Acircumflex",                       722, NULL },
+  { "oslash",                            500, NULL },
+  { "notequal",                          549, NULL },
+  { "Agrave",                            722, NULL },
+  { "AE",                                889, NULL },
+  { "exclam",                            333, NULL },
+  { "ohungarumlaut",                     500, NULL },
+  { "L",                                 611, NULL },
+  { "Ecircumflex",                       611, NULL },
+  { "threequarters",                     750, NULL },
+  { "J",                                 389, NULL },
+  { "Sacute",                            556, NULL },
+  { "Adieresis",                         722, NULL },
+  { "fraction",                          167, NULL },
+  { "atilde",                            444, NULL },
   { "Zacute",                            611, NULL },
-  { "comma",                             250, NULL },
-  { "cedilla",                           333, NULL },
-  { "plusminus",                         564, NULL },
-  { "circumflex",                        333, NULL },
-  { "dotaccent",                         333, NULL },
-  { "edotaccent",                        444, NULL },
+  { "Uacute",                            722, NULL },
   { "asciitilde",                        541, NULL },
-  { "colon",                             278, NULL },
-  { "onehalf",                           750, NULL },
-  { "dollar",                            500, NULL },
+  { "f",                                 333, NULL },
+  { "parenright",                        333, NULL },
+  { "otilde",                            500, NULL },
+  { "Ohungarumlaut",                     722, NULL },
+  { "bracketleft",                       333, NULL },
+  { "gcommaaccent",                      500, NULL },
+  { "Rcommaaccent",                      667, NULL },
+  { "ograve",                            500, NULL },
+  { "sacute",                            389, NULL },
+  { "Idieresis",                         333, NULL },
+  { "Lacute",                            611, NULL },
+  { "Q",                                 722, NULL },
+  { "exclamdown",                        333, NULL },
+  { "lozenge",                           471, NULL },
+  { "V",                                 722, NULL },
+  { "ncaron",                            500, NULL },
+  { "adieresis",                         444, NULL },
+  { "zacute",                            444, NULL },
+  { "Umacron",                           722, NULL },
+  { "semicolon",                         278, NULL },
+  { "guilsinglright",                    333, NULL },
+  { "quoteright",                        333, NULL },
+  { "uogonek",                           500, NULL },
+  { "Eogonek",                           611, NULL },
+  { "macron",                            333, NULL },
+  { "ordmasculine",                      310, NULL },
   { "Lcaron",                            611, NULL },
-  { "ntilde",                            500, NULL },
-  { "Aogonek",                           722, NULL },
-  { "ncommaaccent",                      500, NULL },
-  { "minus",                             564, NULL },
-  { "Iogonek",                           333, NULL },
-  { "zacute",                            444, NULL },
-  { "yen",                               500, NULL },
-  { "space",                             250, NULL },
-  { "Omacron",                           722, NULL },
+  { "backslash",                         278, NULL },
   { "questiondown",                      444, NULL },
-  { "emdash",                           1000, NULL },
-  { "Agrave",                            722, NULL },
+  { "ucircumflex",                       500, NULL },
+  { "r",                                 333, NULL },
+  { "slash",                             278, NULL },
   { "three",                             500, NULL },
-  { "numbersign",                        500, NULL },
-  { "lcaron",                            344, NULL },
-  { "A",                                 722, NULL },
-  { "B",                                 667, NULL },
-  { "C",                                 667, NULL },
-  { "aogonek",                           444, NULL },
-  { "D",                                 722, NULL },
-  { "E",                                 611, NULL },
+  { "Aring",                             722, NULL },
+  { "ellipsis",                         1000, NULL },
+  { "agrave",                            444, NULL },
+  { "Oacute",                            722, NULL },
+  { "quotedbl",                          408, NULL },
+  { "t",                                 278, NULL },
+  { "Uhungarumlaut",                     722, NULL },
+  { "z",                                 444, NULL },
+  { "uring",                             500, NULL },
+  { "s",                                 389, NULL },
+  { "egrave",                            444, NULL },
+  { "c",                                 444, NULL },
+  { "d",                                 500, NULL },
+  { "periodcentered",                    250, NULL },
+  { "I",                                 333, NULL },
+  { "eight",                             500, NULL },
+  { "one",                               500, NULL },
   { "onequarter",                        750, NULL },
-  { "F",                                 556, NULL },
-  { "G",                                 722, NULL },
-  { "H",                                 722, NULL },
-  { "I",                                 333, NULL },
-  { "J",                                 389, NULL },
-  { "K",                                 722, NULL },
-  { "iogonek",                           278, NULL },
-  { "backslash",                         278, NULL },
-  { "L",                                 611, NULL },
-  { "periodcentered",                    250, NULL },
-  { "M",                                 889, NULL },
-  { "N",                                 722, NULL },
-  { "omacron",                           500, NULL },
-  { "Tcommaaccent",                      611, NULL },
-  { "O",                                 722, NULL },
+  { "braceright",                        480, NULL },
+  { "braceleft",                         480, NULL },
+  { "acute",                             333, NULL },
+  { "daggerdbl",                         500, NULL },
+  { "oacute",                            500, NULL },
+  { "Yacute",                            722, NULL },
+  { "Edieresis",                         611, NULL },
+  { "Atilde",                            722, NULL },
   { "P",                                 556, NULL },
-  { "Q",                                 722, NULL },
-  { "Uhungarumlaut",                     722, NULL },
-  { "R",                                 667, NULL },
-  { "Aacute",                            722, NULL },
-  { "caron",                             333, NULL },
-  { "S",                                 556, NULL },
-  { "T",                                 611, NULL },
-  { "U",                                 722, NULL },
-  { "agrave",                            444, NULL },
-  { "V",                                 722, NULL },
-  { "W",                                 944, NULL },
-  { "X",                                 722, NULL },
+  { "lslash",                            278, NULL },
+  { "six",                               500, NULL },
+  { "edotaccent",                        444, NULL },
+  { "quotesingle",                       180, NULL },
+  { "bar",                               200, NULL },
+  { "i",                                 278, NULL },
+  { "multiply",                          564, NULL },
+  { "A",                                 722, NULL },
   { "question",                          444, NULL },
-  { "equal",                             564, NULL },
-  { "Y",                                 722, NULL },
-  { "Z",                                 611, NULL },
-  { "four",                              500, NULL },
-  { "a",                                 444, NULL },
-  { "Gcommaaccent",                      722, NULL },
-  { "b",                                 500, NULL },
-  { "c",                                 444, NULL },
-  { "d",                                 500, NULL },
-  { "e",                                 444, NULL },
-  { "f",                                 333, NULL },
-  { "g",                                 500, NULL },
-  { "bullet",                            350, NULL },
+  { "summation",                         600, NULL },
+  { "igrave",                            278, NULL },
+  { "dcroat",                            500, NULL },
+  { "plus",                              564, NULL },
+  { "guilsinglleft",                     333, NULL },
   { "h",                                 500, NULL },
-  { "i",                                 278, NULL },
-  { "Oslash",                            722, NULL },
-  { "dagger",                            500, NULL },
-  { "j",                                 278, NULL },
-  { "k",                                 500, NULL },
-  { "l",                                 278, NULL },
+  { "Cacute",                            667, NULL },
+  { "rcaron",                            333, NULL },
+  { "tcaron",                            326, NULL },
+  { "cacute",                            444, NULL },
+  { "Dcroat",                            722, NULL },
+  { "tcommaaccent",                      278, NULL },
+  { "logicalnot",                        564, NULL },
+  { "ncommaaccent",                      500, NULL },
+  { "partialdiff",                       476, NULL },
+  { "U",                                 722, NULL },
   { "m",                                 778, NULL },
-  { "n",                                 500, NULL },
-  { "tcommaaccent",                      278, NULL },
-  { "o",                                 500, NULL },
-  { "ordfeminine",                       276, NULL },
-  { "ring",                              333, NULL },
-  { "p",                                 500, NULL },
-  { "q",                                 500, NULL },
-  { "uhungarumlaut",                     500, NULL },
-  { "r",                                 333, NULL },
-  { "twosuperior",                       300, NULL },
-  { "aacute",                            444, NULL },
-  { "s",                                 389, NULL },
   { "OE",                                889, NULL },
-  { "t",                                 278, NULL },
-  { "divide",                            564, NULL },
-  { "u",                                 500, NULL },
-  { "Ccaron",                            667, NULL },
-  { "v",                                 500, NULL },
-  { "w",                                 722, NULL },
+  { "Ncaron",                            722, NULL },
   { "x",                                 500, NULL },
+  { "edieresis",                         444, NULL },
+  { "Iogonek",                           333, NULL },
   { "y",                                 500, NULL },
-  { "z",                                 444, NULL },
+  { "S",                                 556, NULL },
   { "Gbreve",                            722, NULL },
-  { "commaaccent",                       250, NULL },
-  { "hungarumlaut",                      333, NULL },
-  { "Idotaccent",                        333, NULL },
-  { "Nacute",                            722, NULL },
-  { "quotedbl",                          408, NULL },
-  { "gcommaaccent",                      500, NULL },
-  { "mu",                                500, NULL },
-  { "greaterequal",                      549, NULL },
-  { "Scaron",                            556, NULL },
-  { "Lslash",                            611, NULL },
-  { "semicolon",                         278, NULL },
-  { "oslash",                            500, NULL },
-  { "lessequal",                         549, NULL },
-  { "lozenge",                           471, NULL },
-  { "parenright",                        333, NULL },
-  { "ccaron",                            444, NULL },
-  { "Ecircumflex",                       611, NULL },
-  { "gbreve",                            500, NULL },
-  { "trademark",                         980, NULL },
-  { "daggerdbl",                         500, NULL },
-  { "nacute",                            500, NULL },
-  { "macron",                            333, NULL },
+  { "omacron",                           500, NULL },
+  { "comma",                             250, NULL },
+  { "Delta",                             612, NULL },
+  { "ordfeminine",                       276, NULL },
+  { "quotedblleft",                      444, NULL },
+  { "aacute",                            444, NULL },
+  { "Tcaron",                            611, NULL },
   { "Otilde",                            722, NULL },
-  { "Emacron",                           611, NULL },
-  { "ellipsis",                         1000, NULL },
-  { "scaron",                            389, NULL },
-  { "AE",                                889, NULL },
-  { "Ucircumflex",                       722, NULL },
-  { "lslash",                            278, NULL },
-  { "quotedblleft",                      444, NULL },
-  { "guilsinglright",                    333, NULL },
+  { "umacron",                           500, NULL },
+  { "Oslash",                            722, NULL },
   { "hyphen",                            333, NULL },
-  { "quotesingle",                       180, NULL },
-  { "eight",                             500, NULL },
-  { "exclamdown",                        333, NULL },
-  { "endash",                            500, NULL },
-  { "oe",                                722, NULL },
+  { "a",                                 444, NULL },
+  { "ugrave",                            500, NULL },
+  { "dcaron",                            588, NULL },
+  { "yacute",                            500, NULL },
+  { "kcommaaccent",                      500, NULL },
+  { "Rcaron",                            667, NULL },
+  { "R",                                 667, NULL },
+  { "ydieresis",                         500, NULL },
+  { "B",                                 667, NULL },
+  { "seven",                             500, NULL },
+  { "two",                               500, NULL },
+  { "uacute",                            500, NULL },
+  { "Iacute",                            333, NULL },
   { "Abreve",                            722, NULL },
-  { "Umacron",                           722, NULL },
-  { "ecircumflex",                       444, NULL },
-  { "Adieresis",                         722, NULL },
-  { "copyright",                         760, NULL },
-  { "Egrave",                            611, NULL },
-  { "slash",                             278, NULL },
-  { "Edieresis",                         611, NULL },
-  { "otilde",                            500, NULL },
-  { "Idieresis",                         333, NULL },
-  { "parenleft",                         333, NULL },
-  { "one",                               500, NULL },
-  { "emacron",                           444, NULL },
-  { "Odieresis",                         722, NULL },
-  { "ucircumflex",                       500, NULL },
-  { "bracketleft",                       333, NULL },
-  { "Ugrave",                            722, NULL },
-  { "quoteright",                        333, NULL },
   { "Udieresis",                         722, NULL },
-  { "perthousand",                      1000, NULL },
-  { "Ydieresis",                         722, NULL },
-  { "umacron",                           500, NULL },
-  { "abreve",                            444, NULL },
+  { "Zdotaccent",                        611, NULL },
+  { "eacute",                            444, NULL },
+  { "eogonek",                           444, NULL },
+  { "bullet",                            350, NULL },
+  { "guillemotright",                    500, NULL },
+  { "scaron",                            389, NULL },
+  { "fi",                                556, NULL },
+  { "ntilde",                            500, NULL },
+  { "Lcommaaccent",                      611, NULL },
+  { "trademark",                         980, NULL },
+  { "ampersand",                         778, NULL },
+  { "O",                                 722, NULL },
+  { "Icircumflex",                       333, NULL },
+  { "nacute",                            500, NULL },
   { "Eacute",                            611, NULL },
-  { "adieresis",                         444, NULL },
-  { "egrave",                            444, NULL },
-  { "edieresis",                         444, NULL },
-  { "idieresis",                         278, NULL },
-  { "Eth",                               722, NULL },
-  { "ae",                                667, NULL },
-  { "asterisk",                          500, NULL },
-  { "odieresis",                         500, NULL },
-  { "Uacute",                            722, NULL },
-  { "ugrave",                            500, NULL },
-  { "nine",                              500, NULL },
-  { "five",                              500, NULL },
-  { "udieresis",                         500, NULL },
-  { "Zcaron",                            611, NULL },
-  { "Scommaaccent",                      556, NULL },
-  { "threequarters",                     750, NULL },
-  { "guillemotright",                    500, NULL },
-  { "Ccedilla",                          667, NULL },
-  { "ydieresis",                         500, NULL },
-  { "tilde",                             333, NULL },
-  { "at",                                921, NULL },
-  { "eacute",                            444, NULL },
-  { "underscore",                        500, NULL },
-  { "Euro",                              500, NULL },
-  { "Dcroat",                            722, NULL },
-  { "multiply",                          564, NULL },
-  { "zero",                              500, NULL },
+  { "dieresis",                          333, NULL },
+  { "endash",                            500, NULL },
+  { "guillemotleft",                     500, NULL },
+  { "E",                                 611, NULL },
+  { "quotedblbase",                      444, NULL },
+  { "fl",                                556, NULL },
+  { "brokenbar",                         200, NULL },
+  { "Aogonek",                           722, NULL },
+  { "ecaron",                            444, NULL },
+  { "Thorn",                             556, NULL },
+  { "space",                             250, NULL },
+  { "twosuperior",                       300, NULL },
   { "eth",                               500, NULL },
-  { "Scedilla",                          556, NULL },
+  { "w",                                 722, NULL },
+  { "T",                                 611, NULL },
   { "Ograve",                            722, NULL },
-  { "Racute",                            667, NULL },
-  { "partialdiff",                       476, NULL },
-  { "uacute",                            500, NULL },
-  { "braceleft",                         480, NULL },
-  { "Thorn",                             556, NULL },
-  { "zcaron",                            444, NULL },
-  { "scommaaccent",                      389, NULL },
-  { "ccedilla",                          444, NULL },
-  { "Dcaron",                            722, NULL },
-  { "dcroat",                            500, NULL },
+  { "M",                                 889, NULL },
+  { "odieresis",                         500, NULL },
+  { "divide",                            564, NULL },
+  { "emacron",                           444, NULL },
+  { "numbersign",                        500, NULL },
+  { "Ncommaaccent",                      722, NULL },
+  { "amacron",                           444, NULL },
+  { "acircumflex",                       444, NULL },
+  { "Edotaccent",                        611, NULL },
+  { "perthousand",                      1000, NULL },
+  { "Uring",                             722, NULL },
   { "Ocircumflex",                       722, NULL },
-  { "Oacute",                            722, NULL },
+  { "F",                                 556, NULL },
+  { "G",                                 722, NULL },
+  { "thorn",                             500, NULL },
+  { "Ugrave",                            722, NULL },
+  { "germandbls",                        500, NULL },
+  { "bracketright",                      333, NULL },
+  { "W",                                 944, NULL },
+  { "commaaccent",                       250, NULL },
+  { "Igrave",                            333, NULL },
+  { "Ccedilla",                          667, NULL },
+  { "period",                            250, NULL },
   { "scedilla",                          389, NULL },
+  { "udieresis",                         500, NULL },
+  { "zero",                              500, NULL },
+  { "v",                                 500, NULL },
+  { "Nacute",                            722, NULL },
+  { "dotaccent",                         333, NULL },
+  { "Tcommaaccent",                      611, NULL },
+  { "dollar",                            500, NULL },
+  { "mu",                                500, NULL },
+  { "D",                                 722, NULL },
+  { "racute",                            333, NULL },
+  { "underscore",                        500, NULL },
+  { "tilde",                             333, NULL },
+  { "rcommaaccent",                      333, NULL },
+  { "Kcommaaccent",                      722, NULL },
+  { "imacron",                           278, NULL },
+  { "idieresis",                         278, NULL },
   { "ogonek",                            333, NULL },
-  { "ograve",                            500, NULL },
-  { "racute",                            333, NULL },
-  { "Tcaron",                            611, NULL },
-  { "Eogonek",                           611, NULL },
-  { "thorn",                             500, NULL },
-  { "degree",                            400, NULL },
-  { "registered",                        760, NULL },
-  { "radical",                           453, NULL },
-  { "Aring",                             722, NULL },
-  { "percent",                           833, NULL },
-  { "six",                               500, NULL },
-  { "paragraph",                         453, NULL },
-  { "dcaron",                            588, NULL },
-  { "Uogonek",                           722, NULL },
-  { "two",                               500, NULL },
-  { "summation",                         600, NULL },
-  { "Igrave",                            333, NULL },
-  { "Lacute",                            611, NULL },
+  { "Zcaron",                            611, NULL },
+  { "circumflex",                        333, NULL },
+  { "four",                              500, NULL },
+  { "minus",                             564, NULL },
   { "ocircumflex",                       500, NULL },
-  { "oacute",                            500, NULL },
-  { "Uring",                             722, NULL },
-  { "Lcommaaccent",                      611, NULL },
-  { "tcaron",                            326, NULL },
-  { "eogonek",                           444, NULL },
-  { "Delta",                             612, NULL },
-  { "Ohungarumlaut",                     722, NULL },
-  { "asciicircum",                       469, NULL },
-  { "aring",                             444, NULL },
+  { "less",                              564, NULL },
+  { "cent",                              500, NULL },
+  { "ae",                                667, NULL },
   { "grave",                             333, NULL },
-  { "uogonek",                           500, NULL },
-  { "bracketright",                      333, NULL },
-  { "Iacute",                            333, NULL },
-  { "ampersand",                         778, NULL },
-  { "igrave",                            278, NULL },
-  { "lacute",                            278, NULL },
-  { "Ncaron",                            722, NULL },
-  { "plus",                              564, NULL },
-  { "uring",                             500, NULL },
+  { "Scedilla",                          556, NULL },
   { "quotesinglbase",                    333, NULL },
-  { "lcommaaccent",                      278, NULL },
-  { "Yacute",                            722, NULL },
-  { "ohungarumlaut",                     500, NULL },
-  { "threesuperior",                     300, NULL },
-  { "acute",                             333, NULL },
+  { "currency",                          500, NULL },
+  { "nine",                              500, NULL },
+  { "parenleft",                         333, NULL },
+  { "yen",                               500, NULL },
+  { "Y",                                 722, NULL },
+  { "hungarumlaut",                      333, NULL },
+  { "Ccaron",                            667, NULL },
+  { "j",                                 278, NULL },
+  { "lessequal",                         549, NULL },
+  { "Ucircumflex",                       722, NULL },
+  { "Omacron",                           722, NULL },
+  { "ccaron",                            444, NULL },
+  { "X",                                 722, NULL },
+  { "asciicircum",                       469, NULL },
+  { "five",                              500, NULL },
+  { "Odieresis",                         722, NULL },
+  { "oe",                                722, NULL },
+  { "ring",                              333, NULL },
+  { "Egrave",                            611, NULL },
+  { "aogonek",                           444, NULL },
+  { "emdash",                           1000, NULL },
+  { "dotlessi",                          278, NULL },
+  { "p",                                 500, NULL },
+  { "radical",                           453, NULL },
+  { "Ntilde",                            722, NULL },
+  { "g",                                 500, NULL },
+  { "colon",                             278, NULL },
+  { "ccedilla",                          444, NULL },
+  { "quotedblright",                     444, NULL },
+  { "Eth",                               722, NULL },
+  { "plusminus",                         564, NULL },
+  { "Idotaccent",                        333, NULL },
+  { "cedilla",                           333, NULL },
   { "section",                           500, NULL },
-  { "dieresis",                          333, NULL },
-  { "iacute",                            278, NULL },
-  { "quotedblbase",                      444, NULL },
-  { "ncaron",                            500, NULL },
+  { "Scaron",                            556, NULL },
+  { "degree",                            400, NULL },
+  { "Euro",                              500, NULL },
   { "florin",                            500, NULL },
-  { "yacute",                            500, NULL },
-  { "Rcommaaccent",                      667, NULL },
-  { "fi",                                556, NULL },
-  { "fl",                                556, NULL },
-  { "Acircumflex",                       722, NULL },
-  { "Cacute",                            667, NULL },
-  { "Icircumflex",                       333, NULL },
-  { "guillemotleft",                     500, NULL },
-  { "germandbls",                        500, NULL },
+  { "iogonek",                           278, NULL },
+  { "b",                                 500, NULL },
+  { "Scommaaccent",                      556, NULL },
+  { "Aacute",                            722, NULL },
+  { "K",                                 722, NULL },
   { "Amacron",                           722, NULL },
-  { "seven",                             500, NULL },
-  { "Sacute",                            556, NULL },
-  { "ordmasculine",                      310, NULL },
-  { "dotlessi",                          278, NULL },
-  { "sterling",                          500, NULL },
-  { "notequal",                          549, NULL },
+  { "breve",                             333, NULL },
+  { "Z",                                 611, NULL },
+  { "ecircumflex",                       444, NULL },
+  { "Dcaron",                            722, NULL },
+  { "aring",                             444, NULL },
+  { "Ydieresis",                         722, NULL },
+  { "lcaron",                            344, NULL },
+  { "paragraph",                         453, NULL },
+  { "zcaron",                            444, NULL },
   { "Imacron",                           333, NULL },
-  { "rcommaaccent",                      333, NULL },
-  { "Zdotaccent",                        611, NULL },
-  { "acircumflex",                       444, NULL },
-  { "cacute",                            444, NULL },
-  { "Ecaron",                            611, NULL },
+  { "abreve",                            444, NULL },
+  { "e",                                 444, NULL },
+  { "iacute",                            278, NULL },
   { "icircumflex",                       278, NULL },
-  { "braceright",                        480, NULL },
-  { "quotedblright",                     444, NULL },
-  { "amacron",                           444, NULL },
-  { "sacute",                            389, NULL },
-  { "imacron",                           278, NULL },
-  { "cent",                              500, NULL },
-  { "currency",                          500, NULL },
-  { "logicalnot",                        564, NULL },
+  { "q",                                 500, NULL },
+  { "l",                                 278, NULL },
+  { "C",                                 667, NULL },
+  { "u",                                 500, NULL },
+  { "dagger",                            500, NULL },
+  { "equal",                             564, NULL },
+  { "N",                                 722, NULL },
+  { "onesuperior",                       300, NULL },
+  { "asterisk",                          500, NULL },
+  { "Emacron",                           611, NULL },
+  { "scommaaccent",                      389, NULL },
+  { "greater",                           564, NULL },
+  { "o",                                 500, NULL },
+  { "percent",                           833, NULL },
+  { "gbreve",                            500, NULL },
+  { "uhungarumlaut",                     500, NULL },
+  { "lcommaaccent",                      278, NULL },
+  { "onehalf",                           750, NULL },
+  { "threesuperior",                     300, NULL },
   { "zdotaccent",                        444, NULL },
-  { "Atilde",                            722, NULL },
-  { "breve",                             333, NULL },
-  { "bar",                               200, NULL },
-  { "fraction",                          167, NULL },
-  { "less",                              564, NULL },
-  { "ecaron",                            444, NULL },
-  { "guilsinglleft",                     333, NULL },
-  { "exclam",                            333, NULL },
-  { "period",                            250, NULL },
-  { "Rcaron",                            667, NULL },
-  { "Kcommaaccent",                      722, NULL },
-  { "greater",                           564, NULL },
-  { "atilde",                            444, NULL },
-  { "brokenbar",                         200, NULL },
+  { "Ecaron",                            611, NULL },
+  { "n",                                 500, NULL },
+  { "Gcommaaccent",                      722, NULL },
+  { "registered",                        760, NULL },
   { "quoteleft",                         333, NULL },
-  { "Edotaccent",                        611, NULL },
-  { "onesuperior",                       300, NULL }
+  { "copyright",                         760, NULL },
+  { "k",                                 500, NULL },
+  { "Racute",                            667, NULL }
 };
 
 static BuiltinFontWidth zapfDingbatsWidthsTab[] = {
-  { "a81",                               438, NULL },
-  { "a82",                               138, NULL },
-  { "a83",                               277, NULL },
-  { "a84",                               415, NULL },
-  { "a85",                               509, NULL },
-  { "a86",                               410, NULL },
+  { "a198",                              888, NULL },
+  { "a107",                              760, NULL },
+  { "a167",                              927, NULL },
+  { "a97",                               392, NULL },
+  { "a137",                              788, NULL },
+  { "a175",                              930, NULL },
+  { "a55",                               708, NULL },
+  { "a206",                              410, NULL },
+  { "a146",                              788, NULL },
+  { "a27",                               759, NULL },
+  { "a71",                               791, NULL },
+  { "a79",                               784, NULL },
+  { "a136",                              788, NULL },
+  { "a43",                               923, NULL },
+  { "a131",                              788, NULL },
+  { "a154",                              788, NULL },
+  { "a123",                              788, NULL },
+  { "a8",                                537, NULL },
   { "a87",                               234, NULL },
-  { "a88",                               234, NULL },
-  { "a89",                               390, NULL },
+  { "a72",                               873, NULL },
+  { "a199",                              867, NULL },
+  { "a151",                              788, NULL },
+  { "a99",                               668, NULL },
+  { "a126",                              788, NULL },
+  { "a46",                               749, NULL },
+  { "a34",                               794, NULL },
+  { "a186",                              967, NULL },
+  { "a102",                              544, NULL },
+  { "a205",                              509, NULL },
+  { "a62",                               707, NULL },
   { "a140",                              788, NULL },
-  { "a141",                              788, NULL },
-  { "a142",                              788, NULL },
-  { "a143",                              788, NULL },
-  { "a144",                              788, NULL },
-  { "a145",                              788, NULL },
-  { "a146",                              788, NULL },
-  { "a147",                              788, NULL },
-  { "a148",                              788, NULL },
-  { "a149",                              788, NULL },
   { "a90",                               390, NULL },
-  { "a91",                               276, NULL },
-  { "a92",                               276, NULL },
-  { "space",                             278, NULL },
-  { "a93",                               317, NULL },
-  { "a94",                               317, NULL },
-  { "a95",                               334, NULL },
-  { "a96",                               334, NULL },
-  { "a97",                               392, NULL },
   { "a98",                               392, NULL },
-  { "a99",                               668, NULL },
+  { "a9",                                577, NULL },
+  { "a178",                              883, NULL },
+  { "a26",                               760, NULL },
+  { "a40",                               833, NULL },
+  { "a125",                              788, NULL },
+  { "a101",                              732, NULL },
+  { "a103",                              544, NULL },
   { "a150",                              788, NULL },
-  { "a151",                              788, NULL },
+  { "a57",                               701, NULL },
+  { "a18",                               974, NULL },
+  { "a184",                              946, NULL },
+  { "space",                             278, NULL },
+  { "a74",                               762, NULL },
+  { "a168",                              928, NULL },
+  { "a147",                              788, NULL },
+  { "a187",                              831, NULL },
+  { "a110",                              694, NULL },
+  { "a143",                              788, NULL },
+  { "a36",                               823, NULL },
+  { "a41",                               816, NULL },
+  { "a86",                               410, NULL },
+  { "a164",                              458, NULL },
   { "a152",                              788, NULL },
-  { "a153",                              788, NULL },
-  { "a154",                              788, NULL },
-  { "a155",                              788, NULL },
+  { "a163",                             1016, NULL },
+  { "a3",                                980, NULL },
+  { "a160",                              894, NULL },
+  { "a166",                              918, NULL },
+  { "a117",                              690, NULL },
+  { "a83",                               277, NULL },
+  { "a29",                               786, NULL },
+  { "a22",                               761, NULL },
+  { "a112",                              776, NULL },
+  { "a133",                              788, NULL },
   { "a156",                              788, NULL },
+  { "a200",                              696, NULL },
+  { "a81",                               438, NULL },
+  { "a106",                              667, NULL },
+  { "a100",                              668, NULL },
+  { "a132",                              788, NULL },
+  { "a95",                               334, NULL },
+  { "a37",                               789, NULL },
+  { "a58",                               826, NULL },
+  { "a191",                              918, NULL },
+  { "a56",                               682, NULL },
+  { "a70",                               785, NULL },
   { "a157",                              788, NULL },
-  { "a158",                              788, NULL },
-  { "a159",                              788, NULL },
-  { "a160",                              894, NULL },
-  { "a161",                              838, NULL },
-  { "a162",                              924, NULL },
-  { "a163",                             1016, NULL },
-  { "a164",                              458, NULL },
-  { "a165",                              924, NULL },
-  { "a166",                              918, NULL },
-  { "a167",                              927, NULL },
-  { "a168",                              928, NULL },
-  { "a169",                              928, NULL },
-  { "a170",                              834, NULL },
   { "a171",                              873, NULL },
-  { "a172",                              828, NULL },
-  { "a173",                              924, NULL },
-  { "a174",                              917, NULL },
-  { "a175",                              930, NULL },
-  { "a176",                              931, NULL },
-  { "a177",                              463, NULL },
-  { "a178",                              883, NULL },
-  { "a179",                              836, NULL },
-  { "a180",                              867, NULL },
-  { "a181",                              696, NULL },
-  { "a182",                              874, NULL },
-  { "a183",                              760, NULL },
-  { "a184",                              946, NULL },
-  { "a185",                              865, NULL },
-  { "a186",                              967, NULL },
-  { "a187",                              831, NULL },
   { "a188",                              873, NULL },
-  { "a189",                              927, NULL },
-  { "a1",                                974, NULL },
+  { "a47",                               790, NULL },
+  { "a14",                               855, NULL },
+  { "a23",                               571, NULL },
   { "a2",                                961, NULL },
-  { "a3",                                980, NULL },
-  { "a4",                                719, NULL },
-  { "a5",                                789, NULL },
-  { "a6",                                494, NULL },
-  { "a7",                                552, NULL },
-  { "a8",                                537, NULL },
-  { "a9",                                577, NULL },
+  { "a77",                               892, NULL },
+  { "a105",                              911, NULL },
+  { "a25",                               763, NULL },
+  { "a202",                              974, NULL },
+  { "a61",                               789, NULL },
+  { "a10",                               692, NULL },
+  { "a44",                               744, NULL },
+  { "a159",                              788, NULL },
+  { "a48",                               792, NULL },
+  { "a124",                              788, NULL },
   { "a190",                              970, NULL },
-  { "a191",                              918, NULL },
-  { "a192",                              748, NULL },
-  { "a193",                              836, NULL },
-  { "a194",                              771, NULL },
-  { "a195",                              888, NULL },
-  { "a196",                              748, NULL },
-  { "a197",                              771, NULL },
-  { "a198",                              888, NULL },
-  { "a199",                              867, NULL },
-  { "a10",                               692, NULL },
+  { "a20",                               846, NULL },
+  { "a185",                              865, NULL },
+  { "a16",                               933, NULL },
   { "a11",                               960, NULL },
-  { "a12",                               939, NULL },
+  { "a134",                              788, NULL },
+  { "a108",                              760, NULL },
+  { "a28",                               754, NULL },
+  { "a149",                              788, NULL },
+  { "a172",                              828, NULL },
+  { "a1",                                974, NULL },
+  { "a144",                              788, NULL },
+  { "a92",                               276, NULL },
+  { "a66",                               786, NULL },
+  { "a189",                              927, NULL },
+  { "a54",                               707, NULL },
+  { "a59",                               815, NULL },
   { "a13",                               549, NULL },
-  { "a14",                               855, NULL },
-  { "a15",                               911, NULL },
-  { "a16",                               933, NULL },
+  { "a4",                                719, NULL },
+  { "a82",                               138, NULL },
+  { "a109",                              626, NULL },
+  { "a170",                              834, NULL },
+  { "a201",                              874, NULL },
+  { "a204",                              759, NULL },
+  { "a39",                               823, NULL },
+  { "a197",                              771, NULL },
+  { "a49",                               695, NULL },
+  { "a139",                              788, NULL },
+  { "a96",                               334, NULL },
+  { "a7",                                552, NULL },
+  { "a183",                              760, NULL },
+  { "a118",                              791, NULL },
+  { "a155",                              788, NULL },
+  { "a148",                              788, NULL },
+  { "a73",                               761, NULL },
+  { "a75",                               759, NULL },
+  { "a76",                               892, NULL },
+  { "a135",                              788, NULL },
+  { "a177",                              463, NULL },
+  { "a104",                              910, NULL },
+  { "a88",                               234, NULL },
+  { "a142",                              788, NULL },
+  { "a179",                              836, NULL },
   { "a17",                               945, NULL },
-  { "a18",                               974, NULL },
-  { "a19",                               755, NULL },
-  { "a20",                               846, NULL },
-  { "a21",                               762, NULL },
-  { "a22",                               761, NULL },
-  { "a23",                               571, NULL },
-  { "a24",                               677, NULL },
-  { "a25",                               763, NULL },
-  { "a26",                               760, NULL },
-  { "a27",                               759, NULL },
-  { "a28",                               754, NULL },
-  { "a29",                               786, NULL },
-  { "a30",                               788, NULL },
+  { "a203",                              762, NULL },
+  { "a141",                              788, NULL },
   { "a31",                               788, NULL },
-  { "a32",                               790, NULL },
-  { "a33",                               793, NULL },
-  { "a34",                               794, NULL },
+  { "a129",                              788, NULL },
   { "a35",                               816, NULL },
-  { "a36",                               823, NULL },
-  { "a37",                               789, NULL },
+  { "a182",                              874, NULL },
+  { "a15",                               911, NULL },
   { "a38",                               841, NULL },
-  { "a39",                               823, NULL },
-  { "a40",                               833, NULL },
-  { "a41",                               816, NULL },
-  { "a42",                               831, NULL },
-  { "a43",                               923, NULL },
-  { "a44",                               744, NULL },
+  { "a169",                              928, NULL },
+  { "a67",                               787, NULL },
   { "a45",                               723, NULL },
-  { "a46",                               749, NULL },
-  { "a47",                               790, NULL },
-  { "a48",                               792, NULL },
-  { "a49",                               695, NULL },
-  { "a100",                              668, NULL },
-  { "a101",                              732, NULL },
-  { "a102",                              544, NULL },
-  { "a103",                              544, NULL },
-  { "a104",                              910, NULL },
-  { "a105",                              911, NULL },
-  { "a106",                              667, NULL },
-  { "a107",                              760, NULL },
-  { "a108",                              760, NULL },
-  { "a109",                              626, NULL },
-  { "a50",                               776, NULL },
-  { "a51",                               768, NULL },
+  { "a93",                               317, NULL },
+  { "a195",                              888, NULL },
+  { "a68",                               713, NULL },
+  { "a6",                                494, NULL },
+  { "a24",                               677, NULL },
+  { "a21",                               762, NULL },
+  { "a192",                              748, NULL },
+  { "a138",                              788, NULL },
+  { "a65",                               689, NULL },
+  { "a84",                               415, NULL },
   { "a52",                               792, NULL },
+  { "a32",                               790, NULL },
+  { "a33",                               793, NULL },
+  { "a60",                               789, NULL },
+  { "a130",                              788, NULL },
+  { "a180",                              867, NULL },
+  { "a78",                               788, NULL },
+  { "a42",                               831, NULL },
+  { "a196",                              748, NULL },
+  { "a111",                              595, NULL },
   { "a53",                               759, NULL },
-  { "a54",                               707, NULL },
-  { "a55",                               708, NULL },
-  { "a56",                               682, NULL },
-  { "a57",                               701, NULL },
-  { "a58",                               826, NULL },
-  { "a59",                               815, NULL },
-  { "a110",                              694, NULL },
-  { "a111",                              595, NULL },
-  { "a112",                              776, NULL },
-  { "a117",                              690, NULL },
-  { "a118",                              791, NULL },
-  { "a119",                              790, NULL },
-  { "a60",                               789, NULL },
-  { "a61",                               789, NULL },
-  { "a62",                               707, NULL },
-  { "a63",                               687, NULL },
-  { "a64",                               696, NULL },
-  { "a65",                               689, NULL },
-  { "a66",                               786, NULL },
-  { "a67",                               787, NULL },
-  { "a68",                               713, NULL },
-  { "a69",                               791, NULL },
-  { "a200",                              696, NULL },
-  { "a201",                              874, NULL },
+  { "a161",                              838, NULL },
+  { "a94",                               317, NULL },
+  { "a85",                               509, NULL },
+  { "a51",                               768, NULL },
+  { "a181",                              696, NULL },
+  { "a176",                              931, NULL },
+  { "a50",                               776, NULL },
+  { "a173",                              924, NULL },
+  { "a153",                              788, NULL },
   { "a120",                              788, NULL },
+  { "a122",                              788, NULL },
+  { "a193",                              836, NULL },
+  { "a165",                              924, NULL },
+  { "a19",                               755, NULL },
+  { "a30",                               788, NULL },
+  { "a89",                               390, NULL },
+  { "a158",                              788, NULL },
+  { "a145",                              788, NULL },
   { "a121",                              788, NULL },
-  { "a202",                              974, NULL },
-  { "a122",                              788, NULL },
-  { "a203",                              762, NULL },
-  { "a123",                              788, NULL },
-  { "a204",                              759, NULL },
-  { "a124",                              788, NULL },
-  { "a205",                              509, NULL },
-  { "a125",                              788, NULL },
-  { "a206",                              410, NULL },
-  { "a126",                              788, NULL },
+  { "a194",                              771, NULL },
+  { "a64",                               696, NULL },
   { "a127",                              788, NULL },
+  { "a174",                              917, NULL },
+  { "a69",                               791, NULL },
   { "a128",                              788, NULL },
-  { "a129",                              788, NULL },
-  { "a70",                               785, NULL },
-  { "a71",                               791, NULL },
-  { "a72",                               873, NULL },
-  { "a73",                               761, NULL },
-  { "a74",                               762, NULL },
-  { "a75",                               759, NULL },
-  { "a76",                               892, NULL },
-  { "a77",                               892, NULL },
-  { "a78",                               788, NULL },
-  { "a79",                               784, NULL },
-  { "a130",                              788, NULL },
-  { "a131",                              788, NULL },
-  { "a132",                              788, NULL },
-  { "a133",                              788, NULL },
-  { "a134",                              788, NULL },
-  { "a135",                              788, NULL },
-  { "a136",                              788, NULL },
-  { "a137",                              788, NULL },
-  { "a138",                              788, NULL },
-  { "a139",                              788, NULL }
+  { "a91",                               276, NULL },
+  { "a63",                               687, NULL },
+  { "a5",                                789, NULL },
+  { "a119",                              790, NULL },
+  { "a12",                               939, NULL },
+  { "a162",                              924, NULL }
 };
 
 BuiltinFont builtinFonts[] = {
-  { "Courier",               standardEncoding,            629, -157, { -23, -250,  715,  805}, NULL },
-  { "Courier-Bold",          standardEncoding,            629, -157, {-113, -250,  749,  801}, NULL },
-  { "Courier-BoldOblique",   standardEncoding,            629, -157, { -57, -250,  869,  801}, NULL },
-  { "Courier-Oblique",       standardEncoding,            629, -157, { -27, -250,  849,  805}, NULL },
-  { "Helvetica",             standardEncoding,            718, -207, {-166, -225, 1000,  931}, NULL },
-  { "Helvetica-Bold",        standardEncoding,            718, -207, {-170, -228, 1003,  962}, NULL },
-  { "Helvetica-BoldOblique", standardEncoding,            718, -207, {-174, -228, 1114,  962}, NULL },
-  { "Helvetica-Oblique",     standardEncoding,            718, -207, {-170, -225, 1116,  931}, NULL },
-  { "Symbol",                symbolEncoding,             1010, -293, {-180, -293, 1090, 1010}, NULL },
-  { "Times-Bold",            standardEncoding,            683, -217, {-168, -218, 1000,  935}, NULL },
-  { "Times-BoldItalic",      standardEncoding,            683, -217, {-200, -218,  996,  921}, NULL },
-  { "Times-Italic",          standardEncoding,            683, -217, {-169, -217, 1010,  883}, NULL },
-  { "Times-Roman",           standardEncoding,            683, -217, {-168, -218, 1000,  898}, NULL },
-  { "ZapfDingbats",          zapfDingbatsEncoding,        820, -143, {  -1, -143,  981,  820}, NULL }
+  { "Courier",               standardEncoding,            600,  629, -157, { -23, -250,  715,  805}, NULL },
+  { "Courier-Bold",          standardEncoding,            600,  629, -157, {-113, -250,  749,  801}, NULL },
+  { "Courier-BoldOblique",   standardEncoding,            600,  629, -157, { -57, -250,  869,  801}, NULL },
+  { "Courier-Oblique",       standardEncoding,            600,  629, -157, { -27, -250,  849,  805}, NULL },
+  { "Helvetica",             standardEncoding,              0,  718, -207, {-166, -225, 1000,  931}, NULL },
+  { "Helvetica-Bold",        standardEncoding,              0,  718, -207, {-170, -228, 1003,  962}, NULL },
+  { "Helvetica-BoldOblique", standardEncoding,              0,  718, -207, {-174, -228, 1114,  962}, NULL },
+  { "Helvetica-Oblique",     standardEncoding,              0,  718, -207, {-170, -225, 1116,  931}, NULL },
+  { "Symbol",                symbolEncoding,                0, 1010, -293, {-180, -293, 1090, 1010}, NULL },
+  { "Times-Bold",            standardEncoding,              0,  683, -217, {-168, -218, 1000,  935}, NULL },
+  { "Times-BoldItalic",      standardEncoding,              0,  683, -217, {-200, -218,  996,  921}, NULL },
+  { "Times-Italic",          standardEncoding,              0,  683, -217, {-169, -217, 1010,  883}, NULL },
+  { "Times-Roman",           standardEncoding,              0,  683, -217, {-168, -218, 1000,  898}, NULL },
+  { "ZapfDingbats",          zapfDingbatsEncoding,          0,  820, -143, {  -1, -143,  981,  820}, NULL }
 };
 
 BuiltinFont *builtinFontSubst[] = {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CMakeLists.txt	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CMakeLists.txt	2019-05-30 16:25:31 UTC (rev 814)
@@ -56,6 +56,7 @@
   OutputDev.cc
   Page.cc
   Parser.cc
+  PDF417Barcode.cc
   PDFDoc.cc
   PDFDocEncoding.cc
   PSTokenizer.cc
@@ -63,6 +64,7 @@
   Stream.cc
   TextString.cc
   UnicodeMap.cc
+  UnicodeRemapping.cc
   UnicodeTypeTable.cc
   UTF8.cc
   XFAForm.cc
@@ -106,6 +108,7 @@
     pdftops.cc
   )
   target_link_libraries(pdftops goo fofi splash
+                        ${PAPER_LIBRARY}
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
                         ${LCMS_LIBRARY})
@@ -116,10 +119,10 @@
     PSOutputDev.cc
     pdftops.cc
   )
-  target_link_libraries(pdftops goo fofi ${LCMS_LIBRARY})
+  target_link_libraries(pdftops goo fofi ${PAPER_LIBRARY} ${LCMS_LIBRARY})
 endif ()
-install(TARGETS pdftops RUNTIME DESTINATION bin)
-install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftops.1 DESTINATION man/man1)
+install(TARGETS pdftops RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftops.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
 #--- pdftotext
 
@@ -128,9 +131,9 @@
   TextOutputDev.cc
   pdftotext.cc
 )
-target_link_libraries(pdftotext goo fofi ${LCMS_LIBRARY})
-install(TARGETS pdftotext RUNTIME DESTINATION bin)
-install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftotext.1 DESTINATION man/man1)
+target_link_libraries(pdftotext goo fofi ${PAPER_LIBRARY} ${LCMS_LIBRARY})
+install(TARGETS pdftotext RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftotext.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
 #--- pdftohtml
 
@@ -143,11 +146,12 @@
     pdftohtml.cc
   )
   target_link_libraries(pdftohtml goo fofi splash
+                        ${PAPER_LIBRARY}
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
                         ${LCMS_LIBRARY} ${PNG_LIBRARIES})
-  install(TARGETS pdftohtml RUNTIME DESTINATION bin)
-  install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftohtml.1 DESTINATION man/man1)
+  install(TARGETS pdftohtml RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftohtml.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif ()
 
 #--- pdfinfo
@@ -156,9 +160,9 @@
   $<TARGET_OBJECTS:xpdf_objs>
   pdfinfo.cc
 )
-target_link_libraries(pdfinfo goo fofi ${LCMS_LIBRARY})
-install(TARGETS pdfinfo RUNTIME DESTINATION bin)
-install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfinfo.1 DESTINATION man/man1)
+target_link_libraries(pdfinfo goo fofi ${PAPER_LIBRARY} ${LCMS_LIBRARY})
+install(TARGETS pdfinfo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfinfo.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
 #--- pdffonts
 
@@ -166,9 +170,9 @@
   $<TARGET_OBJECTS:xpdf_objs>
   pdffonts.cc
 )
-target_link_libraries(pdffonts goo fofi ${LCMS_LIBRARY})
-install(TARGETS pdffonts RUNTIME DESTINATION bin)
-install(FILES ${PROJECT_SOURCE_DIR}/doc/pdffonts.1 DESTINATION man/man1)
+target_link_libraries(pdffonts goo fofi ${PAPER_LIBRARY} ${LCMS_LIBRARY})
+install(TARGETS pdffonts RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES ${PROJECT_SOURCE_DIR}/doc/pdffonts.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
 #--- pdfdetach
 
@@ -176,9 +180,9 @@
   $<TARGET_OBJECTS:xpdf_objs>
   pdfdetach.cc
 )
-target_link_libraries(pdfdetach goo fofi ${LCMS_LIBRARY})
-install(TARGETS pdfdetach RUNTIME DESTINATION bin)
-install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfdetach.1 DESTINATION man/man1)
+target_link_libraries(pdfdetach goo fofi ${PAPER_LIBRARY} ${LCMS_LIBRARY})
+install(TARGETS pdfdetach RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfdetach.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
 #--- pdftoppm
 
@@ -189,11 +193,12 @@
     pdftoppm.cc
   )
   target_link_libraries(pdftoppm goo fofi splash
+                        ${PAPER_LIBRARY}
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
                         ${LCMS_LIBRARY})
-  install(TARGETS pdftoppm RUNTIME DESTINATION bin)
-  install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftoppm.1 DESTINATION man/man1)
+  install(TARGETS pdftoppm RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftoppm.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif ()
 
 #--- pdftopng
@@ -205,11 +210,12 @@
     pdftopng.cc
   )
   target_link_libraries(pdftopng goo fofi splash
+                        ${PAPER_LIBRARY}
                         ${FREETYPE_LIBRARY} ${FREETYPE_OTHER_LIBS}
                         ${DTYPE_LIBRARY}
                         ${LCMS_LIBRARY} ${PNG_LIBRARIES})
-  install(TARGETS pdftopng RUNTIME DESTINATION bin)
-  install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftopng.1 DESTINATION man/man1)
+  install(TARGETS pdftopng RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(FILES ${PROJECT_SOURCE_DIR}/doc/pdftopng.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 endif ()
 
 #--- pdfimages
@@ -219,10 +225,10 @@
   ImageOutputDev.cc
   pdfimages.cc
 )
-target_link_libraries(pdfimages goo fofi ${LCMS_LIBRARY})
-install(TARGETS pdfimages RUNTIME DESTINATION bin)
-install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfimages.1 DESTINATION man/man1)
+target_link_libraries(pdfimages goo fofi ${PAPER_LIBRARY} ${LCMS_LIBRARY})
+install(TARGETS pdfimages RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(FILES ${PROJECT_SOURCE_DIR}/doc/pdfimages.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
 
 #--- xpdfrc man page
 
-install(FILES ${PROJECT_SOURCE_DIR}/doc/xpdfrc.5 DESTINATION man/man5)
+install(FILES ${PROJECT_SOURCE_DIR}/doc/xpdfrc.5 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Catalog.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Catalog.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Catalog.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -453,8 +453,13 @@
   }
   if (topPagesObj.dictLookup("Count", &countObj)->isInt()) {
     numPages = countObj.getInt();
-    if (numPages == 0) {
-      // Acrobat apparently scans the page tree if it sees a zero count
+    if (numPages == 0 || numPages > 50000) {
+      // 1. Acrobat apparently scans the page tree if it sees a zero
+      //    count.
+      // 2. Absurdly large page counts result in very slow loading,
+      //    because other code tries to fetch pages 1 through n.
+      // In both cases: ignore the given page count and scan the tree
+      // instead.
       numPages = countPageTree(&topPagesObj);
     }
   } else {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Decrypt.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Decrypt.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Decrypt.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -165,7 +165,7 @@
 	memcpy(test2, ownerKey->getCString(), 32);
 	for (i = 19; i >= 0; --i) {
 	  for (j = 0; j < keyLength; ++j) {
-	    tmpKey[j] = test[j] ^ i;
+	    tmpKey[j] = (Guchar)(test[j] ^ i);
 	  }
 	  rc4InitKey(tmpKey, keyLength, fState);
 	  fx = fy = 0;
@@ -274,10 +274,10 @@
     memcpy(buf, passwordPad, 32);
   }
   memcpy(buf + 32, ownerKey->getCString(), 32);
-  buf[64] = permissions & 0xff;
-  buf[65] = (permissions >> 8) & 0xff;
-  buf[66] = (permissions >> 16) & 0xff;
-  buf[67] = (permissions >> 24) & 0xff;
+  buf[64] = (Guchar)(permissions & 0xff);
+  buf[65] = (Guchar)((permissions >> 8) & 0xff);
+  buf[66] = (Guchar)((permissions >> 16) & 0xff);
+  buf[67] = (Guchar)((permissions >> 24) & 0xff);
   memcpy(buf + 68, fileID->getCString(), fileID->getLength());
   len = 68 + fileID->getLength();
   if (!encryptMetadata) {
@@ -305,7 +305,7 @@
     memcpy(test, userKey->getCString(), 32);
     for (i = 19; i >= 0; --i) {
       for (j = 0; j < keyLength; ++j) {
-	tmpKey[j] = fileKey[j] ^ i;
+	tmpKey[j] = (Guchar)(fileKey[j] ^ i);
       }
       rc4InitKey(tmpKey, keyLength, fState);
       fx = fy = 0;
@@ -348,11 +348,11 @@
   }
   switch (algo) {
   case cryptRC4:
-    objKey[keyLength] = objNum & 0xff;
-    objKey[keyLength + 1] = (objNum >> 8) & 0xff;
-    objKey[keyLength + 2] = (objNum >> 16) & 0xff;
-    objKey[keyLength + 3] = objGen & 0xff;
-    objKey[keyLength + 4] = (objGen >> 8) & 0xff;
+    objKey[keyLength] = (Guchar)(objNum & 0xff);
+    objKey[keyLength + 1] = (Guchar)((objNum >> 8) & 0xff);
+    objKey[keyLength + 2] = (Guchar)((objNum >> 16) & 0xff);
+    objKey[keyLength + 3] = (Guchar)(objGen & 0xff);
+    objKey[keyLength + 4] = (Guchar)((objGen >> 8) & 0xff);
     md5(objKey, keyLength + 5, objKey);
     if ((objKeyLength = keyLength + 5) > 16) {
       objKeyLength = 16;
@@ -359,11 +359,11 @@
     }
     break;
   case cryptAES:
-    objKey[keyLength] = objNum & 0xff;
-    objKey[keyLength + 1] = (objNum >> 8) & 0xff;
-    objKey[keyLength + 2] = (objNum >> 16) & 0xff;
-    objKey[keyLength + 3] = objGen & 0xff;
-    objKey[keyLength + 4] = (objGen >> 8) & 0xff;
+    objKey[keyLength] = (Guchar)(objNum & 0xff);
+    objKey[keyLength + 1] = (Guchar)((objNum >> 8) & 0xff);
+    objKey[keyLength + 2] = (Guchar)((objNum >> 16) & 0xff);
+    objKey[keyLength + 3] = (Guchar)(objGen & 0xff);
+    objKey[keyLength + 4] = (Guchar)((objGen >> 8) & 0xff);
     objKey[keyLength + 5] = 0x73; // 's'
     objKey[keyLength + 6] = 0x41; // 'A'
     objKey[keyLength + 7] = 0x6c; // 'l'
@@ -516,14 +516,14 @@
   int i;
 
   for (i = 0; i < 256; ++i)
-    state[i] = i;
+    state[i] = (Guchar)i;
   index1 = index2 = 0;
   for (i = 0; i < 256; ++i) {
-    index2 = (key[index1] + state[i] + index2) % 256;
+    index2 = (Guchar)(key[index1] + state[i] + index2);
     t = state[i];
     state[i] = state[index2];
     state[index2] = t;
-    index1 = (index1 + 1) % keyLen;
+    index1 = (Guchar)((index1 + 1) % keyLen);
   }
 }
 
@@ -530,8 +530,8 @@
 Guchar rc4DecryptByte(Guchar *state, Guchar *x, Guchar *y, Guchar c) {
   Guchar x1, y1, tx, ty;
 
-  x1 = *x = (*x + 1) % 256;
-  y1 = *y = (state[*x] + *y) % 256;
+  x1 = *x = (Guchar)(*x + 1);
+  y1 = *y = (Guchar)(state[*x] + *y);
   tx = state[x1];
   ty = state[y1];
   state[x1] = ty;
@@ -672,7 +672,7 @@
 static inline Guchar mul02(Guchar s) {
   Guchar s2;
 
-  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
   return s2;
 }
 
@@ -680,7 +680,7 @@
 static inline Guchar mul03(Guchar s) {
   Guchar s2;
 
-  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
   return s ^ s2;
 }
 
@@ -688,9 +688,9 @@
 static inline Guchar mul09(Guchar s) {
   Guchar s2, s4, s8;
 
-  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
-  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
-  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
+  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
+  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
   return s ^ s8;
 }
 
@@ -698,9 +698,9 @@
 static inline Guchar mul0b(Guchar s) {
   Guchar s2, s4, s8;
 
-  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
-  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
-  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
+  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
+  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
   return s ^ s2 ^ s8;
 }
 
@@ -708,9 +708,9 @@
 static inline Guchar mul0d(Guchar s) {
   Guchar s2, s4, s8;
 
-  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
-  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
-  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
+  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
+  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
   return s ^ s4 ^ s8;
 }
 
@@ -718,9 +718,9 @@
 static inline Guchar mul0e(Guchar s) {
   Guchar s2, s4, s8;
 
-  s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
-  s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
-  s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+  s2 = (Guchar)((s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1));
+  s4 = (Guchar)((s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1));
+  s8 = (Guchar)((s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1));
   return s2 ^ s4 ^ s8;
 }
 
@@ -761,10 +761,10 @@
   Guchar s0, s1, s2, s3;
 
   for (c = 0; c < 4; ++c) {
-    s0 = w[c] >> 24;
-    s1 = w[c] >> 16;
-    s2 = w[c] >> 8;
-    s3 = w[c];
+    s0 = (Guchar)(w[c] >> 24);
+    s1 = (Guchar)(w[c] >> 16);
+    s2 = (Guchar)(w[c] >> 8);
+    s3 = (Guchar)w[c];
     w[c] = ((mul0e(s0) ^ mul0b(s1) ^ mul0d(s2) ^ mul09(s3)) << 24)
            | ((mul09(s0) ^ mul0e(s1) ^ mul0b(s2) ^ mul0d(s3)) << 16)
            | ((mul0d(s0) ^ mul09(s1) ^ mul0e(s2) ^ mul0b(s3)) << 8)
@@ -776,10 +776,10 @@
   int c;
 
   for (c = 0; c < 4; ++c) {
-    state[c] ^= w[c] >> 24;
-    state[4+c] ^= w[c] >> 16;
-    state[8+c] ^= w[c] >> 8;
-    state[12+c] ^= w[c];
+    state[c] ^= (Guchar)(w[c] >> 24);
+    state[4+c] ^= (Guchar)(w[c] >> 16);
+    state[8+c] ^= (Guchar)(w[c] >> 8);
+    state[12+c] ^= (Guchar)w[c];
   }
 }
 
@@ -993,22 +993,22 @@
 }
 
 static inline Gulong md5Round1(Gulong a, Gulong b, Gulong c, Gulong d,
-			       Gulong Xk,  Gulong s, Gulong Ti) {
+			       Gulong Xk, int s, Gulong Ti) {
   return b + rotateLeft((a + ((b & c) | (~b & d)) + Xk + Ti), s);
 }
 
 static inline Gulong md5Round2(Gulong a, Gulong b, Gulong c, Gulong d,
-			       Gulong Xk,  Gulong s, Gulong Ti) {
+			       Gulong Xk, int s, Gulong Ti) {
   return b + rotateLeft((a + ((b & d) | (c & ~d)) + Xk + Ti), s);
 }
 
 static inline Gulong md5Round3(Gulong a, Gulong b, Gulong c, Gulong d,
-			       Gulong Xk,  Gulong s, Gulong Ti) {
+			       Gulong Xk, int s, Gulong Ti) {
   return b + rotateLeft((a + (b ^ c ^ d) + Xk + Ti), s);
 }
 
 static inline Gulong md5Round4(Gulong a, Gulong b, Gulong c, Gulong d,
-			       Gulong Xk,  Gulong s, Gulong Ti) {
+			       Gulong Xk, int s, Gulong Ti) {
   return b + rotateLeft((a + (c ^ (b | ~d)) + Xk + Ti), s);
 }
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Dict.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Dict.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Dict.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -37,11 +37,11 @@
 
   // Reference counting.
 #if MULTITHREADED
-  int incRef() { return gAtomicIncrement(&ref); }
-  int decRef() { return gAtomicDecrement(&ref); }
+  long incRef() { return gAtomicIncrement(&ref); }
+  long decRef() { return gAtomicDecrement(&ref); }
 #else
-  int incRef() { return ++ref; }
-  int decRef() { return --ref; }
+  long incRef() { return ++ref; }
+  long decRef() { return --ref; }
 #endif
 
   // Get number of entries.
@@ -78,7 +78,7 @@
 #if MULTITHREADED
   GAtomicCounter ref;		// reference count
 #else
-  int ref;			// reference count
+  long ref;			// reference count
 #endif
 
   DictEntry *find(const char *key);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Function.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Function.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Function.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -1169,7 +1169,7 @@
       delete s;
       return NULL;
     }
-    codeString->append(c);
+    codeString->append((char)c);
     if (comment) {
       if (c == '\x0a' || c == '\x0d') {
 	comment = gFalse;
@@ -1190,7 +1190,7 @@
 	break;
       }
       str->getChar();
-      codeString->append(c);
+      codeString->append((char)c);
     }
   } else {
     while (1) {
@@ -1200,7 +1200,7 @@
 	break;
       }
       str->getChar();
-      codeString->append(c);
+      codeString->append((char)c);
     }
   }
   return s;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Gfx.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Gfx.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Gfx.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -947,7 +947,7 @@
   GfxColor backdropColor;
   GBool haveBackdropColor;
   GfxColorSpace *blendingColorSpace;
-  GBool alpha, isolated, knockout;
+  GBool alpha, knockout;
   double opac;
   int i;
 
@@ -1041,22 +1041,37 @@
 
   // fill/stroke overprint, overprint mode
   if ((haveFillOP = (obj1.dictLookup("op", &obj2)->isBool()))) {
-    state->setFillOverprint(obj2.getBool());
-    out->updateFillOverprint(state);
+    if (!state->getInCachedT3Char()) {
+      state->setFillOverprint(obj2.getBool());
+      out->updateFillOverprint(state);
+    } else {
+      error(errSyntaxWarning, getPos(),
+	    "Ignoring overprint setting in cached Type 3 character");
+    }
   }
   obj2.free();
   if (obj1.dictLookup("OP", &obj2)->isBool()) {
-    state->setStrokeOverprint(obj2.getBool());
-    out->updateStrokeOverprint(state);
-    if (!haveFillOP) {
-      state->setFillOverprint(obj2.getBool());
-      out->updateFillOverprint(state);
+    if (!state->getInCachedT3Char()) {
+      state->setStrokeOverprint(obj2.getBool());
+      out->updateStrokeOverprint(state);
+      if (!haveFillOP) {
+	state->setFillOverprint(obj2.getBool());
+	out->updateFillOverprint(state);
+      }
+    } else {
+      error(errSyntaxWarning, getPos(),
+	    "Ignoring overprint setting in cached Type 3 character");
     }
   }
   obj2.free();
   if (obj1.dictLookup("OPM", &obj2)->isInt()) {
-    state->setOverprintMode(obj2.getInt());
-    out->updateOverprintMode(state);
+    if (!state->getInCachedT3Char()) {
+      state->setOverprintMode(obj2.getInt());
+      out->updateOverprintMode(state);
+    } else {
+      error(errSyntaxWarning, getPos(),
+	    "Ignoring overprint setting in cached Type 3 character");
+    }
   }
   obj2.free();
 
@@ -1072,32 +1087,40 @@
     obj2.free();
     obj1.dictLookup("TR", &obj2);
   }
-  if (obj2.isName("Default") ||
-      obj2.isName("Identity")) {
-    funcs[0] = funcs[1] = funcs[2] = funcs[3] = NULL;
-    state->setTransfer(funcs);
-    out->updateTransfer(state);
-  } else if (obj2.isArray() && obj2.arrayGetLength() == 4) {
-    for (i = 0; i < 4; ++i) {
-      obj2.arrayGet(i, &obj3);
-      funcs[i] = Function::parse(&obj3);
-      obj3.free();
-      if (!funcs[i]) {
-	break;
+  if (!obj2.isNull()) {
+    if (!state->getInCachedT3Char()) {
+      if (obj2.isName("Default") ||
+	  obj2.isName("Identity")) {
+	funcs[0] = funcs[1] = funcs[2] = funcs[3] = NULL;
+	state->setTransfer(funcs);
+	out->updateTransfer(state);
+      } else if (obj2.isArray() && obj2.arrayGetLength() == 4) {
+	for (i = 0; i < 4; ++i) {
+	  obj2.arrayGet(i, &obj3);
+	  funcs[i] = Function::parse(&obj3);
+	  obj3.free();
+	  if (!funcs[i]) {
+	    break;
+	  }
+	}
+	if (i == 4) {
+	  state->setTransfer(funcs);
+	  out->updateTransfer(state);
+	}
+      } else if (obj2.isName() || obj2.isDict() || obj2.isStream()) {
+	if ((funcs[0] = Function::parse(&obj2))) {
+	  funcs[1] = funcs[2] = funcs[3] = NULL;
+	  state->setTransfer(funcs);
+	  out->updateTransfer(state);
+	}
+      } else {
+	error(errSyntaxError, getPos(),
+	      "Invalid transfer function in ExtGState");
       }
+    } else {
+      error(errSyntaxWarning, getPos(),
+	    "Ignoring transfer function setting in cached Type 3 character");
     }
-    if (i == 4) {
-      state->setTransfer(funcs);
-      out->updateTransfer(state);
-    }
-  } else if (obj2.isName() || obj2.isDict() || obj2.isStream()) {
-    if ((funcs[0] = Function::parse(&obj2))) {
-      funcs[1] = funcs[2] = funcs[3] = NULL;
-      state->setTransfer(funcs);
-      out->updateTransfer(state);
-    }
-  } else if (!obj2.isNull()) {
-    error(errSyntaxError, getPos(), "Invalid transfer function in ExtGState");
   }
   obj2.free();
 
@@ -1145,16 +1168,12 @@
       if (obj2.dictLookup("G", &obj3)->isStream()) {
 	if (obj3.streamGetDict()->lookup("Group", &obj4)->isDict()) {
 	  blendingColorSpace = NULL;
-	  isolated = knockout = gFalse;
+	  knockout = gFalse;
 	  if (!obj4.dictLookup("CS", &obj5)->isNull()) {
 	    blendingColorSpace = GfxColorSpace::parse(&obj5
 						      );
 	  }
 	  obj5.free();
-	  if (obj4.dictLookup("I", &obj5)->isBool()) {
-	    isolated = obj5.getBool();
-	  }
-	  obj5.free();
 	  if (obj4.dictLookup("K", &obj5)->isBool()) {
 	    knockout = obj5.getBool();
 	  }
@@ -1170,8 +1189,11 @@
 	    }
 	  }
 	  obj2.dictLookupNF("G", &objRef3);
+	  // it doesn't make sense for softmasks to be non-isolated,
+	  // because they're blended with a backdrop color, rather
+	  // than the original backdrop
 	  doSoftMask(&obj3, &objRef3, alpha, blendingColorSpace,
-		     isolated, knockout, funcs[0], &backdropColor);
+		     gTrue, knockout, funcs[0], &backdropColor);
 	  objRef3.free();
 	  if (funcs[0]) {
 	    delete funcs[0];
@@ -1268,6 +1290,11 @@
 void Gfx::opSetRenderingIntent(Object args[], int numArgs) {
   GfxRenderingIntent ri;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring rendering intent setting in cached Type 3 character");
+    return;
+  }
   ri = parseRenderingIntent(args[0].getName());
   state->setRenderingIntent(ri);
   out->updateRenderingIntent(state);
@@ -1293,6 +1320,11 @@
 void Gfx::opSetFillGray(Object args[], int numArgs) {
   GfxColor color;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   state->setFillPattern(NULL);
   state->setFillColorSpace(GfxColorSpace::create(csDeviceGray));
   out->updateFillColorSpace(state);
@@ -1304,6 +1336,11 @@
 void Gfx::opSetStrokeGray(Object args[], int numArgs) {
   GfxColor color;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   state->setStrokePattern(NULL);
   state->setStrokeColorSpace(GfxColorSpace::create(csDeviceGray));
   out->updateStrokeColorSpace(state);
@@ -1316,6 +1353,11 @@
   GfxColor color;
   int i;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   state->setFillPattern(NULL);
   state->setFillColorSpace(GfxColorSpace::create(csDeviceCMYK));
   out->updateFillColorSpace(state);
@@ -1330,6 +1372,11 @@
   GfxColor color;
   int i;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   state->setStrokePattern(NULL);
   state->setStrokeColorSpace(GfxColorSpace::create(csDeviceCMYK));
   out->updateStrokeColorSpace(state);
@@ -1344,6 +1391,11 @@
   GfxColor color;
   int i;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   state->setFillPattern(NULL);
   state->setFillColorSpace(GfxColorSpace::create(csDeviceRGB));
   out->updateFillColorSpace(state);
@@ -1358,6 +1410,11 @@
   GfxColor color;
   int i;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   state->setStrokePattern(NULL);
   state->setStrokeColorSpace(GfxColorSpace::create(csDeviceRGB));
   out->updateStrokeColorSpace(state);
@@ -1373,6 +1430,11 @@
   GfxColorSpace *colorSpace;
   GfxColor color;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color space setting in cached Type 3 character");
+    return;
+  }
   state->setFillPattern(NULL);
   res->lookupColorSpace(args[0].getName(), &obj);
   if (obj.isNull()) {
@@ -1399,6 +1461,11 @@
   GfxColorSpace *colorSpace;
   GfxColor color;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color space setting in cached Type 3 character");
+    return;
+  }
   state->setStrokePattern(NULL);
   res->lookupColorSpace(args[0].getName(), &obj);
   if (obj.isNull()) {
@@ -1424,6 +1491,11 @@
   GfxColor color;
   int i;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   if (numArgs != state->getFillColorSpace()->getNComps()) {
     error(errSyntaxError, getPos(),
 	  "Incorrect number of arguments in 'sc' command");
@@ -1459,7 +1531,17 @@
   GfxPattern *pattern;
   int i;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   if (state->getFillColorSpace()->getMode() == csPattern) {
+    if (numArgs == 0 || !args[numArgs-1].isName()) {
+      error(errSyntaxError, getPos(),
+	    "Invalid arguments in 'scn' command");
+      return;
+    }
     if (numArgs > 1) {
       if (!((GfxPatternColorSpace *)state->getFillColorSpace())->getUnder() ||
 	  numArgs - 1 != ((GfxPatternColorSpace *)state->getFillColorSpace())
@@ -1476,8 +1558,7 @@
       state->setFillColor(&color);
       out->updateFillColor(state);
     }
-    if (args[numArgs-1].isName() &&
-	(pattern = res->lookupPattern(args[numArgs-1].getName()
+    if ((pattern = res->lookupPattern(args[numArgs-1].getName()
 				      ))) {
       state->setFillPattern(pattern);
     }
@@ -1504,7 +1585,17 @@
   GfxPattern *pattern;
   int i;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring color setting in cached Type 3 character");
+    return;
+  }
   if (state->getStrokeColorSpace()->getMode() == csPattern) {
+    if (numArgs == 0 || !args[numArgs-1].isName()) {
+      error(errSyntaxError, getPos(),
+	    "Invalid arguments in 'SCN' command");
+      return;
+    }
     if (numArgs > 1) {
       if (!((GfxPatternColorSpace *)state->getStrokeColorSpace())
 	       ->getUnder() ||
@@ -1522,8 +1613,7 @@
       state->setStrokeColor(&color);
       out->updateStrokeColor(state);
     }
-    if (args[numArgs-1].isName() &&
-	(pattern = res->lookupPattern(args[numArgs-1].getName()
+    if ((pattern = res->lookupPattern(args[numArgs-1].getName()
 				      ))) {
       state->setStrokePattern(pattern);
     }
@@ -2248,6 +2338,12 @@
   GfxState *savedState;
   double xMin, yMin, xMax, yMax;
 
+  if (state->getInCachedT3Char()) {
+    error(errSyntaxWarning, getPos(),
+	  "Ignoring shaded fill in cached Type 3 character");
+    return;
+  }
+
   if (!out->needNonText()) {
     return;
   }
@@ -3715,6 +3811,12 @@
   font = state->getFont();
   wMode = font->getWMode();
 
+  if (globalParams->isDroppedFont(font->getName()
+				    ? font->getName()->getCString() : "")) {
+    doIncCharCount(s);
+    return;
+  }
+
   if (out->useDrawChar()) {
     out->beginString(state, s);
   }
@@ -4294,7 +4396,7 @@
 	delete colorMap;
 	maskObj.free();
 	smaskObj.free();
-	goto err1;
+	goto err2;
       }
       maskColorSpace = new GfxDeviceGrayColorSpace();
       obj1.free();
@@ -4432,14 +4534,18 @@
     }
 
     // if drawing is disabled, skip over inline image data
-    if (!ocState) {
-      str->reset();
-      n = height * ((width * colorMap->getNumPixelComps() *
-		     colorMap->getBits() + 7) / 8);
-      for (i = 0; i < n; ++i) {
-	str->getChar();
+    if (state->getInCachedT3Char() || !ocState) {
+      if (state->getInCachedT3Char()) {
+	error(errSyntaxWarning, getPos(),
+	      "Ignoring image in cached Type 3 character");
       }
-      str->close();
+      if (inlineImg) {
+	str->reset();
+	n = height * ((width * colorMap->getNumPixelComps() *
+		       colorMap->getBits() + 7) / 8);
+	str->discardChars(n);
+	str->close();
+      }
 
     // draw it
     } else {
@@ -4829,6 +4935,7 @@
 }
 
 void Gfx::opSetCacheDevice(Object args[], int numArgs) {
+  state->setInCachedT3Char(gTrue);
   out->type3D1(state, args[0].getNum(), args[1].getNum(),
 	       args[2].getNum(), args[3].getNum(),
 	       args[4].getNum(), args[5].getNum());

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -421,8 +421,6 @@
   // assume Times-Roman by default (for substitution purposes)
   flags = fontSerif;
 
-  missingWidth = 0;
-
   if (fontDict->lookup("FontDescriptor", &obj1)->isDict()) {
 
     // get flags
@@ -933,6 +931,7 @@
 
   // default ascent/descent values
   if (builtinFont) {
+    missingWidth = builtinFont->missingWidth;
     ascent = 0.001 * builtinFont->ascent;
     descent = 0.001 * builtinFont->descent;
     fontBBox[0] = 0.001 * builtinFont->bbox[0];
@@ -940,6 +939,7 @@
     fontBBox[2] = 0.001 * builtinFont->bbox[2];
     fontBBox[3] = 0.001 * builtinFont->bbox[3];
   } else {
+    missingWidth = 0;
     ascent = 0.75;
     descent = -0.25;
     fontBBox[0] = fontBBox[1] = fontBBox[2] = fontBBox[3] = 0;
@@ -1094,7 +1094,7 @@
   // copy the base encoding
   for (i = 0; i < 256; ++i) {
     enc[i] = (char *)baseEnc[i];
-    if ((encFree[i] = baseEncFromFontFile) && enc[i]) {
+    if ((encFree[i] = (char)baseEncFromFontFile) && enc[i]) {
       enc[i] = copyString(baseEnc[i]);
     }
   }
@@ -1394,7 +1394,7 @@
   int *map;
   int cmapPlatform, cmapEncoding;
   int unicodeCmap, macRomanCmap, msSymbolCmap, cmap;
-  GBool useMacRoman, useUnicode;
+  GBool nonsymbolic, useMacRoman, useUnicode;
   char *charName;
   Unicode u;
   int code, i, n;
@@ -1404,32 +1404,9 @@
     map[i] = 0;
   }
 
-  // To match up with the Adobe-defined behaviour, we choose a cmap
-  // like this:
-  // 1. If the PDF font has an encoding:
-  //    1a. If the PDF font specified MacRomanEncoding and the
-  //        TrueType font has a Macintosh Roman cmap, use it, and
-  //        reverse map the char names through MacRomanEncoding to
-  //        get char codes.
-  //    1b. If the PDF font is not symbolic or the PDF font is not
-  //        embedded, and the TrueType font has a Microsoft Unicode
-  //        cmap or a non-Microsoft Unicode cmap, use it, and use the
-  //        Unicode indexes, not the char codes.
-  //    1c. If the PDF font is symbolic and the TrueType font has a
-  //        Microsoft Symbol cmap, use it, and use char codes
-  //        directly (possibly with an offset of 0xf000).
-  //    1d. If the TrueType font has a Macintosh Roman cmap, use it,
-  //        as in case 1a.
-  // 2. If the PDF font does not have an encoding or the PDF font is
-  //    symbolic:
-  //    2a. If the TrueType font has a Macintosh Roman cmap, use it,
-  //        and use char codes directly (possibly with an offset of
-  //        0xf000).
-  //    2b. If the TrueType font has a Microsoft Symbol cmap, use it,
-  //        and use char codes directly (possible with an offset of
-  //        0xf000).
-  // 3. If none of these rules apply, use the first cmap and hope for
-  //    the best (this shouldn't happen).
+  // This is based on the cmap/encoding selection algorithm in the PDF
+  // 2.0 spec, but with some differences to match up with Adobe's
+  // behavior.
   unicodeCmap = macRomanCmap = msSymbolCmap = -1;
   for (i = 0; i < ff->getNumCmaps(); ++i) {
     cmapPlatform = ff->getCmapPlatform(i);
@@ -1443,31 +1420,29 @@
       msSymbolCmap = i;
     }
   }
-  cmap = 0;
   useMacRoman = gFalse;
   useUnicode = gFalse;
-  if (hasEncoding) {
-    if (usesMacRomanEnc && macRomanCmap >= 0) {
-      cmap = macRomanCmap;
-      useMacRoman = gTrue;
-    } else if ((!(flags & fontSymbolic) || embFontID.num < 0) &&
-	       unicodeCmap >= 0) {
-      cmap = unicodeCmap;
-      useUnicode = gTrue;
-    } else if ((flags & fontSymbolic) && msSymbolCmap >= 0) {
-      cmap = msSymbolCmap;
-    } else if ((flags & fontSymbolic) && macRomanCmap >= 0) {
-      cmap = macRomanCmap;
-    } else if (macRomanCmap >= 0) {
-      cmap = macRomanCmap;
-      useMacRoman = gTrue;
-    }
+  nonsymbolic = !(flags & fontSymbolic);
+  if (usesMacRomanEnc && macRomanCmap >= 0) {
+    cmap = macRomanCmap;
+    useMacRoman = gTrue;
+  } else if (embFontID.num < 0 && hasEncoding && unicodeCmap >= 0) { 
+    cmap = unicodeCmap;
+    useUnicode = gTrue;
+  } else if (nonsymbolic && unicodeCmap >= 0) {
+    cmap = unicodeCmap;
+    useUnicode = gTrue;
+  } else if (nonsymbolic && macRomanCmap >= 0) {
+    cmap = macRomanCmap;
+    useMacRoman = gTrue;
+  } else if (msSymbolCmap >= 0) {
+    cmap = msSymbolCmap;
+  } else if (unicodeCmap >= 0) {
+    cmap = unicodeCmap;
+  } else if (macRomanCmap >= 0) {
+    cmap = macRomanCmap;
   } else {
-    if (msSymbolCmap >= 0) {
-      cmap = msSymbolCmap;
-    } else if (macRomanCmap >= 0) {
-      cmap = macRomanCmap;
-    }
+    cmap = 0;
   }
 
   // reverse map the char names through MacRomanEncoding, then map the
@@ -1613,6 +1588,7 @@
   int c1, c2;
   int excepsSize, i, j, k, n;
 
+  missingWidth = 0;
   ascent = 0.95;
   descent = -0.35;
   fontBBox[0] = fontBBox[1] = fontBBox[2] = fontBBox[3] = 0;
@@ -1723,6 +1699,12 @@
   if (!(cMap = CMap::parse(NULL, collection, &obj1))) {
     goto err2;
   }
+
+  // check for fonts that use the Identity-H encoding (cmap), and the
+  // Adobe-Identity character collection
+  identityEnc = obj1.isName("Identity-H") &&
+                !collection->cmp("Adobe-Identity");
+
   obj1.free();
 
   // CIDToGIDMap
@@ -1745,6 +1727,7 @@
       cidToGID[cidToGIDLen++] = (c1 << 8) + c2;
     }
     obj1.streamClose();
+    identityEnc = gFalse;
   } else if (obj1.isName("Identity")) {
     hasIdentityCIDToGID = gTrue;
   } else if (!obj1.isNull()) {
@@ -1868,7 +1851,7 @@
 		      excepsSize, sizeof(GfxFontCIDWidthExcepV));
 	}
 	j = obj2.getInt();
-	for (k = 0; k < obj3.arrayGetLength(); k += 3) {
+	for (k = 0; k + 2 < obj3.arrayGetLength(); k += 3) {
 	  if (obj3.arrayGet(k, &obj4)->isNum() &&
 	      obj3.arrayGet(k+1, &obj5)->isNum() &&
 	      obj3.arrayGet(k+2, &obj6)->isNum()) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -336,6 +336,12 @@
   int *getCIDToGID() { return cidToGID; }
   int getCIDToGIDLen() { return cidToGIDLen; }
 
+  // Returns true if this font uses the Identity-H encoding (cmap),
+  // and the Adobe-Identity character collection, and does not have a
+  // CIDToGIDMap.  When this is true for a CID TrueType font, Adobe
+  // appears to treat char codes as raw GIDs.
+  GBool usesIdentityEncoding() { return identityEnc; }
+
   virtual GBool problematicForUnicode();
 
 private:
@@ -355,6 +361,7 @@
   int cidToGIDLen;
   GBool hasKnownCollection;
   GBool hasIdentityCIDToGID;
+  GBool identityEnc;
 };
 
 //------------------------------------------------------------------------

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -94,6 +94,7 @@
 
 
 
+
 //------------------------------------------------------------------------
 // GfxColorSpace
 //------------------------------------------------------------------------
@@ -233,6 +234,7 @@
 }
 
 
+
 void GfxDeviceGrayColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = 0;
 }
@@ -319,8 +321,8 @@
   *gray = clip01(color->c[0]);
 }
 
- void GfxCalGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb,
-				   GfxRenderingIntent ri) {
+void GfxCalGrayColorSpace::getRGB(GfxColor *color, GfxRGB *rgb,
+				  GfxRenderingIntent ri) {
   rgb->r = rgb->g = rgb->b = clip01(color->c[0]);
 }
 
@@ -331,6 +333,7 @@
 }
 
 
+
 void GfxCalGrayColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = 0;
 }
@@ -388,6 +391,7 @@
 }
 
 
+
 void GfxDeviceRGBColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = 0;
   color->c[1] = 0;
@@ -534,6 +538,7 @@
 }
 
 
+
 void GfxCalRGBColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = 0;
   color->c[1] = 0;
@@ -638,6 +643,7 @@
 }
 
 
+
 void GfxDeviceCMYKColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = 0;
   color->c[1] = 0;
@@ -834,6 +840,7 @@
 }
 
 
+
 void GfxLabColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = 0;
   if (aMin > 0) {
@@ -989,6 +996,7 @@
 }
 
 
+
 void GfxICCBasedColorSpace::getDefaultColor(GfxColor *color) {
   int i;
 
@@ -1097,6 +1105,9 @@
 	  error(errSyntaxError, -1,
 		"Bad Indexed color space (lookup table stream too short)");
 	  cs->indexHigh = indexHighA = i - 1;
+	  if (cs->indexHigh < 0) {
+	    goto err3;
+	  }
 	}
 	cs->lookup[i*n + j] = (Guchar)x;
       }
@@ -1107,6 +1118,9 @@
       error(errSyntaxError, -1,
 	    "Bad Indexed color space (lookup table string too short)");
       cs->indexHigh = indexHighA = obj1.getString()->getLength() / n - 1;
+      if (cs->indexHigh < 0) {
+	goto err3;
+      }
     }
     s = obj1.getString()->getCString();
     for (i = 0; i <= indexHighA; ++i) {
@@ -1173,6 +1187,7 @@
 }
 
 
+
 void GfxIndexedColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = 0;
 }
@@ -1238,7 +1253,7 @@
   GString *nameA;
   GfxColorSpace *altA;
   Function *funcA;
-  Object obj1;
+  Object obj1, obj2;
 
   if (arr->getLength() != 4) {
     error(errSyntaxError, -1, "Bad Separation color space");
@@ -1251,6 +1266,13 @@
   nameA = new GString(obj1.getName());
   obj1.free();
   arr->get(2, &obj1);
+  // some PDF generators use an ICC profile stream here; Adobe
+  // apparently looks at the /Alternate entry in the stream dictionary
+  if (obj1.isStream() &&
+      !obj1.streamGetDict()->lookup("Alternate", &obj2)->isNull()) {
+    obj1.free();
+    obj1 = obj2;
+  }
   if (!(altA = GfxColorSpace::parse(&obj1,
 				    recursion + 1))) {
     error(errSyntaxError, -1,
@@ -1323,6 +1345,7 @@
 }
 
 
+
 void GfxSeparationColorSpace::getDefaultColor(GfxColor *color) {
   color->c[0] = gfxColorComp1;
 }
@@ -1438,6 +1461,13 @@
   }
   obj1.free();
   arr->get(2, &obj1);
+  // some PDF generators use an ICC profile stream here; Adobe
+  // apparently looks at the /Alternate entry in the stream dictionary
+  if (obj1.isStream() &&
+      !obj1.streamGetDict()->lookup("Alternate", &obj2)->isNull()) {
+    obj1.free();
+    obj1 = obj2;
+  }
   if (!(altA = GfxColorSpace::parse(&obj1,
 				    recursion + 1))) {
     error(errSyntaxError, -1,
@@ -1521,6 +1551,7 @@
 }
 
 
+
 void GfxDeviceNColorSpace::getDefaultColor(GfxColor *color) {
   int i;
 
@@ -1595,6 +1626,7 @@
 }
 
 
+
 void GfxPatternColorSpace::getDefaultColor(GfxColor *color) {
   // not used
 }
@@ -3448,7 +3480,8 @@
 //------------------------------------------------------------------------
 
 GfxImageColorMap::GfxImageColorMap(int bitsA, Object *decode,
-				   GfxColorSpace *colorSpaceA) {
+				   GfxColorSpace *colorSpaceA,
+				   int maxAllowedBits) {
   GfxIndexedColorSpace *indexedCS;
   GfxSeparationColorSpace *sepCS;
   int maxPixel, indexHigh;
@@ -3455,8 +3488,8 @@
   Guchar *indexedLookup;
   Function *sepFunc;
   Object obj;
-  double x[gfxColorMaxComps];
-  double y[gfxColorMaxComps];
+  double defaultLow[gfxColorMaxComps], defaultRange[gfxColorMaxComps];
+  double x[gfxColorMaxComps], y[gfxColorMaxComps];
   int i, j, k;
 
   ok = gTrue;
@@ -3463,10 +3496,10 @@
 
   // bits per component and color space
   bits = bitsA;
-  if (bits <= 8) {
+  if (bits <= maxAllowedBits) {
     maxPixel = (1 << bits) - 1;
   } else {
-    maxPixel = 0xff;
+    maxPixel = (1 << maxAllowedBits) - 1;
   }
   colorSpace = colorSpaceA;
 
@@ -3477,9 +3510,13 @@
   }
 
   // get decode map
+  colorSpace->getDefaultRanges(defaultLow, defaultRange, maxPixel);
   if (decode->isNull()) {
     nComps = colorSpace->getNComps();
-    colorSpace->getDefaultRanges(decodeLow, decodeRange, maxPixel);
+    for (i = 0; i < nComps; ++i) {
+      decodeLow[i] = defaultLow[i];
+      decodeRange[i] = defaultRange[i];
+    }
   } else if (decode->isArray()) {
     nComps = decode->arrayGetLength() / 2;
     if (nComps < colorSpace->getNComps()) {
@@ -3514,8 +3551,13 @@
     lookup[k] = (GfxColorComp *)gmallocn(maxPixel + 1,
 					 sizeof(GfxColorComp));
     for (i = 0; i <= maxPixel; ++i) {
-      lookup[k][i] = dblToCol(decodeLow[k] +
-			      (i * decodeRange[k]) / maxPixel);
+      double t = decodeLow[k] + (i * decodeRange[k]) / maxPixel;
+      if (t < defaultLow[k]) {
+	t = defaultLow[k];
+      } else if (t > defaultLow[k] + defaultRange[k]) {
+	t = defaultLow[k] + defaultRange[k];
+      }
+      lookup[k][i] = dblToCol(t);
     }
   }
 
@@ -3560,7 +3602,13 @@
 					    sizeof(GfxColorComp));
     }
     for (i = 0; i <= maxPixel; ++i) {
-      x[0] = decodeLow[0] + (i * decodeRange[0]) / maxPixel;
+      double t = decodeLow[0] + (i * decodeRange[0]) / maxPixel;
+      if (t < defaultLow[0]) {
+	t = defaultLow[0];
+      } else if (t > defaultLow[0] + defaultRange[0]) {
+	t = defaultLow[0] + defaultRange[0];
+      }
+      x[0] = t;
       sepFunc->transform(x, y);
       for (k = 0; k < nComps2; ++k) {
 	lookup2[k][i] = dblToCol(y[k]);
@@ -3682,15 +3730,10 @@
 
 
 void GfxImageColorMap::getColor(Guchar *x, GfxColor *color) {
-  int maxPixel, i;
+  int i;
 
-  if (bits <= 8) {
-    maxPixel = (1 << bits) - 1;
-  } else {
-    maxPixel = 0xff;
-  }
   for (i = 0; i < nComps; ++i) {
-    color->c[i] = dblToCol(decodeLow[i] + (x[i] * decodeRange[i]) / maxPixel);
+    color->c[i] = lookup[i][x[i]];
   }
 }
 
@@ -3779,6 +3822,7 @@
   }
 }
 
+
 //------------------------------------------------------------------------
 // GfxSubpath and GfxPath
 //------------------------------------------------------------------------
@@ -4078,6 +4122,8 @@
   clipXMax = pageWidth;
   clipYMax = pageHeight;
 
+  inCachedT3Char = gFalse;
+
   saved = NULL;
 }
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -22,6 +22,8 @@
 class Array;
 class GfxFont;
 class PDFRectangle;
+class GfxDeviceNColorSpace;
+class GfxSeparationColorSpace;
 class GfxShading;
 class GfxState;
 
@@ -80,17 +82,31 @@
 
 static inline GfxColorComp byteToCol(Guchar x) {
   // (x / 255) << 16  =  (0.0000000100000001... * x) << 16
-  //                  =  ((x << 8) + (x) + (x >> 8) + ...) << 16
+  //                  =  ((x << 8) + (x) + (x >> 8) + ...)
   //                  =  (x << 8) + (x) + (x >> 7)
   //                                      [for rounding]
   return (GfxColorComp)((x << 8) + x + (x >> 7));
 }
 
+static inline GfxColorComp wordToCol(Gushort x) {
+  // (x / 65535) << 16  =  (0.0000000000000001... * x) << 16
+  //                    =  x + (x >> 15)
+  //                           [for rounding]
+  return (GfxColorComp)(x + (x >> 15));
+}
+
 static inline Guchar colToByte(GfxColorComp x) {
-  // 255 * x + 0.5  =  256 * x - x + 0x8000
+  // 255 * x + 0.5  =  256 * x - x + 0.5
+  //                =  [256 * (x << 16) - (x << 16) + (1 << 15)] >> 16
   return (Guchar)(((x << 8) - x + 0x8000) >> 16);
 }
 
+static inline Gushort colToWord(GfxColorComp x) {
+  // 65535 * x + 0.5  =  65536 * x - x + 0.5
+  //                  =  [65536 * (x << 16) - (x << 16) + (1 << 15)] >> 16
+  return (Gushort)(((x << 16) - x + 0x8000) >> 16);
+}
+
 //------------------------------------------------------------------------
 // GfxColor
 //------------------------------------------------------------------------
@@ -126,6 +142,7 @@
 
 
 
+
 //------------------------------------------------------------------------
 // GfxColorSpace
 //------------------------------------------------------------------------
@@ -918,7 +935,8 @@
 public:
 
   // Constructor.
-  GfxImageColorMap(int bitsA, Object *decode, GfxColorSpace *colorSpaceA);
+  GfxImageColorMap(int bitsA, Object *decode, GfxColorSpace *colorSpaceA,
+		   int maxAllowedBits = 8);
 
   // Destructor.
   ~GfxImageColorMap();
@@ -1165,6 +1183,7 @@
   void getUserClipBBox(double *xMin, double *yMin, double *xMax, double *yMax);
   double getLineX() { return lineX; }
   double getLineY() { return lineY; }
+  GBool getInCachedT3Char() { return inCachedT3Char; }
 
   // Is there a current point/path?
   GBool isCurPt() { return path->isCurPt(); }
@@ -1260,6 +1279,9 @@
     { lineX = tx; lineY = ty; textTransform(tx, ty, &curX, &curY); }
   void textShift(double tx, double ty);
   void shift(double dx, double dy);
+  
+  // Cached Type 3 char status.
+  void setInCachedT3Char(GBool in) { inCachedT3Char = in; }
 
   // Push/pop GfxState on/off stack.
   GfxState *save();
@@ -1322,6 +1344,8 @@
   double clipXMin, clipYMin,	// bounding box for clip region
          clipXMax, clipYMax;
 
+  GBool inCachedT3Char;		// in a cached (uncolored) Type 3 char
+
   GfxState *saved;		// next GfxState on stack
 
   GfxState(GfxState *state, GBool copyPath);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -34,6 +34,7 @@
 #include "Error.h"
 #include "NameToCharCode.h"
 #include "CharCodeToUnicode.h"
+#include "UnicodeRemapping.h"
 #include "UnicodeMap.h"
 #include "CMap.h"
 #include "BuiltinFontTables.h"
@@ -144,6 +145,8 @@
 
 GlobalParams *globalParams = NULL;
 
+const char *GlobalParams::defaultTextEncoding = "Latin1";
+
 //------------------------------------------------------------------------
 // PSFontParam16
 //------------------------------------------------------------------------
@@ -376,7 +379,8 @@
 	data[dataLen] = '\0';
 	n = (int)strlen(data);
 	if (!strcasecmp(data + n - 4, ".ttf") ||
-	    !strcasecmp(data + n - 4, ".ttc")) {
+	    !strcasecmp(data + n - 4, ".ttc") ||
+	    !strcasecmp(data + n - 4, ".otf")) {
 	  fontPath = new GString(data);
 	  if (!(dataLen >= 3 && data[1] == ':' && data[2] == '\\')) {
 	    fontPath->insert(0, '\\');
@@ -552,6 +556,7 @@
   unicodeMaps = new GHash(gTrue);
   cMapDirs = new GHash(gTrue);
   toUnicodeDirs = new GList();
+  unicodeRemapping = new UnicodeRemapping();
   fontFiles = new GHash(gTrue);
   fontDirs = new GList();
   ccFontFiles = new GHash(gTrue);
@@ -585,7 +590,6 @@
   psCenter = gTrue;
   psDuplex = gFalse;
   psLevel = psLevel2;
-  psFile = NULL;
   psResidentFonts = new GHash(gTrue);
   psResidentFonts16 = new GList();
   psResidentFontsCC = new GList();
@@ -605,7 +609,7 @@
   psRasterSliceSize = 20000000;
   psAlwaysRasterize = gFalse;
   psNeverRasterize = gFalse;
-  textEncoding = new GString("Latin1");
+  textEncoding = new GString(defaultTextEncoding);
 #if defined(_WIN32)
   textEOL = eolDOS;
 #else
@@ -642,12 +646,15 @@
   fullScreenMatteColor = new GString("#000000");
   launchCommand = NULL;
   movieCommand = NULL;
+  defaultPrinter = NULL;
   mapNumericCharNames = gTrue;
   mapUnknownCharNames = gFalse;
   mapExtTrueTypeFontsViaUnicode = gTrue;
+  droppedFonts = new GHash(gTrue);
   enableXFA = gTrue;
   createDefaultKeyBindings();
   popupMenuCmds = new GList();
+  tabStateFile = appendToPath(getHomeDir(), ".xpdf.tab-state");
   printCommands = gFalse;
   errQuiet = gFalse;
 
@@ -925,6 +932,8 @@
       parseCMapDir(tokens, fileName, line);
     } else if (!cmd->cmp("toUnicodeDir")) {
       parseToUnicodeDir(tokens, fileName, line);
+    } else if (!cmd->cmp("unicodeRemapping")) {
+      parseUnicodeRemapping(tokens, fileName, line);
     } else if (!cmd->cmp("fontFile")) {
       parseFontFile(tokens, fileName, line);
     } else if (!cmd->cmp("fontDir")) {
@@ -931,8 +940,6 @@
       parseFontDir(tokens, fileName, line);
     } else if (!cmd->cmp("fontFileCC")) {
       parseFontFileCC(tokens, fileName, line);
-    } else if (!cmd->cmp("psFile")) {
-      parsePSFile(tokens, fileName, line);
     } else if (!cmd->cmp("psPaperSize")) {
       parsePSPaperSize(tokens, fileName, line);
     } else if (!cmd->cmp("psImageableArea")) {
@@ -1002,7 +1009,7 @@
       parseYesNo("psNeverRasterize", &psNeverRasterize,
 		 tokens, fileName, line);
     } else if (!cmd->cmp("textEncoding")) {
-      parseTextEncoding(tokens, fileName, line);
+      parseString("textEncoding", &textEncoding, tokens, fileName, line);
     } else if (!cmd->cmp("textEOL")) {
       parseTextEOL(tokens, fileName, line);
     } else if (!cmd->cmp("textPageBreaks")) {
@@ -1012,7 +1019,7 @@
       parseYesNo("textKeepTinyChars", &textKeepTinyChars,
 		 tokens, fileName, line);
     } else if (!cmd->cmp("initialZoom")) {
-      parseInitialZoom(tokens, fileName, line);
+      parseString("initialZoom", &initialZoom, tokens, fileName, line);
     } else if (!cmd->cmp("defaultFitZoom")) {
       parseInteger("defaultFitZoom", &defaultFitZoom, tokens, fileName, line);
     } else if (!cmd->cmp("initialSidebarState")) {
@@ -1073,16 +1080,18 @@
       parseYesNo("overprintPreview", &overprintPreview,
 		 tokens, fileName, line);
     } else if (!cmd->cmp("paperColor")) {
-      parseColor("paperColor", &paperColor, tokens, fileName, line);
+      parseString("paperColor", &paperColor, tokens, fileName, line);
     } else if (!cmd->cmp("matteColor")) {
-      parseColor("matteColor", &matteColor, tokens, fileName, line);
+      parseString("matteColor", &matteColor, tokens, fileName, line);
     } else if (!cmd->cmp("fullScreenMatteColor")) {
-      parseColor("fullScreenMatteColor", &fullScreenMatteColor,
-		 tokens, fileName, line);
+      parseString("fullScreenMatteColor", &fullScreenMatteColor,
+		  tokens, fileName, line);
     } else if (!cmd->cmp("launchCommand")) {
-      parseCommand("launchCommand", &launchCommand, tokens, fileName, line);
+      parseString("launchCommand", &launchCommand, tokens, fileName, line);
     } else if (!cmd->cmp("movieCommand")) {
-      parseCommand("movieCommand", &movieCommand, tokens, fileName, line);
+      parseString("movieCommand", &movieCommand, tokens, fileName, line);
+    } else if (!cmd->cmp("defaultPrinter")) {
+      parseString("defaultPrinter", &defaultPrinter, tokens, fileName, line);
     } else if (!cmd->cmp("mapNumericCharNames")) {
       parseYesNo("mapNumericCharNames", &mapNumericCharNames,
 		 tokens, fileName, line);
@@ -1093,6 +1102,8 @@
       parseYesNo("mapExtTrueTypeFontsViaUnicode",
 		 &mapExtTrueTypeFontsViaUnicode,
 		 tokens, fileName, line);
+    } else if (!cmd->cmp("dropFont")) {
+      parseDropFont(tokens, fileName, line);
     } else if (!cmd->cmp("enableXFA")) {
       parseYesNo("enableXFA", &enableXFA, tokens, fileName, line);
     } else if (!cmd->cmp("bind")) {
@@ -1101,6 +1112,8 @@
       parseUnbind(tokens, fileName, line);
     } else if (!cmd->cmp("popupMenuCmd")) {
       parsePopupMenuCmd(tokens, fileName, line);
+    } else if (!cmd->cmp("tabStateFile")) {
+      parseString("tabStateFile", &tabStateFile, tokens, fileName, line);
     } else if (!cmd->cmp("printCommands")) {
       parseYesNo("printCommands", &printCommands, tokens, fileName, line);
     } else if (!cmd->cmp("errQuiet")) {
@@ -1245,6 +1258,17 @@
   toUnicodeDirs->append(((GString *)tokens->get(1))->copy());
 }
 
+void GlobalParams::parseUnicodeRemapping(GList *tokens, GString *fileName,
+					 int line) {
+  if (tokens->getLength() != 2) {
+    error(errConfig, -1,
+	  "Bad 'unicodeRemapping' config file command ({0:t}:{1:d})",
+	  fileName, line);
+    return;
+  }
+  unicodeRemapping->parseFile((GString *)tokens->get(1));
+}
+
 void GlobalParams::parseFontFile(GList *tokens, GString *fileName, int line) {
   if (tokens->getLength() != 3) {
     error(errConfig, -1, "Bad 'fontFile' config file command ({0:t}:{1:d})",
@@ -1275,18 +1299,6 @@
 		   ((GString *)tokens->get(2))->copy());
 }
 
-void GlobalParams::parsePSFile(GList *tokens, GString *fileName, int line) {
-  if (tokens->getLength() != 2) {
-    error(errConfig, -1, "Bad 'psFile' config file command ({0:t}:{1:d})",
-	  fileName, line);
-    return;
-  }
-  if (psFile) {
-    delete psFile;
-  }
-  psFile = ((GString *)tokens->get(1))->copy();
-}
-
 void GlobalParams::parsePSPaperSize(GList *tokens, GString *fileName,
 				    int line) {
   GString *tok;
@@ -1424,18 +1436,6 @@
   psResidentFontsCC->append(param);
 }
 
-void GlobalParams::parseTextEncoding(GList *tokens, GString *fileName,
-				     int line) {
-  if (tokens->getLength() != 2) {
-    error(errConfig, -1,
-	  "Bad 'textEncoding' config file command ({0:s}:{1:d})",
-	  fileName, line);
-    return;
-  }
-  delete textEncoding;
-  textEncoding = ((GString *)tokens->get(1))->copy();
-}
-
 void GlobalParams::parseTextEOL(GList *tokens, GString *fileName, int line) {
   GString *tok;
 
@@ -1457,17 +1457,6 @@
   }
 }
 
-void GlobalParams::parseInitialZoom(GList *tokens,
-				    GString *fileName, int line) {
-  if (tokens->getLength() != 2) {
-    error(errConfig, -1, "Bad 'initialZoom' config file command ({0:t}:{1:d})",
-	  fileName, line);
-    return;
-  }
-  delete initialZoom;
-  initialZoom = ((GString *)tokens->get(1))->copy();
-}
-
 void GlobalParams::parseStrokeAdjust(GList *tokens, GString *fileName,
 				     int line) {
   GString *tok;
@@ -1514,6 +1503,14 @@
   }
 }
 
+void GlobalParams::parseDropFont(GList *tokens, GString *fileName, int line) {
+  if (tokens->getLength() != 2) {
+    error(errConfig, -1, "Bad 'dropFont' config file command ({0:t}:{1:d})",
+	  fileName, line);
+    return;
+  }
+  droppedFonts->add(((GString *)tokens->get(1))->copy(), 1);
+}
 
 void GlobalParams::parseBind(GList *tokens, GString *fileName, int line) {
   KeyBinding *binding;
@@ -1735,19 +1732,6 @@
 					 cmds));
 }
 
-void GlobalParams::parseCommand(const char *cmdName, GString **val,
-				GList *tokens, GString *fileName, int line) {
-  if (tokens->getLength() != 2) {
-    error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
-	  cmdName, fileName, line);
-    return;
-  }
-  if (*val) {
-    delete *val;
-  }
-  *val = ((GString *)tokens->get(1))->copy();
-}
-
 void GlobalParams::parseYesNo(const char *cmdName, GBool *flag,
 			      GList *tokens, GString *fileName, int line) {
   GString *tok;
@@ -1775,17 +1759,17 @@
   return gTrue;
 }
 
-void GlobalParams::parseColor(const char *cmdName, GString **val,
-			      GList *tokens, GString *fileName, int line) {
+void GlobalParams::parseString(const char *cmdName, GString **s,
+			       GList *tokens, GString *fileName, int line) {
   if (tokens->getLength() != 2) {
     error(errConfig, -1, "Bad '{0:s}' config file command ({1:t}:{2:d})",
 	  cmdName, fileName, line);
     return;
   }
-  if (*val) {
-    delete *val;
+  if (*s) {
+    delete *s;
   }
-  *val = ((GString *)tokens->get(1))->copy();
+  *s = ((GString *)tokens->get(1))->copy();
 }
 
 void GlobalParams::parseInteger(const char *cmdName, int *val,
@@ -1867,14 +1851,12 @@
   deleteGHash(residentUnicodeMaps, UnicodeMap);
   deleteGHash(unicodeMaps, GString);
   deleteGList(toUnicodeDirs, GString);
+  delete unicodeRemapping;
   deleteGHash(fontFiles, GString);
   deleteGList(fontDirs, GString);
   deleteGHash(ccFontFiles, GString);
   deleteGHash(base14SysFonts, Base14FontInfo);
   delete sysFonts;
-  if (psFile) {
-    delete psFile;
-  }
   deleteGHash(psResidentFonts, GString);
   deleteGList(psResidentFonts16, PSFontParam16);
   deleteGList(psResidentFontsCC, PSFontParam16);
@@ -1895,8 +1877,13 @@
   if (movieCommand) {
     delete movieCommand;
   }
+  if (defaultPrinter) {
+    delete defaultPrinter;
+  }
+  delete droppedFonts;
   deleteGList(keyBindings, KeyBinding);
   deleteGList(popupMenuCmds, PopupMenuCmd);
+  delete tabStateFile;
 
   cMapDirs->startIter(&iter);
   while (cMapDirs->getNext(&iter, &key, (void **)&list)) {
@@ -2224,8 +2211,12 @@
   return NULL;
 }
 
+UnicodeRemapping *GlobalParams::getUnicodeRemapping() {
+  return unicodeRemapping;
+}
+
 GString *GlobalParams::findFontFile(GString *fontName) {
-  static const char *exts[] = { ".pfa", ".pfb", ".ttf", ".ttc" };
+  static const char *exts[] = { ".pfa", ".pfb", ".ttf", ".ttc", ".otf" };
   GString *path, *dir;
 #ifdef _WIN32
   GString *fontNameU;
@@ -2311,15 +2302,6 @@
   return path;
 }
 
-GString *GlobalParams::getPSFile() {
-  GString *s;
-
-  lockGlobalParams;
-  s = psFile ? psFile->copy() : (GString *)NULL;
-  unlockGlobalParams;
-  return s;
-}
-
 int GlobalParams::getPSPaperWidth() {
   int w;
 
@@ -2890,6 +2872,15 @@
   return s;
 }
 
+GString *GlobalParams::getDefaultPrinter() {
+  GString *s;
+
+  lockGlobalParams;
+  s = defaultPrinter ? defaultPrinter->copy() : (GString *)NULL;
+  unlockGlobalParams;
+  return s;
+}
+
 GBool GlobalParams::getMapNumericCharNames() {
   GBool map;
 
@@ -2917,6 +2908,15 @@
   return map;
 }
 
+GBool GlobalParams::isDroppedFont(const char *fontName) {
+  GBool isDropped;
+
+  lockGlobalParams;
+  isDropped = droppedFonts->lookupInt(fontName) != 0;
+  unlockGlobalParams;
+  return isDropped;
+}
+
 GBool GlobalParams::getEnableXFA() {
   GBool enable;
 
@@ -2974,6 +2974,15 @@
   return cmd;
 }
 
+GString *GlobalParams::getTabStateFile() {
+  GString *s;
+
+  lockGlobalParams;
+  s = tabStateFile->copy();
+  unlockGlobalParams;
+  return s;
+}
+
 GBool GlobalParams::getPrintCommands() {
   GBool p;
 
@@ -3064,6 +3073,10 @@
 // functions to set parameters
 //------------------------------------------------------------------------
 
+void GlobalParams::addUnicodeRemapping(Unicode in, Unicode *out, int len) {
+  unicodeRemapping->addRemapping(in, out, len);
+}
+
 void GlobalParams::addFontFile(GString *fontName, GString *path) {
   lockGlobalParams;
   fontFiles->add(fontName, path);
@@ -3070,15 +3083,6 @@
   unlockGlobalParams;
 }
 
-void GlobalParams::setPSFile(char *file) {
-  lockGlobalParams;
-  if (psFile) {
-    delete psFile;
-  }
-  psFile = new GString(file);
-  unlockGlobalParams;
-}
-
 GBool GlobalParams::setPSPaperSize(char *size) {
   lockGlobalParams;
   if (!strcmp(size, "match")) {
@@ -3365,6 +3369,13 @@
   unlockGlobalParams;
 }
 
+void GlobalParams::setTabStateFile(char *tabStateFileA) {
+  lockGlobalParams;
+  delete tabStateFile;
+  tabStateFile = new GString(tabStateFileA);
+  unlockGlobalParams;
+}
+
 void GlobalParams::setPrintCommands(GBool printCommandsA) {
   lockGlobalParams;
   printCommands = printCommandsA;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -37,6 +37,7 @@
 class CharCodeToUnicodeCache;
 class UnicodeMap;
 class UnicodeMapCache;
+class UnicodeRemapping;
 class CMap;
 class CMapCache;
 struct XpdfSecurityHandler;
@@ -239,6 +240,7 @@
   FILE *getUnicodeMapFile(GString *encodingName);
   FILE *findCMapFile(GString *collection, GString *cMapName);
   FILE *findToUnicodeFile(GString *name);
+  UnicodeRemapping *getUnicodeRemapping();
   GString *findFontFile(GString *fontName);
   GString *findBase14FontFile(GString *fontName, int *fontNum,
 			      double *oblique);
@@ -245,7 +247,6 @@
   GString *findSystemFontFile(GString *fontName, SysFontType *type,
 			      int *fontNum);
   GString *findCCFontFile(GString *collection);
-  GString *getPSFile();
   int getPSPaperWidth();
   int getPSPaperHeight();
   void getPSImageableArea(int *llx, int *lly, int *urx, int *ury);
@@ -309,13 +310,16 @@
   GString *getFullScreenMatteColor();
   GString *getLaunchCommand() { return launchCommand; }
   GString *getMovieCommand() { return movieCommand; }
+  GString *getDefaultPrinter();
   GBool getMapNumericCharNames();
   GBool getMapUnknownCharNames();
   GBool getMapExtTrueTypeFontsViaUnicode();
+  GBool isDroppedFont(const char *fontName);
   GBool getEnableXFA();
   GList *getKeyBinding(int code, int mods, int context);
   int getNumPopupMenuCmds();
   PopupMenuCmd *getPopupMenuCmd(int idx);
+  GString *getTabStateFile();
   GBool getPrintCommands();
   GBool getErrQuiet();
 
@@ -327,8 +331,8 @@
 
   //----- functions to set parameters
 
+  void addUnicodeRemapping(Unicode in, Unicode *out, int len);
   void addFontFile(GString *fontName, GString *path);
-  void setPSFile(char *file);
   GBool setPSPaperSize(char *size);
   void setPSPaperWidth(int width);
   void setPSPaperHeight(int height);
@@ -368,6 +372,7 @@
   void setMapUnknownCharNames(GBool map);
   void setMapExtTrueTypeFontsViaUnicode(GBool map);
   void setEnableXFA(GBool enable);
+  void setTabStateFile(char *tabStateFileA);
   void setPrintCommands(GBool printCommandsA);
   void setErrQuiet(GBool errQuietA);
 
@@ -376,6 +381,8 @@
   XpdfWin32ErrorInfo *getWin32ErrorInfo();
 #endif
 
+  static const char *defaultTextEncoding;
+
 private:
 
   void createDefaultKeyBindings();
@@ -386,11 +393,11 @@
   void parseUnicodeMap(GList *tokens, GString *fileName, int line);
   void parseCMapDir(GList *tokens, GString *fileName, int line);
   void parseToUnicodeDir(GList *tokens, GString *fileName, int line);
+  void parseUnicodeRemapping(GList *tokens, GString *fileName, int line);
   void parseFontFile(GList *tokens, GString *fileName, int line);
   void parseFontDir(GList *tokens, GString *fileName, int line);
   void parseFontFileCC(GList *tokens, GString *fileName,
 		       int line);
-  void parsePSFile(GList *tokens, GString *fileName, int line);
   void parsePSPaperSize(GList *tokens, GString *fileName, int line);
   void parsePSImageableArea(GList *tokens, GString *fileName, int line);
   void parsePSLevel(GList *tokens, GString *fileName, int line);
@@ -397,11 +404,10 @@
   void parsePSResidentFont(GList *tokens, GString *fileName, int line);
   void parsePSResidentFont16(GList *tokens, GString *fileName, int line);
   void parsePSResidentFontCC(GList *tokens, GString *fileName, int line);
-  void parseTextEncoding(GList *tokens, GString *fileName, int line);
   void parseTextEOL(GList *tokens, GString *fileName, int line);
-  void parseInitialZoom(GList *tokens, GString *fileName, int line);
   void parseStrokeAdjust(GList *tokens, GString *fileName, int line);
   void parseScreenType(GList *tokens, GString *fileName, int line);
+  void parseDropFont(GList *tokens, GString *fileName, int line);
   void parseBind(GList *tokens, GString *fileName, int line);
   void parseUnbind(GList *tokens, GString *fileName, int line);
   GBool parseKey(GString *modKeyStr, GString *contextStr,
@@ -409,13 +415,11 @@
 		 const char *cmdName,
 		 GList *tokens, GString *fileName, int line);
   void parsePopupMenuCmd(GList *tokens, GString *fileName, int line);
-  void parseCommand(const char *cmdName, GString **val,
-		    GList *tokens, GString *fileName, int line);
   void parseYesNo(const char *cmdName, GBool *flag,
 		  GList *tokens, GString *fileName, int line);
   GBool parseYesNo2(char *token, GBool *flag);
-  void parseColor(const char *cmdName, GString **val,
-		  GList *tokens, GString *fileName, int line);
+  void parseString(const char *cmdName, GString **s,
+		   GList *tokens, GString *fileName, int line);
   void parseInteger(const char *cmdName, int *val,
 		    GList *tokens, GString *fileName, int line);
   void parseFloat(const char *cmdName, double *val,
@@ -444,6 +448,8 @@
   GHash *cMapDirs;		// list of CMap dirs, indexed by collection
 				//   name [GList[GString]]
   GList *toUnicodeDirs;		// list of ToUnicode CMap dirs [GString]
+  UnicodeRemapping *		// Unicode remapping for text output
+    unicodeRemapping;
   GHash *fontFiles;		// font files: font name mapped to path
 				//   [GString]
   GList *fontDirs;		// list of font dirs [GString]
@@ -452,7 +458,6 @@
   GHash *base14SysFonts;	// Base-14 system font files: font name
 				//   mapped to path [Base14FontInfo]
   SysFontList *sysFonts;	// system fonts
-  GString *psFile;		// PostScript file or command (for xpdf)
   int psPaperWidth;		// paper size, in PostScript points, for
   int psPaperHeight;		//   PostScript output
   int psImageableLLX,		// imageable area, in PostScript points,
@@ -533,13 +538,17 @@
   GString *fullScreenMatteColor; // matte color in full-screen mode
   GString *launchCommand;	// command executed for 'launch' links
   GString *movieCommand;	// command executed for movie annotations
+  GString *defaultPrinter;	// default printer (for interactive printing
+				//   from the viewer)
   GBool mapNumericCharNames;	// map numeric char names (from font subsets)?
   GBool mapUnknownCharNames;	// map unknown char names?
   GBool mapExtTrueTypeFontsViaUnicode;  // map char codes to GID via Unicode
 				        //   for external TrueType fonts?
+  GHash *droppedFonts;		// dropped fonts [int]
   GBool enableXFA;		// enable XFA form rendering
   GList *keyBindings;		// key & mouse button bindings [KeyBinding]
   GList *popupMenuCmds;		// popup menu commands [PopupMenuCmd]
+  GString *tabStateFile;	// path for the tab state save file
   GBool printCommands;		// print the drawing commands
   GBool errQuiet;		// suppress error messages?
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -292,8 +292,13 @@
   png_destroy_write_struct(&png, &pngInfo);
 
   // page size
-  pageW = doc->getPageCropWidth(pg);
-  pageH = doc->getPageCropHeight(pg);
+  if (doc->getPageRotate(pg) == 90 || doc->getPageRotate(pg) == 270) {
+    pageW = doc->getPageCropHeight(pg);
+    pageH = doc->getPageCropWidth(pg);
+  } else {
+    pageW = doc->getPageCropWidth(pg);
+    pageH = doc->getPageCropHeight(pg);
+  }
 
   // get the PDF text
   doc->displayPage(textOut, pg, 72, 72, 0, gFalse, gTrue, gFalse);
@@ -563,27 +568,27 @@
     s->append((char)(0xc0 + (u >> 6)));
     s->append((char)(0x80 + (u & 0x3f)));
   } else if (u <= 0xffff) {
-    s->append((char)0xe0 + (u >> 12));
-    s->append((char)0x80 + ((u >> 6) & 0x3f));
-    s->append((char)0x80 + (u & 0x3f));
+    s->append((char)(0xe0 + (u >> 12)));
+    s->append((char)(0x80 + ((u >> 6) & 0x3f)));
+    s->append((char)(0x80 + (u & 0x3f)));
   } else if (u <= 0x1fffff) {
-    s->append((char)0xf0 + (u >> 18));
-    s->append((char)0x80 + ((u >> 12) & 0x3f));
-    s->append((char)0x80 + ((u >> 6) & 0x3f));
-    s->append((char)0x80 + (u & 0x3f));
+    s->append((char)(0xf0 + (u >> 18)));
+    s->append((char)(0x80 + ((u >> 12) & 0x3f)));
+    s->append((char)(0x80 + ((u >> 6) & 0x3f)));
+    s->append((char)(0x80 + (u & 0x3f)));
   } else if (u <= 0x3ffffff) {
-    s->append((char)0xf8 + (u >> 24));
-    s->append((char)0x80 + ((u >> 18) & 0x3f));
-    s->append((char)0x80 + ((u >> 12) & 0x3f));
-    s->append((char)0x80 + ((u >> 6) & 0x3f));
-    s->append((char)0x80 + (u & 0x3f));
+    s->append((char)(0xf8 + (u >> 24)));
+    s->append((char)(0x80 + ((u >> 18) & 0x3f)));
+    s->append((char)(0x80 + ((u >> 12) & 0x3f)));
+    s->append((char)(0x80 + ((u >> 6) & 0x3f)));
+    s->append((char)(0x80 + (u & 0x3f)));
   } else if (u <= 0x7fffffff) {
-    s->append((char)0xfc + (u >> 30));
-    s->append((char)0x80 + ((u >> 24) & 0x3f));
-    s->append((char)0x80 + ((u >> 18) & 0x3f));
-    s->append((char)0x80 + ((u >> 12) & 0x3f));
-    s->append((char)0x80 + ((u >> 6) & 0x3f));
-    s->append((char)0x80 + (u & 0x3f));
+    s->append((char)(0xfc + (u >> 30)));
+    s->append((char)(0x80 + ((u >> 24) & 0x3f)));
+    s->append((char)(0x80 + ((u >> 18) & 0x3f)));
+    s->append((char)(0x80 + ((u >> 12) & 0x3f)));
+    s->append((char)(0x80 + ((u >> 6) & 0x3f)));
+    s->append((char)(0x80 + (u & 0x3f)));
   }
 }
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -242,7 +242,7 @@
       i = size < (int)sizeof(buf) ? size : (int)sizeof(buf);
       n = str->getBlock(buf, i);
       for (j = 0; j < n; ++j) {
-	buf[j] ^= 0xff;
+	buf[j] = (char)(buf[j] ^ 0xff);
       }
       fwrite(buf, 1, n, f);
       if (n < i) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -48,7 +48,7 @@
 }
 
 void JArithmeticDecoderStats::setEntry(Guint cx, int i, int mps) {
-  cxTab[cx] = (i << 1) + mps;
+  cxTab[cx] = (Guchar)((i << 1) + mps);
 }
 
 //------------------------------------------------------------------------
@@ -202,13 +202,13 @@
       if (a < qe) {
 	bit = 1 - mpsCX;
 	if (switchTab[iCX]) {
-	  stats->cxTab[context] = (nlpsTab[iCX] << 1) | (1 - mpsCX);
+	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
 	} else {
-	  stats->cxTab[context] = (nlpsTab[iCX] << 1) | mpsCX;
+	  stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
 	}
       } else {
 	bit = mpsCX;
-	stats->cxTab[context] = (nmpsTab[iCX] << 1) | mpsCX;
+	stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
       }
       // RENORMD
       do {
@@ -225,13 +225,13 @@
     // LPS_EXCHANGE
     if (a < qe) {
       bit = mpsCX;
-      stats->cxTab[context] = (nmpsTab[iCX] << 1) | mpsCX;
+      stats->cxTab[context] = (Guchar)((nmpsTab[iCX] << 1) | mpsCX);
     } else {
       bit = 1 - mpsCX;
       if (switchTab[iCX]) {
-	stats->cxTab[context] = (nlpsTab[iCX] << 1) | (1 - mpsCX);
+	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | (1 - mpsCX));
       } else {
-	stats->cxTab[context] = (nlpsTab[iCX] << 1) | mpsCX;
+	stats->cxTab[context] = (Guchar)((nlpsTab[iCX] << 1) | mpsCX);
       }
     }
     a = qe;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -494,8 +494,8 @@
     ++nBytesRead;
     ++byteCounter;
     p = &twoDimTab1[(buf >> 1) & 0x7f];
-  } else if (bufLen == 8) {
-    p = &twoDimTab1[(buf >> 1) & 0x7f];
+  } else if (bufLen >= 7) {
+    p = &twoDimTab1[(buf >> (bufLen - 7)) & 0x7f];
   } else {
     p = &twoDimTab1[(buf << (7 - bufLen)) & 0x7f];
     if (p->bits < 0 || p->bits > (int)bufLen) {
@@ -684,9 +684,9 @@
     { return (x < 0 || x >= w || y < 0 || y >= h) ? 0 :
              (data[y * line + (x >> 3)] >> (7 - (x & 7))) & 1; }
   void setPixel(int x, int y)
-    { data[y * line + (x >> 3)] |= 1 << (7 - (x & 7)); }
+    { data[y * line + (x >> 3)] |= (Guchar)(1 << (7 - (x & 7))); }
   void clearPixel(int x, int y)
-    { data[y * line + (x >> 3)] &= 0x7f7f >> (x & 7); }
+    { data[y * line + (x >> 3)] &= (Guchar)(0x7f7f >> (x & 7)); }
   void getPixelPtr(int x, int y, JBIG2BitmapPtr *ptr);
   int nextPixel(JBIG2BitmapPtr *ptr);
   void duplicateRow(int yDest, int ySrc);
@@ -825,7 +825,8 @@
 			  Guint combOp) {
   int x0, x1, y0, y1, xx, yy;
   Guchar *srcPtr, *destPtr;
-  Guint src0, src1, src, dest, s1, s2, m1, m2, m3;
+  Guchar dest, src0, src1, src, m1, m2, m3;
+  Guint s1, s2;
   GBool oneByte;
 
   // check for the pathological case where y = -2^31
@@ -861,9 +862,9 @@
 
   s1 = x & 7;
   s2 = 8 - s1;
-  m1 = 0xff >> (x1 & 7);
-  m2 = 0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7));
-  m3 = (0xff >> s1) & m2;
+  m1 = (Guchar)(0xff >> (x1 & 7));
+  m2 = (Guchar)(0xff << (((x1 & 7) == 0) ? 0 : 8 - (x1 & 7)));
+  m3 = (Guchar)((0xff >> s1) & m2);
 
   oneByte = x0 == ((x1 - 1) & ~7);
 
@@ -878,19 +879,19 @@
 	src1 = *srcPtr;
 	switch (combOp) {
 	case 0: // or
-	  dest |= (src1 >> s1) & m2;
+	  dest |= (Guchar)((src1 >> s1) & m2);
 	  break;
 	case 1: // and
-	  dest &= ((0xff00 | src1) >> s1) | m1;
+	  dest &= (Guchar)(((0xff00 | src1) >> s1) | m1);
 	  break;
 	case 2: // xor
-	  dest ^= (src1 >> s1) & m2;
+	  dest ^= (Guchar)((src1 >> s1) & m2);
 	  break;
 	case 3: // xnor
-	  dest ^= ((src1 ^ 0xff) >> s1) & m2;
+	  dest ^= (Guchar)(((src1 ^ 0xff) >> s1) & m2);
 	  break;
 	case 4: // replace
-	  dest = (dest & ~m3) | ((src1 >> s1) & m3);
+	  dest = (Guchar)((dest & ~m3) | ((src1 >> s1) & m3));
 	  break;
 	}
 	*destPtr = dest;
@@ -931,19 +932,19 @@
 	dest = *destPtr;
 	switch (combOp) {
 	case 0: // or
-	  dest |= src1 >> s1;
+	  dest |= (Guchar)(src1 >> s1);
 	  break;
 	case 1: // and
-	  dest &= (0xff00 | src1) >> s1;
+	  dest &= (Guchar)((0xff00 | src1) >> s1);
 	  break;
 	case 2: // xor
-	  dest ^= src1 >> s1;
+	  dest ^= (Guchar)(src1 >> s1);
 	  break;
 	case 3: // xnor
-	  dest ^= (src1 ^ 0xff) >> s1;
+	  dest ^= (Guchar)((src1 ^ 0xff) >> s1);
 	  break;
 	case 4: // replace
-	  dest = (dest & (0xff << s2)) | (src1 >> s1);
+	  dest = (Guchar)((dest & (0xff << s2)) | (src1 >> s1));
 	  break;
 	}
 	*destPtr++ = dest;
@@ -960,7 +961,7 @@
 	dest = *destPtr;
 	src0 = src1;
 	src1 = *srcPtr++;
-	src = (((src0 << 8) | src1) >> s1) & 0xff;
+	src = (Guchar)(((src0 << 8) | src1) >> s1);
 	switch (combOp) {
 	case 0: // or
 	  dest |= src;
@@ -989,7 +990,7 @@
       dest = *destPtr;
       src0 = src1;
       src1 = *srcPtr++;
-      src = (((src0 << 8) | src1) >> s1) & 0xff;
+      src = (Guchar)(((src0 << 8) | src1) >> s1);
       switch (combOp) {
       case 0: // or
 	dest |= src & m2;
@@ -1712,6 +1713,12 @@
 	    "Bad delta-height value in JBIG2 symbol dictionary");
       goto syntaxError;
     }
+    // sanity check to avoid extremely long run-times with damaged streams
+    if (dh > 1000000) {
+      error(errSyntaxError, getPos(),
+	    "Bogus delta-height value in JBIG2 symbol dictionary");
+      goto syntaxError;
+    }
     symHeight += dh;
     symWidth = 0;
     totalWidth = 0;
@@ -2814,17 +2821,17 @@
   if (mmr) {
 
     mmrDecoder->reset();
-    if (w > INT_MAX - 2) {
+    if (w > INT_MAX - 3) {
       error(errSyntaxError, getPos(), "Bad width in JBIG2 generic bitmap");
       // force a call to gmalloc(-1), which will throw an exception
-      w = -3;
+      w = -4;
     }
     // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = w
     // ---> max codingLine size = w + 1
-    // refLine has one extra guard entry at the end
-    // ---> max refLine size = w + 2
+    // refLine has two extra guard entries at the end
+    // ---> max refLine size = w + 3
     codingLine = (int *)gmallocn(w + 1, sizeof(int));
-    refLine = (int *)gmallocn(w + 2, sizeof(int));
+    refLine = (int *)gmallocn(w + 3, sizeof(int));
     codingLine[0] = w;
 
     for (y = 0; y < h; ++y) {
@@ -2834,6 +2841,7 @@
 	refLine[i] = codingLine[i];
       }
       refLine[i++] = w;
+      refLine[i++] = w;
       refLine[i] = w;
 
       // decode a line
@@ -3125,7 +3133,9 @@
 		atBuf3 |= *atP3++;
 	      }
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx0 = (buf0 >> 14) & 0x07;
@@ -3182,7 +3192,9 @@
 	      }
 	      buf2 |= *p2++;
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx0 = (buf0 >> 14) & 0x07;
@@ -3258,7 +3270,9 @@
 		atBuf0 |= *atP0++;
 	      }
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx0 = (buf0 >> 13) & 0x0f;
@@ -3300,7 +3314,9 @@
 	      }
 	      buf2 |= *p2++;
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx0 = (buf0 >> 13) & 0x0f;
@@ -3373,7 +3389,9 @@
 		atBuf0 |= *atP0++;
 	      }
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx0 = (buf0 >> 14) & 0x07;
@@ -3415,7 +3433,9 @@
 	      }
 	      buf2 |= *p2++;
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx0 = (buf0 >> 14) & 0x07;
@@ -3478,7 +3498,9 @@
 		atBuf0 |= *atP0++;
 	      }
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx1 = (buf1 >> 14) & 0x1f;
@@ -3515,7 +3537,9 @@
 	      }
 	      buf2 |= *p2++;
 	    }
-	    for (x1 = 0, mask = 0x80; x1 < 8 && x < w; ++x1, ++x, mask >>= 1) {
+	    for (x1 = 0, mask = 0x80;
+		 x1 < 8 && x < w;
+		 ++x1, ++x, mask = (Guchar)(mask >> 1)) {
 
 	      // build the context
 	      cx1 = (buf1 >> 14) & 0x1f;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JPXStream.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JPXStream.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JPXStream.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -230,7 +230,7 @@
 JPXStream::JPXStream(Stream *strA):
   FilterStream(strA)
 {
-  bufStr = new BufStream(str, 2);
+  bufStr = new BufStream(str, 3);
 
   nComps = 0;
   bpc = NULL;
@@ -270,10 +270,11 @@
 }
 
 void JPXStream::reset() {
+  img.ySize = 0;
   bufStr->reset();
   if (readBoxes() == jpxDecodeFatalError) {
     // readBoxes reported an error, so we go immediately to EOF
-    curY = img.ySizeR;
+    curY = img.ySize >> reduction;
   } else {
     curY = img.yOffsetR;
   }
@@ -420,8 +421,12 @@
 #else
     tileComp = &img.tiles[tileIdx].tileComps[havePalette ? 0 : curComp];
 #endif
-    tx = jpxCeilDiv((curX - img.xTileOffsetR) % img.xTileSizeR, tileComp->hSep);
-    ty = jpxCeilDiv((curY - img.yTileOffsetR) % img.yTileSizeR, tileComp->vSep);
+    //~ can curX/curY be less than x/yTileOffsetR?
+    //~ if yes, we need to use tx = max(0, ....)
+    tx = jpxFloorDiv((curX - img.xTileOffsetR) % img.xTileSizeR,
+		     tileComp->hSep);
+    ty = jpxFloorDiv((curY - img.yTileOffsetR) % img.yTileSizeR,
+		     tileComp->vSep);
     pix = (int)tileComp->data[ty * tileComp->w + tx];
     pixBits = tileComp->prec;
     eol = gFalse;
@@ -589,7 +594,7 @@
   JPXDecodeResult result;
   GBool haveCodestream;
   Guint boxType, boxLen, dataLen;
-  Guint bpc1, compression, unknownColorspace, ipr;
+  Guint w, h, n, bpc1, compression, unknownColorspace, ipr;
   Guint i, j;
 
   haveImgHdr = gFalse;
@@ -627,9 +632,9 @@
       break;
     case 0x69686472:		// image header
       cover(9);
-      if (!readULong(&height) ||
-	  !readULong(&width) ||
-	  !readUWord(&nComps) ||
+      if (!readULong(&h) ||
+	  !readULong(&w) ||
+	  !readUWord(&n) ||
 	  !readUByte(&bpc1) ||
 	  !readUByte(&compression) ||
 	  !readUByte(&unknownColorspace) ||
@@ -642,6 +647,9 @@
 	      "Unknown compression type in JPX stream");
 	return jpxDecodeFatalError;
       }
+      height = h;
+      width = w;
+      nComps = n;
       bpc = (Guint *)gmallocn(nComps, sizeof(Guint));
       for (i = 0; i < nComps; ++i) {
 	bpc[i] = bpc1;
@@ -895,7 +903,9 @@
   JPXTileComp *tileComp;
   int segType;
   GBool haveSIZ, haveCOD, haveQCD, haveSOT, ok;
-  Guint precinctSize, style;
+  Guint style, progOrder, nLayers, multiComp, nDecompLevels;
+  Guint codeBlockW, codeBlockH, codeBlockStyle, transform;
+  Guint precinctSize;
   Guint segLen, capabilities, comp, i, j, r;
 
   //----- main header
@@ -941,7 +951,8 @@
 	  img.xTileOffset > img.xOffset ||
 	  img.yTileOffset > img.yOffset ||
 	  img.xTileSize + img.xTileOffset <= img.xOffset ||
-	  img.yTileSize + img.yTileOffset <= img.yOffset) {
+	  img.yTileSize + img.yTileOffset <= img.yOffset ||
+	  img.nComps == 0) {
 	error(errSyntaxError, getPos(), "Error in JPX SIZ marker segment");
 	return jpxDecodeFatalError;
       }
@@ -1010,65 +1021,54 @@
 	      "JPX COD marker segment before SIZ segment");
 	return jpxDecodeFatalError;
       }
-      if (!readUByte(&img.tiles[0].tileComps[0].style) ||
-	  !readUByte(&img.tiles[0].progOrder) ||
-	  !readUWord(&img.tiles[0].nLayers) ||
-	  !readUByte(&img.tiles[0].multiComp) ||
-	  !readUByte(&img.tiles[0].tileComps[0].nDecompLevels) ||
-	  !readUByte(&img.tiles[0].tileComps[0].codeBlockW) ||
-	  !readUByte(&img.tiles[0].tileComps[0].codeBlockH) ||
-	  !readUByte(&img.tiles[0].tileComps[0].codeBlockStyle) ||
-	  !readUByte(&img.tiles[0].tileComps[0].transform)) {
+      if (!readUByte(&style) ||
+	  !readUByte(&progOrder) ||
+	  !readUWord(&nLayers) ||
+	  !readUByte(&multiComp) ||
+	  !readUByte(&nDecompLevels) ||
+	  !readUByte(&codeBlockW) ||
+	  !readUByte(&codeBlockH) ||
+	  !readUByte(&codeBlockStyle) ||
+	  !readUByte(&transform)) {
 	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	return jpxDecodeFatalError;
       }
-      if (img.tiles[0].tileComps[0].nDecompLevels > 32 ||
-	  img.tiles[0].tileComps[0].codeBlockW > 8 ||
-	  img.tiles[0].tileComps[0].codeBlockH > 8) {
+      if (nDecompLevels < 1 ||
+	  nDecompLevels > 31 ||
+	  codeBlockW > 8 ||
+	  codeBlockH > 8) {
 	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	return jpxDecodeFatalError;
       }
 #if 1 //~ progression orders 2-4 are unimplemented
-      if (img.tiles[0].progOrder >= 2) {
+      if (progOrder >= 2) {
 	error(errUnimplemented, -1,
 	      "JPX progression order {0:d} is unimplemented",
-	      img.tiles[0].progOrder);
+	      progOrder);
       }
 #endif
-      img.tiles[0].tileComps[0].codeBlockW += 2;
-      img.tiles[0].tileComps[0].codeBlockH += 2;
+      codeBlockW += 2;
+      codeBlockH += 2;
       for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
-	if (i != 0) {
-	  img.tiles[i].progOrder = img.tiles[0].progOrder;
-	  img.tiles[i].nLayers = img.tiles[0].nLayers;
-	  img.tiles[i].multiComp = img.tiles[0].multiComp;
-	}
+	img.tiles[i].progOrder = progOrder;
+	img.tiles[i].nLayers = nLayers;
+	img.tiles[i].multiComp = multiComp;
 	for (comp = 0; comp < img.nComps; ++comp) {
-	  if (!(i == 0 && comp == 0)) {
-	    img.tiles[i].tileComps[comp].style =
-	        img.tiles[0].tileComps[0].style;
-	    img.tiles[i].tileComps[comp].nDecompLevels =
-	        img.tiles[0].tileComps[0].nDecompLevels;
-	    img.tiles[i].tileComps[comp].codeBlockW =
-	        img.tiles[0].tileComps[0].codeBlockW;
-	    img.tiles[i].tileComps[comp].codeBlockH =
-	        img.tiles[0].tileComps[0].codeBlockH;
-	    img.tiles[i].tileComps[comp].codeBlockStyle =
-	        img.tiles[0].tileComps[0].codeBlockStyle;
-	    img.tiles[i].tileComps[comp].transform =
-	        img.tiles[0].tileComps[0].transform;
-	  }
+	  img.tiles[i].tileComps[comp].style = style;
+	  img.tiles[i].tileComps[comp].nDecompLevels = nDecompLevels;
+	  img.tiles[i].tileComps[comp].codeBlockW = codeBlockW;
+	  img.tiles[i].tileComps[comp].codeBlockH = codeBlockH;
+	  img.tiles[i].tileComps[comp].codeBlockStyle = codeBlockStyle;
+	  img.tiles[i].tileComps[comp].transform = transform;
 	  img.tiles[i].tileComps[comp].resLevels =
-	      (JPXResLevel *)gmallocn(
-		     (img.tiles[i].tileComps[comp].nDecompLevels + 1),
-		     sizeof(JPXResLevel));
-	  for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
+	      (JPXResLevel *)gmallocn(nDecompLevels + 1, sizeof(JPXResLevel));
+	  for (r = 0; r <= nDecompLevels; ++r) {
 	    img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
 	  }
 	}
       }
-      for (r = 0; r <= img.tiles[0].tileComps[0].nDecompLevels; ++r) {
-	if (img.tiles[0].tileComps[0].style & 0x01) {
+      for (r = 0; r <= nDecompLevels; ++r) {
+	if (style & 0x01) {
 	  cover(91);
 	  if (!readUByte(&precinctSize)) {
 	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
@@ -1086,7 +1086,7 @@
       for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
 	for (comp = 0; comp < img.nComps; ++comp) {
 	  if (!(i == 0 && comp == 0)) {
-	    for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
+	    for (r = 0; r <= nDecompLevels; ++r) {
 	      img.tiles[i].tileComps[comp].resLevels[r].precinctWidth =
 		  img.tiles[0].tileComps[0].resLevels[r].precinctWidth;
 	      img.tiles[i].tileComps[comp].resLevels[r].precinctHeight =
@@ -1108,50 +1108,42 @@
 	  (img.nComps <= 256 && !readUByte(&comp)) ||
 	  comp >= img.nComps ||
 	  !readUByte(&style) ||
-	  !readUByte(&img.tiles[0].tileComps[comp].nDecompLevels) ||
-	  !readUByte(&img.tiles[0].tileComps[comp].codeBlockW) ||
-	  !readUByte(&img.tiles[0].tileComps[comp].codeBlockH) ||
-	  !readUByte(&img.tiles[0].tileComps[comp].codeBlockStyle) ||
-	  !readUByte(&img.tiles[0].tileComps[comp].transform)) {
+	  !readUByte(&nDecompLevels) ||
+	  !readUByte(&codeBlockW) ||
+	  !readUByte(&codeBlockH) ||
+	  !readUByte(&codeBlockStyle) ||
+	  !readUByte(&transform)) {
 	error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
 	return jpxDecodeFatalError;
       }
-      if (img.tiles[0].tileComps[comp].nDecompLevels > 32 ||
-	  img.tiles[0].tileComps[comp].codeBlockW > 8 ||
-	  img.tiles[0].tileComps[comp].codeBlockH > 8) {
+      if (nDecompLevels < 1 ||
+	  nDecompLevels > 31 ||
+	  codeBlockW > 8 ||
+	  codeBlockH > 8) {
 	error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
 	return jpxDecodeFatalError;
       }
-      img.tiles[0].tileComps[comp].style =
-	  (img.tiles[0].tileComps[comp].style & ~1) | (style & 1);
-      img.tiles[0].tileComps[comp].codeBlockW += 2;
-      img.tiles[0].tileComps[comp].codeBlockH += 2;
+      style = (img.tiles[0].tileComps[comp].style & ~1) | (style & 1);
+      codeBlockW += 2;
+      codeBlockH += 2;
       for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
-	if (i != 0) {
-	  img.tiles[i].tileComps[comp].style =
-	      img.tiles[0].tileComps[comp].style;
-	  img.tiles[i].tileComps[comp].nDecompLevels =
-	      img.tiles[0].tileComps[comp].nDecompLevels;
-	  img.tiles[i].tileComps[comp].codeBlockW =
-	      img.tiles[0].tileComps[comp].codeBlockW;
-	  img.tiles[i].tileComps[comp].codeBlockH =
-	      img.tiles[0].tileComps[comp].codeBlockH;
-	  img.tiles[i].tileComps[comp].codeBlockStyle =
-	      img.tiles[0].tileComps[comp].codeBlockStyle;
-	  img.tiles[i].tileComps[comp].transform =
-	      img.tiles[0].tileComps[comp].transform;
-	}
+	img.tiles[i].tileComps[comp].style = style;
+	img.tiles[i].tileComps[comp].nDecompLevels = nDecompLevels;
+	img.tiles[i].tileComps[comp].codeBlockW = codeBlockW;
+	img.tiles[i].tileComps[comp].codeBlockH = codeBlockH;
+	img.tiles[i].tileComps[comp].codeBlockStyle = codeBlockStyle;
+	img.tiles[i].tileComps[comp].transform = transform;
 	img.tiles[i].tileComps[comp].resLevels =
 	    (JPXResLevel *)greallocn(
 		     img.tiles[i].tileComps[comp].resLevels,
-		     (img.tiles[i].tileComps[comp].nDecompLevels + 1),
+		     nDecompLevels + 1,
 		     sizeof(JPXResLevel));
-	for (r = 0; r <= img.tiles[i].tileComps[comp].nDecompLevels; ++r) {
+	for (r = 0; r <= nDecompLevels; ++r) {
 	  img.tiles[i].tileComps[comp].resLevels[r].precincts = NULL;
 	}
       }
-      for (r = 0; r <= img.tiles[0].tileComps[comp].nDecompLevels; ++r) {
-	if (img.tiles[0].tileComps[comp].style & 0x01) {
+      for (r = 0; r <= nDecompLevels; ++r) {
+	if (style & 0x01) {
 	  if (!readUByte(&precinctSize)) {
 	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	    return jpxDecodeFatalError;
@@ -1507,7 +1499,9 @@
   GBool haveSOD;
   Guint tileIdx, tilePartLen, tilePartIdx, nTileParts;
   GBool tilePartToEOC;
-  Guint precinctSize, style;
+  Guint style, progOrder, nLayers, multiComp, nDecompLevels;
+  Guint codeBlockW, codeBlockH, codeBlockStyle, transform;
+  Guint precinctSize, qStyle;
   Guint n, nSBs, nx, ny, sbx0, sby0, comp, segLen;
   Guint i, j, k, cbX, cbY, r, pre, sb, cbi, cbj;
   int segType, level;
@@ -1545,21 +1539,22 @@
     switch (segType) {
     case 0x52:			// COD - coding style default
       cover(34);
-      if (!readUByte(&img.tiles[tileIdx].tileComps[0].style) ||
-	  !readUByte(&img.tiles[tileIdx].progOrder) ||
-	  !readUWord(&img.tiles[tileIdx].nLayers) ||
-	  !readUByte(&img.tiles[tileIdx].multiComp) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[0].nDecompLevels) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockW) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockH) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[0].codeBlockStyle) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[0].transform)) {
+      if (!readUByte(&style) ||
+	  !readUByte(&progOrder) ||
+	  !readUWord(&nLayers) ||
+	  !readUByte(&multiComp) ||
+	  !readUByte(&nDecompLevels) ||
+	  !readUByte(&codeBlockW) ||
+	  !readUByte(&codeBlockH) ||
+	  !readUByte(&codeBlockStyle) ||
+	  !readUByte(&transform)) {
 	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	return gFalse;
       }
-      if (img.tiles[tileIdx].tileComps[0].nDecompLevels > 32 ||
-	  img.tiles[tileIdx].tileComps[0].codeBlockW > 8 ||
-	  img.tiles[tileIdx].tileComps[0].codeBlockH > 8) {
+      if (nDecompLevels < 1 ||
+	  nDecompLevels > 31 ||
+	  codeBlockW > 8 ||
+	  codeBlockH > 8) {
 	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	return gFalse;
       }
@@ -1570,36 +1565,29 @@
 	      img.tiles[tileIdx].progOrder);
       }
 #endif
-      img.tiles[tileIdx].tileComps[0].codeBlockW += 2;
-      img.tiles[tileIdx].tileComps[0].codeBlockH += 2;
+      codeBlockW += 2;
+      codeBlockH += 2;
+      img.tiles[tileIdx].progOrder = progOrder;
+      img.tiles[tileIdx].nLayers = nLayers;
+      img.tiles[tileIdx].multiComp = multiComp;
       for (comp = 0; comp < img.nComps; ++comp) {
-	if (comp != 0) {
-	  img.tiles[tileIdx].tileComps[comp].style =
-	      img.tiles[tileIdx].tileComps[0].style;
-	  img.tiles[tileIdx].tileComps[comp].nDecompLevels =
-	      img.tiles[tileIdx].tileComps[0].nDecompLevels;
-	  img.tiles[tileIdx].tileComps[comp].codeBlockW =
-	      img.tiles[tileIdx].tileComps[0].codeBlockW;
-	  img.tiles[tileIdx].tileComps[comp].codeBlockH =
-	      img.tiles[tileIdx].tileComps[0].codeBlockH;
-	  img.tiles[tileIdx].tileComps[comp].codeBlockStyle =
-	      img.tiles[tileIdx].tileComps[0].codeBlockStyle;
-	  img.tiles[tileIdx].tileComps[comp].transform =
-	      img.tiles[tileIdx].tileComps[0].transform;
-	}
+	img.tiles[tileIdx].tileComps[comp].style = style;
+	img.tiles[tileIdx].tileComps[comp].nDecompLevels = nDecompLevels;
+	img.tiles[tileIdx].tileComps[comp].codeBlockW = codeBlockW;
+	img.tiles[tileIdx].tileComps[comp].codeBlockH = codeBlockH;
+	img.tiles[tileIdx].tileComps[comp].codeBlockStyle = codeBlockStyle;
+	img.tiles[tileIdx].tileComps[comp].transform = transform;
 	img.tiles[tileIdx].tileComps[comp].resLevels =
 	    (JPXResLevel *)greallocn(
 		     img.tiles[tileIdx].tileComps[comp].resLevels,
-		     (img.tiles[tileIdx].tileComps[comp].nDecompLevels + 1),
+		     nDecompLevels + 1,
 		     sizeof(JPXResLevel));
-	for (r = 0;
-	     r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels;
-	     ++r) {
+	for (r = 0; r <= nDecompLevels; ++r) {
 	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
 	}
       }
-      for (r = 0; r <= img.tiles[tileIdx].tileComps[0].nDecompLevels; ++r) {
-	if (img.tiles[tileIdx].tileComps[0].style & 0x01) {
+      for (r = 0; r <= nDecompLevels; ++r) {
+	if (style & 0x01) {
 	  if (!readUByte(&precinctSize)) {
 	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	    return gFalse;
@@ -1614,9 +1602,7 @@
 	}
       }
       for (comp = 1; comp < img.nComps; ++comp) {
-	for (r = 0;
-	     r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels;
-	     ++r) {
+	for (r = 0; r <= nDecompLevels; ++r) {
 	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctWidth =
 	      img.tiles[tileIdx].tileComps[0].resLevels[r].precinctWidth;
 	  img.tiles[tileIdx].tileComps[comp].resLevels[r].precinctHeight =
@@ -1630,34 +1616,38 @@
 	  (img.nComps <= 256 && !readUByte(&comp)) ||
 	  comp >= img.nComps ||
 	  !readUByte(&style) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[comp].nDecompLevels) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockW) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockH) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[comp].codeBlockStyle) ||
-	  !readUByte(&img.tiles[tileIdx].tileComps[comp].transform)) {
+	  !readUByte(&nDecompLevels) ||
+	  !readUByte(&codeBlockW) ||
+	  !readUByte(&codeBlockH) ||
+	  !readUByte(&codeBlockStyle) ||
+	  !readUByte(&transform)) {
 	error(errSyntaxError, getPos(), "Error in JPX COC marker segment");
 	return gFalse;
       }
-      if (img.tiles[tileIdx].tileComps[comp].nDecompLevels > 32 ||
-	  img.tiles[tileIdx].tileComps[comp].codeBlockW > 8 ||
-	  img.tiles[tileIdx].tileComps[comp].codeBlockH > 8) {
+      if (nDecompLevels < 1 ||
+	  nDecompLevels > 31 ||
+	  codeBlockW > 8 ||
+	  codeBlockH > 8) {
 	error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	return gFalse;
       }
       img.tiles[tileIdx].tileComps[comp].style =
 	  (img.tiles[tileIdx].tileComps[comp].style & ~1) | (style & 1);
-      img.tiles[tileIdx].tileComps[comp].codeBlockW += 2;
-      img.tiles[tileIdx].tileComps[comp].codeBlockH += 2;
+      img.tiles[tileIdx].tileComps[comp].nDecompLevels = nDecompLevels;
+      img.tiles[tileIdx].tileComps[comp].codeBlockW = codeBlockW + 2;
+      img.tiles[tileIdx].tileComps[comp].codeBlockH = codeBlockH + 2;
+      img.tiles[tileIdx].tileComps[comp].codeBlockStyle = codeBlockStyle;
+      img.tiles[tileIdx].tileComps[comp].transform = transform;
       img.tiles[tileIdx].tileComps[comp].resLevels =
 	  (JPXResLevel *)greallocn(
 		     img.tiles[tileIdx].tileComps[comp].resLevels,
-		     (img.tiles[tileIdx].tileComps[comp].nDecompLevels + 1),
+		     nDecompLevels + 1,
 		     sizeof(JPXResLevel));
-      for (r = 0; r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels; ++r) {
+      for (r = 0; r <= nDecompLevels; ++r) {
 	img.tiles[tileIdx].tileComps[comp].resLevels[r].precincts = NULL;
       }
-      for (r = 0; r <= img.tiles[tileIdx].tileComps[comp].nDecompLevels; ++r) {
-	if (img.tiles[tileIdx].tileComps[comp].style & 0x01) {
+      for (r = 0; r <= nDecompLevels; ++r) {
+	if (style & 0x01) {
 	  if (!readUByte(&precinctSize)) {
 	    error(errSyntaxError, getPos(), "Error in JPX COD marker segment");
 	    return gFalse;
@@ -1890,6 +1880,17 @@
     }
   } while (!haveSOD);
 
+  for (comp = 0; comp < img.nComps; ++comp) {
+    tileComp = &img.tiles[tileIdx].tileComps[comp];
+    qStyle = tileComp->quantStyle & 0x1f;
+    if ((qStyle == 0 && tileComp->nQuantSteps < 3 * tileComp->nDecompLevels) ||
+	(qStyle == 1 && tileComp->nQuantSteps < 1) ||
+	(qStyle == 2 && tileComp->nQuantSteps < 3 * tileComp->nDecompLevels)) {
+      error(errSyntaxError, getPos(), "Too few quant steps in JPX tile part");
+      return gFalse;
+    }
+  }
+
   //----- initialize the tile, precincts, and code-blocks
   if (tilePartIdx == 0) {
     tile = &img.tiles[tileIdx];
@@ -2083,7 +2084,8 @@
 		    }
 		  }
 		  memset(cb->touched, 0,
-			 (1 << (tileComp->codeBlockW + tileComp->codeBlockH)));
+			 ((size_t)1 << (tileComp->codeBlockW
+					+ tileComp->codeBlockH)));
 		} else {
 		  cb->coeffs = NULL;
 		  cb->touched = NULL;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Lexer.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Lexer.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Lexer.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -141,7 +141,7 @@
   // number
   case '0': case '1': case '2': case '3': case '4':
   case '5': case '6': case '7': case '8': case '9':
-  case '-': case '.':
+  case '+': case '-': case '.':
     // Adobe's number lexer has some "interesting" behavior:
     // "--123" is interpreted as 0
     // "--123.4" is interpreted as -123.4 [I've seen this in the wild]
@@ -159,7 +159,9 @@
     neg = gFalse;
     doubleMinus = gFalse;
     xf = xi = 0;
-    if (c == '-') {
+    if (c == '+') {
+      // just ignore it
+    } else if (c == '-') {
       neg = gTrue;
       if (lookChar() == '-') {
 	doubleMinus = gTrue;
@@ -373,9 +375,9 @@
       // accept longer names
       ++n;
       if (n < tokBufSize) {
-	*p++ = c;
+	*p++ = (char)c;
       } else if (n == tokBufSize) {
-	*p = c;
+	*p = (char)c;
 	s = new GString(tokBuf, n);
       } else {
 	s->append((char)c);
@@ -393,7 +395,7 @@
   // array punctuation
   case '[':
   case ']':
-    tokBuf[0] = c;
+    tokBuf[0] = (char)c;
     tokBuf[1] = '\0';
     obj->initCmd(tokBuf);
     break;
@@ -484,7 +486,7 @@
   // command
   default:
     p = tokBuf;
-    *p++ = c;
+    *p++ = (char)c;
     n = 1;
     while ((c = lookChar()) != EOF && !specialChars[c]) {
       getChar();
@@ -492,7 +494,7 @@
 	error(errSyntaxError, getPos(), "Command token too long");
 	break;
       }
-      *p++ = c;
+      *p++ = (char)c;
     }
     *p = '\0';
     if (tokBuf[0] == 't' && !strcmp(tokBuf, "true")) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/NameToUnicodeTable.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/NameToUnicodeTable.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/NameToUnicodeTable.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -2785,6 +2785,7 @@
   {0x30ce, "nokatakana"},
   {0xff89, "nokatakanahalfwidth"},
   {0x00a0, "nonbreakingspace"},
+  {0x00a0, "nobreakspace"},
   {0x0e13, "nonenthai"},
   {0x0e19, "nonuthai"},
   {0x0646, "noonarabic"},

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -46,7 +46,7 @@
 #if MULTITHREADED
 GAtomicCounter Object::numAlloc[numObjTypes] =
 #else
-int Object::numAlloc[numObjTypes] =
+long Object::numAlloc[numObjTypes] =
 #endif
   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 #endif
@@ -226,7 +226,7 @@
 void Object::memCheck(FILE *f) {
 #ifdef DEBUG_MEM
   int i;
-  int t;
+  long t;
 
   t = 0;
   for (i = 0; i < numObjTypes; ++i)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -168,7 +168,7 @@
   // Array accessors.
   int arrayGetLength();
   void arrayAdd(Object *elem);
-  Object *arrayGet(int i, Object *obj);
+  Object *arrayGet(int i, Object *obj, int recursion = 0);
   Object *arrayGetNF(int i, Object *obj);
 
   // Dict accessors.
@@ -239,8 +239,8 @@
 inline void Object::arrayAdd(Object *elem)
   { array->add(elem); }
 
-inline Object *Object::arrayGet(int i, Object *obj)
-  { return array->get(i, obj); }
+inline Object *Object::arrayGet(int i, Object *obj, int recursion)
+  { return array->get(i, obj, recursion); }
 
 inline Object *Object::arrayGetNF(int i, Object *obj)
   { return array->getNF(i, obj); }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -42,10 +42,10 @@
 
 OptionalContent::OptionalContent(PDFDoc *doc) {
   Object *ocProps;
-  Object ocgList, defView, obj1, obj2;
+  Object ocgList, defView, uad, obj1, obj2, obj3, obj4;
   Ref ref1;
   OptionalContentGroup *ocg;
-  int i;
+  int i, j;
 
   xref = doc->getXRef();
   ocgs = new GList();
@@ -70,34 +70,41 @@
       //----- read the default viewing OCCD
       if (ocProps->dictLookup("D", &defView)->isDict()) {
 
-	//----- initial state from OCCD
-	if (defView.dictLookup("OFF", &obj1)->isArray()) {
+	//----- read the usage app dicts
+	if (defView.dictLookup("AS", &obj1)->isArray()) {
 	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
-	    if (obj1.arrayGetNF(i, &obj2)->isRef()) {
-	      ref1 = obj2.getRef();
-	      if ((ocg = findOCG(&ref1))) {
-		ocg->setState(gFalse);
-	      } else {
-		error(errSyntaxError, -1,
-		      "Invalid OCG reference in OFF array in default viewing OCCD");
+	    if (obj1.arrayGet(i, &uad)->isDict()) {
+	      if (uad.dictLookup("Event", &obj2)->isName("View")) {
+		if (uad.dictLookup("OCGs", &obj3)->isArray()) {
+		  for (j = 0; j < obj3.arrayGetLength(); ++j) {
+		    if (obj3.arrayGetNF(j, &obj4)->isRef()) {
+		      ref1 = obj4.getRef();
+		      if ((ocg = findOCG(&ref1))) {
+			ocg->setInViewUsageAppDict();
+		      }
+		    }
+		    obj4.free();
+		  }
+		}
+		obj3.free();
 	      }
+	      obj2.free();
 	    }
-	    obj2.free();
+	    uad.free();
 	  }
 	}
 	obj1.free();
-	// the default OCCD is required to have a BaseState of ON, so
-	// the ON array is redundant -- but some (broken) PDF files
-	// include OCGs in both the OFF and ON arrays
-	if (defView.dictLookup("ON", &obj1)->isArray()) {
+
+	//----- initial state from OCCD
+	if (defView.dictLookup("OFF", &obj1)->isArray()) {
 	  for (i = 0; i < obj1.arrayGetLength(); ++i) {
 	    if (obj1.arrayGetNF(i, &obj2)->isRef()) {
 	      ref1 = obj2.getRef();
 	      if ((ocg = findOCG(&ref1))) {
-		ocg->setState(gTrue);
+		ocg->setState(gFalse);
 	      } else {
 		error(errSyntaxError, -1,
-		      "Invalid OCG reference in ON array in default viewing OCCD");
+		      "Invalid OCG reference in OFF array in default viewing OCCD");
 	      }
 	    }
 	    obj2.free();
@@ -108,10 +115,9 @@
 	//----- initial state from OCG usage dict
 	for (i = 0; i < ocgs->getLength(); ++i) {
 	  ocg = (OptionalContentGroup *)ocgs->get(i);
-	  //~ should this look at PrintState when printing, or is it
-	  //~   better to always print the ViewState?
-	  if (ocg->getViewState() == ocUsageOff) {
-	    ocg->setState(gFalse);
+	  if (ocg->getInViewUsageAppDict() &&
+	      ocg->getViewState() != ocUsageUnset) {
+	    ocg->setState(ocg->getViewState() == ocUsageOn);
 	  }
 	}
 
@@ -370,6 +376,7 @@
   viewState = viewStateA;
   printState = printStateA;
   state = gTrue;
+  inViewUsageAppDict = gFalse;
 }
 
 OptionalContentGroup::~OptionalContentGroup() {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -85,6 +85,8 @@
   OCUsageState getPrintState() { return printState; }
   GBool getState() { return state; }
   void setState(GBool stateA) { state = stateA; }
+  GBool getInViewUsageAppDict() { return inViewUsageAppDict; }
+  void setInViewUsageAppDict() { inViewUsageAppDict = gTrue; }
 
 private:
 
@@ -96,6 +98,8 @@
   OCUsageState viewState,	// suggested state when viewing
                printState;	// suggested state when printing
   GBool state;			// current state (on/off)
+  GBool inViewUsageAppDict;	// true if this OCG is listed in a
+				//   usage app dict with Event=View
 
   friend class OCDisplayNode;
 };

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OutputDev.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OutputDev.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OutputDev.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -82,6 +82,7 @@
   virtual GBool needCharCount() { return gFalse; }
 
 
+
   //----- initialization and control
 
   // Set default transform matrix.

Added: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -0,0 +1,1916 @@
+//========================================================================
+//
+// PDF417Barcode.cc
+//
+// Copyright 2018 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <math.h>
+#include "gtypes.h"
+#include "GString.h"
+#include "GList.h"
+#include "Error.h"
+#include "PDF417Barcode.h"
+
+//------------------------------------------------------------------------
+
+#define maxDataCodewords 928
+#define maxErrorCorrectionLevel 8
+#define maxErrorCorrectionCodewords (1 << (maxErrorCorrectionLevel + 1))
+
+// mode latches
+#define textModeLatch         900
+#define byteModeLatchMult6    924
+#define byteModeLatchNonMult6 901
+#define byteModeShift         913
+#define numericModeLatch      902
+
+// text submode latches and shifts
+#define textAlphaLowerLatch 27
+#define textAlphaMixedLatch 28
+#define textAlphaPuncShift  29
+#define textLowerAlphaShift 27
+#define textLowerMixedLatch 28
+#define textLowerPuncShift  29
+#define textMixedPuncLatch  25
+#define textMixedLowerLatch 27
+#define textMixedAlphaLatch 28
+#define textMixedPuncShift  29
+#define textPuncAlphaLatch  29
+
+#define textSubmodeAlpha      0
+#define textSubmodeLower      1
+#define textSubmodeMixed      2
+#define textSubmodePunc       3
+#define textSubmodeAlphaShift 4
+#define textSubmodePuncShift  5
+
+// textCompaction[char][submode] = base-30 value
+//                                 or 30 if char isn't available
+static char textCompaction[128][4] = {
+  { 30, 30, 30, 30 },  //   0
+  { 30, 30, 30, 30 },  //   1
+  { 30, 30, 30, 30 },  //   2
+  { 30, 30, 30, 30 },  //   3
+  { 30, 30, 30, 30 },  //   4
+  { 30, 30, 30, 30 },  //   5
+  { 30, 30, 30, 30 },  //   6
+  { 30, 30, 30, 30 },  //   7
+  { 30, 30, 30, 30 },  //   8
+  { 30, 30, 12, 12 },  //   9
+  { 30, 30, 30, 15 },  //  10
+  { 30, 30, 30, 30 },  //  11
+  { 30, 30, 30, 30 },  //  12
+  { 30, 30, 11, 11 },  //  13
+  { 30, 30, 30, 30 },  //  14
+  { 30, 30, 30, 30 },  //  15
+  { 30, 30, 30, 30 },  //  16
+  { 30, 30, 30, 30 },  //  17
+  { 30, 30, 30, 30 },  //  18
+  { 30, 30, 30, 30 },  //  19
+  { 30, 30, 30, 30 },  //  20
+  { 30, 30, 30, 30 },  //  21
+  { 30, 30, 30, 30 },  //  22
+  { 30, 30, 30, 30 },  //  23
+  { 30, 30, 30, 30 },  //  24
+  { 30, 30, 30, 30 },  //  25
+  { 30, 30, 30, 30 },  //  26
+  { 30, 30, 30, 30 },  //  27
+  { 30, 30, 30, 30 },  //  28
+  { 30, 30, 30, 30 },  //  29
+  { 30, 30, 30, 30 },  //  30
+  { 30, 30, 30, 30 },  //  31
+  { 26, 26, 26, 30 },  //  32
+  { 30, 30, 30, 10 },  //  33
+  { 30, 30, 30, 20 },  //  34
+  { 30, 30, 15, 30 },  //  35
+  { 30, 30, 18, 18 },  //  36
+  { 30, 30, 21, 30 },  //  37
+  { 30, 30, 10, 30 },  //  38
+  { 30, 30, 30, 28 },  //  39
+  { 30, 30, 30, 23 },  //  40
+  { 30, 30, 30, 24 },  //  41
+  { 30, 30, 22, 22 },  //  42
+  { 30, 30, 20, 30 },  //  43
+  { 30, 30, 13, 13 },  //  44
+  { 30, 30, 16, 16 },  //  45
+  { 30, 30, 17, 17 },  //  46
+  { 30, 30, 19, 19 },  //  47
+  { 30, 30,  0, 30 },  //  48
+  { 30, 30,  1, 30 },  //  49
+  { 30, 30,  2, 30 },  //  50
+  { 30, 30,  3, 30 },  //  51
+  { 30, 30,  4, 30 },  //  52
+  { 30, 30,  5, 30 },  //  53
+  { 30, 30,  6, 30 },  //  54
+  { 30, 30,  7, 30 },  //  55
+  { 30, 30,  8, 30 },  //  56
+  { 30, 30,  9, 30 },  //  57
+  { 30, 30, 14, 14 },  //  58
+  { 30, 30, 30,  0 },  //  59
+  { 30, 30, 30,  1 },  //  60
+  { 30, 30, 23, 30 },  //  61
+  { 30, 30, 30,  2 },  //  62
+  { 30, 30, 30, 25 },  //  63
+  { 30, 30, 30,  3 },  //  64
+  {  0, 30, 30, 30 },  //  65
+  {  1, 30, 30, 30 },  //  66
+  {  2, 30, 30, 30 },  //  67
+  {  3, 30, 30, 30 },  //  68
+  {  4, 30, 30, 30 },  //  69
+  {  5, 30, 30, 30 },  //  70
+  {  6, 30, 30, 30 },  //  71
+  {  7, 30, 30, 30 },  //  72
+  {  8, 30, 30, 30 },  //  73
+  {  9, 30, 30, 30 },  //  74
+  { 10, 30, 30, 30 },  //  75
+  { 11, 30, 30, 30 },  //  76
+  { 12, 30, 30, 30 },  //  77
+  { 13, 30, 30, 30 },  //  78
+  { 14, 30, 30, 30 },  //  79
+  { 15, 30, 30, 30 },  //  80
+  { 16, 30, 30, 30 },  //  81
+  { 17, 30, 30, 30 },  //  82
+  { 18, 30, 30, 30 },  //  83
+  { 19, 30, 30, 30 },  //  84
+  { 20, 30, 30, 30 },  //  85
+  { 21, 30, 30, 30 },  //  86
+  { 22, 30, 30, 30 },  //  87
+  { 23, 30, 30, 30 },  //  88
+  { 24, 30, 30, 30 },  //  89
+  { 25, 30, 30, 30 },  //  90
+  { 30, 30, 30,  4 },  //  91
+  { 30, 30, 30,  5 },  //  92
+  { 30, 30, 30,  6 },  //  93
+  { 30, 30, 24, 30 },  //  94
+  { 30, 30, 30,  7 },  //  95
+  { 30, 30, 30,  8 },  //  96
+  { 30,  0, 30, 30 },  //  97
+  { 30,  1, 30, 30 },  //  98
+  { 30,  2, 30, 30 },  //  30
+  { 30,  3, 30, 30 },  // 100
+  { 30,  4, 30, 30 },  // 101
+  { 30,  5, 30, 30 },  // 102
+  { 30,  6, 30, 30 },  // 103
+  { 30,  7, 30, 30 },  // 104
+  { 30,  8, 30, 30 },  // 105
+  { 30,  9, 30, 30 },  // 106
+  { 30, 10, 30, 30 },  // 107
+  { 30, 11, 30, 30 },  // 108
+  { 30, 12, 30, 30 },  // 109
+  { 30, 13, 30, 30 },  // 110
+  { 30, 14, 30, 30 },  // 111
+  { 30, 15, 30, 30 },  // 112
+  { 30, 16, 30, 30 },  // 113
+  { 30, 17, 30, 30 },  // 114
+  { 30, 18, 30, 30 },  // 115
+  { 30, 19, 30, 30 },  // 116
+  { 30, 20, 30, 30 },  // 117
+  { 30, 21, 30, 30 },  // 118
+  { 30, 22, 30, 30 },  // 119
+  { 30, 23, 30, 30 },  // 120
+  { 30, 24, 30, 30 },  // 121
+  { 30, 25, 30, 30 },  // 122
+  { 30, 30, 30, 26 },  // 123
+  { 30, 30, 30, 21 },  // 124
+  { 30, 30, 30, 27 },  // 125
+  { 30, 30, 30,  9 },  // 126
+  { 30, 30, 30, 30 }   // 127
+};
+
+static int errorCorrectionCoeffLevel0[2] = {
+  27, 917
+};
+
+static int errorCorrectionCoeffLevel1[4] = {
+  522, 568, 723, 809
+};
+
+static int errorCorrectionCoeffLevel2[8] = {
+  237, 308, 436, 284, 646, 653, 428, 379
+};
+
+static int errorCorrectionCoeffLevel3[16] = {
+  274, 562, 232, 755, 599, 524, 801, 132,
+  295, 116, 442, 428, 295,  42, 176,  65
+};
+
+static int errorCorrectionCoeffLevel4[32] = {
+  361, 575, 922, 525, 176, 586, 640, 321,
+  536, 742, 677, 742, 687, 284, 193, 517,
+  273, 494, 263, 147, 593, 800, 571, 320,
+  803, 133, 231, 390, 685, 330,  63, 410
+};
+
+static int errorCorrectionCoeffLevel5[64] = {
+  539, 422,   6,  93, 862, 771, 453, 106,
+  610, 287, 107, 505, 733, 877, 381, 612,
+  723, 476, 462, 172, 430, 609, 858, 822,
+  543, 376, 511, 400, 672, 762, 283, 184,
+  440,  35, 519,  31, 460, 594, 225, 535,
+  517, 352, 605, 158, 651, 201, 488, 502,
+  648, 733, 717,  83, 404,  97, 280, 771,
+  840, 629,   4, 381, 843, 623, 264, 543
+};
+
+static int errorCorrectionCoeffLevel6[128] = {
+  521, 310, 864, 547, 858, 580, 296, 379,
+   53, 779, 897, 444, 400, 925, 749, 415,
+  822,  93, 217, 208, 928, 244, 583, 620,
+  246, 148, 447, 631, 292, 908, 490, 704,
+  516, 258, 457, 907, 594, 723, 674, 292,
+  272,  96, 684, 432, 686, 606, 860, 569,
+  193, 219, 129, 186, 236, 287, 192, 775,
+  278, 173,  40, 379, 712, 463, 646, 776,
+  171, 491, 297, 763, 156, 732,  95, 270,
+  447,  90, 507,  48, 228, 821, 808, 898,
+  784, 663, 627, 378, 382, 262, 380, 602,
+  754, 336,  89, 614,  87, 432, 670, 616,
+  157, 374, 242, 726, 600, 269, 375, 898,
+  845, 454, 354, 130, 814, 587, 804,  34,
+  211, 330, 539, 297, 827, 865,  37, 517,
+  834, 315, 550,  86, 801,   4, 108, 539
+};
+
+static int errorCorrectionCoeffLevel7[256] = {
+  524, 894,  75, 766, 882, 857,  74, 204,
+   82, 586, 708, 250, 905, 786, 138, 720,
+  858, 194, 311, 913, 275, 190, 375, 850,
+  438, 733, 194, 280, 201, 280, 828, 757,
+  710, 814, 919,  89,  68, 569,  11, 204,
+  796, 605, 540, 913, 801, 700, 799, 137,
+  439, 418, 592, 668, 353, 859, 370, 694,
+  325, 240, 216, 257, 284, 549, 209, 884,
+  315,  70, 329, 793, 490, 274, 877, 162,
+  749, 812, 684, 461, 334, 376, 849, 521,
+  307, 291, 803, 712,  19, 358, 399, 908,
+  103, 511,  51,   8, 517, 225, 289, 470,
+  637, 731,  66, 255, 917, 269, 463, 830,
+  730, 433, 848, 585, 136, 538, 906,  90,
+    2, 290, 743, 199, 655, 903, 329,  49,
+  802, 580, 355, 588, 188, 462,  10, 134,
+  628, 320, 479, 130, 739,  71, 263, 318,
+  374, 601, 192, 605, 142, 673, 687, 234,
+  722, 384, 177, 752, 607, 640, 455, 193,
+  689, 707, 805, 641,  48,  60, 732, 621,
+  895, 544, 261, 852, 655, 309, 697, 755,
+  756,  60, 231, 773, 434, 421, 726, 528,
+  503, 118,  49, 795,  32, 144, 500, 238,
+  836, 394, 280, 566, 319,   9, 647, 550,
+   73, 914, 342, 126,  32, 681, 331, 792,
+  620,  60, 609, 441, 180, 791, 893, 754,
+  605, 383, 228, 749, 760, 213,  54, 297,
+  134,  54, 834, 299, 922, 191, 910, 532,
+  609, 829, 189,  20, 167,  29, 872, 449,
+   83, 402,  41, 656, 505, 579, 481, 173,
+  404, 251, 688,  95, 497, 555, 642, 543,
+  307, 159, 924, 558, 648,  55, 497,  10
+};
+
+static int errorCorrectionCoeffLevel8[512] = {
+  352,  77, 373, 504,  35, 599, 428, 207,
+  409, 574, 118, 498, 285, 380, 350, 492,
+  197, 265, 920, 155, 914, 299, 229, 643,
+  294, 871, 306,  88,  87, 193, 352, 781,
+  846,  75, 327, 520, 435, 543, 203, 666,
+  249, 346, 781, 621, 640, 268, 794, 534,
+  539, 781, 408, 390, 644, 102, 476, 499,
+  290, 632, 545,  37, 858, 916, 552,  41,
+  542, 289, 122, 272, 383, 800, 485,  98,
+  752, 472, 761, 107, 784, 860, 658, 741,
+  290, 204, 681, 407, 855,  85,  99,  62,
+  482, 180,  20, 297, 451, 593, 913, 142,
+  808, 684, 287, 536, 561,  76, 653, 899,
+  729, 567, 744, 390, 513, 192, 516, 258,
+  240, 518, 794, 395, 768, 848,  51, 610,
+  384, 168, 190, 826, 328, 596, 786, 303,
+  570, 381, 415, 641, 156, 237, 151, 429,
+  531, 207, 676, 710,  89, 168, 304, 402,
+   40, 708, 575, 162, 864, 229,  65, 861,
+  841, 512, 164, 477, 221,  92, 358, 785,
+  288, 357, 850, 836, 827, 736, 707,  94,
+    8, 494, 114, 521,   2, 499, 851, 543,
+  152, 729, 771,  95, 248, 361, 578, 323,
+  856, 797, 289,  51, 684, 466, 533, 820,
+  669,  45, 902, 452, 167, 342, 244, 173,
+   35, 463, 651,  51, 699, 591, 452, 578,
+   37, 124, 298, 332, 552,  43, 427, 119,
+  662, 777, 475, 850, 764, 364, 578, 911,
+  283, 711, 472, 420, 245, 288, 594, 394,
+  511, 327, 589, 777, 699, 688,  43, 408,
+  842, 383, 721, 521, 560, 644, 714, 559,
+   62, 145, 873, 663, 713, 159, 672, 729,
+  624,  59, 193, 417, 158, 209, 563, 564,
+  343, 693, 109, 608, 563, 365, 181, 772,
+  677, 310, 248, 353, 708, 410, 579, 870,
+  617, 841, 632, 860, 289, 536,  35, 777,
+  618, 586, 424, 833,  77, 597, 346, 269,
+  757, 632, 695, 751, 331, 247, 184,  45,
+  787, 680,  18,  66, 407, 369,  54, 492,
+  228, 613, 830, 922, 437, 519, 644, 905,
+  789, 420, 305, 441, 207, 300, 892, 827,
+  141, 537, 381, 662, 513,  56, 252, 341,
+  242, 797, 838, 837, 720, 224, 307, 631,
+   61,  87, 560, 310, 756, 665, 397, 808,
+  851, 309, 473, 795, 378,  31, 647, 915,
+  459, 806, 590, 731, 425, 216, 548, 249,
+  321, 881, 699, 535, 673, 782, 210, 815,
+  905, 303, 843, 922, 281,  73, 469, 791,
+  660, 162, 498, 308, 155, 422, 907, 817,
+  187,  62,  16, 425, 535, 336, 286, 437,
+  375, 273, 610, 296, 183, 923, 116, 667,
+  751, 353,  62, 366, 691, 379, 687, 842,
+   37, 357, 720, 742, 330,   5,  39, 923,
+  311, 424, 242, 749, 321,  54, 669, 316,
+  342, 299, 534, 105, 667, 488, 640, 672,
+  576, 540, 316, 486, 721, 610,  46, 656,
+  447, 171, 616, 464, 190, 531, 297, 321,
+  762, 752, 533, 175, 134,  14, 381, 433,
+  717,  45, 111,  20, 596, 284, 736, 138,
+  646, 411, 877, 669, 141, 919,  45, 780,
+  407, 164, 332, 899, 165, 726, 600, 325,
+  498, 655, 357, 752, 768, 223, 849, 647,
+   63, 310, 863, 251, 366, 304, 282, 738,
+  675, 410, 389, 244,  31, 121, 303, 263
+};
+
+static int *errorCorrectionCoeff[maxErrorCorrectionLevel + 1] = {
+  errorCorrectionCoeffLevel0,
+  errorCorrectionCoeffLevel1,
+  errorCorrectionCoeffLevel2,
+  errorCorrectionCoeffLevel3,
+  errorCorrectionCoeffLevel4,
+  errorCorrectionCoeffLevel5,
+  errorCorrectionCoeffLevel6,
+  errorCorrectionCoeffLevel7,
+  errorCorrectionCoeffLevel8
+};
+
+#define startPatternLength 8
+static char startPattern[startPatternLength] = {8,1,1,1,1,1,1,3};
+
+#define stopPatternLength 9
+static char stopPattern[stopPatternLength] = {7,1,1,3,1,1,1,2,1};
+
+#define patternLength 8
+
+// patterns[codeword][cluster][element] = element (bar or space) width
+static char patterns[929][3][patternLength] = {
+  {{3,1,1,1,1,1,3,6}, {5,1,1,1,1,1,2,5}, {2,1,1,1,1,1,5,5}},
+  {{4,1,1,1,1,1,4,4}, {6,1,1,1,1,1,3,3}, {3,1,1,1,1,1,6,3}},
+  {{5,1,1,1,1,1,5,2}, {4,1,1,1,1,2,1,6}, {1,1,1,1,1,2,4,6}},
+  {{3,1,1,1,1,2,3,5}, {5,1,1,1,1,2,2,4}, {2,1,1,1,1,2,5,4}},
+  {{4,1,1,1,1,2,4,3}, {6,1,1,1,1,2,3,2}, {3,1,1,1,1,2,6,2}},
+  {{5,1,1,1,1,2,5,1}, {4,1,1,1,1,3,1,5}, {1,1,1,1,1,3,4,5}},
+  {{2,1,1,1,1,3,2,6}, {5,1,1,1,1,3,2,3}, {2,1,1,1,1,3,5,3}},
+  {{3,1,1,1,1,3,3,4}, {6,1,1,1,1,3,3,1}, {3,1,1,1,1,3,6,1}},
+  {{2,1,1,1,1,4,2,5}, {4,1,1,1,1,4,1,4}, {1,1,1,1,1,4,4,4}},
+  {{1,1,1,1,1,5,1,6}, {5,1,1,1,1,4,2,2}, {2,1,1,1,1,4,5,2}},
+  {{2,1,1,1,1,5,2,4}, {4,1,1,1,1,5,1,3}, {1,1,1,1,1,5,4,3}},
+  {{1,1,1,1,1,6,1,5}, {5,1,1,1,1,5,2,1}, {6,1,1,1,2,1,1,4}},
+  {{2,1,1,1,2,1,3,6}, {4,1,1,1,1,6,1,2}, {1,1,1,1,2,1,5,5}},
+  {{3,1,1,1,2,1,4,4}, {4,1,1,1,2,1,2,5}, {2,1,1,1,2,1,6,3}},
+  {{4,1,1,1,2,1,5,2}, {5,1,1,1,2,1,3,3}, {6,1,1,1,2,2,1,3}},
+  {{2,1,1,1,2,2,3,5}, {6,1,1,1,2,1,4,1}, {1,1,1,1,2,2,5,4}},
+  {{3,1,1,1,2,2,4,3}, {3,1,1,1,2,2,1,6}, {2,1,1,1,2,2,6,2}},
+  {{4,1,1,1,2,2,5,1}, {4,1,1,1,2,2,2,4}, {6,1,1,1,2,3,1,2}},
+  {{1,1,1,1,2,3,2,6}, {5,1,1,1,2,2,3,2}, {1,1,1,1,2,3,5,3}},
+  {{2,1,1,1,2,3,3,4}, {3,1,1,1,2,3,1,5}, {2,1,1,1,2,3,6,1}},
+  {{1,1,1,1,2,4,2,5}, {4,1,1,1,2,3,2,3}, {6,1,1,1,2,4,1,1}},
+  {{1,1,1,1,3,1,3,6}, {5,1,1,1,2,3,3,1}, {1,1,1,1,2,4,5,2}},
+  {{2,1,1,1,3,1,4,4}, {3,1,1,1,2,4,1,4}, {5,1,1,1,3,1,1,4}},
+  {{3,1,1,1,3,1,5,2}, {4,1,1,1,2,4,2,2}, {6,1,1,1,3,1,2,2}},
+  {{1,1,1,1,3,2,3,5}, {3,1,1,1,2,5,1,3}, {1,1,1,1,3,1,6,3}},
+  {{2,1,1,1,3,2,4,3}, {4,1,1,1,2,5,2,1}, {5,1,1,1,3,2,1,3}},
+  {{3,1,1,1,3,2,5,1}, {3,1,1,1,2,6,1,2}, {6,1,1,1,3,2,2,1}},
+  {{1,1,1,1,3,3,3,4}, {3,1,1,1,3,1,2,5}, {1,1,1,1,3,2,6,2}},
+  {{2,1,1,1,3,3,4,2}, {4,1,1,1,3,1,3,3}, {5,1,1,1,3,3,1,2}},
+  {{1,1,1,1,4,1,4,4}, {5,1,1,1,3,1,4,1}, {1,1,1,1,3,3,6,1}},
+  {{2,1,1,1,4,1,5,2}, {2,1,1,1,3,2,1,6}, {5,1,1,1,3,4,1,1}},
+  {{1,1,1,1,4,2,4,3}, {3,1,1,1,3,2,2,4}, {4,1,1,1,4,1,1,4}},
+  {{2,1,1,1,4,2,5,1}, {4,1,1,1,3,2,3,2}, {5,1,1,1,4,1,2,2}},
+  {{1,1,1,1,5,1,5,2}, {2,1,1,1,3,3,1,5}, {4,1,1,1,4,2,1,3}},
+  {{5,1,1,1,6,1,1,1}, {3,1,1,1,3,3,2,3}, {5,1,1,1,4,2,2,1}},
+  {{3,1,1,2,1,1,3,5}, {4,1,1,1,3,3,3,1}, {4,1,1,1,4,3,1,2}},
+  {{4,1,1,2,1,1,4,3}, {2,1,1,1,3,4,1,4}, {4,1,1,1,4,4,1,1}},
+  {{5,1,1,2,1,1,5,1}, {3,1,1,1,3,4,2,2}, {3,1,1,1,5,1,1,4}},
+  {{2,1,1,2,1,2,2,6}, {2,1,1,1,3,5,1,3}, {4,1,1,1,5,1,2,2}},
+  {{3,1,1,2,1,2,3,4}, {3,1,1,1,3,5,2,1}, {3,1,1,1,5,2,1,3}},
+  {{4,1,1,2,1,2,4,2}, {2,1,1,1,3,6,1,2}, {4,1,1,1,5,2,2,1}},
+  {{2,1,1,2,1,3,2,5}, {2,1,1,1,4,1,2,5}, {3,1,1,1,5,3,1,2}},
+  {{3,1,1,2,1,3,3,3}, {3,1,1,1,4,1,3,3}, {3,1,1,1,5,4,1,1}},
+  {{1,1,1,2,1,4,1,6}, {4,1,1,1,4,1,4,1}, {2,1,1,1,6,1,1,4}},
+  {{2,1,1,2,1,4,2,4}, {1,1,1,1,4,2,1,6}, {3,1,1,1,6,1,2,2}},
+  {{3,1,1,2,1,4,3,2}, {2,1,1,1,4,2,2,4}, {2,1,1,1,6,2,1,3}},
+  {{1,1,1,2,1,5,1,5}, {3,1,1,1,4,2,3,2}, {3,1,1,1,6,2,2,1}},
+  {{2,1,1,2,1,5,2,3}, {1,1,1,1,4,3,1,5}, {2,1,1,1,6,3,1,2}},
+  {{1,1,1,2,1,6,1,4}, {2,1,1,1,4,3,2,3}, {1,1,1,2,1,1,4,6}},
+  {{2,1,1,2,2,1,3,5}, {3,1,1,1,4,3,3,1}, {2,1,1,2,1,1,5,4}},
+  {{3,1,1,2,2,1,4,3}, {1,1,1,1,4,4,1,4}, {3,1,1,2,1,1,6,2}},
+  {{4,1,1,2,2,1,5,1}, {2,1,1,1,4,4,2,2}, {1,1,1,2,1,2,4,5}},
+  {{1,1,1,2,2,2,2,6}, {1,1,1,1,4,5,1,3}, {2,1,1,2,1,2,5,3}},
+  {{2,1,1,2,2,2,3,4}, {2,1,1,1,4,5,2,1}, {3,1,1,2,1,2,6,1}},
+  {{3,1,1,2,2,2,4,2}, {1,1,1,1,5,1,2,5}, {1,1,1,2,1,3,4,4}},
+  {{1,1,1,2,2,3,2,5}, {2,1,1,1,5,1,3,3}, {2,1,1,2,1,3,5,2}},
+  {{2,1,1,2,2,3,3,3}, {3,1,1,1,5,1,4,1}, {1,1,1,2,1,4,4,3}},
+  {{3,1,1,2,2,3,4,1}, {1,1,1,1,5,2,2,4}, {2,1,1,2,1,4,5,1}},
+  {{1,1,1,2,2,4,2,4}, {2,1,1,1,5,2,3,2}, {1,1,1,2,1,5,4,2}},
+  {{2,1,1,2,2,4,3,2}, {1,1,1,1,5,3,2,3}, {6,1,1,2,2,1,1,3}},
+  {{1,1,1,2,3,1,3,5}, {2,1,1,1,5,3,3,1}, {1,1,1,2,2,1,5,4}},
+  {{2,1,1,2,3,1,4,3}, {1,1,1,1,5,4,2,2}, {2,1,1,2,2,1,6,2}},
+  {{3,1,1,2,3,1,5,1}, {1,1,1,1,6,1,3,3}, {6,1,1,2,2,2,1,2}},
+  {{1,1,1,2,3,2,3,4}, {2,1,1,1,6,1,4,1}, {1,1,1,2,2,2,5,3}},
+  {{2,1,1,2,3,2,4,2}, {1,1,1,1,6,2,3,2}, {2,1,1,2,2,2,6,1}},
+  {{1,1,1,2,3,3,3,3}, {1,1,1,1,6,3,3,1}, {6,1,1,2,2,3,1,1}},
+  {{2,1,1,2,3,3,4,1}, {4,1,1,2,1,1,1,6}, {1,1,1,2,2,3,5,2}},
+  {{1,1,1,2,4,1,4,3}, {5,1,1,2,1,1,2,4}, {1,1,1,2,2,4,5,1}},
+  {{2,1,1,2,4,1,5,1}, {6,1,1,2,1,1,3,2}, {5,1,1,2,3,1,1,3}},
+  {{1,1,1,2,4,2,4,2}, {4,1,1,2,1,2,1,5}, {6,1,1,2,3,1,2,1}},
+  {{1,1,1,2,4,3,4,1}, {5,1,1,2,1,2,2,3}, {1,1,1,2,3,1,6,2}},
+  {{2,1,1,3,1,1,2,6}, {6,1,1,2,1,2,3,1}, {5,1,1,2,3,2,1,2}},
+  {{3,1,1,3,1,1,3,4}, {4,1,1,2,1,3,1,4}, {1,1,1,2,3,2,6,1}},
+  {{4,1,1,3,1,1,4,2}, {5,1,1,2,1,3,2,2}, {5,1,1,2,3,3,1,1}},
+  {{2,1,1,3,1,2,2,5}, {4,1,1,2,1,4,1,3}, {4,1,1,2,4,1,1,3}},
+  {{3,1,1,3,1,2,3,3}, {5,1,1,2,1,4,2,1}, {5,1,1,2,4,1,2,1}},
+  {{4,1,1,3,1,2,4,1}, {4,1,1,2,1,5,1,2}, {4,1,1,2,4,2,1,2}},
+  {{1,1,1,3,1,3,1,6}, {4,1,1,2,1,6,1,1}, {4,1,1,2,4,3,1,1}},
+  {{2,1,1,3,1,3,2,4}, {3,1,1,2,2,1,1,6}, {3,1,1,2,5,1,1,3}},
+  {{3,1,1,3,1,3,3,2}, {4,1,1,2,2,1,2,4}, {4,1,1,2,5,1,2,1}},
+  {{1,1,1,3,1,4,1,5}, {5,1,1,2,2,1,3,2}, {3,1,1,2,5,2,1,2}},
+  {{2,1,1,3,1,4,2,3}, {3,1,1,2,2,2,1,5}, {3,1,1,2,5,3,1,1}},
+  {{1,1,1,3,1,5,1,4}, {4,1,1,2,2,2,2,3}, {2,1,1,2,6,1,1,3}},
+  {{1,1,1,3,1,6,1,3}, {5,1,1,2,2,2,3,1}, {3,1,1,2,6,1,2,1}},
+  {{1,1,1,3,2,1,2,6}, {3,1,1,2,2,3,1,4}, {2,1,1,2,6,2,1,2}},
+  {{2,1,1,3,2,1,3,4}, {4,1,1,2,2,3,2,2}, {2,1,1,2,6,3,1,1}},
+  {{3,1,1,3,2,1,4,2}, {3,1,1,2,2,4,1,3}, {1,1,1,3,1,1,4,5}},
+  {{1,1,1,3,2,2,2,5}, {4,1,1,2,2,4,2,1}, {2,1,1,3,1,1,5,3}},
+  {{2,1,1,3,2,2,3,3}, {3,1,1,2,2,5,1,2}, {3,1,1,3,1,1,6,1}},
+  {{3,1,1,3,2,2,4,1}, {3,1,1,2,2,6,1,1}, {1,1,1,3,1,2,4,4}},
+  {{1,1,1,3,2,3,2,4}, {2,1,1,2,3,1,1,6}, {2,1,1,3,1,2,5,2}},
+  {{2,1,1,3,2,3,3,2}, {3,1,1,2,3,1,2,4}, {1,1,1,3,1,3,4,3}},
+  {{1,1,1,3,2,4,2,3}, {4,1,1,2,3,1,3,2}, {2,1,1,3,1,3,5,1}},
+  {{1,1,1,3,2,5,2,2}, {2,1,1,2,3,2,1,5}, {1,1,1,3,1,4,4,2}},
+  {{1,1,1,3,3,1,3,4}, {3,1,1,2,3,2,2,3}, {1,1,1,3,1,5,4,1}},
+  {{2,1,1,3,3,1,4,2}, {4,1,1,2,3,2,3,1}, {6,1,1,3,2,1,1,2}},
+  {{1,1,1,3,3,2,3,3}, {2,1,1,2,3,3,1,4}, {1,1,1,3,2,1,5,3}},
+  {{2,1,1,3,3,2,4,1}, {3,1,1,2,3,3,2,2}, {2,1,1,3,2,1,6,1}},
+  {{1,1,1,3,3,3,3,2}, {2,1,1,2,3,4,1,3}, {6,1,1,3,2,2,1,1}},
+  {{1,1,1,3,4,1,4,2}, {3,1,1,2,3,4,2,1}, {1,1,1,3,2,2,5,2}},
+  {{2,1,1,4,1,1,2,5}, {2,1,1,2,3,5,1,2}, {1,1,1,3,2,3,5,1}},
+  {{3,1,1,4,1,1,3,3}, {2,1,1,2,3,6,1,1}, {5,1,1,3,3,1,1,2}},
+  {{4,1,1,4,1,1,4,1}, {1,1,1,2,4,1,1,6}, {1,1,1,3,3,1,6,1}},
+  {{1,1,1,4,1,2,1,6}, {2,1,1,2,4,1,2,4}, {5,1,1,3,3,2,1,1}},
+  {{2,1,1,4,1,2,2,4}, {3,1,1,2,4,1,3,2}, {4,1,1,3,4,1,1,2}},
+  {{3,1,1,4,1,2,3,2}, {1,1,1,2,4,2,1,5}, {4,1,1,3,4,2,1,1}},
+  {{1,1,1,4,1,3,1,5}, {2,1,1,2,4,2,2,3}, {3,1,1,3,5,1,1,2}},
+  {{2,1,1,4,1,3,2,3}, {3,1,1,2,4,2,3,1}, {3,1,1,3,5,2,1,1}},
+  {{3,1,1,4,1,3,3,1}, {1,1,1,2,4,3,1,4}, {2,1,1,3,6,1,1,2}},
+  {{1,1,1,4,1,4,1,4}, {2,1,1,2,4,3,2,2}, {2,1,1,3,6,2,1,1}},
+  {{2,1,1,4,1,4,2,2}, {1,1,1,2,4,4,1,3}, {1,1,1,4,1,1,4,4}},
+  {{1,1,1,4,1,5,1,3}, {2,1,1,2,4,4,2,1}, {2,1,1,4,1,1,5,2}},
+  {{2,1,1,4,1,5,2,1}, {1,1,1,2,4,5,1,2}, {1,1,1,4,1,2,4,3}},
+  {{1,1,1,4,2,1,2,5}, {1,1,1,2,5,1,2,4}, {2,1,1,4,1,2,5,1}},
+  {{2,1,1,4,2,1,3,3}, {2,1,1,2,5,1,3,2}, {1,1,1,4,1,3,4,2}},
+  {{3,1,1,4,2,1,4,1}, {1,1,1,2,5,2,2,3}, {1,1,1,4,1,4,4,1}},
+  {{1,1,1,4,2,2,2,4}, {2,1,1,2,5,2,3,1}, {6,1,1,4,2,1,1,1}},
+  {{2,1,1,4,2,2,3,2}, {1,1,1,2,5,3,2,2}, {1,1,1,4,2,1,5,2}},
+  {{1,1,1,4,2,3,2,3}, {1,1,1,2,5,4,2,1}, {1,1,1,4,2,2,5,1}},
+  {{2,1,1,4,2,3,3,1}, {1,1,1,2,6,1,3,2}, {5,1,1,4,3,1,1,1}},
+  {{1,1,1,4,2,4,2,2}, {1,1,1,2,6,2,3,1}, {4,1,1,4,4,1,1,1}},
+  {{1,1,1,4,2,5,2,1}, {4,1,1,3,1,1,1,5}, {3,1,1,4,5,1,1,1}},
+  {{2,1,1,4,3,1,4,1}, {5,1,1,3,1,1,2,3}, {1,1,1,5,1,1,4,3}},
+  {{1,1,1,4,3,3,3,1}, {6,1,1,3,1,1,3,1}, {2,1,1,5,1,1,5,1}},
+  {{1,1,1,5,1,1,1,6}, {4,1,1,3,1,2,1,4}, {1,1,1,5,1,2,4,2}},
+  {{2,1,1,5,1,1,2,4}, {5,1,1,3,1,2,2,2}, {1,1,1,5,1,3,4,1}},
+  {{3,1,1,5,1,1,3,2}, {4,1,1,3,1,3,1,3}, {1,1,1,5,2,1,5,1}},
+  {{1,1,1,5,1,2,1,5}, {5,1,1,3,1,3,2,1}, {1,1,1,6,1,1,4,2}},
+  {{2,1,1,5,1,2,2,3}, {4,1,1,3,1,4,1,2}, {1,1,1,6,1,2,4,1}},
+  {{3,1,1,5,1,2,3,1}, {4,1,1,3,1,5,1,1}, {1,2,1,1,1,1,4,6}},
+  {{1,1,1,5,1,3,1,4}, {3,1,1,3,2,1,1,5}, {2,2,1,1,1,1,5,4}},
+  {{2,1,1,5,1,3,2,2}, {4,1,1,3,2,1,2,3}, {3,2,1,1,1,1,6,2}},
+  {{1,1,1,5,1,4,1,3}, {5,1,1,3,2,1,3,1}, {1,2,1,1,1,2,4,5}},
+  {{2,1,1,5,1,4,2,1}, {3,1,1,3,2,2,1,4}, {2,2,1,1,1,2,5,3}},
+  {{1,1,1,5,1,5,1,2}, {4,1,1,3,2,2,2,2}, {3,2,1,1,1,2,6,1}},
+  {{1,1,1,5,2,1,2,4}, {3,1,1,3,2,3,1,3}, {1,2,1,1,1,3,4,4}},
+  {{1,1,1,5,2,2,2,3}, {4,1,1,3,2,3,2,1}, {2,2,1,1,1,3,5,2}},
+  {{1,1,1,5,2,3,2,2}, {3,1,1,3,2,4,1,2}, {1,2,1,1,1,4,4,3}},
+  {{1,1,1,6,1,1,1,5}, {3,1,1,3,2,5,1,1}, {2,2,1,1,1,4,5,1}},
+  {{3,1,1,6,1,1,3,1}, {2,1,1,3,3,1,1,5}, {1,2,1,1,1,5,4,2}},
+  {{2,1,1,6,1,2,2,2}, {3,1,1,3,3,1,2,3}, {6,2,1,1,2,1,1,3}},
+  {{2,1,1,6,1,3,2,1}, {4,1,1,3,3,1,3,1}, {1,2,1,1,2,1,5,4}},
+  {{1,1,1,6,1,5,1,1}, {2,1,1,3,3,2,1,4}, {2,2,1,1,2,1,6,2}},
+  {{3,2,1,1,1,1,3,5}, {3,1,1,3,3,2,2,2}, {6,2,1,1,2,2,1,2}},
+  {{4,2,1,1,1,1,4,3}, {2,1,1,3,3,3,1,3}, {1,2,1,1,2,2,5,3}},
+  {{5,2,1,1,1,1,5,1}, {3,1,1,3,3,3,2,1}, {2,2,1,1,2,2,6,1}},
+  {{2,2,1,1,1,2,2,6}, {2,1,1,3,3,4,1,2}, {6,2,1,1,2,3,1,1}},
+  {{3,2,1,1,1,2,3,4}, {2,1,1,3,3,5,1,1}, {1,2,1,1,2,3,5,2}},
+  {{4,2,1,1,1,2,4,2}, {1,1,1,3,4,1,1,5}, {1,2,1,1,2,4,5,1}},
+  {{2,2,1,1,1,3,2,5}, {2,1,1,3,4,1,2,3}, {5,2,1,1,3,1,1,3}},
+  {{3,2,1,1,1,3,3,3}, {3,1,1,3,4,1,3,1}, {6,2,1,1,3,1,2,1}},
+  {{4,2,1,1,1,3,4,1}, {1,1,1,3,4,2,1,4}, {1,2,1,1,3,1,6,2}},
+  {{1,2,1,1,1,4,1,6}, {2,1,1,3,4,2,2,2}, {5,2,1,1,3,2,1,2}},
+  {{2,2,1,1,1,4,2,4}, {1,1,1,3,4,3,1,3}, {1,2,1,1,3,2,6,1}},
+  {{1,2,1,1,1,5,1,5}, {2,1,1,3,4,3,2,1}, {5,2,1,1,3,3,1,1}},
+  {{2,2,1,1,2,1,3,5}, {1,1,1,3,4,4,1,2}, {4,2,1,1,4,1,1,3}},
+  {{3,2,1,1,2,1,4,3}, {1,1,1,3,4,5,1,1}, {5,2,1,1,4,1,2,1}},
+  {{4,2,1,1,2,1,5,1}, {1,1,1,3,5,1,2,3}, {4,2,1,1,4,2,1,2}},
+  {{1,2,1,1,2,2,2,6}, {2,1,1,3,5,1,3,1}, {4,2,1,1,4,3,1,1}},
+  {{2,2,1,1,2,2,3,4}, {1,1,1,3,5,2,2,2}, {3,2,1,1,5,1,1,3}},
+  {{3,2,1,1,2,2,4,2}, {1,1,1,3,5,3,2,1}, {4,2,1,1,5,1,2,1}},
+  {{1,2,1,1,2,3,2,5}, {1,1,1,3,6,1,3,1}, {3,2,1,1,5,2,1,2}},
+  {{2,2,1,1,2,3,3,3}, {4,1,1,4,1,1,1,4}, {3,2,1,1,5,3,1,1}},
+  {{1,2,1,1,2,4,2,4}, {5,1,1,4,1,1,2,2}, {2,2,1,1,6,1,1,3}},
+  {{1,2,1,1,2,5,2,3}, {4,1,1,4,1,2,1,3}, {3,2,1,1,6,1,2,1}},
+  {{1,2,1,1,3,1,3,5}, {5,1,1,4,1,2,2,1}, {2,2,1,1,6,2,1,2}},
+  {{2,2,1,1,3,1,4,3}, {4,1,1,4,1,3,1,2}, {2,2,1,1,6,3,1,1}},
+  {{3,2,1,1,3,1,5,1}, {4,1,1,4,1,4,1,1}, {2,1,2,1,1,1,4,5}},
+  {{1,2,1,1,3,2,3,4}, {3,1,1,4,2,1,1,4}, {3,1,2,1,1,1,5,3}},
+  {{2,2,1,1,3,2,4,2}, {4,1,1,4,2,1,2,2}, {4,1,2,1,1,1,6,1}},
+  {{1,2,1,1,3,3,3,3}, {3,1,1,4,2,2,1,3}, {1,1,2,1,1,2,3,6}},
+  {{1,2,1,1,3,4,3,2}, {4,1,1,4,2,2,2,1}, {2,1,2,1,1,2,4,4}},
+  {{1,2,1,1,4,1,4,3}, {3,1,1,4,2,3,1,2}, {3,1,2,1,1,2,5,2}},
+  {{2,2,1,1,4,1,5,1}, {3,1,1,4,2,4,1,1}, {1,1,2,1,1,3,3,5}},
+  {{1,2,1,1,4,2,4,2}, {2,1,1,4,3,1,1,4}, {2,1,2,1,1,3,4,3}},
+  {{1,2,1,1,5,1,5,1}, {3,1,1,4,3,1,2,2}, {3,1,2,1,1,3,5,1}},
+  {{3,1,2,1,1,1,2,6}, {2,1,1,4,3,2,1,3}, {1,1,2,1,1,4,3,4}},
+  {{4,1,2,1,1,1,3,4}, {3,1,1,4,3,2,2,1}, {2,1,2,1,1,4,4,2}},
+  {{5,1,2,1,1,1,4,2}, {2,1,1,4,3,3,1,2}, {1,1,2,1,1,5,3,3}},
+  {{3,1,2,1,1,2,2,5}, {2,1,1,4,3,4,1,1}, {2,1,2,1,1,5,4,1}},
+  {{4,1,2,1,1,2,3,3}, {1,1,1,4,4,1,1,4}, {1,1,2,1,1,6,3,2}},
+  {{5,1,2,1,1,2,4,1}, {2,1,1,4,4,1,2,2}, {1,2,1,2,1,1,4,5}},
+  {{2,1,2,1,1,3,1,6}, {1,1,1,4,4,2,1,3}, {2,2,1,2,1,1,5,3}},
+  {{3,1,2,1,1,3,2,4}, {2,1,1,4,4,2,2,1}, {3,2,1,2,1,1,6,1}},
+  {{4,1,2,1,1,3,3,2}, {1,1,1,4,4,3,1,2}, {1,1,2,1,2,1,4,5}},
+  {{2,1,2,1,1,4,1,5}, {1,1,1,4,4,4,1,1}, {1,2,1,2,1,2,4,4}},
+  {{3,1,2,1,1,4,2,3}, {1,1,1,4,5,1,2,2}, {2,2,1,2,1,2,5,2}},
+  {{4,1,2,1,1,4,3,1}, {1,1,1,4,5,2,2,1}, {1,1,2,1,2,2,4,4}},
+  {{2,1,2,1,1,5,1,4}, {4,1,1,5,1,1,1,3}, {2,1,2,1,2,2,5,2}},
+  {{3,1,2,1,1,5,2,2}, {5,1,1,5,1,1,2,1}, {2,2,1,2,1,3,5,1}},
+  {{2,2,1,2,1,1,2,6}, {4,1,1,5,1,2,1,2}, {1,1,2,1,2,3,4,3}},
+  {{3,2,1,2,1,1,3,4}, {4,1,1,5,1,3,1,1}, {1,2,1,2,1,4,4,2}},
+  {{4,2,1,2,1,1,4,2}, {3,1,1,5,2,1,1,3}, {1,1,2,1,2,4,4,2}},
+  {{2,1,2,1,2,1,2,6}, {4,1,1,5,2,1,2,1}, {1,2,1,2,1,5,4,1}},
+  {{2,2,1,2,1,2,2,5}, {3,1,1,5,2,2,1,2}, {1,1,2,1,2,5,4,1}},
+  {{3,2,1,2,1,2,3,3}, {3,1,1,5,2,3,1,1}, {6,2,1,2,2,1,1,2}},
+  {{4,2,1,2,1,2,4,1}, {2,1,1,5,3,1,1,3}, {1,2,1,2,2,1,5,3}},
+  {{2,1,2,1,2,2,2,5}, {3,1,1,5,3,1,2,1}, {2,2,1,2,2,1,6,1}},
+  {{3,1,2,1,2,2,3,3}, {2,1,1,5,3,2,1,2}, {6,1,2,1,3,1,1,2}},
+  {{4,1,2,1,2,2,4,1}, {2,1,1,5,3,3,1,1}, {6,2,1,2,2,2,1,1}},
+  {{1,1,2,1,2,3,1,6}, {1,1,1,5,4,1,1,3}, {1,1,2,1,3,1,5,3}},
+  {{1,2,1,2,1,4,1,5}, {2,1,1,5,4,1,2,1}, {1,2,1,2,2,2,5,2}},
+  {{2,2,1,2,1,4,2,3}, {1,1,1,5,4,2,1,2}, {6,1,2,1,3,2,1,1}},
+  {{3,2,1,2,1,4,3,1}, {1,1,1,5,4,3,1,1}, {1,1,2,1,3,2,5,2}},
+  {{1,1,2,1,2,4,1,5}, {4,1,1,6,1,1,1,2}, {1,2,1,2,2,3,5,1}},
+  {{2,1,2,1,2,4,2,3}, {4,1,1,6,1,2,1,1}, {1,1,2,1,3,3,5,1}},
+  {{1,1,2,1,2,5,1,4}, {3,1,1,6,2,1,1,2}, {5,2,1,2,3,1,1,2}},
+  {{1,2,1,2,2,1,2,6}, {3,1,1,6,2,2,1,1}, {1,2,1,2,3,1,6,1}},
+  {{2,2,1,2,2,1,3,4}, {2,1,1,6,3,1,1,2}, {5,1,2,1,4,1,1,2}},
+  {{3,2,1,2,2,1,4,2}, {2,1,1,6,3,2,1,1}, {5,2,1,2,3,2,1,1}},
+  {{1,1,2,1,3,1,2,6}, {4,2,1,1,1,1,1,6}, {1,1,2,1,4,1,6,1}},
+  {{1,2,1,2,2,2,2,5}, {5,2,1,1,1,1,2,4}, {5,1,2,1,4,2,1,1}},
+  {{2,2,1,2,2,2,3,3}, {6,2,1,1,1,1,3,2}, {4,2,1,2,4,1,1,2}},
+  {{3,2,1,2,2,2,4,1}, {4,2,1,1,1,2,1,5}, {4,1,2,1,5,1,1,2}},
+  {{1,1,2,1,3,2,2,5}, {5,2,1,1,1,2,2,3}, {4,2,1,2,4,2,1,1}},
+  {{2,1,2,1,3,2,3,3}, {6,2,1,1,1,2,3,1}, {4,1,2,1,5,2,1,1}},
+  {{3,1,2,1,3,2,4,1}, {4,2,1,1,1,3,1,4}, {3,2,1,2,5,1,1,2}},
+  {{1,1,2,1,3,3,2,4}, {5,2,1,1,1,3,2,2}, {3,1,2,1,6,1,1,2}},
+  {{1,2,1,2,2,4,2,3}, {4,2,1,1,1,4,1,3}, {3,2,1,2,5,2,1,1}},
+  {{1,1,2,1,3,4,2,3}, {5,2,1,1,1,4,2,1}, {3,1,2,1,6,2,1,1}},
+  {{1,2,1,2,3,1,3,4}, {4,2,1,1,1,5,1,2}, {2,2,1,2,6,1,1,2}},
+  {{2,2,1,2,3,1,4,2}, {4,2,1,1,1,6,1,1}, {2,2,1,2,6,2,1,1}},
+  {{1,1,2,1,4,1,3,4}, {3,2,1,1,2,1,1,6}, {1,1,2,2,1,1,3,6}},
+  {{1,2,1,2,3,2,3,3}, {4,2,1,1,2,1,2,4}, {2,1,2,2,1,1,4,4}},
+  {{2,2,1,2,3,2,4,1}, {5,2,1,1,2,1,3,2}, {3,1,2,2,1,1,5,2}},
+  {{1,1,2,1,4,2,3,3}, {3,2,1,1,2,2,1,5}, {1,1,2,2,1,2,3,5}},
+  {{2,1,2,1,4,2,4,1}, {4,2,1,1,2,2,2,3}, {2,1,2,2,1,2,4,3}},
+  {{1,1,2,1,4,3,3,2}, {5,2,1,1,2,2,3,1}, {3,1,2,2,1,2,5,1}},
+  {{1,2,1,2,4,1,4,2}, {3,2,1,1,2,3,1,4}, {1,1,2,2,1,3,3,4}},
+  {{1,1,2,1,5,1,4,2}, {4,2,1,1,2,3,2,2}, {2,1,2,2,1,3,4,2}},
+  {{1,2,1,2,4,2,4,1}, {3,2,1,1,2,4,1,3}, {1,1,2,2,1,4,3,3}},
+  {{1,1,2,1,5,2,4,1}, {4,2,1,1,2,4,2,1}, {2,1,2,2,1,4,4,1}},
+  {{3,1,2,2,1,1,2,5}, {3,2,1,1,2,5,1,2}, {1,1,2,2,1,5,3,2}},
+  {{4,1,2,2,1,1,3,3}, {3,2,1,1,2,6,1,1}, {1,1,2,2,1,6,3,1}},
+  {{5,1,2,2,1,1,4,1}, {2,2,1,1,3,1,1,6}, {1,2,1,3,1,1,4,4}},
+  {{2,1,2,2,1,2,1,6}, {3,2,1,1,3,1,2,4}, {2,2,1,3,1,1,5,2}},
+  {{3,1,2,2,1,2,2,4}, {4,2,1,1,3,1,3,2}, {1,1,2,2,2,1,4,4}},
+  {{4,1,2,2,1,2,3,2}, {2,2,1,1,3,2,1,5}, {1,2,1,3,1,2,4,3}},
+  {{2,1,2,2,1,3,1,5}, {3,2,1,1,3,2,2,3}, {2,2,1,3,1,2,5,1}},
+  {{3,1,2,2,1,3,2,3}, {4,2,1,1,3,2,3,1}, {1,1,2,2,2,2,4,3}},
+  {{4,1,2,2,1,3,3,1}, {2,2,1,1,3,3,1,4}, {2,1,2,2,2,2,5,1}},
+  {{2,1,2,2,1,4,1,4}, {3,2,1,1,3,3,2,2}, {1,1,2,2,2,3,4,2}},
+  {{3,1,2,2,1,4,2,2}, {2,2,1,1,3,4,1,3}, {1,2,1,3,1,4,4,1}},
+  {{2,1,2,2,1,5,1,3}, {3,2,1,1,3,4,2,1}, {1,1,2,2,2,4,4,1}},
+  {{2,1,2,2,1,6,1,2}, {2,2,1,1,3,5,1,2}, {6,2,1,3,2,1,1,1}},
+  {{2,2,1,3,1,1,2,5}, {2,2,1,1,3,6,1,1}, {1,2,1,3,2,1,5,2}},
+  {{3,2,1,3,1,1,3,3}, {1,2,1,1,4,1,1,6}, {6,1,2,2,3,1,1,1}},
+  {{4,2,1,3,1,1,4,1}, {2,2,1,1,4,1,2,4}, {1,1,2,2,3,1,5,2}},
+  {{2,1,2,2,2,1,2,5}, {3,2,1,1,4,1,3,2}, {1,2,1,3,2,2,5,1}},
+  {{2,2,1,3,1,2,2,4}, {1,2,1,1,4,2,1,5}, {1,1,2,2,3,2,5,1}},
+  {{3,2,1,3,1,2,3,2}, {2,2,1,1,4,2,2,3}, {5,2,1,3,3,1,1,1}},
+  {{1,1,2,2,2,2,1,6}, {3,2,1,1,4,2,3,1}, {5,1,2,2,4,1,1,1}},
+  {{1,2,1,3,1,3,1,5}, {1,2,1,1,4,3,1,4}, {4,2,1,3,4,1,1,1}},
+  {{3,1,2,2,2,2,3,2}, {2,2,1,1,4,3,2,2}, {4,1,2,2,5,1,1,1}},
+  {{3,2,1,3,1,3,3,1}, {1,2,1,1,4,4,1,3}, {3,2,1,3,5,1,1,1}},
+  {{1,1,2,2,2,3,1,5}, {2,2,1,1,4,4,2,1}, {3,1,2,2,6,1,1,1}},
+  {{1,2,1,3,1,4,1,4}, {1,2,1,1,4,5,1,2}, {2,2,1,3,6,1,1,1}},
+  {{2,2,1,3,1,4,2,2}, {1,2,1,1,5,1,2,4}, {1,1,2,3,1,1,3,5}},
+  {{1,1,2,2,2,4,1,4}, {2,2,1,1,5,1,3,2}, {2,1,2,3,1,1,4,3}},
+  {{2,1,2,2,2,4,2,2}, {1,2,1,1,5,2,2,3}, {3,1,2,3,1,1,5,1}},
+  {{2,2,1,3,1,5,2,1}, {2,2,1,1,5,2,3,1}, {1,1,2,3,1,2,3,4}},
+  {{1,2,1,3,1,6,1,2}, {1,2,1,1,5,3,2,2}, {2,1,2,3,1,2,4,2}},
+  {{1,2,1,3,2,1,2,5}, {1,2,1,1,5,4,2,1}, {1,1,2,3,1,3,3,3}},
+  {{2,2,1,3,2,1,3,3}, {1,2,1,1,6,1,3,2}, {2,1,2,3,1,3,4,1}},
+  {{3,2,1,3,2,1,4,1}, {1,2,1,1,6,2,3,1}, {1,1,2,3,1,4,3,2}},
+  {{1,1,2,2,3,1,2,5}, {5,1,2,1,1,1,1,5}, {1,1,2,3,1,5,3,1}},
+  {{1,2,1,3,2,2,2,4}, {6,1,2,1,1,1,2,3}, {1,2,1,4,1,1,4,3}},
+  {{2,2,1,3,2,2,3,2}, {1,1,2,1,1,1,6,4}, {2,2,1,4,1,1,5,1}},
+  {{1,1,2,2,3,2,2,4}, {5,1,2,1,1,2,1,4}, {1,1,2,3,2,1,4,3}},
+  {{2,1,2,2,3,2,3,2}, {6,1,2,1,1,2,2,2}, {1,2,1,4,1,2,4,2}},
+  {{2,2,1,3,2,3,3,1}, {1,1,2,1,1,2,6,3}, {1,1,2,3,2,2,4,2}},
+  {{1,1,2,2,3,3,2,3}, {5,1,2,1,1,3,1,3}, {1,2,1,4,1,3,4,1}},
+  {{1,2,1,3,2,4,2,2}, {6,1,2,1,1,3,2,1}, {1,1,2,3,2,3,4,1}},
+  {{1,2,1,3,2,5,2,1}, {1,1,2,1,1,3,6,2}, {1,2,1,4,2,1,5,1}},
+  {{1,2,1,3,3,1,3,3}, {5,1,2,1,1,4,1,2}, {1,1,2,3,3,1,5,1}},
+  {{2,2,1,3,3,1,4,1}, {5,1,2,1,1,5,1,1}, {1,1,2,4,1,1,3,4}},
+  {{1,1,2,2,4,1,3,3}, {4,2,1,2,1,1,1,5}, {2,1,2,4,1,1,4,2}},
+  {{1,2,1,3,3,2,3,2}, {5,2,1,2,1,1,2,3}, {1,1,2,4,1,2,3,3}},
+  {{1,1,2,2,4,2,3,2}, {6,2,1,2,1,1,3,1}, {2,1,2,4,1,2,4,1}},
+  {{1,2,1,3,3,3,3,1}, {4,1,2,1,2,1,1,5}, {1,1,2,4,1,3,3,2}},
+  {{1,1,2,2,4,3,3,1}, {4,2,1,2,1,2,1,4}, {1,1,2,4,1,4,3,1}},
+  {{1,1,2,2,5,1,4,1}, {6,1,2,1,2,1,3,1}, {1,2,1,5,1,1,4,2}},
+  {{2,1,2,3,1,1,1,6}, {4,1,2,1,2,2,1,4}, {1,1,2,4,2,1,4,2}},
+  {{3,1,2,3,1,1,2,4}, {5,1,2,1,2,2,2,2}, {1,2,1,5,1,2,4,1}},
+  {{4,1,2,3,1,1,3,2}, {5,2,1,2,1,3,2,1}, {1,1,2,4,2,2,4,1}},
+  {{2,1,2,3,1,2,1,5}, {4,1,2,1,2,3,1,3}, {1,1,2,5,1,1,3,3}},
+  {{3,1,2,3,1,2,2,3}, {4,2,1,2,1,4,1,2}, {2,1,2,5,1,1,4,1}},
+  {{4,1,2,3,1,2,3,1}, {4,1,2,1,2,4,1,2}, {1,1,2,5,1,2,3,2}},
+  {{2,1,2,3,1,3,1,4}, {4,2,1,2,1,5,1,1}, {1,1,2,5,1,3,3,1}},
+  {{3,1,2,3,1,3,2,2}, {4,1,2,1,2,5,1,1}, {1,2,1,6,1,1,4,1}},
+  {{2,1,2,3,1,4,1,3}, {3,2,1,2,2,1,1,5}, {1,1,2,5,2,1,4,1}},
+  {{3,1,2,3,1,4,2,1}, {4,2,1,2,2,1,2,3}, {1,1,2,6,1,1,3,2}},
+  {{2,1,2,3,1,5,1,2}, {5,2,1,2,2,1,3,1}, {1,1,2,6,1,2,3,1}},
+  {{2,1,2,3,1,6,1,1}, {3,1,2,1,3,1,1,5}, {1,3,1,1,1,1,4,5}},
+  {{1,2,1,4,1,1,1,6}, {3,2,1,2,2,2,1,4}, {2,3,1,1,1,1,5,3}},
+  {{2,2,1,4,1,1,2,4}, {4,2,1,2,2,2,2,2}, {3,3,1,1,1,1,6,1}},
+  {{3,2,1,4,1,1,3,2}, {3,1,2,1,3,2,1,4}, {1,3,1,1,1,2,4,4}},
+  {{1,1,2,3,2,1,1,6}, {4,1,2,1,3,2,2,2}, {2,3,1,1,1,2,5,2}},
+  {{1,2,1,4,1,2,1,5}, {4,2,1,2,2,3,2,1}, {1,3,1,1,1,3,4,3}},
+  {{2,2,1,4,1,2,2,3}, {3,1,2,1,3,3,1,3}, {2,3,1,1,1,3,5,1}},
+  {{3,2,1,4,1,2,3,1}, {3,2,1,2,2,4,1,2}, {1,3,1,1,1,4,4,2}},
+  {{1,1,2,3,2,2,1,5}, {3,1,2,1,3,4,1,2}, {1,3,1,1,1,5,4,1}},
+  {{2,1,2,3,2,2,2,3}, {3,2,1,2,2,5,1,1}, {6,3,1,1,2,1,1,2}},
+  {{3,1,2,3,2,2,3,1}, {3,1,2,1,3,5,1,1}, {1,3,1,1,2,1,5,3}},
+  {{1,1,2,3,2,3,1,4}, {2,2,1,2,3,1,1,5}, {2,3,1,1,2,1,6,1}},
+  {{1,2,1,4,1,4,1,3}, {3,2,1,2,3,1,2,3}, {6,3,1,1,2,2,1,1}},
+  {{2,2,1,4,1,4,2,1}, {4,2,1,2,3,1,3,1}, {1,3,1,1,2,2,5,2}},
+  {{1,1,2,3,2,4,1,3}, {2,1,2,1,4,1,1,5}, {1,3,1,1,2,3,5,1}},
+  {{2,1,2,3,2,4,2,1}, {2,2,1,2,3,2,1,4}, {5,3,1,1,3,1,1,2}},
+  {{1,1,2,3,2,5,1,2}, {3,2,1,2,3,2,2,2}, {1,3,1,1,3,1,6,1}},
+  {{1,2,1,4,2,1,2,4}, {2,1,2,1,4,2,1,4}, {5,3,1,1,3,2,1,1}},
+  {{2,2,1,4,2,1,3,2}, {3,1,2,1,4,2,2,2}, {4,3,1,1,4,1,1,2}},
+  {{1,1,2,3,3,1,2,4}, {3,2,1,2,3,3,2,1}, {4,3,1,1,4,2,1,1}},
+  {{1,2,1,4,2,2,2,3}, {2,1,2,1,4,3,1,3}, {3,3,1,1,5,1,1,2}},
+  {{2,2,1,4,2,2,3,1}, {2,2,1,2,3,4,1,2}, {3,3,1,1,5,2,1,1}},
+  {{1,1,2,3,3,2,2,3}, {2,1,2,1,4,4,1,2}, {2,3,1,1,6,1,1,2}},
+  {{2,1,2,3,3,2,3,1}, {2,2,1,2,3,5,1,1}, {2,3,1,1,6,2,1,1}},
+  {{1,1,2,3,3,3,2,2}, {2,1,2,1,4,5,1,1}, {1,2,2,1,1,1,3,6}},
+  {{1,2,1,4,2,4,2,1}, {1,2,1,2,4,1,1,5}, {2,2,2,1,1,1,4,4}},
+  {{1,1,2,3,3,4,2,1}, {2,2,1,2,4,1,2,3}, {3,2,2,1,1,1,5,2}},
+  {{1,1,2,3,4,1,3,2}, {3,2,1,2,4,1,3,1}, {1,2,2,1,1,2,3,5}},
+  {{1,1,2,3,4,2,3,1}, {1,1,2,1,5,1,1,5}, {2,2,2,1,1,2,4,3}},
+  {{2,1,2,4,1,1,1,5}, {1,2,1,2,4,2,1,4}, {3,2,2,1,1,2,5,1}},
+  {{3,1,2,4,1,1,2,3}, {2,2,1,2,4,2,2,2}, {1,2,2,1,1,3,3,4}},
+  {{4,1,2,4,1,1,3,1}, {1,1,2,1,5,2,1,4}, {2,2,2,1,1,3,4,2}},
+  {{2,1,2,4,1,2,1,4}, {2,1,2,1,5,2,2,2}, {1,2,2,1,1,4,3,3}},
+  {{3,1,2,4,1,2,2,2}, {2,2,1,2,4,3,2,1}, {2,2,2,1,1,4,4,1}},
+  {{2,1,2,4,1,3,1,3}, {1,1,2,1,5,3,1,3}, {1,2,2,1,1,5,3,2}},
+  {{3,1,2,4,1,3,2,1}, {1,2,1,2,4,4,1,2}, {1,2,2,1,1,6,3,1}},
+  {{2,1,2,4,1,4,1,2}, {1,1,2,1,5,4,1,2}, {1,3,1,2,1,1,4,4}},
+  {{2,1,2,4,1,5,1,1}, {1,2,1,2,4,5,1,1}, {2,3,1,2,1,1,5,2}},
+  {{1,2,1,5,1,1,1,5}, {1,2,1,2,5,1,2,3}, {1,2,2,1,2,1,4,4}},
+  {{2,2,1,5,1,1,2,3}, {2,2,1,2,5,1,3,1}, {1,3,1,2,1,2,4,3}},
+  {{3,2,1,5,1,1,3,1}, {1,1,2,1,6,1,2,3}, {2,3,1,2,1,2,5,1}},
+  {{1,1,2,4,2,1,1,5}, {1,2,1,2,5,2,2,2}, {1,2,2,1,2,2,4,3}},
+  {{1,2,1,5,1,2,1,4}, {1,1,2,1,6,2,2,2}, {2,2,2,1,2,2,5,1}},
+  {{2,2,1,5,1,2,2,2}, {1,2,1,2,5,3,2,1}, {1,2,2,1,2,3,4,2}},
+  {{1,1,2,4,2,2,1,4}, {1,1,2,1,6,3,2,1}, {1,3,1,2,1,4,4,1}},
+  {{2,1,2,4,2,2,2,2}, {1,2,1,2,6,1,3,1}, {1,2,2,1,2,4,4,1}},
+  {{2,2,1,5,1,3,2,1}, {5,1,2,2,1,1,1,4}, {6,3,1,2,2,1,1,1}},
+  {{1,1,2,4,2,3,1,3}, {6,1,2,2,1,1,2,2}, {1,3,1,2,2,1,5,2}},
+  {{1,2,1,5,1,4,1,2}, {1,1,2,2,1,1,6,3}, {6,2,2,1,3,1,1,1}},
+  {{1,1,2,4,2,4,1,2}, {5,1,2,2,1,2,1,3}, {1,2,2,1,3,1,5,2}},
+  {{1,2,1,5,1,5,1,1}, {6,1,2,2,1,2,2,1}, {1,3,1,2,2,2,5,1}},
+  {{1,2,1,5,2,1,2,3}, {1,1,2,2,1,2,6,2}, {1,2,2,1,3,2,5,1}},
+  {{1,1,2,4,3,1,2,3}, {5,1,2,2,1,3,1,2}, {5,3,1,2,3,1,1,1}},
+  {{1,1,2,4,3,2,2,2}, {1,1,2,2,1,3,6,1}, {5,2,2,1,4,1,1,1}},
+  {{1,1,2,4,3,3,2,1}, {5,1,2,2,1,4,1,1}, {4,3,1,2,4,1,1,1}},
+  {{3,1,2,5,1,1,2,2}, {4,2,1,3,1,1,1,4}, {4,2,2,1,5,1,1,1}},
+  {{3,1,2,5,1,2,2,1}, {5,2,1,3,1,1,2,2}, {3,3,1,2,5,1,1,1}},
+  {{2,1,2,5,1,4,1,1}, {4,1,2,2,2,1,1,4}, {3,2,2,1,6,1,1,1}},
+  {{2,2,1,6,1,1,2,2}, {4,2,1,3,1,2,1,3}, {2,3,1,2,6,1,1,1}},
+  {{1,2,1,6,1,2,1,3}, {5,2,1,3,1,2,2,1}, {2,1,3,1,1,1,3,5}},
+  {{1,1,2,5,2,2,1,3}, {4,1,2,2,2,2,1,3}, {3,1,3,1,1,1,4,3}},
+  {{1,1,2,5,2,3,1,2}, {5,1,2,2,2,2,2,1}, {4,1,3,1,1,1,5,1}},
+  {{1,1,2,5,2,4,1,1}, {4,1,2,2,2,3,1,2}, {1,1,3,1,1,2,2,6}},
+  {{2,3,1,1,1,1,2,6}, {4,2,1,3,1,4,1,1}, {2,1,3,1,1,2,3,4}},
+  {{3,3,1,1,1,1,3,4}, {4,1,2,2,2,4,1,1}, {3,1,3,1,1,2,4,2}},
+  {{4,3,1,1,1,1,4,2}, {3,2,1,3,2,1,1,4}, {1,1,3,1,1,3,2,5}},
+  {{2,3,1,1,1,2,2,5}, {4,2,1,3,2,1,2,2}, {2,1,3,1,1,3,3,3}},
+  {{3,3,1,1,1,2,3,3}, {3,1,2,2,3,1,1,4}, {3,1,3,1,1,3,4,1}},
+  {{1,3,1,1,1,3,1,6}, {3,2,1,3,2,2,1,3}, {1,1,3,1,1,4,2,4}},
+  {{2,3,1,1,1,3,2,4}, {4,2,1,3,2,2,2,1}, {2,1,3,1,1,4,3,2}},
+  {{3,3,1,1,1,3,3,2}, {3,1,2,2,3,2,1,3}, {1,1,3,1,1,5,2,3}},
+  {{1,3,1,1,1,4,1,5}, {4,1,2,2,3,2,2,1}, {2,1,3,1,1,5,3,1}},
+  {{2,3,1,1,1,4,2,3}, {3,1,2,2,3,3,1,2}, {1,1,3,1,1,6,2,2}},
+  {{1,3,1,1,1,5,1,4}, {3,2,1,3,2,4,1,1}, {1,2,2,2,1,1,3,5}},
+  {{1,3,1,1,1,6,1,3}, {3,1,2,2,3,4,1,1}, {2,2,2,2,1,1,4,3}},
+  {{1,3,1,1,2,1,2,6}, {2,2,1,3,3,1,1,4}, {3,2,2,2,1,1,5,1}},
+  {{2,3,1,1,2,1,3,4}, {3,2,1,3,3,1,2,2}, {1,1,3,1,2,1,3,5}},
+  {{3,3,1,1,2,1,4,2}, {2,1,2,2,4,1,1,4}, {1,2,2,2,1,2,3,4}},
+  {{1,3,1,1,2,2,2,5}, {2,2,1,3,3,2,1,3}, {2,2,2,2,1,2,4,2}},
+  {{2,3,1,1,2,2,3,3}, {3,2,1,3,3,2,2,1}, {1,1,3,1,2,2,3,4}},
+  {{3,3,1,1,2,2,4,1}, {2,1,2,2,4,2,1,3}, {2,1,3,1,2,2,4,2}},
+  {{1,3,1,1,2,3,2,4}, {3,1,2,2,4,2,2,1}, {2,2,2,2,1,3,4,1}},
+  {{2,3,1,1,2,3,3,2}, {2,1,2,2,4,3,1,2}, {1,1,3,1,2,3,3,3}},
+  {{1,3,1,1,2,4,2,3}, {2,2,1,3,3,4,1,1}, {1,2,2,2,1,4,3,2}},
+  {{1,3,1,1,2,5,2,2}, {2,1,2,2,4,4,1,1}, {1,1,3,1,2,4,3,2}},
+  {{1,3,1,1,3,1,3,4}, {1,2,1,3,4,1,1,4}, {1,2,2,2,1,5,3,1}},
+  {{2,3,1,1,3,1,4,2}, {2,2,1,3,4,1,2,2}, {1,1,3,1,2,5,3,1}},
+  {{1,3,1,1,3,2,3,3}, {1,1,2,2,5,1,1,4}, {1,3,1,3,1,1,4,3}},
+  {{2,3,1,1,3,2,4,1}, {1,2,1,3,4,2,1,3}, {2,3,1,3,1,1,5,1}},
+  {{1,3,1,1,3,3,3,2}, {2,2,1,3,4,2,2,1}, {1,2,2,2,2,1,4,3}},
+  {{1,3,1,1,4,1,4,2}, {1,1,2,2,5,2,1,3}, {1,3,1,3,1,2,4,2}},
+  {{1,3,1,1,4,2,4,1}, {2,1,2,2,5,2,2,1}, {1,1,3,1,3,1,4,3}},
+  {{3,2,2,1,1,1,2,5}, {1,1,2,2,5,3,1,2}, {1,2,2,2,2,2,4,2}},
+  {{4,2,2,1,1,1,3,3}, {1,2,1,3,4,4,1,1}, {1,3,1,3,1,3,4,1}},
+  {{5,2,2,1,1,1,4,1}, {1,1,2,2,5,4,1,1}, {1,1,3,1,3,2,4,2}},
+  {{2,2,2,1,1,2,1,6}, {1,2,1,3,5,1,2,2}, {1,2,2,2,2,3,4,1}},
+  {{3,2,2,1,1,2,2,4}, {1,1,2,2,6,1,2,2}, {1,1,3,1,3,3,4,1}},
+  {{4,2,2,1,1,2,3,2}, {1,2,1,3,5,2,2,1}, {1,3,1,3,2,1,5,1}},
+  {{2,2,2,1,1,3,1,5}, {1,1,2,2,6,2,2,1}, {1,2,2,2,3,1,5,1}},
+  {{3,2,2,1,1,3,2,3}, {5,1,2,3,1,1,1,3}, {1,1,3,1,4,1,5,1}},
+  {{4,2,2,1,1,3,3,1}, {6,1,2,3,1,1,2,1}, {1,1,3,2,1,1,2,6}},
+  {{2,2,2,1,1,4,1,4}, {1,1,2,3,1,1,6,2}, {2,1,3,2,1,1,3,4}},
+  {{3,2,2,1,1,4,2,2}, {5,1,2,3,1,2,1,2}, {3,1,3,2,1,1,4,2}},
+  {{2,2,2,1,1,5,1,3}, {1,1,2,3,1,2,6,1}, {1,1,3,2,1,2,2,5}},
+  {{3,2,2,1,1,5,2,1}, {5,1,2,3,1,3,1,1}, {2,1,3,2,1,2,3,3}},
+  {{2,3,1,2,1,1,2,5}, {4,2,1,4,1,1,1,3}, {3,1,3,2,1,2,4,1}},
+  {{3,3,1,2,1,1,3,3}, {5,2,1,4,1,1,2,1}, {1,1,3,2,1,3,2,4}},
+  {{4,3,1,2,1,1,4,1}, {4,1,2,3,2,1,1,3}, {2,1,3,2,1,3,3,2}},
+  {{2,2,2,1,2,1,2,5}, {5,1,2,3,2,1,2,1}, {1,1,3,2,1,4,2,3}},
+  {{2,3,1,2,1,2,2,4}, {4,1,2,3,2,2,1,2}, {2,1,3,2,1,4,3,1}},
+  {{3,3,1,2,1,2,3,2}, {4,2,1,4,1,3,1,1}, {1,1,3,2,1,5,2,2}},
+  {{1,2,2,1,2,2,1,6}, {4,1,2,3,2,3,1,1}, {1,1,3,2,1,6,2,1}},
+  {{1,3,1,2,1,3,1,5}, {3,2,1,4,2,1,1,3}, {1,2,2,3,1,1,3,4}},
+  {{3,2,2,1,2,2,3,2}, {4,2,1,4,2,1,2,1}, {2,2,2,3,1,1,4,2}},
+  {{3,3,1,2,1,3,3,1}, {3,1,2,3,3,1,1,3}, {1,1,3,2,2,1,3,4}},
+  {{1,2,2,1,2,3,1,5}, {3,2,1,4,2,2,1,2}, {1,2,2,3,1,2,3,3}},
+  {{2,2,2,1,2,3,2,3}, {3,1,2,3,3,2,1,2}, {2,2,2,3,1,2,4,1}},
+  {{2,3,1,2,1,4,2,2}, {3,2,1,4,2,3,1,1}, {1,1,3,2,2,2,3,3}},
+  {{1,2,2,1,2,4,1,4}, {3,1,2,3,3,3,1,1}, {2,1,3,2,2,2,4,1}},
+  {{1,3,1,2,1,5,1,3}, {2,2,1,4,3,1,1,3}, {1,1,3,2,2,3,3,2}},
+  {{1,2,2,1,2,5,1,3}, {3,2,1,4,3,1,2,1}, {1,2,2,3,1,4,3,1}},
+  {{1,3,1,2,2,1,2,5}, {2,1,2,3,4,1,1,3}, {1,1,3,2,2,4,3,1}},
+  {{2,3,1,2,2,1,3,3}, {3,1,2,3,4,1,2,1}, {1,3,1,4,1,1,4,2}},
+  {{3,3,1,2,2,1,4,1}, {2,1,2,3,4,2,1,2}, {1,2,2,3,2,1,4,2}},
+  {{1,2,2,1,3,1,2,5}, {2,2,1,4,3,3,1,1}, {1,3,1,4,1,2,4,1}},
+  {{1,3,1,2,2,2,2,4}, {2,1,2,3,4,3,1,1}, {1,1,3,2,3,1,4,2}},
+  {{3,2,2,1,3,1,4,1}, {1,2,1,4,4,1,1,3}, {1,2,2,3,2,2,4,1}},
+  {{1,2,2,1,3,2,2,4}, {2,2,1,4,4,1,2,1}, {1,1,3,2,3,2,4,1}},
+  {{2,2,2,1,3,2,3,2}, {1,1,2,3,5,1,1,3}, {1,1,3,3,1,1,2,5}},
+  {{2,3,1,2,2,3,3,1}, {1,2,1,4,4,2,1,2}, {2,1,3,3,1,1,3,3}},
+  {{1,2,2,1,3,3,2,3}, {1,1,2,3,5,2,1,2}, {3,1,3,3,1,1,4,1}},
+  {{1,3,1,2,2,4,2,2}, {1,2,1,4,4,3,1,1}, {1,1,3,3,1,2,2,4}},
+  {{1,2,2,1,3,4,2,2}, {1,1,2,3,5,3,1,1}, {2,1,3,3,1,2,3,2}},
+  {{1,3,1,2,3,1,3,3}, {1,2,1,4,5,1,2,1}, {1,1,3,3,1,3,2,3}},
+  {{2,3,1,2,3,1,4,1}, {1,1,2,3,6,1,2,1}, {2,1,3,3,1,3,3,1}},
+  {{1,2,2,1,4,1,3,3}, {5,1,2,4,1,1,1,2}, {1,1,3,3,1,4,2,2}},
+  {{1,3,1,2,3,2,3,2}, {1,1,2,4,1,1,6,1}, {1,1,3,3,1,5,2,1}},
+  {{1,2,2,1,4,2,3,2}, {5,1,2,4,1,2,1,1}, {1,2,2,4,1,1,3,3}},
+  {{1,3,1,2,3,3,3,1}, {4,2,1,5,1,1,1,2}, {2,2,2,4,1,1,4,1}},
+  {{1,3,1,2,4,1,4,1}, {4,1,2,4,2,1,1,2}, {1,1,3,3,2,1,3,3}},
+  {{1,2,2,1,5,1,4,1}, {4,2,1,5,1,2,1,1}, {1,2,2,4,1,2,3,2}},
+  {{3,1,3,1,1,1,1,6}, {4,1,2,4,2,2,1,1}, {1,1,3,3,2,2,3,2}},
+  {{4,1,3,1,1,1,2,4}, {3,2,1,5,2,1,1,2}, {1,2,2,4,1,3,3,1}},
+  {{5,1,3,1,1,1,3,2}, {3,1,2,4,3,1,1,2}, {1,1,3,3,2,3,3,1}},
+  {{3,1,3,1,1,2,1,5}, {3,2,1,5,2,2,1,1}, {1,3,1,5,1,1,4,1}},
+  {{4,1,3,1,1,2,2,3}, {3,1,2,4,3,2,1,1}, {1,2,2,4,2,1,4,1}},
+  {{5,1,3,1,1,2,3,1}, {2,2,1,5,3,1,1,2}, {1,1,3,3,3,1,4,1}},
+  {{3,1,3,1,1,3,1,4}, {2,1,2,4,4,1,1,2}, {1,1,3,4,1,1,2,4}},
+  {{4,1,3,1,1,3,2,2}, {2,2,1,5,3,2,1,1}, {2,1,3,4,1,1,3,2}},
+  {{3,1,3,1,1,4,1,3}, {2,1,2,4,4,2,1,1}, {1,1,3,4,1,2,2,3}},
+  {{4,1,3,1,1,4,2,1}, {1,2,1,5,4,1,1,2}, {2,1,3,4,1,2,3,1}},
+  {{3,1,3,1,1,5,1,2}, {1,1,2,4,5,1,1,2}, {1,1,3,4,1,3,2,2}},
+  {{2,2,2,2,1,1,1,6}, {1,2,1,5,4,2,1,1}, {1,1,3,4,1,4,2,1}},
+  {{3,2,2,2,1,1,2,4}, {1,1,2,4,5,2,1,1}, {1,2,2,5,1,1,3,2}},
+  {{4,2,2,2,1,1,3,2}, {5,1,2,5,1,1,1,1}, {1,1,3,4,2,1,3,2}},
+  {{2,1,3,1,2,1,1,6}, {4,2,1,6,1,1,1,1}, {1,2,2,5,1,2,3,1}},
+  {{2,2,2,2,1,2,1,5}, {4,1,2,5,2,1,1,1}, {1,1,3,4,2,2,3,1}},
+  {{4,1,3,1,2,1,3,2}, {3,2,1,6,2,1,1,1}, {1,1,3,5,1,1,2,3}},
+  {{4,2,2,2,1,2,3,1}, {3,1,2,5,3,1,1,1}, {2,1,3,5,1,1,3,1}},
+  {{2,1,3,1,2,2,1,5}, {2,2,1,6,3,1,1,1}, {1,1,3,5,1,2,2,2}},
+  {{3,1,3,1,2,2,2,3}, {2,1,2,5,4,1,1,1}, {1,1,3,5,1,3,2,1}},
+  {{4,1,3,1,2,2,3,1}, {4,3,1,1,1,1,1,5}, {1,2,2,6,1,1,3,1}},
+  {{2,1,3,1,2,3,1,4}, {5,3,1,1,1,1,2,3}, {1,1,3,5,2,1,3,1}},
+  {{2,2,2,2,1,4,1,3}, {6,3,1,1,1,1,3,1}, {1,1,3,6,1,1,2,2}},
+  {{3,2,2,2,1,4,2,1}, {4,3,1,1,1,2,1,4}, {1,1,3,6,1,2,2,1}},
+  {{2,1,3,1,2,4,1,3}, {5,3,1,1,1,2,2,2}, {1,4,1,1,1,1,4,4}},
+  {{3,1,3,1,2,4,2,1}, {4,3,1,1,1,3,1,3}, {2,4,1,1,1,1,5,2}},
+  {{2,2,2,2,1,6,1,1}, {5,3,1,1,1,3,2,1}, {1,4,1,1,1,2,4,3}},
+  {{1,3,1,3,1,1,1,6}, {4,3,1,1,1,4,1,2}, {2,4,1,1,1,2,5,1}},
+  {{2,3,1,3,1,1,2,4}, {4,3,1,1,1,5,1,1}, {1,4,1,1,1,3,4,2}},
+  {{3,3,1,3,1,1,3,2}, {3,3,1,1,2,1,1,5}, {1,4,1,1,1,4,4,1}},
+  {{1,2,2,2,2,1,1,6}, {4,3,1,1,2,1,2,3}, {1,4,1,1,2,1,5,2}},
+  {{1,3,1,3,1,2,1,5}, {5,3,1,1,2,1,3,1}, {1,4,1,1,2,2,5,1}},
+  {{2,3,1,3,1,2,2,3}, {3,3,1,1,2,2,1,4}, {5,4,1,1,3,1,1,1}},
+  {{3,3,1,3,1,2,3,1}, {4,3,1,1,2,2,2,2}, {4,4,1,1,4,1,1,1}},
+  {{1,1,3,1,3,1,1,6}, {3,3,1,1,2,3,1,3}, {3,4,1,1,5,1,1,1}},
+  {{1,2,2,2,2,2,1,5}, {4,3,1,1,2,3,2,1}, {2,4,1,1,6,1,1,1}},
+  {{2,2,2,2,2,2,2,3}, {3,3,1,1,2,4,1,2}, {1,3,2,1,1,1,3,5}},
+  {{3,2,2,2,2,2,3,1}, {3,3,1,1,2,5,1,1}, {2,3,2,1,1,1,4,3}},
+  {{1,1,3,1,3,2,1,5}, {2,3,1,1,3,1,1,5}, {3,3,2,1,1,1,5,1}},
+  {{2,1,3,1,3,2,2,3}, {3,3,1,1,3,1,2,3}, {1,3,2,1,1,2,3,4}},
+  {{3,1,3,1,3,2,3,1}, {4,3,1,1,3,1,3,1}, {2,3,2,1,1,2,4,2}},
+  {{2,3,1,3,1,4,2,1}, {2,3,1,1,3,2,1,4}, {1,3,2,1,1,3,3,3}},
+  {{1,1,3,1,3,3,1,4}, {3,3,1,1,3,2,2,2}, {2,3,2,1,1,3,4,1}},
+  {{1,2,2,2,2,4,1,3}, {2,3,1,1,3,3,1,3}, {1,3,2,1,1,4,3,2}},
+  {{2,2,2,2,2,4,2,1}, {3,3,1,1,3,3,2,1}, {1,3,2,1,1,5,3,1}},
+  {{1,1,3,1,3,4,1,3}, {2,3,1,1,3,4,1,2}, {1,4,1,2,1,1,4,3}},
+  {{1,3,1,3,1,6,1,1}, {2,3,1,1,3,5,1,1}, {2,4,1,2,1,1,5,1}},
+  {{1,3,1,3,2,1,2,4}, {1,3,1,1,4,1,1,5}, {1,3,2,1,2,1,4,3}},
+  {{2,3,1,3,2,1,3,2}, {2,3,1,1,4,1,2,3}, {1,4,1,2,1,2,4,2}},
+  {{1,2,2,2,3,1,2,4}, {3,3,1,1,4,1,3,1}, {1,3,2,1,2,2,4,2}},
+  {{1,3,1,3,2,2,2,3}, {1,3,1,1,4,2,1,4}, {1,4,1,2,1,3,4,1}},
+  {{2,3,1,3,2,2,3,1}, {2,3,1,1,4,2,2,2}, {1,3,2,1,2,3,4,1}},
+  {{1,1,3,1,4,1,2,4}, {1,3,1,1,4,3,1,3}, {1,4,1,2,2,1,5,1}},
+  {{1,2,2,2,3,2,2,3}, {2,3,1,1,4,3,2,1}, {1,3,2,1,3,1,5,1}},
+  {{2,2,2,2,3,2,3,1}, {1,3,1,1,4,4,1,2}, {1,2,3,1,1,1,2,6}},
+  {{1,1,3,1,4,2,2,3}, {1,3,1,1,4,5,1,1}, {2,2,3,1,1,1,3,4}},
+  {{2,1,3,1,4,2,3,1}, {1,3,1,1,5,1,2,3}, {3,2,3,1,1,1,4,2}},
+  {{1,3,1,3,2,4,2,1}, {2,3,1,1,5,1,3,1}, {1,2,3,1,1,2,2,5}},
+  {{1,2,2,2,3,4,2,1}, {1,3,1,1,5,2,2,2}, {2,2,3,1,1,2,3,3}},
+  {{1,3,1,3,3,1,3,2}, {1,3,1,1,5,3,2,1}, {3,2,3,1,1,2,4,1}},
+  {{1,2,2,2,4,1,3,2}, {1,3,1,1,6,1,3,1}, {1,2,3,1,1,3,2,4}},
+  {{1,3,1,3,3,2,3,1}, {5,2,2,1,1,1,1,4}, {2,2,3,1,1,3,3,2}},
+  {{1,1,3,1,5,1,3,2}, {6,2,2,1,1,1,2,2}, {1,2,3,1,1,4,2,3}},
+  {{1,2,2,2,4,2,3,1}, {1,2,2,1,1,1,6,3}, {2,2,3,1,1,4,3,1}},
+  {{3,1,3,2,1,1,1,5}, {5,2,2,1,1,2,1,3}, {1,2,3,1,1,5,2,2}},
+  {{4,1,3,2,1,1,2,3}, {6,2,2,1,1,2,2,1}, {1,2,3,1,1,6,2,1}},
+  {{5,1,3,2,1,1,3,1}, {1,2,2,1,1,2,6,2}, {1,3,2,2,1,1,3,4}},
+  {{3,1,3,2,1,2,1,4}, {5,2,2,1,1,3,1,2}, {2,3,2,2,1,1,4,2}},
+  {{4,1,3,2,1,2,2,2}, {1,2,2,1,1,3,6,1}, {1,2,3,1,2,1,3,4}},
+  {{3,1,3,2,1,3,1,3}, {5,2,2,1,1,4,1,1}, {1,3,2,2,1,2,3,3}},
+  {{4,1,3,2,1,3,2,1}, {4,3,1,2,1,1,1,4}, {2,3,2,2,1,2,4,1}},
+  {{3,1,3,2,1,4,1,2}, {5,3,1,2,1,1,2,2}, {1,2,3,1,2,2,3,3}},
+  {{3,1,3,2,1,5,1,1}, {4,2,2,1,2,1,1,4}, {1,3,2,2,1,3,3,2}},
+  {{2,2,2,3,1,1,1,5}, {4,3,1,2,1,2,1,3}, {1,2,3,1,2,3,3,2}},
+  {{3,2,2,3,1,1,2,3}, {5,3,1,2,1,2,2,1}, {1,3,2,2,1,4,3,1}},
+  {{4,2,2,3,1,1,3,1}, {4,2,2,1,2,2,1,3}, {1,2,3,1,2,4,3,1}},
+  {{2,1,3,2,2,1,1,5}, {5,2,2,1,2,2,2,1}, {1,4,1,3,1,1,4,2}},
+  {{2,2,2,3,1,2,1,4}, {4,2,2,1,2,3,1,2}, {1,3,2,2,2,1,4,2}},
+  {{4,1,3,2,2,1,3,1}, {4,3,1,2,1,4,1,1}, {1,4,1,3,1,2,4,1}},
+  {{2,1,3,2,2,2,1,4}, {4,2,2,1,2,4,1,1}, {1,2,3,1,3,1,4,2}},
+  {{3,1,3,2,2,2,2,2}, {3,3,1,2,2,1,1,4}, {1,3,2,2,2,2,4,1}},
+  {{3,2,2,3,1,3,2,1}, {4,3,1,2,2,1,2,2}, {1,2,3,1,3,2,4,1}},
+  {{2,1,3,2,2,3,1,3}, {3,2,2,1,3,1,1,4}, {2,1,4,1,1,1,2,5}},
+  {{2,2,2,3,1,4,1,2}, {3,3,1,2,2,2,1,3}, {3,1,4,1,1,1,3,3}},
+  {{2,1,3,2,2,4,1,2}, {4,3,1,2,2,2,2,1}, {4,1,4,1,1,1,4,1}},
+  {{2,2,2,3,1,5,1,1}, {3,2,2,1,3,2,1,3}, {1,1,4,1,1,2,1,6}},
+  {{2,1,3,2,2,5,1,1}, {4,2,2,1,3,2,2,1}, {2,1,4,1,1,2,2,4}},
+  {{1,3,1,4,1,1,1,5}, {3,2,2,1,3,3,1,2}, {3,1,4,1,1,2,3,2}},
+  {{2,3,1,4,1,1,2,3}, {3,3,1,2,2,4,1,1}, {1,1,4,1,1,3,1,5}},
+  {{3,3,1,4,1,1,3,1}, {3,2,2,1,3,4,1,1}, {2,1,4,1,1,3,2,3}},
+  {{1,2,2,3,2,1,1,5}, {2,3,1,2,3,1,1,4}, {3,1,4,1,1,3,3,1}},
+  {{1,3,1,4,1,2,1,4}, {3,3,1,2,3,1,2,2}, {1,1,4,1,1,4,1,4}},
+  {{2,3,1,4,1,2,2,2}, {2,2,2,1,4,1,1,4}, {2,1,4,1,1,4,2,2}},
+  {{1,1,3,2,3,1,1,5}, {2,3,1,2,3,2,1,3}, {1,1,4,1,1,5,1,3}},
+  {{1,2,2,3,2,2,1,4}, {3,3,1,2,3,2,2,1}, {2,1,4,1,1,5,2,1}},
+  {{2,2,2,3,2,2,2,2}, {2,2,2,1,4,2,1,3}, {1,1,4,1,1,6,1,2}},
+  {{2,3,1,4,1,3,2,1}, {3,2,2,1,4,2,2,1}, {1,2,3,2,1,1,2,5}},
+  {{1,1,3,2,3,2,1,4}, {2,2,2,1,4,3,1,2}, {2,2,3,2,1,1,3,3}},
+  {{2,1,3,2,3,2,2,2}, {2,3,1,2,3,4,1,1}, {3,2,3,2,1,1,4,1}},
+  {{1,3,1,4,1,4,1,2}, {2,2,2,1,4,4,1,1}, {1,1,4,1,2,1,2,5}},
+  {{1,1,3,2,3,3,1,3}, {1,3,1,2,4,1,1,4}, {1,2,3,2,1,2,2,4}},
+  {{1,2,2,3,2,4,1,2}, {2,3,1,2,4,1,2,2}, {2,2,3,2,1,2,3,2}},
+  {{1,3,1,4,1,5,1,1}, {1,2,2,1,5,1,1,4}, {1,1,4,1,2,2,2,4}},
+  {{1,2,2,3,2,5,1,1}, {1,3,1,2,4,2,1,3}, {2,1,4,1,2,2,3,2}},
+  {{1,3,1,4,2,1,2,3}, {2,3,1,2,4,2,2,1}, {2,2,3,2,1,3,3,1}},
+  {{2,3,1,4,2,1,3,1}, {1,2,2,1,5,2,1,3}, {1,1,4,1,2,3,2,3}},
+  {{1,2,2,3,3,1,2,3}, {2,2,2,1,5,2,2,1}, {1,2,3,2,1,4,2,2}},
+  {{1,3,1,4,2,2,2,2}, {1,2,2,1,5,3,1,2}, {1,1,4,1,2,4,2,2}},
+  {{1,1,3,2,4,1,2,3}, {1,3,1,2,4,4,1,1}, {1,2,3,2,1,5,2,1}},
+  {{1,2,2,3,3,2,2,2}, {1,2,2,1,5,4,1,1}, {1,1,4,1,2,5,2,1}},
+  {{1,3,1,4,2,3,2,1}, {1,3,1,2,5,1,2,2}, {1,3,2,3,1,1,3,3}},
+  {{1,1,3,2,4,2,2,2}, {1,2,2,1,6,1,2,2}, {2,3,2,3,1,1,4,1}},
+  {{1,2,2,3,3,3,2,1}, {1,3,1,2,5,2,2,1}, {1,2,3,2,2,1,3,3}},
+  {{1,3,1,4,3,1,3,1}, {1,2,2,1,6,2,2,1}, {1,3,2,3,1,2,3,2}},
+  {{1,1,3,2,5,1,3,1}, {6,1,3,1,1,1,1,3}, {1,1,4,1,3,1,3,3}},
+  {{3,1,3,3,1,1,1,4}, {1,1,3,1,1,1,5,4}, {1,2,3,2,2,2,3,2}},
+  {{4,1,3,3,1,1,2,2}, {2,1,3,1,1,1,6,2}, {1,3,2,3,1,3,3,1}},
+  {{3,1,3,3,1,2,1,3}, {6,1,3,1,1,2,1,2}, {1,1,4,1,3,2,3,2}},
+  {{4,1,3,3,1,2,2,1}, {1,1,3,1,1,2,5,3}, {1,2,3,2,2,3,3,1}},
+  {{3,1,3,3,1,3,1,2}, {2,1,3,1,1,2,6,1}, {1,1,4,1,3,3,3,1}},
+  {{3,1,3,3,1,4,1,1}, {6,1,3,1,1,3,1,1}, {1,4,1,4,1,1,4,1}},
+  {{2,2,2,4,1,1,1,4}, {1,1,3,1,1,3,5,2}, {1,3,2,3,2,1,4,1}},
+  {{3,2,2,4,1,1,2,2}, {1,1,3,1,1,4,5,1}, {1,2,3,2,3,1,4,1}},
+  {{2,1,3,3,2,1,1,4}, {5,2,2,2,1,1,1,3}, {1,1,4,1,4,1,4,1}},
+  {{2,2,2,4,1,2,1,3}, {6,2,2,2,1,1,2,1}, {1,1,4,2,1,1,1,6}},
+  {{3,2,2,4,1,2,2,1}, {1,2,2,2,1,1,6,2}, {2,1,4,2,1,1,2,4}},
+  {{2,1,3,3,2,2,1,3}, {5,1,3,1,2,1,1,3}, {3,1,4,2,1,1,3,2}},
+  {{3,1,3,3,2,2,2,1}, {6,1,3,1,2,1,2,1}, {1,1,4,2,1,2,1,5}},
+  {{2,1,3,3,2,3,1,2}, {1,1,3,1,2,1,6,2}, {2,1,4,2,1,2,2,3}},
+  {{2,2,2,4,1,4,1,1}, {1,2,2,2,1,2,6,1}, {3,1,4,2,1,2,3,1}},
+  {{2,1,3,3,2,4,1,1}, {5,1,3,1,2,2,1,2}, {1,1,4,2,1,3,1,4}},
+  {{1,3,1,5,1,1,1,4}, {5,2,2,2,1,3,1,1}, {2,1,4,2,1,3,2,2}},
+  {{2,3,1,5,1,1,2,2}, {1,1,3,1,2,2,6,1}, {1,1,4,2,1,4,1,3}},
+  {{1,2,2,4,2,1,1,4}, {5,1,3,1,2,3,1,1}, {2,1,4,2,1,4,2,1}},
+  {{1,3,1,5,1,2,1,3}, {4,3,1,3,1,1,1,3}, {1,1,4,2,1,5,1,2}},
+  {{2,3,1,5,1,2,2,1}, {5,3,1,3,1,1,2,1}, {1,1,4,2,1,6,1,1}},
+  {{1,1,3,3,3,1,1,4}, {4,2,2,2,2,1,1,3}, {1,2,3,3,1,1,2,4}},
+  {{1,2,2,4,2,2,1,3}, {4,3,1,3,1,2,1,2}, {2,2,3,3,1,1,3,2}},
+  {{2,2,2,4,2,2,2,1}, {4,1,3,1,3,1,1,3}, {1,1,4,2,2,1,2,4}},
+  {{1,1,3,3,3,2,1,3}, {5,1,3,1,3,1,2,1}, {1,2,3,3,1,2,2,3}},
+  {{2,1,3,3,3,2,2,1}, {4,3,1,3,1,3,1,1}, {2,2,3,3,1,2,3,1}},
+  {{1,3,1,5,1,4,1,1}, {4,1,3,1,3,2,1,2}, {1,1,4,2,2,2,2,3}},
+  {{1,1,3,3,3,3,1,2}, {4,2,2,2,2,3,1,1}, {2,1,4,2,2,2,3,1}},
+  {{1,2,2,4,2,4,1,1}, {4,1,3,1,3,3,1,1}, {1,1,4,2,2,3,2,2}},
+  {{1,1,3,3,3,4,1,1}, {3,3,1,3,2,1,1,3}, {1,2,3,3,1,4,2,1}},
+  {{1,2,2,4,3,1,2,2}, {4,3,1,3,2,1,2,1}, {1,1,4,2,2,4,2,1}},
+  {{1,1,3,3,4,1,2,2}, {3,2,2,2,3,1,1,3}, {1,3,2,4,1,1,3,2}},
+  {{1,1,3,3,4,2,2,1}, {3,3,1,3,2,2,1,2}, {1,2,3,3,2,1,3,2}},
+  {{4,1,3,4,1,1,2,1}, {3,1,3,1,4,1,1,3}, {1,3,2,4,1,2,3,1}},
+  {{3,1,3,4,1,3,1,1}, {3,2,2,2,3,2,1,2}, {1,1,4,2,3,1,3,2}},
+  {{3,2,2,5,1,1,2,1}, {3,3,1,3,2,3,1,1}, {1,2,3,3,2,2,3,1}},
+  {{2,2,2,5,1,2,1,2}, {3,1,3,1,4,2,1,2}, {1,1,4,2,3,2,3,1}},
+  {{2,2,2,5,1,3,1,1}, {3,2,2,2,3,3,1,1}, {1,1,4,3,1,1,1,5}},
+  {{1,3,1,6,1,1,1,3}, {3,1,3,1,4,3,1,1}, {2,1,4,3,1,1,2,3}},
+  {{1,2,2,5,2,1,1,3}, {2,3,1,3,3,1,1,3}, {3,1,4,3,1,1,3,1}},
+  {{1,1,3,4,3,1,1,3}, {3,3,1,3,3,1,2,1}, {1,1,4,3,1,2,1,4}},
+  {{1,3,1,6,1,3,1,1}, {2,2,2,2,4,1,1,3}, {2,1,4,3,1,2,2,2}},
+  {{1,2,2,5,2,3,1,1}, {2,3,1,3,3,2,1,2}, {1,1,4,3,1,3,1,3}},
+  {{2,4,1,1,1,1,2,5}, {2,1,3,1,5,1,1,3}, {2,1,4,3,1,3,2,1}},
+  {{1,4,1,1,1,2,1,6}, {2,2,2,2,4,2,1,2}, {1,1,4,3,1,4,1,2}},
+  {{2,4,1,1,1,2,2,4}, {2,3,1,3,3,3,1,1}, {1,1,4,3,1,5,1,1}},
+  {{1,4,1,1,1,3,1,5}, {2,1,3,1,5,2,1,2}, {1,2,3,4,1,1,2,3}},
+  {{2,4,1,1,1,3,2,3}, {2,2,2,2,4,3,1,1}, {2,2,3,4,1,1,3,1}},
+  {{3,4,1,1,1,3,3,1}, {2,1,3,1,5,3,1,1}, {1,1,4,3,2,1,2,3}},
+  {{1,4,1,1,1,4,1,4}, {1,3,1,3,4,1,1,3}, {1,2,3,4,1,2,2,2}},
+  {{2,4,1,1,1,4,2,2}, {2,3,1,3,4,1,2,1}, {1,1,4,3,2,2,2,2}},
+  {{1,4,1,1,1,5,1,3}, {1,2,2,2,5,1,1,3}, {1,2,3,4,1,3,2,1}},
+  {{2,4,1,1,1,5,2,1}, {1,3,1,3,4,2,1,2}, {1,1,4,3,2,3,2,1}},
+  {{1,4,1,1,2,1,2,5}, {1,1,3,1,6,1,1,3}, {1,3,2,5,1,1,3,1}},
+  {{2,4,1,1,2,1,3,3}, {1,2,2,2,5,2,1,2}, {1,2,3,4,2,1,3,1}},
+  {{3,4,1,1,2,1,4,1}, {1,3,1,3,4,3,1,1}, {1,1,4,3,3,1,3,1}},
+  {{1,4,1,1,2,2,2,4}, {1,1,3,1,6,2,1,2}, {1,1,4,4,1,1,1,4}},
+  {{2,4,1,1,2,2,3,2}, {1,2,2,2,5,3,1,1}, {2,1,4,4,1,1,2,2}},
+  {{1,4,1,1,2,3,2,3}, {1,1,3,1,6,3,1,1}, {1,1,4,4,1,2,1,3}},
+  {{2,4,1,1,2,3,3,1}, {1,3,1,3,5,1,2,1}, {2,1,4,4,1,2,2,1}},
+  {{1,4,1,1,2,4,2,2}, {1,2,2,2,6,1,2,1}, {1,1,4,4,1,3,1,2}},
+  {{1,4,1,1,2,5,2,1}, {6,1,3,2,1,1,1,2}, {1,1,4,4,1,4,1,1}},
+  {{1,4,1,1,3,1,3,3}, {1,1,3,2,1,1,5,3}, {1,2,3,5,1,1,2,2}},
+  {{2,4,1,1,3,1,4,1}, {2,1,3,2,1,1,6,1}, {1,1,4,4,2,1,2,2}},
+  {{1,4,1,1,3,2,3,2}, {6,1,3,2,1,2,1,1}, {1,2,3,5,1,2,2,1}},
+  {{1,4,1,1,3,3,3,1}, {1,1,3,2,1,2,5,2}, {1,1,4,4,2,2,2,1}},
+  {{1,4,1,1,4,1,4,1}, {1,1,3,2,1,3,5,1}, {1,1,4,5,1,1,1,3}},
+  {{2,3,2,1,1,1,1,6}, {5,2,2,3,1,1,1,2}, {2,1,4,5,1,1,2,1}},
+  {{3,3,2,1,1,1,2,4}, {1,2,2,3,1,1,6,1}, {1,1,4,5,1,2,1,2}},
+  {{4,3,2,1,1,1,3,2}, {5,1,3,2,2,1,1,2}, {1,1,4,5,1,3,1,1}},
+  {{2,3,2,1,1,2,1,5}, {5,2,2,3,1,2,1,1}, {1,2,3,6,1,1,2,1}},
+  {{3,3,2,1,1,2,2,3}, {1,1,3,2,2,1,6,1}, {1,1,4,5,2,1,2,1}},
+  {{2,3,2,1,1,3,1,4}, {5,1,3,2,2,2,1,1}, {1,5,1,1,1,1,4,3}},
+  {{3,3,2,1,1,3,2,2}, {4,3,1,4,1,1,1,2}, {2,5,1,1,1,1,5,1}},
+  {{2,3,2,1,1,4,1,3}, {4,2,2,3,2,1,1,2}, {1,5,1,1,1,2,4,2}},
+  {{3,3,2,1,1,4,2,1}, {4,3,1,4,1,2,1,1}, {1,5,1,1,1,3,4,1}},
+  {{2,3,2,1,1,5,1,2}, {4,1,3,2,3,1,1,2}, {1,5,1,1,2,1,5,1}},
+  {{1,4,1,2,1,1,1,6}, {4,2,2,3,2,2,1,1}, {1,4,2,1,1,1,3,4}},
+  {{2,4,1,2,1,1,2,4}, {4,1,3,2,3,2,1,1}, {2,4,2,1,1,1,4,2}},
+  {{3,4,1,2,1,1,3,2}, {3,3,1,4,2,1,1,2}, {1,4,2,1,1,2,3,3}},
+  {{1,3,2,1,2,1,1,6}, {3,2,2,3,3,1,1,2}, {2,4,2,1,1,2,4,1}},
+  {{1,4,1,2,1,2,1,5}, {3,3,1,4,2,2,1,1}, {1,4,2,1,1,3,3,2}},
+  {{3,3,2,1,2,1,3,2}, {3,1,3,2,4,1,1,2}, {1,4,2,1,1,4,3,1}},
+  {{3,4,1,2,1,2,3,1}, {3,2,2,3,3,2,1,1}, {1,5,1,2,1,1,4,2}},
+  {{1,3,2,1,2,2,1,5}, {3,1,3,2,4,2,1,1}, {1,4,2,1,2,1,4,2}},
+  {{2,3,2,1,2,2,2,3}, {2,3,1,4,3,1,1,2}, {1,5,1,2,1,2,4,1}},
+  {{3,3,2,1,2,2,3,1}, {2,2,2,3,4,1,1,2}, {1,4,2,1,2,2,4,1}},
+  {{1,3,2,1,2,3,1,4}, {2,3,1,4,3,2,1,1}, {1,3,3,1,1,1,2,5}},
+  {{1,4,1,2,1,4,1,3}, {2,1,3,2,5,1,1,2}, {2,3,3,1,1,1,3,3}},
+  {{2,4,1,2,1,4,2,1}, {2,2,2,3,4,2,1,1}, {3,3,3,1,1,1,4,1}},
+  {{1,3,2,1,2,4,1,3}, {2,1,3,2,5,2,1,1}, {1,3,3,1,1,2,2,4}},
+  {{2,3,2,1,2,4,2,1}, {1,3,1,4,4,1,1,2}, {2,3,3,1,1,2,3,2}},
+  {{1,4,1,2,1,6,1,1}, {1,2,2,3,5,1,1,2}, {1,3,3,1,1,3,2,3}},
+  {{1,4,1,2,2,1,2,4}, {1,3,1,4,4,2,1,1}, {2,3,3,1,1,3,3,1}},
+  {{2,4,1,2,2,1,3,2}, {1,1,3,2,6,1,1,2}, {1,3,3,1,1,4,2,2}},
+  {{1,3,2,1,3,1,2,4}, {1,2,2,3,5,2,1,1}, {1,3,3,1,1,5,2,1}},
+  {{1,4,1,2,2,2,2,3}, {1,1,3,2,6,2,1,1}, {1,4,2,2,1,1,3,3}},
+  {{2,4,1,2,2,2,3,1}, {6,1,3,3,1,1,1,1}, {2,4,2,2,1,1,4,1}},
+  {{1,3,2,1,3,2,2,3}, {1,1,3,3,1,1,5,2}, {1,3,3,1,2,1,3,3}},
+  {{2,3,2,1,3,2,3,1}, {1,1,3,3,1,2,5,1}, {1,4,2,2,1,2,3,2}},
+  {{1,3,2,1,3,3,2,2}, {5,2,2,4,1,1,1,1}, {1,3,3,1,2,2,3,2}},
+  {{1,4,1,2,2,4,2,1}, {5,1,3,3,2,1,1,1}, {1,4,2,2,1,3,3,1}},
+  {{1,4,1,2,3,1,3,2}, {4,3,1,5,1,1,1,1}, {1,3,3,1,2,3,3,1}},
+  {{1,3,2,1,4,1,3,2}, {4,2,2,4,2,1,1,1}, {1,5,1,3,1,1,4,1}},
+  {{1,4,1,2,3,2,3,1}, {4,1,3,3,3,1,1,1}, {1,4,2,2,2,1,4,1}},
+  {{1,3,2,1,4,2,3,1}, {3,3,1,5,2,1,1,1}, {1,3,3,1,3,1,4,1}},
+  {{3,2,3,1,1,1,1,5}, {3,2,2,4,3,1,1,1}, {1,2,4,1,1,1,1,6}},
+  {{4,2,3,1,1,1,2,3}, {3,1,3,3,4,1,1,1}, {2,2,4,1,1,1,2,4}},
+  {{5,2,3,1,1,1,3,1}, {2,3,1,5,3,1,1,1}, {3,2,4,1,1,1,3,2}},
+  {{3,2,3,1,1,2,1,4}, {2,2,2,4,4,1,1,1}, {1,2,4,1,1,2,1,5}},
+  {{4,2,3,1,1,2,2,2}, {2,1,3,3,5,1,1,1}, {2,2,4,1,1,2,2,3}},
+  {{3,2,3,1,1,3,1,3}, {1,3,1,5,4,1,1,1}, {3,2,4,1,1,2,3,1}},
+  {{4,2,3,1,1,3,2,1}, {1,2,2,4,5,1,1,1}, {1,2,4,1,1,3,1,4}},
+  {{3,2,3,1,1,4,1,2}, {1,1,3,3,6,1,1,1}, {2,2,4,1,1,3,2,2}},
+  {{3,2,3,1,1,5,1,1}, {1,1,3,4,1,1,5,1}, {1,2,4,1,1,4,1,3}},
+  {{2,3,2,2,1,1,1,5}, {4,4,1,1,1,1,1,4}, {2,2,4,1,1,4,2,1}},
+  {{3,3,2,2,1,1,2,3}, {5,4,1,1,1,1,2,2}, {1,2,4,1,1,5,1,2}},
+  {{2,2,3,1,2,1,1,5}, {4,4,1,1,1,2,1,3}, {1,2,4,1,1,6,1,1}},
+  {{2,3,2,2,1,2,1,4}, {5,4,1,1,1,2,2,1}, {1,3,3,2,1,1,2,4}},
+  {{3,3,2,2,1,2,2,2}, {4,4,1,1,1,3,1,2}, {2,3,3,2,1,1,3,2}},
+  {{2,2,3,1,2,2,1,4}, {4,4,1,1,1,4,1,1}, {1,2,4,1,2,1,2,4}},
+  {{3,2,3,1,2,2,2,2}, {3,4,1,1,2,1,1,4}, {1,3,3,2,1,2,2,3}},
+  {{3,3,2,2,1,3,2,1}, {4,4,1,1,2,1,2,2}, {2,3,3,2,1,2,3,1}},
+  {{2,2,3,1,2,3,1,3}, {3,4,1,1,2,2,1,3}, {1,2,4,1,2,2,2,3}},
+  {{2,3,2,2,1,4,1,2}, {4,4,1,1,2,2,2,1}, {2,2,4,1,2,2,3,1}},
+  {{2,2,3,1,2,4,1,2}, {3,4,1,1,2,3,1,2}, {1,2,4,1,2,3,2,2}},
+  {{2,3,2,2,1,5,1,1}, {3,4,1,1,2,4,1,1}, {1,3,3,2,1,4,2,1}},
+  {{2,2,3,1,2,5,1,1}, {2,4,1,1,3,1,1,4}, {1,2,4,1,2,4,2,1}},
+  {{1,4,1,3,1,1,1,5}, {3,4,1,1,3,1,2,2}, {1,4,2,3,1,1,3,2}},
+  {{2,4,1,3,1,1,2,3}, {2,4,1,1,3,2,1,3}, {1,3,3,2,2,1,3,2}},
+  {{1,3,2,2,2,1,1,5}, {3,4,1,1,3,2,2,1}, {1,4,2,3,1,2,3,1}},
+  {{1,4,1,3,1,2,1,4}, {2,4,1,1,3,3,1,2}, {1,2,4,1,3,1,3,2}},
+  {{3,3,2,2,2,1,3,1}, {2,4,1,1,3,4,1,1}, {1,3,3,2,2,2,3,1}},
+  {{1,2,3,1,3,1,1,5}, {1,4,1,1,4,1,1,4}, {1,2,4,1,3,2,3,1}},
+  {{1,3,2,2,2,2,1,4}, {2,4,1,1,4,1,2,2}, {2,1,5,1,1,1,1,5}},
+  {{2,3,2,2,2,2,2,2}, {1,4,1,1,4,2,1,3}, {3,1,5,1,1,1,2,3}},
+  {{2,4,1,3,1,3,2,1}, {2,4,1,1,4,2,2,1}, {4,1,5,1,1,1,3,1}},
+  {{1,2,3,1,3,2,1,4}, {1,4,1,1,4,3,1,2}, {2,1,5,1,1,2,1,4}},
+  {{2,2,3,1,3,2,2,2}, {1,4,1,1,4,4,1,1}, {3,1,5,1,1,2,2,2}},
+  {{1,4,1,3,1,4,1,2}, {1,4,1,1,5,1,2,2}, {2,1,5,1,1,3,1,3}},
+  {{1,2,3,1,3,3,1,3}, {1,4,1,1,5,2,2,1}, {3,1,5,1,1,3,2,1}},
+  {{1,3,2,2,2,4,1,2}, {5,3,2,1,1,1,1,3}, {2,1,5,1,1,4,1,2}},
+  {{1,4,1,3,1,5,1,1}, {6,3,2,1,1,1,2,1}, {2,1,5,1,1,5,1,1}},
+  {{1,3,2,2,2,5,1,1}, {1,3,2,1,1,1,6,2}, {1,2,4,2,1,1,1,5}},
+  {{1,4,1,3,2,1,2,3}, {5,3,2,1,1,2,1,2}, {2,2,4,2,1,1,2,3}},
+  {{2,4,1,3,2,1,3,1}, {1,3,2,1,1,2,6,1}, {3,2,4,2,1,1,3,1}},
+  {{1,3,2,2,3,1,2,3}, {5,3,2,1,1,3,1,1}, {1,1,5,1,2,1,1,5}},
+  {{1,4,1,3,2,2,2,2}, {4,4,1,2,1,1,1,3}, {1,2,4,2,1,2,1,4}},
+  {{1,2,3,1,4,1,2,3}, {5,4,1,2,1,1,2,1}, {2,2,4,2,1,2,2,2}},
+  {{1,3,2,2,3,2,2,2}, {4,3,2,1,2,1,1,3}, {1,1,5,1,2,2,1,4}},
+  {{1,4,1,3,2,3,2,1}, {4,4,1,2,1,2,1,2}, {2,1,5,1,2,2,2,2}},
+  {{1,2,3,1,4,2,2,2}, {4,3,2,1,2,2,1,2}, {2,2,4,2,1,3,2,1}},
+  {{1,3,2,2,3,3,2,1}, {4,4,1,2,1,3,1,1}, {1,1,5,1,2,3,1,3}},
+  {{1,4,1,3,3,1,3,1}, {4,3,2,1,2,3,1,1}, {1,2,4,2,1,4,1,2}},
+  {{1,3,2,2,4,1,3,1}, {3,4,1,2,2,1,1,3}, {1,1,5,1,2,4,1,2}},
+  {{1,2,3,1,5,1,3,1}, {4,4,1,2,2,1,2,1}, {1,2,4,2,1,5,1,1}},
+  {{4,1,4,1,1,1,1,4}, {3,3,2,1,3,1,1,3}, {1,1,5,1,2,5,1,1}},
+  {{5,1,4,1,1,1,2,2}, {3,4,1,2,2,2,1,2}, {1,3,3,3,1,1,2,3}},
+  {{4,1,4,1,1,2,1,3}, {3,3,2,1,3,2,1,2}, {2,3,3,3,1,1,3,1}},
+  {{5,1,4,1,1,2,2,1}, {3,4,1,2,2,3,1,1}, {1,2,4,2,2,1,2,3}},
+  {{4,1,4,1,1,3,1,2}, {3,3,2,1,3,3,1,1}, {1,3,3,3,1,2,2,2}},
+  {{4,1,4,1,1,4,1,1}, {2,4,1,2,3,1,1,3}, {1,1,5,1,3,1,2,3}},
+  {{3,2,3,2,1,1,1,4}, {3,4,1,2,3,1,2,1}, {1,2,4,2,2,2,2,2}},
+  {{4,2,3,2,1,1,2,2}, {2,3,2,1,4,1,1,3}, {1,3,3,3,1,3,2,1}},
+  {{3,1,4,1,2,1,1,4}, {2,4,1,2,3,2,1,2}, {1,1,5,1,3,2,2,2}},
+  {{4,1,4,1,2,1,2,2}, {2,3,2,1,4,2,1,2}, {1,2,4,2,2,3,2,1}},
+  {{4,2,3,2,1,2,2,1}, {2,4,1,2,3,3,1,1}, {1,1,5,1,3,3,2,1}},
+  {{3,1,4,1,2,2,1,3}, {2,3,2,1,4,3,1,1}, {1,4,2,4,1,1,3,1}},
+  {{4,1,4,1,2,2,2,1}, {1,4,1,2,4,1,1,3}, {1,3,3,3,2,1,3,1}},
+  {{3,1,4,1,2,3,1,2}, {2,4,1,2,4,1,2,1}, {1,2,4,2,3,1,3,1}},
+  {{3,2,3,2,1,4,1,1}, {1,3,2,1,5,1,1,3}, {1,1,5,1,4,1,3,1}},
+  {{3,1,4,1,2,4,1,1}, {1,4,1,2,4,2,1,2}, {2,1,5,2,1,1,1,4}},
+  {{2,3,2,3,1,1,1,4}, {1,3,2,1,5,2,1,2}, {3,1,5,2,1,1,2,2}},
+  {{3,3,2,3,1,1,2,2}, {1,4,1,2,4,3,1,1}, {2,1,5,2,1,2,1,3}},
+  {{2,2,3,2,2,1,1,4}, {1,3,2,1,5,3,1,1}, {3,1,5,2,1,2,2,1}},
+  {{2,3,2,3,1,2,1,3}, {1,4,1,2,5,1,2,1}, {2,1,5,2,1,3,1,2}},
+  {{3,3,2,3,1,2,2,1}, {1,3,2,1,6,1,2,1}, {2,1,5,2,1,4,1,1}},
+  {{2,1,4,1,3,1,1,4}, {6,2,3,1,1,1,1,2}, {1,2,4,3,1,1,1,4}},
+  {{2,2,3,2,2,2,1,3}, {1,2,3,1,1,1,5,3}, {2,2,4,3,1,1,2,2}},
+  {{3,2,3,2,2,2,2,1}, {2,2,3,1,1,1,6,1}, {1,1,5,2,2,1,1,4}},
+  {{2,1,4,1,3,2,1,3}, {6,2,3,1,1,2,1,1}, {1,2,4,3,1,2,1,3}},
+  {{3,1,4,1,3,2,2,1}, {1,2,3,1,1,2,5,2}, {2,2,4,3,1,2,2,1}},
+  {{2,3,2,3,1,4,1,1}, {1,2,3,1,1,3,5,1}, {1,1,5,2,2,2,1,3}},
+  {{2,1,4,1,3,3,1,2}, {5,3,2,2,1,1,1,2}, {2,1,5,2,2,2,2,1}},
+  {{2,2,3,2,2,4,1,1}, {1,3,2,2,1,1,6,1}, {1,1,5,2,2,3,1,2}},
+  {{2,1,4,1,3,4,1,1}, {5,2,3,1,2,1,1,2}, {1,2,4,3,1,4,1,1}},
+  {{1,4,1,4,1,1,1,4}, {5,3,2,2,1,2,1,1}, {1,1,5,2,2,4,1,1}},
+  {{2,4,1,4,1,1,2,2}, {1,2,3,1,2,1,6,1}, {1,3,3,4,1,1,2,2}},
+  {{1,3,2,3,2,1,1,4}, {5,2,3,1,2,2,1,1}, {1,2,4,3,2,1,2,2}},
+  {{1,4,1,4,1,2,1,3}, {4,4,1,3,1,1,1,2}, {1,3,3,4,1,2,2,1}},
+  {{2,4,1,4,1,2,2,1}, {4,3,2,2,2,1,1,2}, {1,1,5,2,3,1,2,2}},
+  {{1,2,3,2,3,1,1,4}, {4,4,1,3,1,2,1,1}, {1,2,4,3,2,2,2,1}},
+  {{1,3,2,3,2,2,1,3}, {4,2,3,1,3,1,1,2}, {1,1,5,2,3,2,2,1}},
+  {{2,3,2,3,2,2,2,1}, {4,3,2,2,2,2,1,1}, {2,1,5,3,1,1,1,3}},
+  {{1,1,4,1,4,1,1,4}, {4,2,3,1,3,2,1,1}, {3,1,5,3,1,1,2,1}},
+  {{1,2,3,2,3,2,1,3}, {3,4,1,3,2,1,1,2}, {2,1,5,3,1,2,1,2}},
+  {{2,2,3,2,3,2,2,1}, {3,3,2,2,3,1,1,2}, {2,1,5,3,1,3,1,1}},
+  {{1,4,1,4,1,4,1,1}, {3,4,1,3,2,2,1,1}, {1,2,4,4,1,1,1,3}},
+  {{1,1,4,1,4,2,1,3}, {3,2,3,1,4,1,1,2}, {2,2,4,4,1,1,2,1}},
+  {{2,1,4,1,4,2,2,1}, {3,3,2,2,3,2,1,1}, {1,1,5,3,2,1,1,3}},
+  {{1,3,2,3,2,4,1,1}, {3,2,3,1,4,2,1,1}, {1,2,4,4,1,2,1,2}},
+  {{1,1,4,1,4,3,1,2}, {2,4,1,3,3,1,1,2}, {1,1,5,3,2,2,1,2}},
+  {{1,4,1,4,2,1,2,2}, {2,3,2,2,4,1,1,2}, {1,2,4,4,1,3,1,1}},
+  {{1,3,2,3,3,1,2,2}, {2,4,1,3,3,2,1,1}, {1,1,5,3,2,3,1,1}},
+  {{1,4,1,4,2,2,2,1}, {2,2,3,1,5,1,1,2}, {1,3,3,5,1,1,2,1}},
+  {{1,2,3,2,4,1,2,2}, {2,3,2,2,4,2,1,1}, {1,2,4,4,2,1,2,1}},
+  {{1,3,2,3,3,2,2,1}, {2,2,3,1,5,2,1,1}, {1,1,5,3,3,1,2,1}},
+  {{1,1,4,1,5,1,2,2}, {1,4,1,3,4,1,1,2}, {2,1,5,4,1,1,1,2}},
+  {{1,2,3,2,4,2,2,1}, {1,3,2,2,5,1,1,2}, {2,1,5,4,1,2,1,1}},
+  {{1,1,4,1,5,2,2,1}, {1,4,1,3,4,2,1,1}, {1,2,4,5,1,1,1,2}},
+  {{4,1,4,2,1,1,1,3}, {1,2,3,1,6,1,1,2}, {1,1,5,4,2,1,1,2}},
+  {{5,1,4,2,1,1,2,1}, {1,3,2,2,5,2,1,1}, {1,2,4,5,1,2,1,1}},
+  {{4,1,4,2,1,2,1,2}, {1,2,3,1,6,2,1,1}, {1,1,5,4,2,2,1,1}},
+  {{4,1,4,2,1,3,1,1}, {1,1,4,1,1,1,4,4}, {1,6,1,1,1,1,4,2}},
+  {{3,2,3,3,1,1,1,3}, {2,1,4,1,1,1,5,2}, {1,6,1,1,1,2,4,1}},
+  {{4,2,3,3,1,1,2,1}, {1,1,4,1,1,2,4,3}, {1,5,2,1,1,1,3,3}},
+  {{3,1,4,2,2,1,1,3}, {2,1,4,1,1,2,5,1}, {2,5,2,1,1,1,4,1}},
+  {{4,1,4,2,2,1,2,1}, {1,1,4,1,1,3,4,2}, {1,5,2,1,1,2,3,2}},
+  {{3,1,4,2,2,2,1,2}, {1,1,4,1,1,4,4,1}, {1,5,2,1,1,3,3,1}},
+  {{3,2,3,3,1,3,1,1}, {6,2,3,2,1,1,1,1}, {1,6,1,2,1,1,4,1}},
+  {{3,1,4,2,2,3,1,1}, {1,2,3,2,1,1,5,2}, {1,5,2,1,2,1,4,1}},
+  {{2,3,2,4,1,1,1,3}, {6,1,4,1,2,1,1,1}, {1,4,3,1,1,1,2,4}},
+  {{3,3,2,4,1,1,2,1}, {1,1,4,1,2,1,5,2}, {2,4,3,1,1,1,3,2}},
+  {{2,2,3,3,2,1,1,3}, {1,2,3,2,1,2,5,1}, {1,4,3,1,1,2,2,3}},
+  {{2,3,2,4,1,2,1,2}, {1,1,4,1,2,2,5,1}, {2,4,3,1,1,2,3,1}},
+  {{2,1,4,2,3,1,1,3}, {5,3,2,3,1,1,1,1}, {1,4,3,1,1,3,2,2}},
+  {{2,2,3,3,2,2,1,2}, {5,2,3,2,2,1,1,1}, {1,4,3,1,1,4,2,1}},
+  {{2,3,2,4,1,3,1,1}, {5,1,4,1,3,1,1,1}, {1,5,2,2,1,1,3,2}},
+  {{2,1,4,2,3,2,1,2}, {4,4,1,4,1,1,1,1}, {1,4,3,1,2,1,3,2}},
+  {{2,2,3,3,2,3,1,1}, {4,3,2,3,2,1,1,1}, {1,5,2,2,1,2,3,1}},
+  {{2,1,4,2,3,3,1,1}, {4,2,3,2,3,1,1,1}, {1,4,3,1,2,2,3,1}},
+  {{1,4,1,5,1,1,1,3}, {4,1,4,1,4,1,1,1}, {1,3,4,1,1,1,1,5}},
+  {{2,4,1,5,1,1,2,1}, {3,4,1,4,2,1,1,1}, {2,3,4,1,1,1,2,3}},
+  {{1,3,2,4,2,1,1,3}, {3,3,2,3,3,1,1,1}, {3,3,4,1,1,1,3,1}},
+  {{2,3,2,4,2,1,2,1}, {3,2,3,2,4,1,1,1}, {1,3,4,1,1,2,1,4}},
+  {{1,2,3,3,3,1,1,3}, {3,1,4,1,5,1,1,1}, {2,3,4,1,1,2,2,2}},
+  {{1,3,2,4,2,2,1,2}, {2,4,1,4,3,1,1,1}, {1,3,4,1,1,3,1,3}},
+  {{1,4,1,5,1,3,1,1}, {2,3,2,3,4,1,1,1}, {2,3,4,1,1,3,2,1}},
+  {{1,1,4,2,4,1,1,3}, {2,2,3,2,5,1,1,1}, {1,3,4,1,1,4,1,2}},
+  {{1,2,3,3,3,2,1,2}, {2,1,4,1,6,1,1,1}, {1,3,4,1,1,5,1,1}},
+  {{1,3,2,4,2,3,1,1}, {1,4,1,4,4,1,1,1}, {1,4,3,2,1,1,2,3}},
+  {{1,1,4,2,4,2,1,2}, {1,3,2,3,5,1,1,1}, {2,4,3,2,1,1,3,1}},
+  {{1,2,3,3,3,3,1,1}, {1,2,3,2,6,1,1,1}, {1,3,4,1,2,1,2,3}},
+  {{1,1,4,2,4,3,1,1}, {1,1,4,2,1,1,4,3}, {2,3,4,1,2,1,3,1}},
+  {{1,3,2,4,3,1,2,1}, {2,1,4,2,1,1,5,1}, {1,3,4,1,2,2,2,2}},
+  {{1,1,4,2,5,1,2,1}, {1,1,4,2,1,2,4,2}, {1,4,3,2,1,3,2,1}},
+  {{4,1,4,3,1,2,1,1}, {1,1,4,2,1,3,4,1}, {1,3,4,1,2,3,2,1}},
+  {{3,1,4,3,2,1,1,2}, {1,2,3,3,1,1,5,1}, {1,5,2,3,1,1,3,1}},
+  {{3,1,4,3,2,2,1,1}, {1,1,4,2,2,1,5,1}, {1,4,3,2,2,1,3,1}},
+  {{2,2,3,4,2,1,1,2}, {1,1,4,3,1,1,4,2}, {1,3,4,1,3,1,3,1}},
+  {{2,1,4,3,3,1,1,2}, {1,1,4,3,1,2,4,1}, {2,2,5,1,1,1,1,4}},
+  {{2,1,4,3,3,2,1,1}, {1,1,4,4,1,1,4,1}, {3,2,5,1,1,1,2,2}},
+  {{1,3,2,5,2,1,1,2}, {4,5,1,1,1,1,1,3}, {2,2,5,1,1,2,1,3}},
+  {{1,2,3,4,3,1,1,2}, {4,5,1,1,1,2,1,2}, {3,2,5,1,1,2,2,1}},
+  {{1,1,4,3,4,1,1,2}, {4,5,1,1,1,3,1,1}, {2,2,5,1,1,3,1,2}},
+  {{1,1,4,3,4,2,1,1}, {3,5,1,1,2,1,1,3}, {2,2,5,1,1,4,1,1}},
+  {{1,5,1,1,1,1,1,6}, {4,5,1,1,2,1,2,1}, {1,3,4,2,1,1,1,4}},
+  {{1,5,1,1,1,2,1,5}, {3,5,1,1,2,2,1,2}, {2,3,4,2,1,1,2,2}},
+  {{2,5,1,1,1,2,2,3}, {3,5,1,1,2,3,1,1}, {1,2,5,1,2,1,1,4}},
+  {{1,5,1,1,1,3,1,4}, {2,5,1,1,3,1,1,3}, {2,2,5,1,2,1,2,2}},
+  {{1,5,1,1,1,4,1,3}, {3,5,1,1,3,1,2,1}, {2,3,4,2,1,2,2,1}},
+  {{1,5,1,1,1,5,1,2}, {2,5,1,1,3,2,1,2}, {1,2,5,1,2,2,1,3}},
+  {{1,5,1,1,2,1,2,4}, {2,5,1,1,3,3,1,1}, {1,3,4,2,1,3,1,2}},
+  {{1,5,1,1,2,2,2,3}, {1,5,1,1,4,1,1,3}, {1,2,5,1,2,3,1,2}},
+  {{1,5,1,1,2,3,2,2}, {2,5,1,1,4,1,2,1}, {1,3,4,2,1,4,1,1}},
+  {{1,5,1,1,2,4,2,1}, {1,5,1,1,4,2,1,2}, {1,2,5,1,2,4,1,1}},
+  {{1,5,1,1,3,1,3,2}, {1,5,1,1,4,3,1,1}, {1,4,3,3,1,1,2,2}},
+  {{1,5,1,1,3,2,3,1}, {1,5,1,1,5,1,2,1}, {1,3,4,2,2,1,2,2}},
+  {{2,4,2,1,1,1,1,5}, {5,4,2,1,1,1,1,2}, {1,4,3,3,1,2,2,1}},
+  {{2,4,2,1,1,2,1,4}, {1,4,2,1,1,1,6,1}, {1,2,5,1,3,1,2,2}},
+  {{3,4,2,1,1,2,2,2}, {5,4,2,1,1,2,1,1}, {1,3,4,2,2,2,2,1}},
+  {{2,4,2,1,1,3,1,3}, {4,5,1,2,1,1,1,2}, {1,2,5,1,3,2,2,1}},
+  {{3,4,2,1,1,3,2,1}, {4,4,2,1,2,1,1,2}, {3,1,6,1,1,1,1,3}},
+  {{2,4,2,1,1,4,1,2}, {4,5,1,2,1,2,1,1}, {4,1,6,1,1,1,2,1}},
+  {{2,4,2,1,1,5,1,1}, {4,4,2,1,2,2,1,1}, {3,1,6,1,1,2,1,2}},
+  {{1,5,1,2,1,1,1,5}, {3,5,1,2,2,1,1,2}, {3,1,6,1,1,3,1,1}},
+  {{2,5,1,2,1,1,2,3}, {3,4,2,1,3,1,1,2}, {2,2,5,2,1,1,1,3}},
+  {{1,4,2,1,2,1,1,5}, {3,5,1,2,2,2,1,1}, {3,2,5,2,1,1,2,1}},
+  {{2,4,2,1,2,1,2,3}, {3,4,2,1,3,2,1,1}, {2,1,6,1,2,1,1,3}},
+  {{2,5,1,2,1,2,2,2}, {2,5,1,2,3,1,1,2}, {2,2,5,2,1,2,1,2}},
+  {{1,4,2,1,2,2,1,4}, {2,4,2,1,4,1,1,2}, {2,1,6,1,2,2,1,2}},
+  {{2,4,2,1,2,2,2,2}, {2,5,1,2,3,2,1,1}, {2,2,5,2,1,3,1,1}},
+  {{1,4,2,1,2,3,1,3}, {2,4,2,1,4,2,1,1}, {2,1,6,1,2,3,1,1}},
+  {{2,4,2,1,2,3,2,1}, {1,5,1,2,4,1,1,2}, {1,3,4,3,1,1,1,3}},
+  {{1,4,2,1,2,4,1,2}, {1,4,2,1,5,1,1,2}, {2,3,4,3,1,1,2,1}},
+  {{1,5,1,2,1,5,1,1}, {1,5,1,2,4,2,1,1}, {1,2,5,2,2,1,1,3}},
+  {{1,4,2,1,2,5,1,1}, {1,4,2,1,5,2,1,1}, {1,3,4,3,1,2,1,2}},
+  {{1,5,1,2,2,1,2,3}, {6,3,3,1,1,1,1,1}, {1,1,6,1,3,1,1,3}},
+  {{2,5,1,2,2,1,3,1}, {1,3,3,1,1,1,5,2}, {1,2,5,2,2,2,1,2}},
+  {{1,4,2,1,3,1,2,3}, {1,3,3,1,1,2,5,1}, {1,3,4,3,1,3,1,1}},
+  {{2,4,2,1,3,1,3,1}, {5,4,2,2,1,1,1,1}, {1,1,6,1,3,2,1,2}},
+  {{1,4,2,1,3,2,2,2}, {5,3,3,1,2,1,1,1}, {1,2,5,2,2,3,1,1}},
+  {{1,5,1,2,2,3,2,1}, {4,5,1,3,1,1,1,1}, {1,1,6,1,3,3,1,1}},
+  {{1,4,2,1,3,3,2,1}, {4,4,2,2,2,1,1,1}, {1,4,3,4,1,1,2,1}},
+  {{1,5,1,2,3,1,3,1}, {4,3,3,1,3,1,1,1}, {1,3,4,3,2,1,2,1}},
+  {{1,4,2,1,4,1,3,1}, {3,5,1,3,2,1,1,1}, {1,2,5,2,3,1,2,1}},
+  {{3,3,3,1,1,1,1,4}, {3,4,2,2,3,1,1,1}, {1,1,6,1,4,1,2,1}},
+  {{3,3,3,1,1,2,1,3}, {3,3,3,1,4,1,1,1}, {3,1,6,2,1,1,1,2}},
+  {{3,3,3,1,1,3,1,2}, {2,5,1,3,3,1,1,1}, {3,1,6,2,1,2,1,1}},
+  {{3,3,3,1,1,4,1,1}, {2,4,2,2,4,1,1,1}, {2,2,5,3,1,1,1,2}},
+  {{2,4,2,2,1,1,1,4}, {2,3,3,1,5,1,1,1}, {2,1,6,2,2,1,1,2}},
+  {{2,3,3,1,2,1,1,4}, {1,5,1,3,4,1,1,1}, {2,2,5,3,1,2,1,1}},
+  {{3,3,3,1,2,1,2,2}, {1,4,2,2,5,1,1,1}, {2,1,6,2,2,2,1,1}},
+  {{3,4,2,2,1,2,2,1}, {1,3,3,1,6,1,1,1}, {1,3,4,4,1,1,1,2}},
+  {{2,3,3,1,2,2,1,3}, {1,2,4,1,1,1,4,3}, {1,2,5,3,2,1,1,2}},
+  {{3,3,3,1,2,2,2,1}, {2,2,4,1,1,1,5,1}, {1,3,4,4,1,2,1,1}},
+  {{2,3,3,1,2,3,1,2}, {1,2,4,1,1,2,4,2}, {1,1,6,2,3,1,1,2}},
+  {{2,4,2,2,1,4,1,1}, {1,2,4,1,1,3,4,1}, {1,2,5,3,2,2,1,1}},
+  {{2,3,3,1,2,4,1,1}, {1,3,3,2,1,1,5,1}, {1,1,6,2,3,2,1,1}},
+  {{1,5,1,3,1,1,1,4}, {1,2,4,1,2,1,5,1}, {3,1,6,3,1,1,1,1}},
+  {{1,4,2,2,2,1,1,4}, {1,1,5,1,1,1,3,4}, {2,2,5,4,1,1,1,1}},
+  {{1,5,1,3,1,2,1,3}, {2,1,5,1,1,1,4,2}, {2,1,6,3,2,1,1,1}},
+  {{2,5,1,3,1,2,2,1}, {1,1,5,1,1,2,3,3}, {1,3,4,5,1,1,1,1}},
+  {{1,3,3,1,3,1,1,4}, {2,1,5,1,1,2,4,1}, {1,2,5,4,2,1,1,1}},
+  {{1,4,2,2,2,2,1,3}, {1,1,5,1,1,3,3,2}, {1,1,6,3,3,1,1,1}},
+  {{1,5,1,3,1,3,1,2}, {1,1,5,1,1,4,3,1}, {1,6,2,1,1,1,3,2}},
+  {{1,3,3,1,3,2,1,3}, {1,2,4,2,1,1,4,2}, {1,6,2,1,1,2,3,1}},
+  {{1,4,2,2,2,3,1,2}, {1,1,5,1,2,1,4,2}, {1,5,3,1,1,1,2,3}},
+  {{1,5,1,3,1,4,1,1}, {1,2,4,2,1,2,4,1}, {2,5,3,1,1,1,3,1}},
+  {{1,3,3,1,3,3,1,2}, {1,1,5,1,2,2,4,1}, {1,5,3,1,1,2,2,2}},
+  {{1,4,2,2,2,4,1,1}, {1,1,5,2,1,1,3,3}, {1,5,3,1,1,3,2,1}},
+  {{1,5,1,3,2,1,2,2}, {2,1,5,2,1,1,4,1}, {1,6,2,2,1,1,3,1}},
+  {{1,4,2,2,3,1,2,2}, {1,1,5,2,1,2,3,2}, {1,5,3,1,2,1,3,1}},
+  {{1,5,1,3,2,2,2,1}, {1,1,5,2,1,3,3,1}, {1,4,4,1,1,1,1,4}},
+  {{1,3,3,1,4,1,2,2}, {1,2,4,3,1,1,4,1}, {2,4,4,1,1,1,2,2}},
+  {{1,4,2,2,3,2,2,1}, {1,1,5,2,2,1,4,1}, {1,4,4,1,1,2,1,3}},
+  {{1,3,3,1,4,2,2,1}, {1,1,5,3,1,1,3,2}, {2,4,4,1,1,2,2,1}},
+  {{4,2,4,1,1,1,1,3}, {1,1,5,3,1,2,3,1}, {1,4,4,1,1,3,1,2}},
+  {{4,2,4,1,1,2,1,2}, {1,1,5,4,1,1,3,1}, {1,4,4,1,1,4,1,1}},
+  {{4,2,4,1,1,3,1,1}, {3,6,1,1,2,1,1,2}, {1,5,3,2,1,1,2,2}},
+  {{3,3,3,2,1,1,1,3}, {3,6,1,1,2,2,1,1}, {1,4,4,1,2,1,2,2}},
+  {{3,2,4,1,2,1,1,3}, {2,6,1,1,3,1,1,2}, {1,5,3,2,1,2,2,1}},
+  {{4,2,4,1,2,1,2,1}, {2,6,1,1,3,2,1,1}, {1,4,4,1,2,2,2,1}},
+  {{3,2,4,1,2,2,1,2}, {1,6,1,1,4,1,1,2}, {2,3,5,1,1,1,1,3}},
+  {{3,3,3,2,1,3,1,1}, {1,6,1,1,4,2,1,1}, {3,3,5,1,1,1,2,1}},
+  {{3,2,4,1,2,3,1,1}, {4,5,2,1,2,1,1,1}, {2,3,5,1,1,2,1,2}},
+  {{2,4,2,3,1,1,1,3}, {3,6,1,2,2,1,1,1}, {2,3,5,1,1,3,1,1}},
+  {{3,4,2,3,1,1,2,1}, {3,5,2,1,3,1,1,1}, {1,4,4,2,1,1,1,3}},
+  {{2,3,3,2,2,1,1,3}, {2,6,1,2,3,1,1,1}, {2,4,4,2,1,1,2,1}},
+  {{3,3,3,2,2,1,2,1}, {2,5,2,1,4,1,1,1}, {1,3,5,1,2,1,1,3}},
+  {{2,2,4,1,3,1,1,3}, {1,6,1,2,4,1,1,1}, {2,3,5,1,2,1,2,1}},
+  {{2,3,3,2,2,2,1,2}, {1,5,2,1,5,1,1,1}, {1,3,5,1,2,2,1,2}},
+  {{2,4,2,3,1,3,1,1}, {1,4,3,1,1,1,5,1}, {1,4,4,2,1,3,1,1}},
+  {{2,2,4,1,3,2,1,2}, {1,3,4,1,1,1,4,2}, {1,3,5,1,2,3,1,1}},
+  {{2,3,3,2,2,3,1,1}, {1,3,4,1,1,2,4,1}, {1,5,3,3,1,1,2,1}},
+  {{2,2,4,1,3,3,1,1}, {1,2,5,1,1,1,3,3}, {1,4,4,2,2,1,2,1}},
+  {{1,5,1,4,1,1,1,3}, {2,2,5,1,1,1,4,1}, {1,3,5,1,3,1,2,1}},
+  {{2,5,1,4,1,1,2,1}, {1,2,5,1,1,2,3,2}, {3,2,6,1,1,1,1,2}},
+  {{1,4,2,3,2,1,1,3}, {1,2,5,1,1,3,3,1}, {3,2,6,1,1,2,1,1}},
+  {{2,4,2,3,2,1,2,1}, {1,3,4,2,1,1,4,1}, {2,3,5,2,1,1,1,2}},
+  {{1,3,3,2,3,1,1,3}, {1,2,5,1,2,1,4,1}, {2,2,6,1,2,1,1,2}},
+  {{1,4,2,3,2,2,1,2}, {1,1,6,1,1,1,2,4}, {2,3,5,2,1,2,1,1}},
+  {{1,5,1,4,1,3,1,1}, {2,1,6,1,1,1,3,2}, {2,2,6,1,2,2,1,1}},
+  {{1,2,4,1,4,1,1,3}, {1,1,6,1,1,2,2,3}, {1,4,4,3,1,1,1,2}},
+  {{1,3,3,2,3,2,1,2}, {2,1,6,1,1,2,3,1}, {1,3,5,2,2,1,1,2}},
+  {{1,4,2,3,2,3,1,1}, {1,1,6,1,1,3,2,2}, {1,4,4,3,1,2,1,1}},
+  {{1,2,4,1,4,2,1,2}, {1,1,6,1,1,4,2,1}, {1,2,6,1,3,1,1,2}},
+  {{1,3,3,2,3,3,1,1}, {1,2,5,2,1,1,3,2}, {1,3,5,2,2,2,1,1}},
+  {{1,5,1,4,2,1,2,1}, {1,1,6,1,2,1,3,2}, {1,2,6,1,3,2,1,1}},
+  {{1,4,2,3,3,1,2,1}, {1,2,5,2,1,2,3,1}, {3,2,6,2,1,1,1,1}},
+  {{1,3,3,2,4,1,2,1}, {1,1,6,1,2,2,3,1}, {2,3,5,3,1,1,1,1}},
+  {{1,2,4,1,5,1,2,1}, {1,1,6,2,1,1,2,3}, {2,2,6,2,2,1,1,1}},
+  {{5,1,5,1,1,1,1,2}, {2,1,6,2,1,1,3,1}, {1,4,4,4,1,1,1,1}},
+  {{5,1,5,1,1,2,1,1}, {1,1,6,2,1,2,2,2}, {1,3,5,3,2,1,1,1}},
+  {{4,2,4,2,1,1,1,2}, {1,1,6,2,1,3,2,1}, {1,2,6,2,3,1,1,1}},
+  {{4,1,5,1,2,1,1,2}, {1,2,5,3,1,1,3,1}, {1,6,3,1,1,1,2,2}},
+  {{4,2,4,2,1,2,1,1}, {1,1,6,2,2,1,3,1}, {1,6,3,1,1,2,2,1}},
+  {{4,1,5,1,2,2,1,1}, {1,1,6,3,1,1,2,2}, {1,5,4,1,1,1,1,3}},
+  {{3,3,3,3,1,1,1,2}, {1,1,6,3,1,2,2,1}, {2,5,4,1,1,1,2,1}},
+  {{3,2,4,2,2,1,1,2}, {1,4,4,1,1,1,4,1}, {1,5,4,1,1,2,1,2}},
+  {{3,3,3,3,1,2,1,1}, {1,3,5,1,1,1,3,2}, {1,5,4,1,1,3,1,1}},
+  {{3,1,5,1,3,1,1,2}, {1,3,5,1,1,2,3,1}, {1,6,3,2,1,1,2,1}},
+  {{3,2,4,2,2,2,1,1}, {1,2,6,1,1,1,2,3}, {1,5,4,1,2,1,2,1}},
+  {{3,1,5,1,3,2,1,1}, {2,2,6,1,1,1,3,1}, {2,4,5,1,1,1,1,2}},
+  {{2,4,2,4,1,1,1,2}, {1,2,6,1,1,2,2,2}, {2,4,5,1,1,2,1,1}},
+  {{2,3,3,3,2,1,1,2}, {1,2,6,1,1,3,2,1}, {1,5,4,2,1,1,1,2}},
+  {{2,4,2,4,1,2,1,1}, {1,3,5,2,1,1,3,1}, {1,4,5,1,2,1,1,2}},
+  {{2,2,4,2,3,1,1,2}, {1,2,6,1,2,1,3,1}, {1,5,4,2,1,2,1,1}},
+  {{2,3,3,3,2,2,1,1}, {1,2,6,2,1,1,2,2}, {1,4,5,1,2,2,1,1}},
+  {{2,1,5,1,4,1,1,2}, {1,2,6,2,1,2,2,1}, {3,3,6,1,1,1,1,1}}
+};
+
+//------------------------------------------------------------------------
+
+static int makeDataCodewords(GString *value, int *codewords);
+static int countNumeric(GString *value, int start);
+static int countText(GString *value, int start);
+static int countBinary(GString *value, int start);
+static GBool makeNumericCodewords(GString *value, int start, int n,
+				  int *codewords, int &codewordIdx);
+static int divMod900(int *d, int n);
+static GBool makeByteCodewords(GString *value, int start, int n,
+			       int *codewords, int &codewordIdx);
+static GBool makeTextCodewords(GString *value, int start, int n,
+			       int *codewords, int &codewordIdx);
+static GBool appendTextHalfSymbol(int *codewords, int &codewordIdx,
+				  int halfSymbol, int &prevHalfSymbol);
+static GBool appendDataCodeword(int *codewords, int &codewordIdx,
+				int codeword);
+static void makeErrorCorrectionCodewords(int errorCorrectionLevel,
+					 int *codewords, int length);
+static void drawBarcode(int *codewords, int totalLength,
+			int nRows, int nCols,
+			int errorCorrectionLevel,
+			double moduleWidth, double moduleHeight,
+			double fieldWidth, double fieldHeight,
+			GString *appearBuf);
+static void drawPattern(int &x, int y, char *pattern, int length,
+			GString *appearBuf);
+
+//------------------------------------------------------------------------
+
+GBool drawPDF417Barcode(double fieldWidth, double fieldHeight,
+			double moduleWidth, double moduleHeight,
+			int errorCorrectionLevel, GString *value,
+			GString *appearBuf) {
+  int codewords[maxDataCodewords + maxErrorCorrectionCodewords];
+
+  if (moduleWidth <= 0 || moduleHeight <= 0) {
+    error(errSyntaxError, -1, "Invalid module size in PDF417 barcode");
+    return gFalse;
+  }
+
+  // each row contains:
+  // - left quiet zone (2 modules, minimum)
+  // - start code (17 modules)
+  // - left row indicator (17 modules)
+  // - nCols codewords (17 modules each)
+  // - right row indicator (17 modules)
+  // - stop code (18 modules)
+  // - right quiet zone (2 modules, minimum)
+  // total = 73 + nCols * 17
+  int nCols = (int)floor((fieldWidth / moduleWidth - 73) / 17);
+  if (nCols < 1) {
+    error(errSyntaxError, -1, "Invalid field size for PDF417 barcode");
+    return gFalse;
+  }
+  if (nCols > 30) {
+    nCols = 30;
+  }
+
+  int nDataCodewords = makeDataCodewords(value, codewords);
+  if (nDataCodewords == maxDataCodewords) {
+    error(errSyntaxError, -1, "Too many codewords in PDF417 barcode");
+    return gFalse;
+  }
+
+  int nErrorCorrectionCodewords = 1 << (errorCorrectionLevel + 1);
+
+  // total codewords = 1 + nDataCodewords + nPadCodewords
+  //                   + nErrorCorrectionCodewords
+  int nRows = (1 + nDataCodewords + nErrorCorrectionCodewords + (nCols - 1))
+              / nCols;
+  if (nRows < 3) {
+    nRows = 3;
+  }
+  if (nRows > 90) {
+    error(errSyntaxError, -1, "Too many rows in PDF417 barcode");
+    return gFalse;
+  }
+  int nPadCodewords = nRows * nCols
+                      - (1 + nDataCodewords + nErrorCorrectionCodewords);
+  int length = 1 + nDataCodewords + nPadCodewords;
+  if (length > maxDataCodewords) {
+    error(errSyntaxError, -1, "Too many codewords in PDF417 barcode");
+    return gFalse;
+  }
+  codewords[0] = length;
+  for (int i = 1 + nDataCodewords; i < length; ++i) {
+    codewords[i] = 900;
+  }
+
+  makeErrorCorrectionCodewords(errorCorrectionLevel, codewords, length);
+
+  // we need at least 3 modules of vertical quiet space above and below
+  // (the spec says 2, but Adobe seems to use 3)
+  if (nRows * moduleHeight + 6 * moduleWidth > fieldHeight) {
+    error(errSyntaxError, -1, "Too many rows in PDF417 barcode");
+    return gFalse;
+  }
+
+  // Adobe adjusts the module height to fill the available space
+  double moduleHeight2 = (fieldHeight - 6 * moduleWidth) / nRows;
+
+  drawBarcode(codewords, length + nErrorCorrectionCodewords,
+	      nRows, nCols, errorCorrectionLevel,
+	      moduleWidth, moduleHeight2, fieldWidth, fieldHeight,
+	      appearBuf);
+
+  return gTrue;
+}
+
+// Generate up to maxDataCodewords-1 codewords in codewords[1 .. m],
+// leaving codewords[0] unused.  Returns the number of generated
+// codewords (m), or maxDataCodewords if there are too many to fit.
+static int makeDataCodewords(GString *value, int *codewords) {
+  GBool textMode = gTrue;
+  int codewordIdx = 1;
+  int valueIdx = 0;
+  while (valueIdx < value->getLength()) {
+
+    int nNumeric = countNumeric(value, valueIdx);
+    if (nNumeric >= 13) {
+      if (!appendDataCodeword(codewords, codewordIdx, numericModeLatch) ||
+	  !makeNumericCodewords(value, valueIdx, nNumeric,
+				codewords, codewordIdx)) {
+	return maxDataCodewords;
+      }
+      valueIdx += nNumeric;
+      textMode = gFalse;
+
+    } else {
+      int nText = countText(value, valueIdx);
+      if (nText >= 5) {
+	if (!textMode) {
+	  if (!appendDataCodeword(codewords, codewordIdx, textModeLatch)) {
+	    return maxDataCodewords;
+	  }
+	}
+	if (!makeTextCodewords(value, valueIdx, nText,
+			       codewords, codewordIdx)) {
+	  return maxDataCodewords;
+	}
+	valueIdx += nText;
+	textMode = gTrue;
+
+      } else {
+	int nBinary = countBinary(value, valueIdx);
+	//~ this doesn't currently use byte mode shift when nBinary==1
+	//~   because we don't track the text submode (which is needed
+	//~   because we'll return to that submode after the byte shift)
+	int code = (nBinary % 6 == 0) ? byteModeLatchMult6
+	                              : byteModeLatchNonMult6;
+	if (!appendDataCodeword(codewords, codewordIdx, code) ||
+	    !makeByteCodewords(value, valueIdx, nBinary,
+			       codewords, codewordIdx)) {
+	  return maxDataCodewords;
+	}
+	valueIdx += nBinary;
+	textMode = gFalse;
+      }
+    }
+  }
+
+  return codewordIdx - 1;
+}
+
+static int countNumeric(GString *value, int start) {
+  int n = 0;
+  for (int i = start; i < value->getLength(); ++i) {
+    char c = value->getChar(i);
+    if (!(c >= '0' && c <= '9')) {
+      break;
+    }
+    ++n;
+  }
+  return n;
+}
+
+static int countText(GString *value, int start) {
+  int n = 0;
+  for (int i = start; i < value->getLength(); ++i) {
+    char c = value->getChar(i);
+    if ((c & 0x80) ||
+	(textCompaction[(int)c][0] == 30 &&
+	 textCompaction[(int)c][1] == 30 &&
+	 textCompaction[(int)c][2] == 30 &&
+	 textCompaction[(int)c][3] == 30) ||
+	countNumeric(value, i) >= 13) {
+      break;
+    }
+    ++n;
+  }
+  return n;
+}
+
+static int countBinary(GString *value, int start) {
+  int n = 0;
+  for (int i = start; i < value->getLength(); ++i) {
+    if (countNumeric(value, i) >= 13 ||
+	countText(value, i) >= 5) {
+      break;
+    }
+    ++n;
+  }
+  return n;
+}
+
+static GBool makeNumericCodewords(GString *value, int start, int n,
+				  int *codewords, int &codewordIdx) {
+  for (int i = 0; i < n; i += 44) {
+    int nInDigits = n - i;
+    if (nInDigits > 44) {
+      nInDigits = 44;
+    }
+    int inDigits[45];
+    inDigits[0] = 1;
+    for (int j = 0; j < nInDigits; ++j) {
+      inDigits[j+1] = value->getChar(start + i + j) - '0';
+    }
+    int nOutDigits = 1 + nInDigits / 3;
+    int outDigits[15];
+    for (int j = 0; j < nOutDigits; ++j) {
+      outDigits[nOutDigits - 1 - j] = divMod900(inDigits, nInDigits + 1);
+    }
+    for (int j = 0; j < nOutDigits; ++j) {
+      if (!appendDataCodeword(codewords, codewordIdx, outDigits[j])) {
+	return gFalse;
+      }
+    }
+  }
+  return gTrue;
+}
+
+// Given x = sum(i = 0..n-1, d[i] * 10^(n-1-i))
+// Compute x' = x / 900 and return x % 900.
+static int divMod900(int *d, int n) {
+  int r = 0;
+  for (int i = 0; i < n; ++i) {
+    int dd = r * 10 + d[i];
+    d[i] = dd / 900;
+    r = dd % 900;
+  }
+  return r;
+}
+
+static GBool makeByteCodewords(GString *value, int start, int n,
+			       int *codewords, int &codewordIdx) {
+  int i;
+  for (i = 0; i <= n - 6; i += 6) {
+    long long in = 0;
+    for (int j = 0; j < 6; ++j) {
+      in = (in << 8) | (value->getChar(start + i + j) & 0xff);
+    }
+    int outCodes[5];
+    for (int j = 4; j >= 0; --j) {
+      outCodes[j] = (int)(in % 900);
+      in /= 900;
+    }
+    for (int j = 0; j < 4; ++j) {
+      if (!appendDataCodeword(codewords, codewordIdx, outCodes[j])) {
+	return gFalse;
+      }
+    }
+  }
+  for (; i < n; ++i) {
+    if (!appendDataCodeword(codewords, codewordIdx,
+			    value->getChar(start + i) & 0xff)) {
+      return gFalse;
+    }
+  }
+  return gTrue;
+}
+
+static GBool makeTextCodewords(GString *value, int start, int n,
+			       int *codewords, int &codewordIdx) {
+  int submode = textSubmodeAlpha;
+  int prevSubmode = textSubmodeAlpha;
+  int nextSubmode;
+  int prevHalfSymbol = 30;
+  int valueIdx = start;
+  while (valueIdx < start + n) {
+    int c = value->getChar(valueIdx) & 0x7f;
+    nextSubmode = submode;
+    switch (submode) {
+    case textSubmodeAlpha:
+      if (textCompaction[c][textSubmodeAlpha] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textCompaction[c][textSubmodeAlpha],
+				  prevHalfSymbol)) {
+	  return gFalse;
+	}
+	++valueIdx;
+      } else if (textCompaction[c][textSubmodeLower] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textAlphaLowerLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeLower;
+      } else if (textCompaction[c][textSubmodeMixed] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textAlphaMixedLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeMixed;
+      } else if (textCompaction[c][textSubmodePunc] < 30) {
+	if (valueIdx < start + n - 2 &&
+	    textCompaction[value->getChar(valueIdx + 1) & 0x7f]
+	                  [textSubmodePunc] < 30 &&
+	    textCompaction[value->getChar(valueIdx + 2) & 0x7f]
+	                  [textSubmodePunc] < 30) {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textAlphaMixedLatch, prevHalfSymbol) ||
+	      !appendTextHalfSymbol(codewords, codewordIdx,
+				    textMixedPuncLatch, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodePunc;
+	} else {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textAlphaPuncShift, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodePuncShift;
+	}
+      } else {
+	// this shouldn't happen
+	++valueIdx;
+      }
+      break;
+    case textSubmodeAlphaShift:
+      if (textCompaction[c][textSubmodeAlpha] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textCompaction[c][textSubmodeAlpha],
+				  prevHalfSymbol)) {
+	  return gFalse;
+	}
+	++valueIdx;
+      } else {
+	// this shouldn't happen
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  0, prevHalfSymbol)) {
+	  return gFalse;
+	}
+      }
+      nextSubmode = prevSubmode;
+      break;
+    case textSubmodeLower:
+      if (textCompaction[c][textSubmodeAlpha] < 30) {
+	if (valueIdx < start + n - 2 &&
+	    textCompaction[value->getChar(valueIdx + 1) & 0x7f]
+	                  [textSubmodeAlpha] < 30 &&
+	    textCompaction[value->getChar(valueIdx + 2) & 0x7f]
+	                  [textSubmodeAlpha] < 30) {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textLowerMixedLatch, prevHalfSymbol) ||
+	      !appendTextHalfSymbol(codewords, codewordIdx,
+				    textMixedAlphaLatch, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodeAlpha;
+	} else {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textLowerAlphaShift, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodeAlphaShift;
+	}
+      } else if (textCompaction[c][textSubmodeLower] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textCompaction[c][textSubmodeLower],
+				  prevHalfSymbol)) {
+	  return gFalse;
+	}
+	++valueIdx;
+      } else if (textCompaction[c][textSubmodeMixed] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textLowerMixedLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeMixed;
+      } else if (textCompaction[c][textSubmodePunc] < 30) {
+	if (valueIdx < start + n - 2 &&
+	    textCompaction[value->getChar(valueIdx + 1) & 0x7f]
+	                  [textSubmodePunc] < 30 &&
+	    textCompaction[value->getChar(valueIdx + 2) & 0x7f]
+	                  [textSubmodePunc] < 30) {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textLowerMixedLatch, prevHalfSymbol) ||
+	      !appendTextHalfSymbol(codewords, codewordIdx,
+				    textMixedPuncLatch, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodePunc;
+	} else {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textLowerPuncShift, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodePuncShift;
+	}
+      } else {
+	// this shouldn't happen
+	++valueIdx;
+      }
+      break;
+    case textSubmodeMixed:
+      if (textCompaction[c][textSubmodeAlpha] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textMixedAlphaLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeAlpha;
+      } else if (textCompaction[c][textSubmodeLower] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textMixedLowerLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeLower;
+      } else if (textCompaction[c][textSubmodeMixed] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textCompaction[c][textSubmodeMixed],
+				  prevHalfSymbol)) {
+	  return gFalse;
+	}
+	++valueIdx;
+      } else if (textCompaction[c][textSubmodePunc] < 30) {
+	if (valueIdx < start + n - 1 &&
+	    textCompaction[value->getChar(valueIdx + 1) & 0x7f]
+	                  [textSubmodePunc] < 30) {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textMixedPuncLatch, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodePunc;
+	} else {
+	  if (!appendTextHalfSymbol(codewords, codewordIdx,
+				    textMixedPuncShift, prevHalfSymbol)) {
+	    return gFalse;
+	  }
+	  nextSubmode = textSubmodePuncShift;
+	}
+      } else {
+	// this shouldn't happen
+	++valueIdx;
+      }
+      break;
+    case textSubmodePunc:
+      if (textCompaction[c][textSubmodeAlpha] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textPuncAlphaLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeAlpha;
+      } else if (textCompaction[c][textSubmodeLower] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textPuncAlphaLatch, prevHalfSymbol) ||
+	    !appendTextHalfSymbol(codewords, codewordIdx,
+				  textAlphaLowerLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeLower;
+      } else if (textCompaction[c][textSubmodeMixed] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textPuncAlphaLatch, prevHalfSymbol) ||
+	    !appendTextHalfSymbol(codewords, codewordIdx,
+				  textAlphaMixedLatch, prevHalfSymbol)) {
+	  return gFalse;
+	}
+	nextSubmode = textSubmodeMixed;
+      } else if (textCompaction[c][textSubmodePunc] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textCompaction[c][textSubmodePunc],
+				  prevHalfSymbol)) {
+	  return gFalse;
+	}
+	++valueIdx;
+      } else {
+	// this shouldn't happen
+	++valueIdx;
+      }
+      break;
+    case textSubmodePuncShift:
+      if (textCompaction[c][textSubmodePunc] < 30) {
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  textCompaction[c][textSubmodePunc],
+				  prevHalfSymbol)) {
+	  return gFalse;
+	}
+	++valueIdx;
+      } else {
+	// this shouldn't happen
+	if (!appendTextHalfSymbol(codewords, codewordIdx,
+				  0, prevHalfSymbol)) {
+	  return gFalse;
+	}
+      }
+      nextSubmode = prevSubmode;
+      break;
+    }
+    prevSubmode = submode;
+    submode = nextSubmode;
+  }
+
+  // padding
+  if (prevHalfSymbol < 30) {
+    appendTextHalfSymbol(codewords, codewordIdx, 29, prevHalfSymbol);
+  }
+
+  return gTrue;
+}
+
+static GBool appendTextHalfSymbol(int *codewords, int &codewordIdx,
+				  int halfSymbol, int &prevHalfSymbol) {
+  if (prevHalfSymbol == 30) {
+    prevHalfSymbol = halfSymbol;
+  } else {
+    int codeword = prevHalfSymbol * 30 + halfSymbol;
+    if (!appendDataCodeword(codewords, codewordIdx, codeword)) {
+      return gFalse;
+    }
+    prevHalfSymbol = 30;
+  }
+  return gTrue;
+}
+
+static GBool appendDataCodeword(int *codewords, int &codewordIdx,
+				int codeword) {
+  if (codewordIdx >= maxDataCodewords) {
+    return gFalse;
+  }
+  codewords[codewordIdx++] = codeword;
+  return gTrue;
+}
+
+// Compute the error correction codewords and add to codewords[].
+static void makeErrorCorrectionCodewords(int errorCorrectionLevel,
+					 int *codewords, int length) {
+  int e[1 << (maxErrorCorrectionLevel + 1)];
+  int k = 1 << (errorCorrectionLevel + 1);
+  for (int i = 0; i < k; ++i) {
+    e[i] = 0;
+  }
+  for (int i = 0; i < length; ++i) {
+    int t1 = (codewords[i] + e[k-1]) % 929;
+    int t2, t3;
+    for (int j = k-1; j >= 1; --j) {
+      t2 = (t1 * errorCorrectionCoeff[errorCorrectionLevel][j]) % 929;
+      t3 = 929 - t2;
+      e[j] = (e[j-1] + t3) % 929;
+    }
+    t2 = (t1 * errorCorrectionCoeff[errorCorrectionLevel][0]) % 929;
+    t3 = 929 - t2;
+    e[0] = t3 % 929;
+  }
+  int j = length;
+  for (int i = k-1; i >= 0; --i) {
+    int ee = e[i] ? (929 - e[i]) : 0;
+    codewords[j++] = ee;
+  }
+}
+
+// Draw the barcode in the rectangle (0, 0, fieldWidth, fieldHeight).
+static void drawBarcode(int *codewords, int totalLength,
+			int nRows, int nCols,
+			int errorCorrectionLevel,
+			double moduleWidth, double moduleHeight,
+			double fieldWidth, double fieldHeight,
+			GString *appearBuf) {
+  double w = (73 + nCols * 17) * moduleWidth;
+  double h = nRows * moduleHeight;
+  double x0 = 0.5 * (fieldWidth - w);
+  double y0 = 0.5 * (fieldHeight - h);
+
+  appearBuf->append("0 g q\n");
+  appearBuf->appendf("{0:.4f} 0 0 {1:.4f} {2:.4f} {3:.4f} cm\n",
+		     moduleWidth, moduleHeight, x0, y0);
+
+  int i = 0;
+  for (int row = 0; row < nRows; ++row) {
+    int cluster = row % 3;
+    int y = nRows - 1 - row;
+    int left = 0;
+    int right = 0;
+    switch (cluster) {
+    case 0:
+      left = 30 * (row / 3) + (nRows - 1) / 3;
+      right = 30 * (row / 3) + (nCols - 1);
+      break;
+    case 1:
+      left = 30 * (row / 3) + (errorCorrectionLevel * 3) + (nRows - 1) % 3;
+      right = 30 * (row / 3) + (nRows - 1) / 3;
+      break;
+    case 2:
+      left = 30 * (row / 3) + (nCols - 1);
+      right = 30 * (row / 3) + (errorCorrectionLevel * 3) + (nRows - 1) % 3;
+      break;
+    }
+    int x = 0;
+    drawPattern(x, y, startPattern, startPatternLength, appearBuf);
+    drawPattern(x, y, patterns[left][cluster], patternLength, appearBuf);
+    for (int col = 0; col < nCols; ++col) {
+      drawPattern(x, y, patterns[codewords[i]][cluster], patternLength,
+		  appearBuf);
+      ++i;
+    }
+    drawPattern(x, y, patterns[right][cluster], patternLength, appearBuf);
+    drawPattern(x, y, stopPattern, stopPatternLength, appearBuf);
+  }
+
+  appearBuf->append("Q\n");
+}
+
+static void drawPattern(int &x, int y, char *pattern, int length,
+			GString *appearBuf) {
+  for (int i = 0; i < length; ++i) {
+    if (!(i & 1)) {
+      appearBuf->appendf("{0:d} {1:d} {2:d} 1 re f\n", x, y, pattern[i]);
+    }
+    x += pattern[i];
+  }
+}


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.cc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -0,0 +1,32 @@
+//========================================================================
+//
+// PDF417Barcode.h
+//
+// Copyright 2018 Glyph & Cog, LLC
+//
+//========================================================================
+
+#ifndef PDF417BARCODE_H
+#define PDF417BARCODE_H
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
+class GString;
+
+// Draw a PDF417 barcode:
+// fieldWidth, fieldHeight = field size (in points)
+// moduleWidth, moduleHeight = requested module size (in points)
+// errorCorrectionLevel = 0 .. 8
+// value = byte string
+// output is appended to appearBuf
+// Returns true on success, false on error.
+extern GBool drawPDF417Barcode(double fieldWidth, double fieldHeight,
+			       double moduleWidth, double moduleHeight,
+			       int errorCorrectionLevel, GString *value,
+			       GString *appearBuf);
+
+#endif


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDF417Barcode.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -673,25 +673,23 @@
 }
 
 void PDFCore::scrollToTopEdge() {
-  scrollTo(state->getScrollX(), tileMap->getPageTopY(tileMap->getFirstPage()));
+  scrollTo(state->getScrollX(),
+	   tileMap->getPageTopY(tileMap->getFirstPage()));
 }
 
 void PDFCore::scrollToBottomEdge() {
-  int horizMax, vertMax;
-
-  tileMap->getScrollLimits(&horizMax, &vertMax);
-  scrollTo(state->getScrollX(), vertMax - state->getWinH());
+  scrollTo(state->getScrollX(),
+	   tileMap->getPageBottomY(tileMap->getLastPage()));
 }
 
 void PDFCore::scrollToTopLeft() {
-  scrollTo(0, tileMap->getPageTopY(tileMap->getFirstPage()));
+  scrollTo(tileMap->getPageLeftX(tileMap->getFirstPage()),
+	   tileMap->getPageTopY(tileMap->getFirstPage()));
 }
 
 void PDFCore::scrollToBottomRight() {
-  int horizMax, vertMax;
-
-  tileMap->getScrollLimits(&horizMax, &vertMax);
-  scrollTo(horizMax - state->getWinW(), vertMax - state->getWinH());
+  scrollTo(tileMap->getPageRightX(tileMap->getLastPage()),
+	   tileMap->getPageBottomY(tileMap->getLastPage()));
 }
 
 void PDFCore::setZoom(double zoom) {
@@ -899,6 +897,10 @@
   }
 }
 
+SplashColorPtr PDFCore::getSelectionColor() {
+  return state->getSelectColor();
+}
+
 void PDFCore::setSelectionColor(SplashColor color) {
   int wx0, wy0, wx1, wy1;
 
@@ -1648,6 +1650,11 @@
   return doc->getCatalog()->getForm()->getField(idx);
 }
 
+GBool PDFCore::overText(int pg, double x, double y) {
+  loadText(pg);
+  return text->checkPointInside(x, y);
+}
+
 void PDFCore::forceRedraw() {
   startUpdate();
   state->forceRedraw();

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -164,6 +164,7 @@
   void setSelectMode(SelectMode mode);
 
   // Selection color.
+  SplashColorPtr getSelectionColor();
   void setSelectionColor(SplashColor color);
 
   // Modify the selection.  These functions use device coordinates.
@@ -242,6 +243,7 @@
   FormField *findFormField(int pg, double x, double y);
   int findFormFieldIdx(int pg, double x, double y);
   FormField *getFormField(int idx);
+  GBool overText(int pg, double x, double y);
   void forceRedraw();
   void setTileDoneCbk(void (*cbk)(void *data), void *data);
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -34,6 +34,7 @@
 #include "Lexer.h"
 #include "Parser.h"
 #include "SecurityHandler.h"
+#include "UTF8.h"
 #ifndef DISABLE_OUTLINE
 #include "Outline.h"
 #endif
@@ -57,20 +58,8 @@
   int n, i;
 #endif
 
-  ok = gFalse;
-  errCode = errNone;
+  init(coreA);
 
-  core = coreA;
-
-  file = NULL;
-  str = NULL;
-  xref = NULL;
-  catalog = NULL;
-#ifndef DISABLE_OUTLINE
-  outline = NULL;
-#endif
-  optContent = NULL;
-
   fileName = fileNameA;
 #ifdef _WIN32
   n = fileName->getLength();
@@ -122,20 +111,8 @@
   Object obj;
   int i;
 
-  ok = gFalse;
-  errCode = errNone;
+  init(coreA);
 
-  core = coreA;
-
-  file = NULL;
-  str = NULL;
-  xref = NULL;
-  catalog = NULL;
-#ifndef DISABLE_OUTLINE
-  outline = NULL;
-#endif
-  optContent = NULL;
-
   // save both Unicode and 8-bit copies of the file name
   fileName = new GString();
   fileNameU = (wchar_t *)gmallocn(fileNameLen + 1, sizeof(wchar_t));
@@ -147,17 +124,13 @@
 
   // try to open file
   // NB: _wfopen is only available in NT
-/*
   version.dwOSVersionInfoSize = sizeof(version);
   GetVersionEx(&version);
   if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
     file = _wfopen(fileNameU, L"rb");
   } else {
-*/
     file = fopen(fileName->getCString(), "rb");
-/*
   }
-*/
   if (!file) {
     error(errIO, -1, "Couldn't open file '{0:t}'", fileName);
     errCode = errOpenFile;
@@ -172,6 +145,69 @@
 }
 #endif
 
+PDFDoc::PDFDoc(char *fileNameA, GString *ownerPassword,
+	       GString *userPassword, PDFCore *coreA) {
+/*
+#ifdef _WIN32
+  OSVERSIONINFO version;
+#endif
+*/
+  Object obj;
+/*
+#ifdef _WIN32
+  Unicode u;
+  int n, i, j;
+#endif
+*/
+
+  init(coreA);
+
+  fileName = new GString(fileNameA);
+
+#if defined(_WIN32)
+#if 0
+  n = 0;
+  i = 0;
+  while (getUTF8(fileName, &i, &u)) {
+    ++n;
+  }
+  fileNameU = (wchar_t *)gmallocn(n + 1, sizeof(wchar_t));
+  i = j = 0;
+  while (j < n && getUTF8(fileName, &i, &u)) {
+    fileNameU[j++] = (wchar_t)u;
+  }
+  fileNameU[n] = L'\0';
+  // NB: _wfopen is only available in NT
+  version.dwOSVersionInfoSize = sizeof(version);
+  GetVersionEx(&version);
+  if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+    file = _wfopen(fileNameU, L"rb");
+  } else {
+#endif /* 0 */
+    file = fopen(fileName->getCString(), "rb");
+#if 0
+  }
+#endif /* 0 */
+
+#elif defined(VMS)
+  file = fopen(fileName->getCString(), "rb", "ctx=stm");
+#else
+  file = fopen(fileName->getCString(), "rb");
+#endif
+
+  if (!file) {
+    error(errIO, -1, "Couldn't open file '{0:t}'", fileName);
+    errCode = errOpenFile;
+    return;
+  }
+
+  // create stream
+  obj.initNull();
+  str = new FileStream(file, 0, gFalse, 0, &obj);
+
+  ok = setup(ownerPassword, userPassword);
+}
+
 PDFDoc::PDFDoc(BaseStream *strA, GString *ownerPassword,
 	       GString *userPassword, PDFCore *coreA) {
 #ifdef _WIN32
@@ -178,9 +214,8 @@
   int n, i;
 #endif
 
-  ok = gFalse;
-  errCode = errNone;
-  core = coreA;
+  init(coreA);
+
   if (strA->getFileName()) {
     fileName = strA->getFileName()->copy();
 #ifdef _WIN32
@@ -197,8 +232,15 @@
     fileNameU = NULL;
 #endif
   }
+  ok = setup(ownerPassword, userPassword);
+}
+
+void PDFDoc::init(PDFCore *coreA) {
+  ok = gFalse;
+  errCode = errNone;
+  core = coreA;
   file = NULL;
-  str = strA;
+  str = NULL;
   xref = NULL;
   catalog = NULL;
 #ifndef DISABLE_OUTLINE
@@ -205,7 +247,6 @@
   outline = NULL;
 #endif
   optContent = NULL;
-  ok = setup(ownerPassword, userPassword);
 }
 
 GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -40,12 +40,20 @@
 
   PDFDoc(GString *fileNameA, GString *ownerPassword = NULL,
 	 GString *userPassword = NULL, PDFCore *coreA = NULL);
+
 #ifdef _WIN32
   PDFDoc(wchar_t *fileNameA, int fileNameLen, GString *ownerPassword = NULL,
 	 GString *userPassword = NULL, PDFCore *coreA = NULL);
 #endif
+
+  // This version takes a UTF-8 file name (which is only relevant on
+  // Windows).
+  PDFDoc(char *fileNameA, GString *ownerPassword = NULL,
+	 GString *userPassword = NULL, PDFCore *coreA = NULL);
+
   PDFDoc(BaseStream *strA, GString *ownerPassword = NULL,
 	 GString *userPassword = NULL, PDFCore *coreA = NULL);
+
   ~PDFDoc();
 
   // Was PDF document successfully opened?
@@ -185,6 +193,7 @@
 
 private:
 
+  void init(PDFCore *coreA);
   GBool setup(GString *ownerPassword, GString *userPassword);
   GBool setup2(GString *ownerPassword, GString *userPassword,
 	       GBool repairXRef);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -1240,7 +1240,7 @@
   for (x = 0; x < width; x += 8) {
     byte = 0;
     for (xx = 0; xx < 8; ++xx) {
-      byte <<= 1;
+      byte = (Guchar)(byte << 1);
       if (x + xx < width) {
 	for (i = 0; i < numComps; ++i) {
 	  if (linePtr[i] < maskColors[2 * i] ||
@@ -1296,7 +1296,7 @@
   fontFileInfo = new GHash();
   imgIDs = NULL;
   formIDs = NULL;
-  xobjStack = NULL;
+  visitedResources = NULL;
   saveStack = NULL;
   paperSizes = NULL;
   embFontList = NULL;
@@ -1358,7 +1358,7 @@
   fontFileInfo = new GHash();
   imgIDs = NULL;
   formIDs = NULL;
-  xobjStack = NULL;
+  visitedResources = NULL;
   saveStack = NULL;
   paperSizes = NULL;
   embFontList = NULL;
@@ -1489,7 +1489,6 @@
   formIDLen = 0;
   formIDSize = 0;
 
-  xobjStack = new GList();
   noStateChanges = gFalse;
   saveStack = new GList();
   numTilingPatterns = 0;
@@ -1561,9 +1560,6 @@
   deleteGHash(fontFileInfo, PSFontFileInfo);
   gfree(imgIDs);
   gfree(formIDs);
-  if (xobjStack) {
-    delete xobjStack;
-  }
   if (saveStack) {
     delete saveStack;
   }
@@ -1737,6 +1733,7 @@
   Form *form;
   Object obj1, obj2, obj3;
   GString *s;
+  GBool needDefaultFont;
   int pg, i, j;
 
   // check to see which pages will be rasterized
@@ -1749,6 +1746,9 @@
     rasterizePage = NULL;
   }
 
+  visitedResources = (char *)gmalloc(xref->getNumObjects());
+  memset(visitedResources, 0, xref->getNumObjects());
+
   if (mode == psModeForm) {
     // swap the form and xpdf dicts
     writePS("xpdf end begin dup begin\n");
@@ -1755,6 +1755,7 @@
   } else {
     writePS("xpdf begin\n");
   }
+  needDefaultFont = gFalse;
   for (pg = firstPage; pg <= lastPage; ++pg) {
     if (rasterizePage[pg - firstPage]) {
       continue;
@@ -1765,6 +1766,9 @@
     }
     annots = new Annots(doc, page->getAnnots(&obj1));
     obj1.free();
+    if (annots->getNumAnnots()) {
+      needDefaultFont = gTrue;
+    }
     for (i = 0; i < annots->getNumAnnots(); ++i) {
       if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) {
 	obj1.streamGetDict()->lookup("Resources", &obj2);
@@ -1778,6 +1782,9 @@
     delete annots;
   }
   if ((form = catalog->getForm())) {
+    if (form->getNumFields() > 0) {
+      needDefaultFont = gTrue;
+    }
     for (i = 0; i < form->getNumFields(); ++i) {
       form->getField(i)->getResources(&obj1);
       if (obj1.isArray()) {
@@ -1794,6 +1801,9 @@
       obj1.free();
     }
   }
+  if (needDefaultFont) {
+    setupDefaultFont();
+  }
   if (mode != psModeForm) {
     if (mode != psModeEPS && !manualCtrl) {
       writePSFmt("{0:s} pdfSetup\n",
@@ -1818,6 +1828,9 @@
   if (mode != psModeForm) {
     writePS("end\n");
   }
+
+  gfree(visitedResources);
+  visitedResources = NULL;
 }
 
 void PSOutputDev::writePageTrailer() {
@@ -1895,9 +1908,9 @@
 void PSOutputDev::setupResources(Dict *resDict) {
   Object xObjDict, xObjRef, xObj, patDict, patRef, pat;
   Object gsDict, gsRef, gs, smask, smaskGroup, resObj;
-  Ref ref0, ref1;
+  Ref ref0;
   GBool skip;
-  int i, j;
+  int i;
 
   setupFonts(resDict);
   setupImages(resDict);
@@ -1907,20 +1920,12 @@
   if (xObjDict.isDict()) {
     for (i = 0; i < xObjDict.dictGetLength(); ++i) {
 
-      // avoid infinite recursion on XObjects
+      // check for an already-visited XObject
       skip = gFalse;
       if ((xObjDict.dictGetValNF(i, &xObjRef)->isRef())) {
 	ref0 = xObjRef.getRef();
-	for (j = 0; j < xobjStack->getLength(); ++j) {
-	  ref1 = *(Ref *)xobjStack->get(j);
-	  if (ref1.num == ref0.num && ref1.gen == ref0.gen) {
-	    skip = gTrue;
-	    break;
-	  }
-	}
-	if (!skip) {
-	  xobjStack->append(&ref0);
-	}
+	skip = (GBool)visitedResources[ref0.num];
+	visitedResources[ref0.num] = 1;
       }
       if (!skip) {
 
@@ -1936,9 +1941,6 @@
 	xObj.free();
       }
 
-      if (xObjRef.isRef() && !skip) {
-	xobjStack->del(xobjStack->getLength() - 1);
-      }
       xObjRef.free();
     }
   }
@@ -1950,20 +1952,12 @@
     inType3Char = gTrue;
     for (i = 0; i < patDict.dictGetLength(); ++i) {
 
-      // avoid infinite recursion on Patterns
+      // check for an already-visited Pattern
       skip = gFalse;
       if ((patDict.dictGetValNF(i, &patRef)->isRef())) {
 	ref0 = patRef.getRef();
-	for (j = 0; j < xobjStack->getLength(); ++j) {
-	  ref1 = *(Ref *)xobjStack->get(j);
-	  if (ref1.num == ref0.num && ref1.gen == ref0.gen) {
-	    skip = gTrue;
-	    break;
-	  }
-	}
-	if (!skip) {
-	  xobjStack->append(&ref0);
-	}
+	skip = (GBool)visitedResources[ref0.num];
+	visitedResources[ref0.num] = 1;
       }
       if (!skip) {
 
@@ -1979,9 +1973,6 @@
 	pat.free();
       }
 
-      if (patRef.isRef() && !skip) {
-	xobjStack->del(xobjStack->getLength() - 1);
-      }
       patRef.free();
     }
     inType3Char = gFalse;
@@ -1993,20 +1984,12 @@
   if (gsDict.isDict()) {
     for (i = 0; i < gsDict.dictGetLength(); ++i) {
 
-      // avoid infinite recursion on ExtGStates
+      // check for an already-visited ExtGState
       skip = gFalse;
       if ((gsDict.dictGetValNF(i, &gsRef)->isRef())) {
 	ref0 = gsRef.getRef();
-	for (j = 0; j < xobjStack->getLength(); ++j) {
-	  ref1 = *(Ref *)xobjStack->get(j);
-	  if (ref1.num == ref0.num && ref1.gen == ref0.gen) {
-	    skip = gTrue;
-	    break;
-	  }
-	}
-	if (!skip) {
-	  xobjStack->append(&ref0);
-	}
+	skip = (GBool)visitedResources[ref0.num];
+	visitedResources[ref0.num] = 1;
       }
       if (!skip) {
 
@@ -2027,9 +2010,6 @@
 	gs.free();
       }
 
-      if (gsRef.isRef() && !skip) {
-	xobjStack->del(xobjStack->getLength() - 1);
-      }
       gsRef.free();
     }
   }
@@ -2149,6 +2129,9 @@
 	  fi->ff = setupExternalCIDTrueTypeFont(font, fontLoc->path,
 						fontLoc->fontNum, gTrue);
 	  break;
+	case fontCIDType0COT:
+	  fi->ff = setupExternalOpenTypeCFFFont(font, fontLoc->path);
+	  break;
 	default:
 	  break;
 	}
@@ -2194,7 +2177,7 @@
 	}
       }
       if (code < 256) {
-	w1 = ((Gfx8BitFont *)font)->getWidth(code);
+	w1 = ((Gfx8BitFont *)font)->getWidth((Guchar)code);
       } else {
 	w1 = 0;
       }
@@ -2272,8 +2255,10 @@
   int length1, length2, n;
 
   // check if font is already embedded
-  if ((ff = (PSFontFileInfo *)
-                fontFileInfo->lookup(font->getEmbeddedFontName()))) {
+  if (!font->getEmbeddedFontName()) {
+    rename = gTrue;
+  } else if ((ff = (PSFontFileInfo *)
+	             fontFileInfo->lookup(font->getEmbeddedFontName()))) {
     if (ff->loc == psFontFileEmbedded &&
 	ff->embFontID.num == id->num &&
 	ff->embFontID.gen == id->gen) {
@@ -2408,7 +2393,7 @@
 	  if ((c = fgetc(fontFile)) == EOF) {
 	    break;
 	  }
-	  writePSChar(c);
+	  writePSChar((char)c);
 	}
       } else {
 	for (i = 0; i < n; ++i) {
@@ -2438,10 +2423,10 @@
 
   // plain text (PFA) format
   } else {
-    writePSChar(buf[0]);
-    writePSChar(buf[1]);
+    writePSChar((char)buf[0]);
+    writePSChar((char)buf[1]);
     while ((c = fgetc(fontFile)) != EOF) {
-      writePSChar(c);
+      writePSChar((char)c);
     }
   }
 
@@ -2999,6 +2984,119 @@
   return ff;
 }
 
+// This assumes an OpenType CFF font that has a Unicode cmap (in the
+// OpenType section), and a CFF blob that uses an identity CID-to-GID
+// mapping.
+PSFontFileInfo *PSOutputDev::setupExternalOpenTypeCFFFont(GfxFont *font,
+							  GString *fileName) {
+  GString *psName;
+  PSFontFileInfo *ff;
+  FoFiTrueType *ffTT;
+  GHashIter *iter;
+  CharCodeToUnicode *ctu;
+  Unicode uBuf[8];
+  int *codeToGID;
+  int codeToGIDLen;
+  int cmap, cmapPlatform, cmapEncoding, code;
+
+  // create a code-to-GID mapping, via Unicode
+  if (!(ffTT = FoFiTrueType::load(fileName->getCString(), 0, gTrue))) {
+    return NULL;
+  }
+  if (!ffTT->isOpenTypeCFF()) {
+    delete ffTT;
+    return NULL;
+  }
+  if (!(ctu = ((GfxCIDFont *)font)->getToUnicode())) {
+    error(errSyntaxError, -1,
+	  "Couldn't find a mapping to Unicode for font '{0:s}'",
+	  font->getName() ? font->getName()->getCString() : "(unnamed)");
+    delete ffTT;
+    return NULL;
+  }
+  // look for a Unicode cmap
+  for (cmap = 0; cmap < ffTT->getNumCmaps(); ++cmap) {
+    cmapPlatform = ffTT->getCmapPlatform(cmap);
+    cmapEncoding = ffTT->getCmapEncoding(cmap);
+    if ((cmapPlatform == 3 && cmapEncoding == 1) ||
+	(cmapPlatform == 0 && cmapEncoding <= 4)) {
+      break;
+    }
+  }
+  if (cmap >= ffTT->getNumCmaps()) {
+    error(errSyntaxError, -1,
+	  "Couldn't find a Unicode cmap in font '{0:s}'",
+	  font->getName() ? font->getName()->getCString() : "(unnamed)");
+    ctu->decRefCnt();
+    delete ffTT;
+    return NULL;
+  }
+  // map CID -> Unicode -> GID
+  if (ctu->isIdentity()) {
+    codeToGIDLen = 65536;
+  } else {
+    codeToGIDLen = ctu->getLength();
+  }
+  codeToGID = (int *)gmallocn(codeToGIDLen, sizeof(int));
+  for (code = 0; code < codeToGIDLen; ++code) {
+    if (ctu->mapToUnicode(code, uBuf, 8) > 0) {
+      codeToGID[code] = ffTT->mapCodeToGID(cmap, uBuf[0]);
+    } else {
+      codeToGID[code] = 0;
+    }
+  }
+  ctu->decRefCnt();
+
+  // check if font is already embedded
+  fontFileInfo->startIter(&iter);
+  while (fontFileInfo->getNext(&iter, &psName, (void **)&ff)) {
+    if (ff->loc == psFontFileExternal &&
+	ff->type == font->getType() &&
+	!ff->extFileName->cmp(fileName) &&
+	ff->codeToGIDLen == codeToGIDLen &&
+	ff->codeToGID &&
+	!memcmp(ff->codeToGID, codeToGID, codeToGIDLen * sizeof(int))) {
+      fontFileInfo->killIter(&iter);
+      gfree(codeToGID);
+      delete ffTT;
+      return ff;
+    }
+  }
+
+  // generate name
+  psName = makePSFontName(font, font->getID());
+
+  // beginning comment
+  writePSFmt("%%BeginResource: font {0:t}\n", psName);
+  embFontList->append("%%+ font ");
+  embFontList->append(psName->getCString());
+  embFontList->append("\n");
+
+  // convert it to a Type 0 font
+  if (globalParams->getPSLevel() >= psLevel3) {
+    // Level 3: use a CID font
+    ffTT->convertToCIDType0(psName->getCString(),
+			    codeToGID, codeToGIDLen,
+			    outputFunc, outputStream);
+  } else {
+    // otherwise: use a non-CID composite font
+    ffTT->convertToType0(psName->getCString(),
+			 codeToGID, codeToGIDLen,
+			 outputFunc, outputStream);
+  }
+  delete ffTT;
+
+  // ending comment
+  writePS("%%EndResource\n");
+
+  ff = new PSFontFileInfo(psName, font->getType(), psFontFileExternal);
+  ff->extFileName = fileName->copy();
+  ff->codeToGID = codeToGID;
+  ff->codeToGIDLen = codeToGIDLen;
+  fontFileInfo->add(ff->psName, ff);
+  return ff;
+}
+
 PSFontFileInfo *PSOutputDev::setupType3Font(GfxFont *font,
 					    Dict *parentResDict) {
   PSFontFileInfo *ff;
@@ -3404,17 +3502,17 @@
       continue;
     }
     if (c >= '0' && c <= '9') {
-      byte += c - '0';
+      byte = (Guchar)(byte + (c - '0'));
     } else if (c >= 'A' && c <= 'F') {
-      byte += c - 'A' + 10;
+      byte = (Guchar)(byte + (c - 'A' + 10));
     } else if (c >= 'a' && c <= 'f') {
-      byte += c - 'a' + 10;
+      byte = (Guchar)(byte + (c - 'a' + 10));
     } else {
       delete out;
       return in;
     }
     if (state == 0) {
-      byte <<= 4;
+      byte = (Guchar)(byte << 4);
       state = 1;
     } else {
       out->append((char)byte);
@@ -3557,6 +3655,10 @@
   font->insert(i, name);
 }
 
+void PSOutputDev::setupDefaultFont() {
+  writePS("/xpdf_default_font /Helvetica 1 1 ISOLatin1Encoding pdfMakeFont\n");
+}
+
 void PSOutputDev::setupImages(Dict *resDict) {
   Object xObjDict, xObj, xObjRef, subtypeObj, maskObj, maskRef;
   Ref imgID;
@@ -3591,12 +3693,17 @@
 		imgIDs = (Ref *)greallocn(imgIDs, imgIDSize, sizeof(Ref));
 	      }
 	      imgIDs[imgIDLen++] = imgID;
-	      setupImage(imgID, xObj.getStream(), gFalse);
-	      if (level >= psLevel3 &&
-		  xObj.streamGetDict()->lookup("Mask", &maskObj)->isStream()) {
-		setupImage(imgID, maskObj.getStream(), gTrue);
+	      setupImage(imgID, xObj.getStream(), gFalse, NULL);
+	      if (level >= psLevel3) {
+		xObj.streamGetDict()->lookup("Mask", &maskObj);
+		if (maskObj.isStream()) {
+		  setupImage(imgID, maskObj.getStream(), gTrue, NULL);
+		} else if (level == psLevel3Gray && maskObj.isArray()) {
+		  setupImage(imgID, xObj.getStream(), gFalse,
+			     maskObj.getArray());
+		}
+	        maskObj.free();
 	      }
-	      maskObj.free();
 	    }
 	  } else {
 	    error(errSyntaxError, -1,
@@ -3612,12 +3719,12 @@
   xObjDict.free();
 }
 
-//~ this doesn't currently handle color key masks in psLevel3Gray
-//~   (which need to be converted to explicit masks)
-void PSOutputDev::setupImage(Ref id, Stream *str, GBool mask) {
+void PSOutputDev::setupImage(Ref id, Stream *str, GBool mask,
+			     Array *colorKeyMask) {
   StreamColorSpaceMode csMode;
   GfxColorSpace *colorSpace;
   GfxImageColorMap *colorMap;
+  int maskColors[2*gfxColorMaxComps];
   Object obj1;
   GBool imageMask, useLZW, useRLE, useCompressed, useASCIIHex;
   GString *s;
@@ -3696,8 +3803,20 @@
     useCompressed = gFalse;
     useASCIIHex = gTrue;
   } else {
-    if (colorMap && (colorMap->getColorSpace()->getMode() == csDeviceN ||
-		     level == psLevel2Gray || level == psLevel3Gray)) {
+    if (colorKeyMask) {
+      if (globalParams->getPSUncompressPreloadedImages()) {
+	useLZW = useRLE = gFalse;
+      } else if (globalParams->getPSLZW()) {
+	useLZW = gTrue;
+	useRLE = gFalse;
+      } else {
+	useRLE = gTrue;
+	useLZW = gFalse;
+      }
+      useCompressed = gFalse;
+    } else if (colorMap &&
+	       (colorMap->getColorSpace()->getMode() == csDeviceN ||
+		level == psLevel2Gray || level == psLevel3Gray)) {
       if (globalParams->getPSLZW()) {
 	useLZW = gTrue;
 	useRLE = gFalse;
@@ -3731,7 +3850,17 @@
   if (useCompressed) {
     str = str->getUndecodedStream();
   }
-  if (colorMap && (level == psLevel2Gray || level == psLevel3Gray)) {
+  if (colorKeyMask) {
+    memset(maskColors, 0, sizeof(maskColors));
+    for (i = 0; i < colorKeyMask->getLength() && i < 2*gfxColorMaxComps; ++i) {
+      colorKeyMask->get(i, &obj1);
+      if (obj1.isInt()) {
+	maskColors[i] = obj1.getInt();
+      }
+      obj1.free();
+    }
+    str = new ColorKeyToMaskEncoder(str, width, height, colorMap, maskColors);
+  } else if (colorMap && (level == psLevel2Gray || level == psLevel3Gray)) {
     str = new GrayRecoder(str, width, height, colorMap);
   } else if (colorMap && colorMap->getColorSpace()->getMode() == csDeviceN) {
     str = new DeviceNRecoder(str, width, height, colorMap);
@@ -3783,7 +3912,7 @@
     ++size;
   }
   writePSFmt("{0:d} array dup /{1:s}Data_{2:d}_{3:d} exch def\n",
-	     size, mask ? "Mask" : "Im", id.num, id.gen);
+	     size, (mask || colorKeyMask) ? "Mask" : "Im", id.num, id.gen);
   str->close();
 
   // write the data into the array
@@ -3798,10 +3927,10 @@
       break;
     }
     if (c == 'z') {
-      writePSChar(c);
+      writePSChar((char)c);
       ++col;
     } else {
-      writePSChar(c);
+      writePSChar((char)c);
       ++col;
       for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
 	do {
@@ -3810,7 +3939,7 @@
 	if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
 	  break;
 	}
-	writePSChar(c);
+	writePSChar((char)c);
 	++col;
       }
     }
@@ -4837,10 +4966,17 @@
 
 void PSOutputDev::updateFont(GfxState *state) {
   if (state->getFont()) {
-    writePSFmt("/F{0:d}_{1:d} {2:.6g} Tf\n",
-	       state->getFont()->getID()->num, state->getFont()->getID()->gen,
-	       fabs(state->getFontSize()) < 0.0001 ? 0.0001
-	                                            : state->getFontSize());
+    if (state->getFont()->getTag() &&
+	!state->getFont()->getTag()->cmp("xpdf_default_font")) {
+      writePSFmt("/xpdf_default_font {0:.6g} Tf\n",
+		 fabs(state->getFontSize()) < 0.0001 ? 0.0001
+		                                     : state->getFontSize());
+    } else {
+      writePSFmt("/F{0:d}_{1:d} {2:.6g} Tf\n",
+		 state->getFont()->getID()->num, state->getFont()->getID()->gen,
+		 fabs(state->getFontSize()) < 0.0001 ? 0.0001
+		                                     : state->getFontSize());
+    }
     noStateChanges = gFalse;
   }
 }
@@ -5056,6 +5192,7 @@
   writePSFmt("  /XStep {0:.6g}\n", xStep);
   writePSFmt("  /YStep {0:.6g}\n", yStep);
   writePS("  /PaintProc {\n");
+  writePS("    pop\n");
   box.x1 = bbox[0];
   box.y1 = bbox[1];
   box.x2 = bbox[2];
@@ -5850,7 +5987,7 @@
 	if (c == '>' || c == EOF) {
 	  break;
 	}
-	writePSChar(c);
+	writePSChar((char)c);
 	++col;
 	// each line is: "<...data...><eol>"
 	// so max data length = 255 - 4 = 251
@@ -6061,10 +6198,10 @@
 	  break;
 	}
 	if (c == 'z') {
-	  writePSChar(c);
+	  writePSChar((char)c);
 	  ++col;
 	} else {
-	  writePSChar(c);
+	  writePSChar((char)c);
 	  ++col;
 	  for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
 	    do {
@@ -6073,7 +6210,7 @@
 	    if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
 	      break;
 	    }
-	    writePSChar(c);
+	    writePSChar((char)c);
 	    ++col;
 	  }
 	}
@@ -6608,14 +6745,28 @@
     // mask data source
     if (maskColors && colorMap && level == psLevel3Gray) {
       s = NULL;
-      if (globalParams->getPSLZW()) {
-	maskUseLZW = gTrue;
-	maskUseRLE = gFalse;
+      if (mode == psModeForm || inType3Char || preload) {
+	if (globalParams->getPSUncompressPreloadedImages()) {
+	  maskUseLZW = maskUseRLE = gFalse;
+	} else if (globalParams->getPSLZW()) {
+	  maskUseLZW = gTrue;
+	  maskUseRLE = gFalse;
+	} else {
+	  maskUseRLE = gTrue;
+	  maskUseLZW = gFalse;
+	}
+	maskUseASCII = gFalse;
+	maskUseCompressed = gFalse;
       } else {
-	maskUseRLE = gTrue;
-	maskUseLZW = gFalse;
+	if (globalParams->getPSLZW()) {
+	  maskUseLZW = gTrue;
+	  maskUseRLE = gFalse;
+	} else {
+	  maskUseRLE = gTrue;
+	  maskUseLZW = gFalse;
+	}
+	maskUseASCII = gTrue;
       }
-      maskUseASCII = gTrue;
       maskUseCompressed = gFalse;
       maskWidth = width;
       maskHeight = height;
@@ -6647,13 +6798,13 @@
     }
     maskFilters = new GString();
     if (maskUseASCII) {
-      maskFilters->appendf("  /ASCII{0:s}Decode filter\n",
+      maskFilters->appendf("    /ASCII{0:s}Decode filter\n",
 			   useASCIIHex ? "Hex" : "85");
     }
     if (maskUseLZW) {
-      maskFilters->append("  /LZWDecode filter\n");
+      maskFilters->append("    /LZWDecode filter\n");
     } else if (maskUseRLE) {
-      maskFilters->append("  /RunLengthDecode filter\n");
+      maskFilters->append("    /RunLengthDecode filter\n");
     }
     if (maskUseCompressed) {
       maskFilters->append(s);
@@ -6661,8 +6812,7 @@
     if (s) {
       delete s;
     }
-    if ((mode == psModeForm || inType3Char || preload) &&
-	!(maskColors && colorMap && level == psLevel3Gray)) {
+    if (mode == psModeForm || inType3Char || preload) {
       writePSFmt("MaskData_{0:d}_{1:d} pdfMaskInit\n",
 		 ref->getRefNum(), ref->getRefGen());
     } else {
@@ -6744,10 +6894,10 @@
 	  break;
 	}
 	if (c == 'z') {
-	  writePSChar(c);
+	  writePSChar((char)c);
 	  ++col;
 	} else {
-	  writePSChar(c);
+	  writePSChar((char)c);
 	  ++col;
 	  for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
 	    do {
@@ -6756,7 +6906,7 @@
 	    if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
 	      break;
 	    }
-	    writePSChar(c);
+	    writePSChar((char)c);
 	    ++col;
 	  }
 	}
@@ -6907,8 +7057,7 @@
 	       maskInvert ? 1 : 0, maskInvert ? 0 : 1);
 
     // mask data source
-    if ((mode == psModeForm || inType3Char || preload) &&
-	!(maskColors && colorMap && level == psLevel3Gray)) {
+    if (mode == psModeForm || inType3Char || preload) {
       writePS("  /DataSource {pdfMaskSrc}\n");
       writePS(maskFilters->getCString());
     } else {
@@ -8216,7 +8365,7 @@
       writePSFmt("\\{0:03o}", c);
       j += 4;
     } else {
-      writePSChar(c);
+      writePSChar((char)c);
       ++j;
     }
   }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -259,6 +259,8 @@
   virtual void psXObject(Stream *psStream, Stream *level1Stream);
 
   //----- miscellaneous
+  void setImageableArea(int imgLLXA, int imgLLYA, int imgURXA, int imgURYA)
+    { imgLLX = imgLLXA; imgLLY = imgLLYA; imgURX = imgURXA; imgURY = imgURYA; }
   void setOffset(double x, double y)
     { tx0 = x; ty0 = y; }
   void setScale(double x, double y)
@@ -307,6 +309,8 @@
 					       int fontNum,
 					       GBool needVerticalMetrics);
   PSFontFileInfo *setupEmbeddedOpenTypeCFFFont(GfxFont *font, Ref *id);
+  PSFontFileInfo *setupExternalOpenTypeCFFFont(GfxFont *font,
+					       GString *fileName);
   PSFontFileInfo *setupType3Font(GfxFont *font, Dict *parentResDict);
   GString *makePSFontName(GfxFont *font, Ref *id);
   GString *fixType1Font(GString *font, int length1, int length2);
@@ -320,8 +324,9 @@
   GString *copyType1PFA(Guchar *font, int fontSize);
   GString *copyType1PFB(Guchar *font, int fontSize);
   void renameType1Font(GString *font, GString *name);
+  void setupDefaultFont();
   void setupImages(Dict *resDict);
-  void setupImage(Ref id, Stream *stream, GBool mask);
+  void setupImage(Ref id, Stream *str, GBool mask, Array *colorKeyMask);
   void setupForms(Dict *resDict);
   void setupForm(Object *strRef, Object *strObj);
   void addProcessColor(double c, double m, double y, double k);
@@ -455,8 +460,7 @@
   Ref *formIDs;			// list of IDs for predefined forms
   int formIDLen;		// number of entries in formIDs array
   int formIDSize;		// size of formIDs array
-  GList *xobjStack;		// stack of XObject dicts currently being
-				//   processed
+  char *visitedResources;	// vector of resource objects already visited
   GBool noStateChanges;		// true if there have been no state changes
 				//   since the last save
   GList *saveStack;		// "no state changes" flag for each

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -77,12 +77,12 @@
 
   // read a token
   i = 0;
-  buf[i++] = c;
+  buf[i++] = (char)c;
   if (c == '(') {
     backslash = gFalse;
     while ((c = lookChar()) != EOF) {
       if (i < size - 1) {
-	buf[i++] = c;
+	buf[i++] = (char)c;
       }
       getChar();
       if (c == '\\') {
@@ -97,7 +97,7 @@
     while ((c = lookChar()) != EOF) {
       getChar();
       if (i < size - 1 && specialChars[c] != 1) {
-	buf[i++] = c;
+	buf[i++] = (char)c;
       }
       if (c == '>') {
 	break;
@@ -107,7 +107,7 @@
     while ((c = lookChar()) != EOF && !specialChars[c]) {
       getChar();
       if (i < size - 1) {
-	buf[i++] = c;
+	buf[i++] = (char)c;
       }
     }
   }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -289,6 +289,8 @@
 void PreScanOutputDev::check(GfxState *state,
 			     GfxColorSpace *colorSpace, GfxColor *color,
 			     double opacity, GfxBlendMode blendMode) {
+  GfxGray gr;
+  GfxCMYK cmyk;
   GfxRGB rgb;
 
   if (colorSpace->getMode() == csPattern) {
@@ -295,6 +297,20 @@
     mono = gFalse;
     gray = gFalse;
     gdi = gFalse;
+  } else if (colorSpace->getMode() == csDeviceGray ||
+	     colorSpace->getMode() == csCalGray) {
+    colorSpace->getGray(color, &gr, state->getRenderingIntent());
+    if (!(gr == 0 || gr == gfxColorComp1)) {
+      mono = gFalse;
+    }
+  } else if (colorSpace->getMode() == csDeviceCMYK) {
+    colorSpace->getCMYK(color, &cmyk, state->getRenderingIntent());
+    if (cmyk.c != 0 || cmyk.m != 0 || cmyk.y != 0) {
+      mono = gFalse;
+      gray = gFalse;
+    } else if (!(cmyk.k == 0 || cmyk.k == gfxColorComp1)) {
+      mono = gFalse;
+    }
   } else {
     colorSpace->getRGB(color, &rgb, state->getRenderingIntent());
     if (rgb.r != rgb.g || rgb.g != rgb.b || rgb.b != rgb.r) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -65,6 +65,14 @@
 };
 
 //------------------------------------------------------------------------
+
+// Clip x to lie in [0, 255].
+static inline Guchar clip255(int x) {
+  return x < 0 ? 0 : x > 255 ? 255 : (Guchar)x;
+}
+
+
+//------------------------------------------------------------------------
 // Blend functions
 //------------------------------------------------------------------------
 
@@ -73,7 +81,7 @@
   int i;
 
   for (i = 0; i < splashColorModeNComps[cm]; ++i) {
-    blend[i] = (dest[i] * src[i]) / 255;
+    blend[i] = (Guchar)((dest[i] * src[i]) / 255);
   }
 }
 
@@ -82,11 +90,11 @@
   int i;
 
   for (i = 0; i < splashColorModeNComps[cm]; ++i) {
-    blend[i] = dest[i] + src[i] - (dest[i] * src[i]) / 255;
+    blend[i] = (Guchar)(dest[i] + src[i] - (dest[i] * src[i]) / 255);
   }
 }
 
-// note: this is the same os HardLight
+// note: this is the same as HardLight, with src/dest reversed
 static void splashOutBlendOverlay(SplashColorPtr src, SplashColorPtr dest,
 				  SplashColorPtr blend, SplashColorMode cm) {
   int i;
@@ -94,8 +102,8 @@
   for (i = 0; i < splashColorModeNComps[cm]; ++i) {
     // the spec says "if Cs <= 0.5" -- note that 0x80 is 128/255=0.5020
     blend[i] = dest[i] < 0x80
-                 ? (src[i] * 2 * dest[i]) / 255
-                 : 255 - 2 * ((255 - src[i]) * (255 - dest[i])) / 255;
+                 ? (Guchar)((src[i] * 2 * dest[i]) / 255)
+                 : (Guchar)(255 - 2 * ((255 - src[i]) * (255 - dest[i])) / 255);
   }
 }
 
@@ -128,7 +136,7 @@
     } else if (dest[i] >= 255 - src[i]) {
       blend[i] = 255;
     } else {
-      blend[i] = (dest[i] * 255) / (255 - src[i]);
+      blend[i] = (Guchar)((dest[i] * 255) / (255 - src[i]));
     }
   }
 }
@@ -143,7 +151,7 @@
     } else if (255 - dest[i] >= src[i]) {
       blend[i] = 0;
     } else {
-      blend[i] = 255 - (((255 - dest[i]) * 255) / src[i]);
+      blend[i] = (Guchar)(255 - (((255 - dest[i]) * 255) / src[i]));
     }
   }
 }
@@ -155,8 +163,8 @@
   for (i = 0; i < splashColorModeNComps[cm]; ++i) {
     // the spec says "if Cs <= 0.5" -- note that 0x80 is 128/255=0.5020
     blend[i] = src[i] < 0x80
-                 ? (dest[i] * 2 * src[i]) / 255
-                 : 255 - 2 * ((255 - dest[i]) * (255 - src[i])) / 255;
+                 ? (Guchar)((dest[i] * 2 * src[i]) / 255)
+                 : (Guchar)(255 - 2 * ((255 - dest[i]) * (255 - src[i])) / 255);
   }
 }
 
@@ -167,8 +175,9 @@
   for (i = 0; i < splashColorModeNComps[cm]; ++i) {
     // the spec says "if Cs <= 0.5" -- note that 0x80 is 128/255=0.5020
     if (src[i] < 0x80) {
-      blend[i] = dest[i] - (255 - 2 * src[i]) * dest[i] * (255 - dest[i]) /
-	         (255 * 255);
+      blend[i] = (Guchar)(dest[i] -
+			  (255 - 2 * src[i]) * dest[i] * (255 - dest[i]) /
+			    (255 * 255));
     } else {
       // the spec says "if Cb <= 0.25" -- note that 0x40 is 64/255=0.2510
       if (dest[i] < 0x40) {
@@ -177,7 +186,7 @@
       } else {
 	x = (int)sqrt(255.0 * dest[i]);
       }
-      blend[i] = dest[i] + (2 * src[i] - 255) * (x - dest[i]) / 255;
+      blend[i] = (Guchar)(dest[i] + (2 * src[i] - 255) * (x - dest[i]) / 255);
     }
   }
 }
@@ -188,7 +197,8 @@
   int i;
 
   for (i = 0; i < splashColorModeNComps[cm]; ++i) {
-    blend[i] = dest[i] < src[i] ? src[i] - dest[i] : dest[i] - src[i];
+    blend[i] = dest[i] < src[i] ? (Guchar)(src[i] - dest[i])
+			        : (Guchar)(dest[i] - src[i]);
   }
 }
 
@@ -197,7 +207,7 @@
   int i;
 
   for (i = 0; i < splashColorModeNComps[cm]; ++i) {
-    blend[i] = dest[i] + src[i] - (2 * dest[i] * src[i]) / 255;
+    blend[i] = (Guchar)(dest[i] + src[i] - (2 * dest[i] * src[i]) / 255);
   }
 }
 
@@ -423,6 +433,7 @@
   &splashOutBlendLuminosity
 };
 
+
 //------------------------------------------------------------------------
 // SplashOutFontFileID
 //------------------------------------------------------------------------
@@ -526,7 +537,7 @@
   cacheTags = (T3FontCacheTag *)gmallocn(cacheSets * cacheAssoc,
 					 sizeof(T3FontCacheTag));
   for (i = 0; i < cacheSets * cacheAssoc; ++i) {
-    cacheTags[i].mru = i & (cacheAssoc - 1);
+    cacheTags[i].mru = (Gushort)(i & (cacheAssoc - 1));
   }
 }
 
@@ -565,6 +576,9 @@
   GfxColorSpace *blendingColorSpace;
   GBool isolated;
 
+  //----- modified region in tBitmap
+  int modXMin, modYMin, modXMax, modYMax;
+
   //----- saved state
   SplashBitmap *origBitmap;
   Splash *origSplash;
@@ -627,6 +641,7 @@
   startPageCbkData = NULL;
 }
 
+
 void SplashOutputDev::setupScreenParams(double hDPI, double vDPI) {
   screenParams.size = globalParams->getScreenSize();
   screenParams.dotRadius = globalParams->getScreenDotRadius();
@@ -906,6 +921,7 @@
 #endif
 }
 
+
 void SplashOutputDev::updateFillColor(GfxState *state) {
   GfxGray gray;
   GfxRGB rgb;
@@ -960,6 +976,7 @@
   }
 }
 
+
 SplashPattern *SplashOutputDev::getColor(GfxGray gray) {
   SplashColor color;
 
@@ -1018,6 +1035,7 @@
 #endif
 
 
+
 void SplashOutputDev::setOverprintMask(GfxState *state,
 				       GfxColorSpace *colorSpace,
 				       GBool overprintFlag,
@@ -1054,6 +1072,7 @@
   }
   splash->setOverprintMask(mask);
 #endif
+
 }
 
 void SplashOutputDev::updateBlendMode(GfxState *state) {
@@ -1474,7 +1493,8 @@
 	  memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
 		 n * sizeof(int));
 	}
-      } else if (globalParams->getMapExtTrueTypeFontsViaUnicode()) {
+      } else if (globalParams->getMapExtTrueTypeFontsViaUnicode() &&
+		 !((GfxCIDFont *)gfxFont)->usesIdentityEncoding()) {
 	// create a CID-to-GID mapping, via Unicode
 	if ((ctu = ((GfxCIDFont *)gfxFont)->getToUnicode())) {
 #if LOAD_FONTS_FROM_MEM
@@ -1572,7 +1592,7 @@
 	  ((name[0] >= 'A' && name[0] <= 'Z') ||
 	   (name[0] >= 'a' && name[0] <= 'z') ||
 	   (name[0] >= '0' && name[0] <= '9'))) {
-	w = ((Gfx8BitFont *)gfxFont)->getWidth(code);
+	w = ((Gfx8BitFont *)gfxFont)->getWidth((Guchar)code);
 	builtinFontSubst[substIdx]->widths->getWidth(name, &ww);
 	if (w > 0.01 && ww > 10) {
 	  w /= ww * 0.001;
@@ -1685,7 +1705,7 @@
   double xStepX, xStepY, yStepX, yStepY;
   double adjXMin, adjYMin;
   double sx, sy;
-  double clipXMin, clipYMin, clipXMax, clipYMax;
+  double clipXMin, clipYMin, clipXMax, clipYMax, clipXC, clipYC;
   double tx, ty, idet, txMin, tyMin, txMax, tyMax;
   int tileW, tileH, tileSize;
   int ixMin, ixMax, iyMin, iyMax, ix, iy, x, y;
@@ -1781,15 +1801,27 @@
   state->transformDelta(xStep * mat[0], xStep * mat[1], &xStepX, &xStepY);
   state->transformDelta(yStep * mat[2], yStep * mat[3], &yStepX, &yStepY);
 
+  // get the clipping bbox (in device space)
+  state->getClipBBox(&clipXMin, &clipYMin, &clipXMax, &clipYMax);
+
   // compute tiling parameters
-  if (tilingType == 2) {
+  idet = xStepX * yStepY - yStepX * xStepY;
+  if (tilingType == 2 || idet == 0) {
     adjXMin = tileXMin;
     adjYMin = tileYMin;
     sx = 1;
     sy = 1;
   } else {
-    adjXMin = (int)floor(tileXMin + 0.5);
-    adjYMin = (int)floor(tileYMin + 0.5);
+    // reposition the pattern origin to the center of the clipping bbox
+    idet = 1 / idet;
+    clipXC = 0.5 * (clipXMin + clipXMax);
+    clipYC = 0.5 * (clipYMin + clipYMax);
+    ix = (int)((yStepX * (tileYMin - clipYC) - (tileXMin - clipXC) * yStepY)
+	       * idet + 0.5);
+    iy = (int)((xStepX * (clipYC - tileYMin) - (clipXC - tileXMin) * xStepY)
+	       * idet + 0.5);
+    adjXMin = (int)floor(tileXMin + ix * xStepX + iy * yStepX + 0.5);
+    adjYMin = (int)floor(tileYMin + ix * xStepY + iy * yStepY + 0.5);
     sx = tileW / (tileXMax - tileXMin);
     sy = tileH / (tileYMax - tileYMin);
     xStepX = (int)floor(sx * xStepX + 0.5);
@@ -1834,7 +1866,6 @@
   // - look at the four corners of the clipping bbox
   // - solve for the (ix,iy) tile position at each corner
   // - take the min and max values for ix, iy
-  state->getClipBBox(&clipXMin, &clipYMin, &clipXMax, &clipYMax);
   idet = xStepX * yStepY - xStepY * yStepX;
   if (idet == 0) {
     return;
@@ -1903,19 +1934,20 @@
   bitmap = tileBitmap = new SplashBitmap(tileW, tileH, bitmapRowPad,
 					 colorMode, gTrue, bitmapTopDown);
   splash = new Splash(bitmap, vectorAntialias, origSplash->getScreen());
+  for (i = 0; i < splashMaxColorComps; ++i) {
+    color[i] = 0;
+  }
+  splash->clear(color);
   splash->setMinLineWidth(globalParams->getMinLineWidth());
   splash->setStrokeAdjust(
 		 mapStrokeAdjustMode[globalParams->getStrokeAdjust()]);
   splash->setEnablePathSimplification(
 		 globalParams->getEnablePathSimplification());
-  for (i = 0; i < splashMaxColorComps; ++i) {
-    color[i] = 0;
-  }
-  splash->clear(color);
   ++nestCount;
 
   // copy the fill color (for uncolored tiling patterns)
   // (and stroke color, to handle buggy PDF files)
+  // -- Acrobat apparently doesn't copy the full state here
   splash->setFillPattern(origSplash->getFillPattern()->copy());
   splash->setStrokePattern(origSplash->getStrokePattern()->copy());
 
@@ -1967,6 +1999,7 @@
   SplashColorPtr sColors, sColor;
   SplashColor sColor0;
 
+
   // get the shading parameters
   shading->getCoords(&x0, &y0, &x1, &y1);
   t0 = shading->getDomain0();
@@ -1986,7 +2019,7 @@
 
   // get clip region (in user space)
   state->getUserClipBBox(&uxMin, &uyMin, &uxMax, &uyMax);
-  if (uxMin >= uxMax || uyMin >= uyMax) {
+  if (uxMin > uxMax || uyMin > uyMax) {
     return gTrue;
   }
 
@@ -2053,7 +2086,7 @@
   bitmapHeight = iyMax - iyMin;
   tBitmap = new SplashBitmap(bitmapWidth, bitmapHeight, 1,
 			     srcMode, gTrue, gTrue);
-  memset(tBitmap->getAlphaPtr(), 0, bitmapWidth * bitmapHeight);
+  memset(tBitmap->getAlphaPtr(), 0, (size_t)bitmapWidth * bitmapHeight);
   nComps = splashColorModeNComps[srcMode];
 
   // compute the inverse CTM
@@ -2266,6 +2299,7 @@
   GfxColor color;
   SplashColorPtr sColors, sColor;
 
+
   // get the shading parameters
   shading->getCoords(&x0, &y0, &r0, &x1, &y1, &r1);
   t0 = shading->getDomain0();
@@ -2277,7 +2311,7 @@
 
   // get clip region (in user space)
   state->getUserClipBBox(&uxMin, &uyMin, &uxMax, &uyMax);
-  if (uxMin >= uxMax || uyMin >= uyMax) {
+  if (uxMin > uxMax || uyMin > uyMax) {
     return gTrue;
   }
 
@@ -2370,7 +2404,7 @@
   bitmapHeight = iyMax - iyMin;
   tBitmap = new SplashBitmap(bitmapWidth, bitmapHeight, 1,
 			     srcMode, gTrue, gTrue);
-  memset(tBitmap->getAlphaPtr(), 0, bitmapWidth * bitmapHeight);
+  memset(tBitmap->getAlphaPtr(), 0, tBitmap->getAlphaRowSize() * bitmapHeight);
   nComps = splashColorModeNComps[srcMode];
 
   // compute the inverse CTM
@@ -2518,7 +2552,7 @@
   for (y = byMin; y < byMax; ++y) {
     dataPtr = tBitmap->getDataPtr()
               + y * tBitmap->getRowSize() + bxMin * nComps;
-    alphaPtr = tBitmap->getAlphaPtr() + y * bitmapWidth + bxMin;
+    alphaPtr = tBitmap->getAlphaPtr() + y * tBitmap->getAlphaRowSize() + bxMin;
     for (x = bxMin; x < bxMax; ++x) {
 
       // convert coords to user space
@@ -2646,6 +2680,7 @@
   }
 }
 
+
 void SplashOutputDev::clip(GfxState *state) {
   SplashPath *path;
 
@@ -2954,7 +2989,7 @@
   t3gs = new T3GlyphStack();
   t3gs->next = t3GlyphStack;
   t3GlyphStack = t3gs;
-  t3GlyphStack->code = code;
+  t3GlyphStack->code = (Gushort)code;
   t3GlyphStack->cache = t3Font;
   t3GlyphStack->cacheTag = NULL;
   t3GlyphStack->cacheData = NULL;
@@ -2975,6 +3010,7 @@
     delete bitmap;
     delete splash;
     bitmap = t3GlyphStack->origBitmap;
+    colorMode = bitmap->getMode();
     splash = t3GlyphStack->origSplash;
     ctm = state->getCTM();
     state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
@@ -3093,6 +3129,7 @@
 
   // create the temporary bitmap
   if (colorMode == splashModeMono1) {
+    colorMode = splashModeMono1;
     bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
 			      splashModeMono1, gFalse);
     splash = new Splash(bitmap, gFalse, t3GlyphStack->origSplash->getScreen());
@@ -3100,6 +3137,7 @@
     splash->clear(color);
     color[0] = 0xff;
   } else {
+    colorMode = splashModeMono8;
     bitmap = new SplashBitmap(t3Font->glyphW, t3Font->glyphH, 1,
 			      splashModeMono8, gFalse);
     splash = new Splash(bitmap, vectorAntialias,
@@ -3112,10 +3150,9 @@
   splash->setStrokeAdjust(t3GlyphStack->origSplash->getStrokeAdjust());
   splash->setEnablePathSimplification(
 		 globalParams->getEnablePathSimplification());
+  copyState(t3GlyphStack->origSplash, gFalse);
   splash->setFillPattern(new SplashSolidColor(color));
   splash->setStrokePattern(new SplashSolidColor(color));
-  //~ this should copy other state from t3GlyphStack->origSplash?
-  //~ [this is likely the same situation as in beginTransparencyGroup()]
   state->setCTM(ctm[0], ctm[1], ctm[2], ctm[3],
 		-t3Font->glyphX, -t3Font->glyphY);
   updateCTM(state, 0, 0, 0, 0, 0, 0);
@@ -3149,11 +3186,11 @@
 
 struct SplashOutImageMaskData {
   ImageStream *imgStr;
-  GBool invert;
+  Guchar invert;
   int width, height, y;
 };
 
-GBool SplashOutputDev::imageMaskSrc(void *data, SplashColorPtr line) {
+GBool SplashOutputDev::imageMaskSrc(void *data, Guchar *line) {
   SplashOutImageMaskData *imgMaskData = (SplashOutImageMaskData *)data;
   Guchar *p;
   SplashColorPtr q;
@@ -3341,18 +3378,13 @@
 GBool SplashOutputDev::alphaImageSrc(void *data, SplashColorPtr colorLine,
 				     Guchar *alphaLine) {
   SplashOutImageData *imgData = (SplashOutImageData *)data;
-  Guchar *p, *aq;
+  Guchar *p0, *p, *aq;
   SplashColorPtr q, col;
-  GfxRGB rgb;
-  GfxGray gray;
-#if SPLASH_CMYK
-  GfxCMYK cmyk;
-#endif
   Guchar alpha;
   int nComps, x, i;
 
   if (imgData->y == imgData->height ||
-      !(p = imgData->imgStr->getLine())) {
+      !(p0 = imgData->imgStr->getLine())) {
     memset(colorLine, 0,
 	   imgData->width * splashColorModeNComps[imgData->colorMode]);
     memset(alphaLine, 0, imgData->width);
@@ -3361,67 +3393,66 @@
 
   nComps = imgData->colorMap->getNumPixelComps();
 
-  for (x = 0, q = colorLine, aq = alphaLine;
-       x < imgData->width;
-       ++x, p += nComps) {
-    alpha = 0;
-    for (i = 0; i < nComps; ++i) {
-      if (p[i] < imgData->maskColors[2*i] ||
-	  p[i] > imgData->maskColors[2*i+1]) {
-	alpha = 0xff;
-	break;
+  if (imgData->lookup) {
+    switch (imgData->colorMode) {
+    case splashModeMono1:
+    case splashModeMono8:
+      for (x = 0, p = p0, q = colorLine; x < imgData->width; ++x, ++p) {
+	*q++ = imgData->lookup[*p];
       }
-    }
-    if (imgData->lookup) {
-      switch (imgData->colorMode) {
-      case splashModeMono1:
-      case splashModeMono8:
-	*q++ = imgData->lookup[*p];
-	break;
-      case splashModeRGB8:
-      case splashModeBGR8:
+      break;
+    case splashModeRGB8:
+    case splashModeBGR8:
+      for (x = 0, p = p0, q = colorLine; x < imgData->width; ++x, ++p) {
 	col = &imgData->lookup[3 * *p];
 	*q++ = col[0];
 	*q++ = col[1];
 	*q++ = col[2];
-	break;
+      }
+      break;
 #if SPLASH_CMYK
-      case splashModeCMYK8:
+    case splashModeCMYK8:
+      for (x = 0, p = p0, q = colorLine; x < imgData->width; ++x, ++p) {
 	col = &imgData->lookup[4 * *p];
 	*q++ = col[0];
 	*q++ = col[1];
 	*q++ = col[2];
 	*q++ = col[3];
-	break;
+      }
+      break;
 #endif
-      }
-      *aq++ = alpha;
-    } else {
-      switch (imgData->colorMode) {
-      case splashModeMono1:
-      case splashModeMono8:
-	imgData->colorMap->getGray(p, &gray, imgData->ri);
-	*q++ = colToByte(gray);
-	break;
-      case splashModeRGB8:
-      case splashModeBGR8:
-	imgData->colorMap->getRGB(p, &rgb, imgData->ri);
-	*q++ = colToByte(rgb.r);
-	*q++ = colToByte(rgb.g);
-	*q++ = colToByte(rgb.b);
-	break;
+    }
+  } else {
+    switch (imgData->colorMode) {
+    case splashModeMono1:
+    case splashModeMono8:
+      imgData->colorMap->getGrayByteLine(p0, colorLine, imgData->width,
+					 imgData->ri);
+      break;
+    case splashModeRGB8:
+    case splashModeBGR8:
+      imgData->colorMap->getRGBByteLine(p0, colorLine, imgData->width,
+					imgData->ri);
+      break;
 #if SPLASH_CMYK
-      case splashModeCMYK8:
-	imgData->colorMap->getCMYK(p, &cmyk, imgData->ri);
-	*q++ = colToByte(cmyk.c);
-	*q++ = colToByte(cmyk.m);
-	*q++ = colToByte(cmyk.y);
-	*q++ = colToByte(cmyk.k);
+    case splashModeCMYK8:
+      imgData->colorMap->getCMYKByteLine(p0, colorLine, imgData->width,
+					 imgData->ri);
+      break;
+#endif
+    }
+  }
+
+  for (x = 0, p = p0, aq = alphaLine; x < imgData->width; ++x, p += nComps) {
+    alpha = 0;
+    for (i = 0; i < nComps; ++i) {
+      if (p[i] < imgData->maskColors[2*i] ||
+	  p[i] > imgData->maskColors[2*i+1]) {
+	alpha = 0xff;
 	break;
-#endif
       }
-      *aq++ = alpha;
     }
+    *aq++ = alpha;
   }
 
   ++imgData->y;
@@ -3428,6 +3459,7 @@
   return gTrue;
 }
 
+
 void SplashOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
 				int width, int height,
 				GfxImageColorMap *colorMap,
@@ -3476,7 +3508,12 @@
   // build a lookup table here
   imgData.lookup = NULL;
   if (colorMap->getNumPixelComps() == 1) {
-    n = 1 << colorMap->getBits();
+    if (colorMap->getBits() <= 8) {
+      n = 1 << colorMap->getBits();
+    } else {
+      // GfxImageColorMap and ImageStream compress 16-bit samples to 8-bit
+      n = 1 << 8;
+    }
     switch (colorMode) {
     case splashModeMono1:
     case splashModeMono8:
@@ -3639,6 +3676,7 @@
   return gTrue;
 }
 
+
 void SplashOutputDev::drawMaskedImage(GfxState *state, Object *ref,
 				      Stream *str, int width, int height,
 				      GfxImageColorMap *colorMap,
@@ -3745,7 +3783,12 @@
     // build a lookup table here
     imgData.lookup = NULL;
     if (colorMap->getNumPixelComps() == 1) {
-      n = 1 << colorMap->getBits();
+      if (colorMap->getBits() <= 8) {
+	n = 1 << colorMap->getBits();
+      } else {
+	// GfxImageColorMap and ImageStream compress 16-bit samples to 8-bit
+	n = 1 << 8;
+      }
       switch (colorMode) {
       case splashModeMono1:
       case splashModeMono8:
@@ -3806,7 +3849,6 @@
   GfxImageColorMap *colorMap;
   GfxRenderingIntent ri;
   Guchar matte[gfxColorMaxComps];
-  SplashColorPtr maskLookup;
   SplashColorMode colorMode;
   int width, height, y;
 };
@@ -3846,8 +3888,8 @@
     case splashModeMono8:
       if (alpha) {
 	imgData->colorMap->getGray(p, &gray, imgData->ri);
-	*q++ = imgData->matte[0] + (255 * (colToByte(gray) -
-					   imgData->matte[0])) / alpha;
+	*q++ = clip255(imgData->matte[0] +
+		       (255 * (colToByte(gray) - imgData->matte[0])) / alpha);
       } else {
 	*q++ = 0;
       }
@@ -3856,12 +3898,12 @@
     case splashModeBGR8:
       if (alpha) {
 	imgData->colorMap->getRGB(p, &rgb, imgData->ri);
-	*q++ = imgData->matte[0] + (255 * (colToByte(rgb.r) -
-					   imgData->matte[0])) / alpha;
-	*q++ = imgData->matte[1] + (255 * (colToByte(rgb.g) -
-					   imgData->matte[1])) / alpha;
-	*q++ = imgData->matte[2] + (255 * (colToByte(rgb.b) -
-					   imgData->matte[2])) / alpha;
+	*q++ = clip255(imgData->matte[0] +
+		       (255 * (colToByte(rgb.r) - imgData->matte[0])) / alpha);
+	*q++ = clip255(imgData->matte[1] +
+		       (255 * (colToByte(rgb.g) - imgData->matte[1])) / alpha);
+	*q++ = clip255(imgData->matte[2] +
+		       (255 * (colToByte(rgb.b) - imgData->matte[2])) / alpha);
       } else {
 	*q++ = 0;
 	*q++ = 0;
@@ -3872,14 +3914,18 @@
     case splashModeCMYK8:
       if (alpha) {
 	imgData->colorMap->getCMYK(p, &cmyk, imgData->ri);
-	*q++ = imgData->matte[0] + (255 * (colToByte(cmyk.c) -
-					   imgData->matte[0])) / alpha;
-	*q++ = imgData->matte[1] + (255 * (colToByte(cmyk.m) -
-					   imgData->matte[1])) / alpha;
-	*q++ = imgData->matte[2] + (255 * (colToByte(cmyk.y) -
-					   imgData->matte[2])) / alpha;
-	*q++ = imgData->matte[3] + (255 * (colToByte(cmyk.k) -
-					   imgData->matte[3])) / alpha;
+	*q++ = clip255(imgData->matte[0] +
+		       (255 * (colToByte(cmyk.c) - imgData->matte[0]))
+			 / alpha);
+	*q++ = clip255(imgData->matte[1] +
+		       (255 * (colToByte(cmyk.m) - imgData->matte[1]))
+			 / alpha);
+	*q++ = clip255(imgData->matte[2] +
+		       (255 * (colToByte(cmyk.y) - imgData->matte[2]))
+			 / alpha);
+	*q++ = clip255(imgData->matte[3] +
+		       (255 * (colToByte(cmyk.k) - imgData->matte[3]))
+		         / alpha);
       } else {
 	*q++ = 0;
 	*q++ = 0;
@@ -3896,6 +3942,7 @@
   return gTrue;
 }
 
+
 void SplashOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref,
 					  Stream *str, int width, int height,
 					  GfxImageColorMap *colorMap,
@@ -3990,13 +4037,11 @@
 #endif
     }
     //~ could add the matteImgData.lookup special case
-    n = 1 << maskColorMap->getBits();
-    matteImgData.maskLookup = (SplashColorPtr)gmalloc(n);
-    for (i = 0; i < n; ++i) {
-      pix = (Guchar)i;
-      maskColorMap->getGray(&pix, &gray,
-			    state->getRenderingIntent());
-      matteImgData.maskLookup[i] = colToByte(gray);
+    if (colorMap->getBits() <= 8) {
+      n = 1 << maskColorMap->getBits();
+    } else {
+      // GfxImageColorMap and ImageStream compress 16-bit samples to 8-bit
+      n = 1 << 8;
     }
     matteImgData.colorMode = colorMode;
     matteImgData.width = width;
@@ -4004,7 +4049,6 @@
     matteImgData.y = 0;
     splash->drawImage(&softMaskMatteImageSrc, &matteImgData,
 		      srcMode, gTrue, width, height, mat, interpolate);
-    gfree(matteImgData.maskLookup);
     delete matteImgData.maskStr;
     delete matteImgData.imgStr;
     maskStr->close();
@@ -4069,7 +4113,12 @@
     // build a lookup table here
     imgData.lookup = NULL;
     if (colorMap->getNumPixelComps() == 1) {
-      n = 1 << colorMap->getBits();
+      if (colorMap->getBits() <= 8) {
+	n = 1 << colorMap->getBits();
+      } else {
+	// GfxImageColorMap and ImageStream compress 16-bit samples to 8-bit
+	n = 1 << 8;
+      }
       switch (colorMode) {
       case splashModeMono1:
       case splashModeMono8:
@@ -4113,6 +4162,8 @@
     splash->setSoftMask(NULL);
     gfree(imgData.lookup);
     delete imgData.imgStr;
+
+
     str->close();
   }
 }
@@ -4217,7 +4268,7 @@
   SplashBitmap *backdropBitmap;
   SplashColor color;
   double xMin, yMin, xMax, yMax, x, y;
-  int tx, ty, w, h, i;
+  int bw, bh, tx, ty, w, h, i;
 
   // transform the bbox
   state->transform(bbox[0], bbox[1], &x, &y);
@@ -4276,28 +4327,30 @@
   }
 
   // convert box coords to integers
+  bw = bitmap->getWidth();
+  bh = bitmap->getHeight();
   tx = (int)floor(xMin);
   if (tx < 0) {
     tx = 0;
-  } else if (tx >= bitmap->getWidth()) {
-    tx = bitmap->getWidth() - 1;
+  } else if (tx >= bw) {
+    tx = bw - 1;
   }
   ty = (int)floor(yMin);
   if (ty < 0) {
     ty = 0;
-  } else if (ty >= bitmap->getHeight()) {
-    ty = bitmap->getHeight() - 1;
+  } else if (ty >= bh) {
+    ty = bh - 1;
   }
   w = (int)ceil(xMax) - tx + 1;
-  if (tx + w > bitmap->getWidth()) {
-    w = bitmap->getWidth() - tx;
+  if (tx + w > bw) {
+    w = bw - tx;
   }
   if (w < 1) {
     w = 1;
   }
   h = (int)ceil(yMax) - ty + 1;
-  if (ty + h > bitmap->getHeight()) {
-    h = bitmap->getHeight() - ty;
+  if (ty + h > bh) {
+    h = bh - ty;
   }
   if (h < 1) {
     h = 1;
@@ -4351,16 +4404,7 @@
 		 mapStrokeAdjustMode[globalParams->getStrokeAdjust()]);
   splash->setEnablePathSimplification(
 		 globalParams->getEnablePathSimplification());
-  //~ Acrobat apparently copies at least the fill and stroke colors, and
-  //~ maybe other state(?) -- but not the clipping path (and not sure
-  //~ what else)
-  //~ [this is likely the same situation as in type3D1()]
-  splash->setFillPattern(transpGroup->origSplash->getFillPattern()->copy());
-  splash->setStrokePattern(
-		         transpGroup->origSplash->getStrokePattern()->copy());
-  splash->setLineDash(transpGroup->origSplash->getLineDash(),
-		      transpGroup->origSplash->getLineDashLength(),
-		      transpGroup->origSplash->getLineDashPhase());
+  copyState(transpGroup->origSplash, gTrue);
   if (isolated) {
     for (i = 0; i < splashMaxColorComps; ++i) {
       color[i] = 0;
@@ -4387,7 +4431,13 @@
     splash->setInTransparencyGroup(backdropBitmap, tx, ty,
 				   !isolated, knockout);
   }
+  splash->clearModRegion();
   transpGroup->tBitmap = bitmap;
+#if 1 //~tmp
+  if (knockout) {
+    splash->setInShading(gTrue);
+  }
+#endif
   state->shiftCTM(-tx, -ty);
   updateCTM(state, 0, 0, 0, 0, 0, 0);
   ++nestCount;
@@ -4394,6 +4444,9 @@
 }
 
 void SplashOutputDev::endTransparencyGroup(GfxState *state) {
+  splash->getModRegion(&transpGroupStack->modXMin, &transpGroupStack->modYMin,
+		       &transpGroupStack->modXMax, &transpGroupStack->modYMax);
+
   // restore state
   --nestCount;
   delete splash;
@@ -4408,19 +4461,23 @@
   SplashBitmap *tBitmap;
   SplashTransparencyGroup *transpGroup;
   GBool isolated;
-  int tx, ty;
+  int xSrc, ySrc, xDest, yDest, w, h;
 
-  tx = transpGroupStack->tx;
-  ty = transpGroupStack->ty;
+  xSrc = transpGroupStack->modXMin;
+  ySrc = transpGroupStack->modYMin;
+  xDest = transpGroupStack->tx + transpGroupStack->modXMin;
+  yDest = transpGroupStack->ty + transpGroupStack->modYMin;
+  w = transpGroupStack->modXMax - transpGroupStack->modXMin + 1;
+  h = transpGroupStack->modYMax - transpGroupStack->modYMin + 1;
   tBitmap = transpGroupStack->tBitmap;
   isolated = transpGroupStack->isolated;
 
   // paint the transparency group onto the parent bitmap
   // - the clip path was set in the parent's state)
-  if (tx < bitmap->getWidth() && ty < bitmap->getHeight()) {
+  if (xDest < bitmap->getWidth() && yDest < bitmap->getHeight() &&
+      w > 0 && h > 0) {
     splash->setOverprintMask(0xffffffff);
-    splash->composite(tBitmap, 0, 0, tx, ty,
-		      tBitmap->getWidth(), tBitmap->getHeight(),
+    splash->composite(tBitmap, xSrc, ySrc, xDest, yDest, w, h,
 		      gFalse, !isolated);
   }
 
@@ -4462,13 +4519,13 @@
   if (!alpha && tBitmap->getMode() != splashModeMono1) {
     //~ need to correctly handle the case where no blending color
     //~ space is given
-    tSplash = new Splash(tBitmap, vectorAntialias,
-			 transpGroupStack->origSplash->getScreen());
-    tSplash->setStrokeAdjust(
-		    mapStrokeAdjustMode[globalParams->getStrokeAdjust()]);
-    tSplash->setEnablePathSimplification(
-		    globalParams->getEnablePathSimplification());
     if (transpGroupStack->blendingColorSpace) {
+      tSplash = new Splash(tBitmap, vectorAntialias,
+			   transpGroupStack->origSplash->getScreen());
+      tSplash->setStrokeAdjust(
+		      mapStrokeAdjustMode[globalParams->getStrokeAdjust()]);
+      tSplash->setEnablePathSimplification(
+		      globalParams->getEnablePathSimplification());
       switch (tBitmap->getMode()) {
       case splashModeMono1:
 	// transparency is not supported in mono1 mode
@@ -4562,7 +4619,7 @@
 	} else {
 	  lum2 = lum;
 	}
-	p[x] = (int)(lum2 * 255.0 + 0.5);
+	p[x] = (Guchar)(lum2 * 255.0 + 0.5);
       }
       p += softMask->getRowSize();
     }
@@ -4623,9 +4680,9 @@
   GfxCMYK cmyk;
 #endif
 
-  rgb.r = byteToCol(r);
-  rgb.g = byteToCol(g);
-  rgb.b = byteToCol(b);
+  rgb.r = byteToCol((Guchar)r);
+  rgb.g = byteToCol((Guchar)g);
+  rgb.b = byteToCol((Guchar)b);
   switch (colorMode) {
   case splashModeMono1:
   case splashModeMono8:
@@ -4784,6 +4841,25 @@
   return fontObj;
 }
 
+// This is called when initializing a temporary Splash object for Type
+// 3 characters and transparency groups.  Acrobat apparently copies at
+// least the fill and stroke colors, and the line parameters.
+//~ not sure what else should be copied -- the PDF spec is unclear
+//~   - fill and stroke alpha?
+void SplashOutputDev::copyState(Splash *oldSplash, GBool copyColors) {
+  // cached Type 3 chars set a color, so no need to copy the color here
+  if (copyColors) {
+    splash->setFillPattern(oldSplash->getFillPattern()->copy());
+    splash->setStrokePattern(oldSplash->getStrokePattern()->copy());
+  }
+  splash->setLineDash(oldSplash->getLineDash(),
+		      oldSplash->getLineDashLength(),
+		      oldSplash->getLineDashPhase());
+  splash->setLineCap(oldSplash->getLineCap());
+  splash->setLineJoin(oldSplash->getLineJoin());
+  splash->setLineWidth(oldSplash->getLineWidth());
+}
+
 #if 1 //~tmp: turn off anti-aliasing temporarily
 void SplashOutputDev::setInShading(GBool sh) {
   splash->setInShading(sh);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -51,6 +51,7 @@
 		  GBool bitmapTopDownA = gTrue,
 		  GBool allowAntialiasA = gTrue);
 
+
   // Destructor.
   virtual ~SplashOutputDev();
 
@@ -78,6 +79,7 @@
   virtual GBool interpretType3Chars() { return gTrue; }
 
 
+
   //----- initialization and control
 
   // Start a page.
@@ -267,7 +269,7 @@
   void doUpdateFont(GfxState *state);
   void drawType3Glyph(GfxState *state, T3FontCache *t3Font,
 		      T3FontCacheTag *tag, Guchar *data);
-  static GBool imageMaskSrc(void *data, SplashColorPtr line);
+  static GBool imageMaskSrc(void *data, Guchar *line);
   static GBool imageSrc(void *data, SplashColorPtr colorLine,
 			Guchar *alphaLine);
   static GBool alphaImageSrc(void *data, SplashColorPtr line,
@@ -283,6 +285,7 @@
 		       Splash *maskSplash,
 		       double xMin, double yMin,
 		       double xMax, double yMax);
+  void copyState(Splash *oldSplash, GBool copyColors);
 
   SplashColorMode colorMode;
   int bitmapRowPad;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -97,7 +97,7 @@
 	getChar();
       break;
     }
-    buf[i] = c;
+    buf[i] = (char)c;
   }
   buf[i] = '\0';
   return buf;
@@ -146,9 +146,9 @@
     str = makeFilter(obj.getName(), str, &params, recursion);
   } else if (obj.isArray()) {
     for (i = 0; i < obj.arrayGetLength(); ++i) {
-      obj.arrayGet(i, &obj2);
+      obj.arrayGet(i, &obj2, recursion);
       if (params.isArray())
-	params.arrayGet(i, &params2);
+	params.arrayGet(i, &params2, recursion);
       else
 	params2.initNull();
       if (obj2.isName()) {
@@ -356,7 +356,8 @@
 
   nVals = width * nComps;
   inputLineSize = (nVals * nBits + 7) >> 3;
-  if (nVals > INT_MAX / nBits - 7) {
+  if (width > INT_MAX / nComps ||
+      nVals > (INT_MAX - 7) / nBits) {
     // force a call to gmallocn(-1,...), which will throw an exception
     inputLineSize = -1;
   }
@@ -369,10 +370,6 @@
     } else {
       imgLineSize = nVals;
     }
-    if (width > INT_MAX / nComps) {
-      // force a call to gmallocn(-1,...), which will throw an exception
-      imgLineSize = -1;
-    }
     imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar));
   }
   imgIdx = nVals;
@@ -458,6 +455,7 @@
   str->getBlock(inputLine, inputLineSize);
 }
 
+
 //------------------------------------------------------------------------
 // StreamPredictor
 //------------------------------------------------------------------------
@@ -574,14 +572,13 @@
     }
     switch (curPred) {
     case 11:			// PNG sub
-      predLine[i] = predLine[i - pixBytes] + (Guchar)c;
+      predLine[i] = (Guchar)(predLine[i - pixBytes] + c);
       break;
     case 12:			// PNG up
-      predLine[i] = predLine[i] + (Guchar)c;
+      predLine[i] = (Guchar)(predLine[i] + c);
       break;
     case 13:			// PNG average
-      predLine[i] = ((predLine[i - pixBytes] + predLine[i]) >> 1) +
-	            (Guchar)c;
+      predLine[i] = (Guchar)(((predLine[i - pixBytes] + predLine[i]) >> 1) + c);
       break;
     case 14:			// PNG Paeth
       left = predLine[i - pixBytes];
@@ -595,11 +592,11 @@
       if ((pc = p - upLeft) < 0)
 	pc = -pc;
       if (pa <= pb && pa <= pc)
-	predLine[i] = left + (Guchar)c;
+	predLine[i] = (Guchar)(left + c);
       else if (pb <= pc)
-	predLine[i] = up + (Guchar)c;
+	predLine[i] = (Guchar)(up + c);
       else
-	predLine[i] = upLeft + (Guchar)c;
+	predLine[i] = (Guchar)(upLeft + c);
       break;
     case 10:			// PNG none
     default:			// no predictor or TIFF predictor
@@ -612,7 +609,7 @@
   if (predictor == 2) {
     if (nBits == 8) {
       for (i = pixBytes; i < rowBytes; ++i) {
-	predLine[i] += predLine[i - nComps];
+	predLine[i] = (Guchar)(predLine[i] + predLine[i - nComps]);
       }
     } else if (nBits == 16) {
       for (i = pixBytes; i < rowBytes; i += 2) {
@@ -1349,7 +1346,7 @@
   // process the next code
   nextLength = seqLength + 1;
   if (code < 256) {
-    seqBuf[0] = code;
+    seqBuf[0] = (Guchar)code;
     seqLength = 1;
   } else if (code < nextCode) {
     seqLength = table[code].length;
@@ -1357,9 +1354,9 @@
       seqBuf[i] = table[j].tail;
       j = table[j].head;
     }
-    seqBuf[0] = j;
+    seqBuf[0] = (Guchar)j;
   } else if (code == nextCode) {
-    seqBuf[seqLength] = newChar;
+    seqBuf[seqLength] = (Guchar)newChar;
     ++seqLength;
   } else {
     error(errSyntaxError, getPos(), "Bad LZW stream - unexpected code");
@@ -1372,7 +1369,7 @@
   } else {
     table[nextCode].length = nextLength;
     table[nextCode].head = prevCode;
-    table[nextCode].tail = newChar;
+    table[nextCode].tail = (Guchar)newChar;
     ++nextCode;
     if (nextCode + early == 512)
       nextBits = 10;
@@ -1534,8 +1531,8 @@
   columns = columnsA;
   if (columns < 1) {
     columns = 1;
-  } else if (columns > INT_MAX - 2) {
-    columns = INT_MAX - 2;
+  } else if (columns > INT_MAX - 3) {
+    columns = INT_MAX - 3;
   }
   rows = rowsA;
   endOfBlock = endOfBlockA;
@@ -1543,10 +1540,10 @@
   blackXOR = black ? 0xff : 0x00;
   // 0 <= codingLine[0] < codingLine[1] < ... < codingLine[n] = columns
   // ---> max codingLine size = columns + 1
-  // refLine has one extra guard entry at the end
-  // ---> max refLine size = columns + 2
+  // refLine has two extra guard entries at the end
+  // ---> max refLine size = columns + 3
   codingLine = (int *)gmallocn(columns + 1, sizeof(int));
-  refLine = (int *)gmallocn(columns + 2, sizeof(int));
+  refLine = (int *)gmallocn(columns + 3, sizeof(int));
 
   eof = gFalse;
   row = 0;
@@ -1555,6 +1552,8 @@
   codingLine[0] = columns;
   nextCol = columns;
   a0i = 0;
+  err = gFalse;
+  nErrors = 0;
 }
 
 CCITTFaxStream::~CCITTFaxStream() {
@@ -1714,7 +1713,7 @@
       } while (bitsNeeded > 0);
     }
     nextCol += 8;
-    blk[bytesRead++] = c ^ blackXOR;
+    blk[bytesRead++] = (char)(c ^ blackXOR);
   }
   return bytesRead;
 }
@@ -1725,6 +1724,7 @@
       error(errSyntaxError, getPos(),
 	    "CCITTFax row is wrong length ({0:d})", a1);
       err = gTrue;
+      ++nErrors;
       a1 = columns;
     }
     if ((a0i & 1) ^ blackPixels) {
@@ -1740,6 +1740,7 @@
       error(errSyntaxError, getPos(),
 	    "CCITTFax row is wrong length ({0:d})", a1);
       err = gTrue;
+      ++nErrors;
       a1 = columns;
     }
     if ((a0i & 1) ^ blackPixels) {
@@ -1750,6 +1751,7 @@
     if (a1 < 0) {
       error(errSyntaxError, getPos(), "Invalid CCITTFax code");
       err = gTrue;
+      ++nErrors;
       a1 = 0;
     }
     while (a0i > 0 && a1 <= codingLine[a0i - 1]) {
@@ -1777,6 +1779,7 @@
       refLine[i] = codingLine[i];
     }
     refLine[i++] = columns;
+    refLine[i++] = columns;
     refLine[i] = columns;
     codingLine[0] = 0;
     a0i = 0;
@@ -1914,6 +1917,7 @@
 	      "Bad 2D code {0:04x} in CCITTFax stream", code1);
 	addPixels(columns, 0);
 	err = gTrue;
+	++nErrors;
 	break;
       }
     }
@@ -2014,6 +2018,7 @@
 	  if (code1 != 0x001) {
 	    error(errSyntaxError, getPos(),
 		  "Bad RTC code in CCITTFax stream");
+	    ++nErrors;
 	  }
 	  eatBits(12);
 	  if (encoding > 0) {
@@ -2047,6 +2052,14 @@
     }
   }
 
+  // corrupt CCITTFax streams can generate huge data expansion -- we
+  // avoid that case by aborting decode after 1000 errors
+  if (nErrors > 1000) {
+    error(errSyntaxError, getPos(), "Too many errors in CCITTFaxStream - aborting decode");
+    eof = gTrue;
+    return gFalse;
+  }
+
   // set up for output
   nextCol = 0;
   a0i = (codingLine[0] > 0) ? 0 : 1;
@@ -2087,6 +2100,7 @@
   }
   error(errSyntaxError, getPos(),
 	"Bad two dim code ({0:04x}) in CCITTFax stream", code);
+  ++nErrors;
   return EOF;
 }
 
@@ -2117,7 +2131,7 @@
 	return 1;
       }
       if (n < 9) {
-	code <<= 9 - n;
+	code = (short)(code << (9 - n));
       }
       p = &whiteTab2[code];
       if (p->bits == n) {
@@ -2131,7 +2145,7 @@
 	return 1;
       }
       if (n < 12) {
-	code <<= 12 - n;
+	code = (short)(code << (12 - n));
       }
       p = &whiteTab1[code];
       if (p->bits == n) {
@@ -2142,6 +2156,7 @@
   }
   error(errSyntaxError, getPos(),
 	"Bad white code ({0:04x}) in CCITTFax stream", code);
+  ++nErrors;
   // eat a bit and return a positive number so that the caller doesn't
   // go into an infinite loop
   eatBits(1);
@@ -2177,7 +2192,7 @@
 	return 1;
       }
       if (n < 6) {
-	code <<= 6 - n;
+	code = (short)(code << (6 - n));
       }
       p = &blackTab3[code];
       if (p->bits == n) {
@@ -2191,7 +2206,7 @@
 	return 1;
       }
       if (n < 12) {
-	code <<= 12 - n;
+	code = (short)(code << (12 - n));
       }
       if (code >= 64) {
 	p = &blackTab2[code - 64];
@@ -2207,7 +2222,7 @@
 	return 1;
       }
       if (n < 13) {
-	code <<= 13 - n;
+	code = (short)(code << (13 - n));
       }
       p = &blackTab1[code];
       if (p->bits == n) {
@@ -2218,6 +2233,7 @@
   }
   error(errSyntaxError, getPos(),
 	"Bad black code ({0:04x}) in CCITTFax stream", code);
+  ++nErrors;
   // eat a bit and return a positive number so that the caller doesn't
   // go into an infinite loop
   eatBits(1);
@@ -2236,12 +2252,12 @@
       // than are available, but there may still be a valid code in
       // however many bits are available -- we need to return correct
       // data in this case
-      return (inputBuf << (n - inputBits)) & (0xffffffff >> (32 - n));
+      return (short)((inputBuf << (n - inputBits)) & (0xffffffff >> (32 - n)));
     }
     inputBuf = (inputBuf << 8) + c;
     inputBits += 8;
   }
-  return (inputBuf >> (inputBits - n)) & (0xffffffff >> (32 - n));
+  return (short)((inputBuf >> (inputBits - n)) & (0xffffffff >> (32 - n)));
 }
 
 GString *CCITTFaxStream::getPSFilter(int psLevel, const char *indent) {
@@ -2569,7 +2585,7 @@
       dctClipData[dctClipOffset + i] = 0;
     }
     for (i = 0; i < 256; ++i) {
-      dctClipData[dctClipOffset + i] = i;
+      dctClipData[dctClipOffset + i] = (Guchar)i;
     }
     for (i = 256; i < 639; ++i) {
       dctClipData[dctClipOffset + i] = 255;
@@ -2578,7 +2594,7 @@
   }
 }
 
-static inline int dctClip(int x) {
+static inline Guchar dctClip(int x) {
   return dctClipData[(dctClipOffset + x) & dctClipMask];
 }
 
@@ -2646,7 +2662,7 @@
   gotAdobeMarker = gFalse;
   restartInterval = 0;
 
-  if (!readHeader()) {
+  if (!readHeader(gTrue)) {
     // force an EOF condition
     progressive = gTrue;
     y = height;
@@ -2707,7 +2723,7 @@
       restartMarker = 0xd0;
       restart();
       readScan();
-    } while (readHeader());
+    } while (readHeader(gFalse));
 
     // decode
     decodeImage();
@@ -2866,6 +2882,20 @@
   int x1, x2, y2, x3, y3, x4, y4, x5, y5, cc, i;
   int c;
 
+  for (cc = 0; cc < numComps; ++cc) {
+    if (scanInfo.dcHuffTable[cc] >= numDCHuffTables ||
+	scanInfo.acHuffTable[cc] >= numACHuffTables) {
+      error(errSyntaxError, getPos(),
+	    "Bad DCT data: invalid Huffman table index");
+      return gFalse;
+    }
+    if (compInfo[cc].quantTable > numQuantTables) {
+      error(errSyntaxError, getPos(),
+	    "Bad DCT data: invalid quant table index");
+      return gFalse;
+    }
+  }
+
   for (x1 = 0; x1 < width; x1 += mcuWidth) {
 
     // deal with restart marker
@@ -2974,11 +3004,11 @@
 	pCb = p1[1] - 128;
 	pCr = p1[2] - 128;
 	pR = ((pY << 16) + dctCrToR * pCr + 32768) >> 16;
-	p1[0] = 255 - dctClip(pR);
+	p1[0] = (Guchar)(255 - dctClip(pR));
 	pG = ((pY << 16) + dctCbToG * pCb + dctCrToG * pCr + 32768) >> 16;
-	p1[1] = 255 - dctClip(pG);
+	p1[1] = (Guchar)(255 - dctClip(pG));
 	pB = ((pY << 16) + dctCbToB * pCb + 32768) >> 16;
-	p1[2] = 255 - dctClip(pB);
+	p1[2] = (Guchar)(255 - dctClip(pB));
       }
     }
   }
@@ -3001,6 +3031,22 @@
   int *p1;
   int c;
 
+  for (cc = 0; cc < numComps; ++cc) {
+    if (scanInfo.comp[cc] &&
+	(scanInfo.dcHuffTable[cc] >= numDCHuffTables ||
+	 ((!progressive || scanInfo.lastCoeff > 0) &&
+	  scanInfo.acHuffTable[cc] >= numACHuffTables))) {
+      error(errSyntaxError, getPos(),
+	    "Bad DCT data: invalid Huffman table index");
+      return;
+    }
+    if (compInfo[cc].quantTable > numQuantTables) {
+      error(errSyntaxError, getPos(),
+	    "Bad DCT data: invalid quant table index");
+      return;
+    }
+  }
+
   if (scanInfo.numComps == 1) {
     for (cc = 0; cc < numComps; ++cc) {
       if (scanInfo.comp[cc]) {
@@ -3175,11 +3221,7 @@
 	return gFalse;
       }
       if (bit) {
-	if (data[0] >= 0) {
-	  data[0] += 1 << scanInfo.al;
-	} else {
-	  data[0] -= 1 << scanInfo.al;
-	}
+	data[0] += 1 << scanInfo.al;
       }
     }
     ++i;
@@ -3655,7 +3697,7 @@
     if ((bit = readBit()) == EOF) {
       return 9999;
     }
-    code = (code << 1) + bit;
+    code = (Gushort)((code << 1) + bit);
     ++codeBits;
 
     // look up code
@@ -3663,7 +3705,7 @@
       break;
     }
     if (code - table->firstCode[codeBits] < table->numCodes[codeBits]) {
-      code -= table->firstCode[codeBits];
+      code = (Gushort)(code - table->firstCode[codeBits]);
       return table->sym[table->firstSym[codeBits] + code];
     }
   } while (codeBits < 16);
@@ -3711,7 +3753,7 @@
   return bit;
 }
 
-GBool DCTStream::readHeader() {
+GBool DCTStream::readHeader(GBool frame) {
   GBool doScan;
   int n;
   int c = 0;
@@ -3723,11 +3765,21 @@
     switch (c) {
     case 0xc0:			// SOF0 (sequential)
     case 0xc1:			// SOF1 (extended sequential)
+      if (!frame) {
+	error(errSyntaxError, getPos(),
+	      "Invalid DCT marker in scan <{0:02x}>", c);
+	return gFalse;
+      }
       if (!readBaselineSOF()) {
 	return gFalse;
       }
       break;
     case 0xc2:			// SOF2 (progressive)
+      if (!frame) {
+	error(errSyntaxError, getPos(),
+	      "Invalid DCT marker in scan <{0:02x}>", c);
+	return gFalse;
+      }
       if (!readProgressiveSOF()) {
 	return gFalse;
       }
@@ -3738,6 +3790,11 @@
       }
       break;
     case 0xd8:			// SOI
+      if (!frame) {
+	error(errSyntaxError, getPos(),
+	      "Invalid DCT marker in scan <{0:02x}>", c);
+	return gFalse;
+      }
       break;
     case 0xd9:			// EOI
       return gFalse;
@@ -3758,11 +3815,21 @@
       }
       break;
     case 0xe0:			// APP0
+      if (!frame) {
+	error(errSyntaxError, getPos(),
+	      "Invalid DCT marker in scan <{0:02x}>", c);
+	return gFalse;
+      }
       if (!readJFIFMarker()) {
 	return gFalse;
       }
       break;
     case 0xee:			// APP14
+      if (!frame) {
+	error(errSyntaxError, getPos(),
+	      "Invalid DCT marker in scan <{0:02x}>", c);
+	return gFalse;
+      }
       if (!readAdobeMarker()) {
 	return gFalse;
       }
@@ -3945,9 +4012,9 @@
     }
     for (i = 0; i < 64; ++i) {
       if (prec) {
-	quantTables[index][dctZigZag[i]] = read16();
+	quantTables[index][dctZigZag[i]] = (Gushort)read16();
       } else {
-	quantTables[index][dctZigZag[i]] = str->getChar();
+	quantTables[index][dctZigZag[i]] = (Gushort)str->getChar();
       }
     }
     if (prec) {
@@ -3993,13 +4060,13 @@
       c = str->getChar();
       tbl->firstSym[i] = sym;
       tbl->firstCode[i] = code;
-      tbl->numCodes[i] = c;
-      sym += c;
-      code = (code + c) << 1;
+      tbl->numCodes[i] = (Gushort)c;
+      sym = (Guchar)(sym + c);
+      code = (Gushort)((code + c) << 1);
     }
     length -= 16;
     for (i = 0; i < sym; ++i)
-      tbl->sym[i] = str->getChar();
+      tbl->sym[i] = (Guchar)str->getChar();
     length -= sym;
   }
   return gTrue;
@@ -4030,7 +4097,7 @@
 	error(errSyntaxError, getPos(), "Bad DCT APP0 marker");
 	return gFalse;
       }
-      buf[i] = c;
+      buf[i] = (char)c;
     }
     length -= 5;
     if (!memcmp(buf, "JFIF\0", 5)) {
@@ -4060,7 +4127,7 @@
     if ((c = str->getChar()) == EOF) {
       goto err;
     }
-    buf[i] = c;
+    buf[i] = (char)c;
   }
   if (!strncmp(buf, "Adobe", 5)) {
     colorXform = buf[11];
@@ -4947,7 +5014,7 @@
     if ((code1 = getHuffmanCodeWord(&litCodeTab)) == EOF)
       goto err;
     if (code1 < 256) {
-      buf[index] = code1;
+      buf[index] = (Guchar)code1;
       remain = 1;
     } else if (code1 == 256) {
       endOfBlock = gTrue;
@@ -4981,7 +5048,7 @@
 	endOfBlock = eof = gTrue;
 	break;
       }
-      buf[j] = c & 0xff;
+      buf[j] = (Guchar)c;
     }
     remain = i;
     blockLen -= len;
@@ -5569,7 +5636,7 @@
     if ((c2 = str->getChar()) == EOF) {
       eof = gTrue;
       buf[0] = 0;
-      buf[1] = c1;
+      buf[1] = (char)c1;
       bufPtr = buf;
       bufEnd = &buf[2];
       return gTrue;
@@ -5585,12 +5652,12 @@
     while (n < 128 && (c = str->getChar()) == c1)
       ++n;
     buf[0] = (char)(257 - n);
-    buf[1] = c1;
+    buf[1] = (char)c1;
     bufEnd = &buf[2];
     if (c == EOF) {
       eof = gTrue;
     } else if (n < 128) {
-      buf[2] = c;
+      buf[2] = (char)c;
       nextEnd = &buf[3];
     } else {
       nextEnd = bufEnd;
@@ -5598,8 +5665,8 @@
 
   // get up to 128 chars
   } else {
-    buf[1] = c1;
-    buf[2] = c2;
+    buf[1] = (char)c1;
+    buf[2] = (char)c2;
     n = 2;
     while (n < 128) {
       if ((c = str->getChar()) == EOF) {
@@ -5607,7 +5674,7 @@
 	break;
       }
       ++n;
-      buf[n] = c;
+      buf[n] = (char)c;
       if (buf[n] == buf[n-1])
 	break;
     }
@@ -5757,7 +5824,7 @@
     memcpy(inBuf, inBuf + inBufStart, inBufLen);
     inBufStart = 0;
     inBufLen += str->getBlock((char *)inBuf + inBufLen,
-			      sizeof(inBuf) - inBufLen);
+			      (int)sizeof(inBuf) - inBufLen);
   }
 
   // increment codeLen; generate clear-table code

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -248,6 +248,7 @@
   int imgIdx;			// current index in imgLine
 };
 
+
 //------------------------------------------------------------------------
 // StreamPredictor
 //------------------------------------------------------------------------
@@ -574,6 +575,7 @@
   int nextCol;			// next column to read
   int a0i;			// index into codingLine
   GBool err;			// error on current line
+  int nErrors;			// number of errors so far in this stream
 
   void addPixels(int a1, int blackPixels);
   void addPixelsNeg(int a1, int blackPixels);
@@ -726,7 +728,7 @@
   int readHuffSym(DCTHuffTable *table);
   int readAmp(int size);
   int readBit();
-  GBool readHeader();
+  GBool readHeader(GBool frame);
   GBool readBaselineSOF();
   GBool readProgressiveSOF();
   GBool readScanInfo();

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -29,6 +29,7 @@
 #include "Error.h"
 #include "GlobalParams.h"
 #include "UnicodeMap.h"
+#include "UnicodeRemapping.h"
 #include "UnicodeTypeTable.h"
 #include "GfxState.h"
 #include "Link.h"
@@ -155,6 +156,8 @@
 // rectangles, in order to work around flakey ascent values in fonts.
 #define selectionAscent 0.8
 
+#define maxUnicodeLen 16
+
 //------------------------------------------------------------------------
 // TextChar
 //------------------------------------------------------------------------
@@ -243,7 +246,7 @@
   } else if (ch1->xMin > ch2->xMin) {
     return 1;
   } else {
-    return 0;
+    return ch1->charPos - ch2->charPos;
   }
 }
 
@@ -256,7 +259,7 @@
   } else if (ch1->yMin > ch2->yMin) {
     return 1;
   } else {
-    return 0;
+    return ch1->charPos - ch2->charPos;
   }
 }
 
@@ -547,7 +550,7 @@
     for (code = 0; code < 256; ++code) {
       if ((name = ((Gfx8BitFont *)gfxFont)->getCharName(code)) &&
 	  name[0] == 'm' && name[1] == '\0') {
-	mWidth = ((Gfx8BitFont *)gfxFont)->getWidth(code);
+	mWidth = ((Gfx8BitFont *)gfxFont)->getWidth((Guchar)code);
 	break;
       }
     }
@@ -811,7 +814,20 @@
 }
 
 double TextLine::getBaseline() {
-  return ((TextWord *)words->get(0))->getBaseline();
+  TextWord *word0;
+
+  word0 = (TextWord *)words->get(0);
+  switch (rot) {
+  case 0:
+  default:
+    return yMax + fontSize * word0->font->descent;
+  case 1:
+    return xMin - fontSize * word0->font->descent;
+  case 2:
+    return yMin - fontSize * word0->font->descent;
+  case 3:
+    return xMax + fontSize * word0->font->descent;
+  }
 }
 
 int TextLine::cmpX(const void *p1, const void *p2) {
@@ -994,6 +1010,9 @@
 
 TextPage::TextPage(TextOutputControl *controlA) {
   control = *controlA;
+  remapping = globalParams->getUnicodeRemapping();
+  uBufSize = 16;
+  uBuf = (Unicode *)gmallocn(uBufSize, sizeof(Unicode));
   pageWidth = pageHeight = 0;
   charPos = 0;
   curFont = NULL;
@@ -1031,6 +1050,7 @@
   if (findCols) {
     deleteGList(findCols, TextColumn);
   }
+  gfree(uBuf);
 }
 
 void TextPage::startPage(GfxState *state) {
@@ -1122,20 +1142,21 @@
 	letterCode = code;
       }
       if (anyCode < 0 && name &&
-	  ((Gfx8BitFont *)gfxFont)->getWidth(code) > 0) {
+	  ((Gfx8BitFont *)gfxFont)->getWidth((Guchar)code) > 0) {
 	anyCode = code;
       }
     }
     if (mCode >= 0 &&
-	(w = ((Gfx8BitFont *)gfxFont)->getWidth(mCode)) > 0) {
+	(w = ((Gfx8BitFont *)gfxFont)->getWidth((Guchar)mCode)) > 0) {
       // 0.6 is a generic average 'm' width -- yes, this is a hack
       curFontSize *= w / 0.6;
     } else if (letterCode >= 0 &&
-	       (w = ((Gfx8BitFont *)gfxFont)->getWidth(letterCode)) > 0) {
+	       (w = ((Gfx8BitFont *)gfxFont)->getWidth((Guchar)letterCode))
+	         > 0) {
       // even more of a hack: 0.5 is a generic letter width
       curFontSize *= w / 0.5;
     } else if (anyCode >= 0 &&
-	       (w = ((Gfx8BitFont *)gfxFont)->getWidth(anyCode)) > 0) {
+	       (w = ((Gfx8BitFont *)gfxFont)->getWidth((Guchar)anyCode)) > 0) {
       // better than nothing: 0.5 is a generic character width
       curFontSize *= w / 0.5;
     }
@@ -1184,7 +1205,7 @@
   GfxRGB rgb;
   double alpha;
   GBool clipped, rtl;
-  int i, j;
+  int uBufLen, i, j;
 
   // if we're in an ActualText span, save the position info (the
   // ActualText chars will be added by TextPage::endActualText()).
@@ -1246,16 +1267,26 @@
     return;
   }
 
+  // remap Unicode
+  uBufLen = 0;
+  for (i = 0; i < uLen; ++i) {
+    if (uBufSize - uBufLen < 8 && uBufSize < 20000) {
+      uBufSize *= 2;
+      uBuf = (Unicode *)greallocn(uBuf, uBufSize, sizeof(Unicode));
+    }
+    uBufLen += remapping->map(u[i], uBuf + uBufLen, uBufSize - uBufLen);
+  }
+
   // add the characters
-  if (uLen > 0) {
+  if (uBufLen > 0) {
 
     // handle right-to-left ligatures: if there are multiple Unicode
     // characters, and they're all right-to-left, insert them in
     // right-to-left order
-    if (uLen > 1) {
+    if (uBufLen > 1) {
       rtl = gTrue;
-      for (i = 0; i < uLen; ++i) {
-	if (!unicodeTypeR(u[i])) {
+      for (i = 0; i < uBufLen; ++i) {
+	if (!unicodeTypeR(uBuf[i])) {
 	  rtl = gFalse;
 	  break;
 	}
@@ -1265,11 +1296,11 @@
     }
 
     // compute the bounding box
-    w1 /= uLen;
-    h1 /= uLen;
+    w1 /= uBufLen;
+    h1 /= uBufLen;
     ascent = curFont->ascent * curFontSize;
     descent = curFont->descent * curFontSize;
-    for (i = 0; i < uLen; ++i) {
+    for (i = 0; i < uBufLen; ++i) {
       x2 = x1 + i * w1;
       y2 = y1 + i * h1;
       switch (curRot) {
@@ -1320,11 +1351,12 @@
 	alpha = state->getFillOpacity();
       }
       if (rtl) {
-	j = uLen - 1 - i;
+	j = uBufLen - 1 - i;
       } else {
 	j = i;
       }
-      chars->append(new TextChar(u[j], charPos, nBytes, xMin, yMin, xMax, yMax,
+      chars->append(new TextChar(uBuf[j], charPos, nBytes,
+				 xMin, yMin, xMax, yMax,
 				 curRot, clipped,
 				 state->getRender() == 3 || alpha < 0.001,
 				 curFont, curFontSize,
@@ -1405,7 +1437,7 @@
     break;
   case eolDOS:
     eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
-    eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen);
+    eolLen += uMap->mapUnicode(0x0a, eol + eolLen, (int)sizeof(eol) - eolLen);
     break;
   case eolMac:
     eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
@@ -4358,7 +4390,7 @@
     break;
   case eolDOS:
     eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
-    eolLen += uMap->mapUnicode(0x0a, eol + eolLen, sizeof(eol) - eolLen);
+    eolLen += uMap->mapUnicode(0x0a, eol + eolLen, (int)sizeof(eol) - eolLen);
     break;
   case eolMac:
     eolLen = uMap->mapUnicode(0x0d, eol, sizeof(eol));
@@ -4497,6 +4529,28 @@
   return gTrue;
 }
 
+GBool TextPage::checkPointInside(double x, double y) {
+  TextColumn *col;
+  int colIdx;
+
+  buildFindCols();
+
+  //~ this doesn't handle RtL, vertical, or rotated text
+  //~ this doesn't handle drop caps
+
+  for (colIdx = 0; colIdx < findCols->getLength(); ++colIdx) {
+    col = (TextColumn *)findCols->get(colIdx);
+    if (col->getRotation() != 0) {
+      continue;
+    }
+    if (x >= col->getXMin() && x <= col->getXMax() &&
+	y >= col->getYMin() && y <= col->getYMax()) {
+      return gTrue;
+    }
+  }
+  return gFalse;
+}
+
 GBool TextPage::findPointInside(double x, double y, TextPosition *pos) {
   TextColumn *col;
   int colIdx;
@@ -4708,6 +4762,37 @@
 }
 
 TextWordList *TextPage::makeWordList() {
+  return makeWordListForChars(chars);
+}
+
+TextWordList *TextPage::makeWordListForRect(double xMin, double yMin,
+					    double xMax, double yMax) {
+  TextWordList *words;
+  GList *chars2;
+  TextChar *ch;
+  double xx, yy;
+  int i;
+
+  // get all chars in the rectangle
+  // (i.e., all chars whose center lies inside the rectangle)
+  chars2 = new GList();
+  for (i = 0; i < chars->getLength(); ++i) {
+    ch = (TextChar *)chars->get(i);
+    xx = 0.5 * (ch->xMin + ch->xMax);
+    yy = 0.5 * (ch->yMin + ch->yMax);
+    if (xx > xMin && xx < xMax && yy > yMin && yy < yMax) {
+      chars2->append(ch);
+    }
+  }
+
+  words = makeWordListForChars(chars2);
+
+  delete chars2;
+
+  return words;
+}
+
+TextWordList *TextPage::makeWordListForChars(GList *charList) {
   TextBlock *tree;
   GList *columns;
   TextColumn *col;
@@ -4718,12 +4803,18 @@
   GBool primaryLR;
   int rot, colIdx, parIdx, lineIdx, wordIdx;
 
-  rot = rotateChars(chars);
-  primaryLR = checkPrimaryLR(chars);
-  tree = splitChars(chars);
+#if 0 //~debug
+  dumpCharList(charList);
+#endif
+  rot = rotateChars(charList);
+  primaryLR = checkPrimaryLR(charList);
+  tree = splitChars(charList);
+#if 0 //~debug
+  dumpTree(tree);
+#endif
   if (!tree) {
     // no text
-    unrotateChars(chars, rot);
+    unrotateChars(charList, rot);
     return new TextWordList(new GList(), gTrue);
   }
   columns = buildColumns(tree, primaryLR);
@@ -4731,7 +4822,7 @@
   dumpColumns(columns, gTrue);
 #endif
   delete tree;
-  unrotateChars(chars, rot);
+  unrotateChars(charList, rot);
   if (control.html) {
     rotateUnderlinesAndLinks(rot);
     generateUnderlinesAndLinks(columns);
@@ -4791,9 +4882,9 @@
 
   for (i = 0; i < charsA->getLength(); ++i) {
     ch = (TextChar *)charsA->get(i);
-    printf("char: U+%04x '%c' xMin=%g yMin=%g xMax=%g yMax=%g fontSize=%g rot=%d charPos=%d charLen=%d\n",
+    printf("char: U+%04x '%c' xMin=%g yMin=%g xMax=%g yMax=%g fontSize=%g rot=%d charPos=%d charLen=%d spaceAfter=%d\n",
 	   ch->c, ch->c & 0xff, ch->xMin, ch->yMin, ch->xMax, ch->yMax,
-	   ch->fontSize, ch->rot, ch->charPos, ch->charLen);
+	   ch->fontSize, ch->rot, ch->charPos, ch->charLen, ch->spaceAfter);
   }
 }
 
@@ -5180,6 +5271,11 @@
   return text->makeWordList();
 }
 
+TextWordList *TextOutputDev::makeWordListForRect(double xMin, double yMin,
+						 double xMax, double yMax) {
+  return text->makeWordListForRect(xMin, yMin, xMax, yMax);
+}
+
 TextPage *TextOutputDev::takeText() {
   TextPage *ret;
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -22,6 +22,7 @@
 
 class GList;
 class UnicodeMap;
+class UnicodeRemapping;
 
 class TextBlock;
 class TextChar;
@@ -390,6 +391,9 @@
 		      double *xMin, double *yMin,
 		      double *xMax, double *yMax);
 
+  // Returns true if x,y falls inside a column.
+  GBool checkPointInside(double x, double y);
+
   // Find a point inside a column.  Returns false if x,y fall outside
   // all columns.
   GBool findPointInside(double x, double y, TextPosition *pos);
@@ -425,6 +429,11 @@
   // Build a flat word list, in the specified ordering.
   TextWordList *makeWordList();
 
+  // Build a word list containing only words inside the specified
+  // rectangle.
+  TextWordList *makeWordListForRect(double xMin, double yMin,
+				    double xMax, double yMax);
+
   // Returns true if the primary character direction is left-to-right,
   // false if it is right-to-left.
   GBool primaryDirectionIsLR();
@@ -532,8 +541,15 @@
   void dumpUnderlines();
 #endif
 
+  // word list
+  TextWordList *makeWordListForChars(GList *charList);
+
   TextOutputControl control;	// formatting parameters
 
+  UnicodeRemapping *remapping;
+  Unicode *uBuf;
+  int uBufSize;
+
   double pageWidth, pageHeight;	// width and height of current page
   int charPos;			// next character position (within content
 				//   stream)
@@ -686,6 +702,11 @@
   // order (if both flags are false).
   TextWordList *makeWordList();
 
+  // Build a word list containing only words inside the specified
+  // rectangle.
+  TextWordList *makeWordListForRect(double xMin, double yMin,
+				    double xMax, double yMax);
+
   // Returns the TextPage object for the last rasterized page,
   // transferring ownership to the caller.
   TextPage *takeText();

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -231,7 +231,8 @@
 // BGR8 color modes.
 void TileCompositor::clearBitmap() {
   SplashColorPtr data, row, p;
-  int rowSize, w, h, x, y;
+  SplashBitmapRowSize rowSize;
+  int w, h, x, y;
 
   w = bitmap->getWidth();
   h = bitmap->getHeight();
@@ -299,7 +300,9 @@
   SplashColorPtr paperColor;
   Guchar *alphaData, *alphaP;
   Guchar alpha, alpha1;
-  int srcRowSize, destRowSize, alphaRowSize, x, y;
+  SplashBitmapRowSize srcRowSize, destRowSize;
+  size_t alphaRowSize;
+  int x, y;
 
   srcData = srcBitmap->getDataPtr();
   srcRowSize = srcBitmap->getRowSize();
@@ -307,7 +310,7 @@
   destRowSize = destBitmap->getRowSize();
 
   if (compositeWithPaper && (alphaData = srcBitmap->getAlphaPtr())) {
-    alphaRowSize = srcBitmap->getWidth();
+    alphaRowSize = srcBitmap->getAlphaRowSize();
     paperColor = state->getPaperColor();
     for (y = 0; y < h; ++y) {
       destP = &destData[(yDest + y) * destRowSize + 3 * xDest];
@@ -325,7 +328,7 @@
 	  destP[1] = paperColor[1];
 	  destP[2] = paperColor[2];
 	} else {
-	  alpha1 = 255 - alpha;
+	  alpha1 = (Guchar)(255 - alpha);
 	  destP[0] = div255(alpha1 * paperColor[0] + alpha * srcP[0]);
 	  destP[1] = div255(alpha1 * paperColor[1] + alpha * srcP[1]);
 	  destP[2] = div255(alpha1 * paperColor[2] + alpha * srcP[2]);
@@ -349,7 +352,8 @@
 			  SplashColorPtr color) {
   SplashColorPtr data, p;
   Guchar c0, c1, c2;
-  int rowSize, x, y;
+  SplashBitmapRowSize rowSize;
+  int x, y;
 
   if (xDest < 0) {
     w += xDest;
@@ -399,7 +403,8 @@
 				    SplashColorPtr color) {
   SplashColorPtr data, p;
   Guchar c0, c1, c2;
-  int rowSize, x, y;
+  SplashBitmapRowSize rowSize;
+  int x, y;
 
   if (xDest < 0) {
     w += xDest;
@@ -435,9 +440,9 @@
   for (y = 0; y < h; ++y) {
     p = &data[(yDest + y) * rowSize + 3 * xDest];
     for (x = 0; x < w; ++x) {
-      p[0] = (3 * p[0] + c0) / 4;
-      p[1] = (3 * p[1] + c1) / 4;
-      p[2] = (3 * p[2] + c2) / 4;
+      p[0] = (Guchar)((3 * p[0] + c0) / 4);
+      p[1] = (Guchar)((3 * p[1] + c1) / 4);
+      p[2] = (Guchar)((3 * p[2] + c2) / 4);
       p += 3;
     }
   }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -989,7 +989,6 @@
     }
     offsetX2 = offsetX + pageW1 + sideBySidePageSpacing;
     return (page == leftPage) ? offsetX : offsetX2;
-    return 0;
   case displaySideBySideContinuous:
     leftPage = ((page - 1) & ~1) + 1;
     rightPage = leftPage + 1;
@@ -1008,6 +1007,68 @@
   }
 }
 
+int TileMap::getPageRightX(int page) {
+  int leftPage, rightPage, pageW1, pageW2, offsetX, offsetX2;
+
+  if (!state->getDoc() || !state->getDoc()->getNumPages()) {
+    return 0;
+  }
+
+  updatePageParams();
+  updateContinuousModeParams();
+
+  switch (state->getDisplayMode()) {
+  case displaySingle:
+  default:
+    return pageW[page - 1] - state->getWinW();
+  case displayContinuous:
+    return (maxW + pageW[page - 1]) / 2 - state->getWinW();
+  case displaySideBySideSingle:
+    leftPage = ((page - 1) & ~1) + 1;
+    rightPage = leftPage + 1;
+    pageW1 = pageW[leftPage - 1];
+    if (rightPage <= state->getDoc()->getNumPages()) {
+      pageW2 = pageW[rightPage - 1];
+    } else {
+      // display a single page as though there were a blank facing
+      // page of the same size
+      pageW2 = pageW1;
+    }
+    if (pageW1 + sideBySidePageSpacing + pageW2 < state->getWinW()) {
+      offsetX = (state->getWinW() -
+		 (pageW1 + sideBySidePageSpacing + pageW2)) / 2;
+    } else {
+      offsetX = 0;
+    }
+    offsetX2 = offsetX + pageW1 + sideBySidePageSpacing;
+    return (page == leftPage) ? offsetX + pageW1 - state->getWinW()
+                              : offsetX2 + pageW2 - state->getWinW();
+  case displaySideBySideContinuous:
+    leftPage = ((page - 1) & ~1) + 1;
+    rightPage = leftPage + 1;
+    pageW1 = pageW[leftPage - 1];
+    if (rightPage <= state->getDoc()->getNumPages()) {
+      pageW2 = pageW[rightPage - 1];
+    } else {
+      // display a single page as though there were a blank facing
+      // page of the same size
+      pageW2 = pageW1;
+    }
+    if (maxW + sideBySidePageSpacing + maxW2 < state->getWinW()) {
+      offsetX = (state->getWinW() -
+		 (maxW + sideBySidePageSpacing + maxW2)) / 2;
+    } else {
+      offsetX = 0;
+    }
+    offsetX += maxW - pageW1;
+    offsetX2 = offsetX + pageW1 + sideBySidePageSpacing;
+    return (page == leftPage) ? offsetX + pageW1 - state->getWinW()
+                              : offsetX2 + pageW2 - state->getWinW();
+  case displayHorizontalContinuous:
+    return pageX[page - 1] + pageW[page - 1] - state->getWinW();
+  }
+}
+
 int TileMap::getFirstPage() {
   updateContinuousModeParams();
   switch (state->getDisplayMode()) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -122,6 +122,10 @@
   // this just returns zero.)
   int getPageLeftX(int page);
 
+  // Return the scrollX setting that would place the right side of
+  // <page> at the right side of the window.
+  int getPageRightX(int page);
+
   // In continuous modes: return the lowest page number visible
   // anywhere in the window; in non-continuous modes: return the
   // current page.

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UTF8.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UTF8.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UTF8.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -151,7 +151,7 @@
     if (*i < s->getLength() - 1) {
       w1 = ((s->getChar(*i) & 0xff) << 8) | (s->getChar(*i + 1) & 0xff);
       *i += 2;
-      *u = 0x10000 + ((w0 - 0xd8000) << 10) + (w1 - 0xdc00);
+      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
     } else {
       *u = (Unicode)w0;
     }
@@ -173,7 +173,7 @@
     if (*i < s->getLength() - 1) {
       w1 = (s->getChar(*i) & 0xff) | ((s->getChar(*i + 1) & 0xff) << 8);
       *i += 2;
-      *u = 0x10000 + ((w0 - 0xd8000) << 10) + (w1 - 0xdc00);
+      *u = 0x10000 + ((w0 - 0xd800) << 10) + (w1 - 0xdc00);
     } else {
       *u = (Unicode)w0;
     }

Added: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -0,0 +1,178 @@
+//========================================================================
+//
+// UnicodeRemapping.cc
+//
+// Copyright 2018 Glyph & Cog, LLC
+//
+//========================================================================
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma implementation
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include "gmem.h"
+#include "gmempp.h"
+#include "gfile.h"
+#include "GString.h"
+#include "Error.h"
+#include "UnicodeRemapping.h"
+
+//------------------------------------------------------------------------
+
+#define maxUnicodeString 8
+
+struct UnicodeRemappingString {
+  Unicode in;
+  Unicode out[maxUnicodeString];
+  int len;
+};
+
+//------------------------------------------------------------------------
+
+static int hexCharVals[256] = {
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0x
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 1x
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 2x
+   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, // 3x
+  -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 4x
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 5x
+  -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 6x
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 7x
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 8x
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 9x
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // Ax
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // Bx
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // Cx
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // Dx
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // Ex
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1  // Fx
+};
+
+// Parse a <len>-byte hex string <s> into *<val>.  Returns false on
+// error.
+static GBool parseHex(char *s, int len, Guint *val) {
+  int i, x;
+
+  *val = 0;
+  for (i = 0; i < len; ++i) {
+    x = hexCharVals[s[i] & 0xff];
+    if (x < 0) {
+      return gFalse;
+    }
+    *val = (*val << 4) + x;
+  }
+  return gTrue;
+}
+
+//------------------------------------------------------------------------
+
+UnicodeRemapping::UnicodeRemapping() {
+  for (int i = 0; i < 256; ++i) {
+    page0[i] = (Unicode)i;
+  }
+  sMap = NULL;
+  sMapLen = sMapSize = 0;
+}
+
+UnicodeRemapping::~UnicodeRemapping() {
+  gfree(sMap);
+}
+
+void UnicodeRemapping::addRemapping(Unicode in, Unicode *out, int len) {
+  int i;
+
+  if (in < 256 && len == 1) {
+    page0[in] = out[0];
+  } else {
+    if (in < 256) {
+      page0[in] = 0xffffffff;
+    }
+    if (sMapLen == sMapSize) {
+      sMapSize += 16;
+      sMap = (UnicodeRemappingString *)
+	         greallocn(sMap, sMapSize, sizeof(UnicodeRemappingString));
+    }
+    sMap[sMapLen].in = in;
+    for (i = 0; i < len && i < maxUnicodeString; ++i) {
+      sMap[sMapLen].out[i] = out[i];
+    }
+    sMap[sMapLen].len = i;
+    ++sMapLen;
+  }
+}
+
+void UnicodeRemapping::parseFile(GString *fileName) {
+  FILE *f;
+  char buf[256];
+  Unicode in;
+  Unicode out[maxUnicodeString];
+  char *tok;
+  int line, n;
+
+  if (!(f = openFile(fileName->getCString(), "r"))) {
+    error(errSyntaxError, -1, "Couldn't open unicodeRemapping file '{0:t}'",
+	  fileName);
+    return;
+  }
+
+  line = 0;
+  while (getLine(buf, sizeof(buf), f)) {
+    ++line;
+    if (!(tok = strtok(buf, " \t\r\n")) ||
+	!parseHex(tok, (int)strlen(tok), &in)) {
+      error(errSyntaxWarning, -1,
+	    "Bad line ({0:d}) in unicodeRemapping file '{1:t}'",
+	    line, fileName);
+      continue;
+    }
+    n = 0;
+    while (n < maxUnicodeString) {
+      if (!(tok = strtok(NULL, " \t\r\n"))) {
+	break;
+      }
+      if (!parseHex(tok, (int)strlen(tok), &out[n])) {
+	error(errSyntaxWarning, -1,
+	      "Bad line ({0:d}) in unicodeRemapping file '{1:t}'",
+	      line, fileName);
+	break;
+      }
+      ++n;
+    }
+    addRemapping(in, out, n);
+  }
+
+  fclose(f);
+}
+
+int UnicodeRemapping::map(Unicode in, Unicode *out, int size) {
+  int a, b, m, i;
+
+  if (in < 256 && page0[in] != 0xffffffff) {
+    out[0] = page0[in];
+    return 1;
+  }
+
+  a = -1;
+  b = sMapLen;
+  // invariant: sMap[a].in < in < sMap[b].in
+  while (b - a > 1) {
+    m = (a + b) / 2;
+    if (sMap[m].in < in) {
+      a = m;
+    } else if (in < sMap[m].in) {
+      b = m;
+    } else {
+      for (i = 0; i < sMap[m].len && i < size; ++i) {
+	out[i] = sMap[m].out[i];
+      }
+      return i;
+    }
+  }
+
+  out[0] = in;
+  return 1;
+}


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.cc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -0,0 +1,51 @@
+//========================================================================
+//
+// UnicodeRemapping.h
+//
+// Sparse remapping of Unicode characters.
+//
+// Copyright 2018 Glyph & Cog, LLC
+//
+//========================================================================
+
+#ifndef UNICODEREMAPPING_H
+#define UNICODEREMAPPING_H
+
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
+#pragma interface
+#endif
+
+#include "CharTypes.h"
+
+struct UnicodeRemappingString;
+
+//------------------------------------------------------------------------
+
+class UnicodeRemapping {
+public:
+
+  // Create an empty (i.e., identity) remapping.
+  UnicodeRemapping();
+
+  ~UnicodeRemapping();
+
+  // Add a remapping for <in>.
+  void addRemapping(Unicode in, Unicode *out, int len);
+
+  // Add entries from the specified file to this UnicodeRemapping.
+  void parseFile(GString *fileName);
+
+  // Map <in> to zero or more (up to <size>) output characters in
+  // <out>.  Returns the number of output characters.
+  int map(Unicode in, Unicode *out, int size);
+
+private:
+
+  Unicode page0[256];
+  UnicodeRemappingString *sMap;
+  int sMapLen, sMapSize;
+};
+
+#endif


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeRemapping.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -24,6 +24,7 @@
 #include "Gfx.h"
 #include "GfxFont.h"
 #include "Zoox.h"
+#include "PDF417Barcode.h"
 #include "XFAForm.h"
 
 #ifdef _WIN32
@@ -377,9 +378,14 @@
   GString *data;
   GBool fullXFAA;
   GString *name, *fullName;
+  GHash *nameCount, *nameIdx, *fullNameCount, *fullNameIdx;
   char buf[4096];
   int n, i;
 
+  if (catalog->getNumPages() == 0) {
+    return NULL;
+  }
+
   docA->getXRef()->getCatalog(&catDict);
   catDict.dictLookup("NeedsRendering", &obj1);
   fullXFAA = obj1.isBool() && obj1.getBool();
@@ -430,11 +436,21 @@
 
   if (xfaForm->xml->getRoot()) {
     if ((tmpl = xfaForm->xml->getRoot()->findFirstChildElement("template"))) {
-      name = new GString("form");
-      fullName = new GString("form");
       xfaForm->curPageNum = 0;
       xfaForm->curXOffset = xfaForm->curYOffset = 0;
-      xfaForm->scanNamedNode(tmpl, name, fullName, gFalse, NULL);
+      name = new GString();
+      fullName = new GString();
+      nameCount = new GHash();
+      nameIdx = new GHash();
+      fullNameCount = new GHash();
+      fullNameIdx = new GHash();
+      xfaForm->scanNode(tmpl, name, fullName, gFalse, NULL,
+			nameCount, nameIdx, fullNameCount, fullNameIdx,
+			catalog);
+      delete nameCount;
+      delete nameIdx;
+      delete fullNameCount;
+      delete fullNameIdx;
       delete name;
       delete fullName;
 
@@ -488,229 +504,302 @@
   gfree(pageOffsetY);
 }
 
-// Scan all children of <elem>, which is a named internal (non-field)
-// node, with the specified name.
-void XFAForm::scanNamedNode(ZxElement *elem, GString *name, GString *fullName,
-			    GBool inPageSet, XFATableInfo *tableInfo) {
-  GHash *childNameCount, *childNameIdx;
-  ZxNode *child;
+//~ need to handle exclGroup
+//~ - fields in an exclGroup may/must(?) not have names
+//~ - each field has an items element with the the value when that
+//~   field is selected
 
-  childNameCount = new GHash();
-  for (child = elem->getFirstChild(); child; child = child->getNextChild()) {
-    if (child->isElement()) {
-      scanNames((ZxElement *)child, childNameCount);
+// Scan <elem>.  Constructs the node's name and full name.  If <elem>
+// is a field, creates an XFAFormField; else scans <elem>'s children.
+void XFAForm::scanNode(ZxElement *elem,
+		       GString *parentName, GString *parentFullName,
+		       GBool inPageSet, XFATableInfo *tableInfo,
+		       GHash *nameCount, GHash *nameIdx,
+		       GHash *fullNameCount, GHash *fullNameIdx,
+		       Catalog *catalog) {
+  ZxAttr *attr;
+  GString *name, *fullName, *namePart, *fullNamePart;
+  GHash *childNameCount, *childNameIdx, *childFullNameCount, *childFullNameIdx;
+  int colSpan, i;
+
+  if (elem->isElement("template")) {
+    name = new GString("form");
+    fullName = new GString("form");
+    childNameCount = new GHash();
+    scanNames(elem, childNameCount);
+    childNameIdx = new GHash();
+    childFullNameCount = new GHash();
+    scanFullNames(elem, childFullNameCount);
+    childFullNameIdx = new GHash();
+  } else {
+    if ((namePart = getNodeName(elem))) {
+      name = GString::format("{0:t}.{1:t}", parentName, namePart);
+      if (nameCount->lookupInt(namePart) > 1) {
+	i = nameIdx->lookupInt(namePart);
+	name->appendf("[{0:d}]", i);
+	nameIdx->replace(namePart, i + 1);
+      }
+      childNameCount = new GHash();
+      scanNames(elem, childNameCount);
+      childNameIdx = new GHash();
+    } else {
+      name = parentName->copy();
+      childNameCount = nameCount;
+      childNameIdx = nameIdx;
     }
+    if ((fullNamePart = getNodeFullName(elem))) {
+      fullName = GString::format("{0:t}.{1:t}", parentFullName, fullNamePart);
+      if (fullNameCount->lookupInt(fullNamePart) > 1) {
+	i = fullNameIdx->lookupInt(fullNamePart);
+	fullName->appendf("[{0:d}]", i);
+	fullNameIdx->replace(fullNamePart, i + 1);
+      }
+      childFullNameCount = new GHash();
+      scanFullNames(elem, childFullNameCount);
+      childFullNameIdx = new GHash();
+    } else {
+      fullName = parentFullName->copy();
+      childFullNameCount = fullNameCount;
+      childFullNameIdx = fullNameIdx;
+    }
   }
-  childNameIdx = new GHash();
-  for (child = elem->getFirstChild(); child; child = child->getNextChild()) {
-    if (child->isElement()) {
-      scanFields((ZxElement *)child, name, fullName, inPageSet,
-		 tableInfo, childNameCount, childNameIdx);
+
+  if (tableInfo && (elem->isElement("field") || elem->isElement("draw"))) {
+    if ((attr = elem->findAttr("colSpan"))) {
+      colSpan = atoi(attr->getValue()->getCString());
+    } else {
+      colSpan = 1;
     }
+  } else {
+    colSpan = 0;
   }
-  delete childNameIdx;
-  delete childNameCount;
+
+  if (elem->isElement("field")) {
+    scanField(elem, name, fullName, inPageSet, tableInfo, colSpan, catalog);
+  } else {
+    scanNonField(elem, name, fullName, inPageSet, tableInfo, colSpan,
+		 childNameCount, childNameIdx,
+		 childFullNameCount, childFullNameIdx,
+		 catalog);
+  }
+
+  if (tableInfo) {
+    tableInfo->columnIdx += colSpan;
+  }
+
+  delete name;
+  delete fullName;
+  if (childNameCount != nameCount) {
+    delete childNameCount;
+  }
+  if (childNameIdx != nameIdx) {
+    delete childNameIdx;
+  }
+  if (childFullNameCount != fullNameCount) {
+    delete childFullNameCount;
+  }
+  if (childFullNameIdx != fullNameIdx) {
+    delete childFullNameIdx;
+  }
 }
 
 // Traverse all children of <elem>, incrementing nameCount[name] for
 // each named child.  Traversal stops at each named child.
 void XFAForm::scanNames(ZxElement *elem, GHash *nameCount) {
-  ZxNode *child;
-  GString *childName;
+  ZxNode *node;
+  ZxElement *child;
+  GString *namePart;
 
-  if ((childName = getNodeName(elem))) {
-    if (nodeIsBindGlobal(elem)) {
-      nameCount->replace(childName, 1);
-    } else {
-      nameCount->replace(childName, nameCount->lookupInt(childName) + 1);
+  for (node = elem->getFirstChild(); node; node = node->getNextChild()) {
+    if (node->isElement()) {
+      child = (ZxElement *)node;
+      if ((namePart = getNodeName(child))) {
+	if (nodeIsBindGlobal(child)) {
+	  nameCount->replace(namePart, 1);
+	} else {
+	  nameCount->replace(namePart, nameCount->lookupInt(namePart) + 1);
+	}
+      } else {
+	scanNames(child, nameCount);
+      }
     }
-  } else {
-    for (child = elem->getFirstChild(); child; child = child->getNextChild()) {
-      if (child->isElement()) {
-	scanNames((ZxElement *)child, nameCount);
+  }
+}
+
+// Traverse all children of <elem>, incrementing fullNameCount[name]
+// for each full-named child.  Traversal stops at each full-named
+// child.
+void XFAForm::scanFullNames(ZxElement *elem, GHash *fullNameCount) {
+  ZxNode *node;
+  ZxElement *child;
+  GString *fullNamePart;
+
+  for (node = elem->getFirstChild(); node; node = node->getNextChild()) {
+    if (node->isElement()) {
+      child = (ZxElement *)node;
+      if ((fullNamePart = getNodeFullName(child))) {
+	if (nodeIsBindGlobal(child)) {
+	  fullNameCount->replace(fullNamePart, 1);
+	} else {
+	  fullNameCount->replace(fullNamePart,
+				 fullNameCount->lookupInt(fullNamePart) + 1);
+	}
+      } else {
+	scanFullNames(child, fullNameCount);
       }
     }
   }
 }
 
-// Create fields for <elem> and its children.  <parentName> is the
-// name of <elem>'s parent.  <siblingNameCount> contains the number of
-// occurrences of the siblings' (parent's childrens') names.
-// <siblingNameIdx> contains the number of occurrences of each name
-// used so far.
-void XFAForm::scanFields(ZxElement *elem, GString *parentName,
-			 GString *parentFullName, GBool inPageSet,
-			 XFATableInfo *tableInfo,
-			 GHash *siblingNameCount, GHash *siblingNameIdx) {
+void XFAForm::scanField(ZxElement *elem, GString *name, GString *fullName,
+			GBool inPageSet,
+			XFATableInfo *tableInfo, int colSpan,
+			Catalog *catalog) {
+  double xSubOffset, ySubOffset, columnWidth, rowHeight;
+
+  if (curPageNum == 0) {
+    curPageNum = 1;
+  }
+
+  xSubOffset = ySubOffset = 0;
+  columnWidth = rowHeight = 0;
+  if (tableInfo) {
+    if (tableInfo->columnIdx > 0 &&
+	tableInfo->columnIdx <= tableInfo->nColumns) {
+      xSubOffset = tableInfo->columnRight[tableInfo->columnIdx - 1];
+    }
+    if (tableInfo->columnIdx + colSpan <= tableInfo->nColumns) {
+      columnWidth = tableInfo->columnRight[tableInfo->columnIdx + colSpan - 1]
+	            - xSubOffset;
+    }
+    ySubOffset = tableInfo->rowTop;
+    rowHeight = tableInfo->rowHeight;
+    curXOffset += xSubOffset;
+    curYOffset += ySubOffset;
+  }
+
+  fields->append(new XFAFormField(this, elem, name->copy(), fullName->copy(),
+				  curPageNum, curXOffset, curYOffset,
+				  columnWidth, rowHeight));
+
+  if (tableInfo) {
+    curXOffset -= xSubOffset;
+    curYOffset -= ySubOffset;
+  }
+}
+
+void XFAForm::scanNonField(ZxElement *elem, GString *name, GString *fullName,
+			   GBool inPageSet,
+			   XFATableInfo *tableInfo, int colSpan,
+			   GHash *nameCount, GHash *nameIdx,
+			   GHash *fullNameCount, GHash *fullNameIdx,
+			   Catalog *catalog) {
   XFATableInfo *newTableInfo;
   ZxElement *brk, *contentArea;
   ZxNode *child;
   ZxAttr *attr;
-  GString *elemName, *elemFullName, *name, *fullName;
-  double xSubOffset, ySubOffset, columnWidth, rowHeight;
+  PDFRectangle *box;
+  double xSubOffset, ySubOffset;
   int savedPageNum;
-  int colSpan, i;
 
-  //~ need to handle exclGroup
-  //~ - fields in an exclGroup may/must(?) not have names
-  //~ - each field has an items element with the the value when that
-  //~   field is selected
+  newTableInfo = tableInfo;
 
-  if ((elemName = getNodeName(elem))) {
-    name = GString::format("{0:t}.{1:t}", parentName, elemName);
-  } else {
-    name = parentName;
-  }
+  if (elem->isElement("subform")) {
 
-  if ((elemFullName = getNodeFullName(elem))) {
-    fullName = GString::format("{0:t}.{1:t}", parentFullName, elemFullName);
-  } else {
-    fullName = parentFullName;
-  }
+    // update page number
+    if (((brk = elem->findFirstChildElement("breakBefore")) &&
+	 (attr = brk->findAttr("targetType")) &&
+	 !attr->getValue()->cmp("pageArea")) ||
+	((brk = elem->findFirstChildElement("break")) &&
+	 (attr = brk->findAttr("before")) &&
+	 !attr->getValue()->cmp("pageArea")) ||
+	(curPageNum < nPages &&
+	 (attr = elem->findAttr("w")) &&
+	 (box = catalog->getPage(curPageNum + 1)->getMediaBox()) &&
+	 XFAFormField::getMeasurement(attr, 0) == box->x2 - box->x1 &&
+	 (attr = elem->findAttr("h")) &&
+	 XFAFormField::getMeasurement(attr, 0) == box->y2 - box->y1)) {
+      if (curPageNum < nPages) {
+	++curPageNum;
+      }
+    }
 
-  //~ do we need a separate siblingNameCount/siblingNameIndex for
-  //~   elemName and elemFullName?
-  if (elemFullName && siblingNameCount->lookupInt(elemFullName) > 1) {
-    i = siblingNameIdx->lookupInt(elemFullName);
-    fullName->appendf("[{0:d}]", i);
-    if (elemName) {
-      name->appendf("[{0:d}]", i);
+    // update tableInfo
+    if ((attr = elem->findAttr("layout"))) {
+      if (!attr->getValue()->cmp("table")) {
+	newTableInfo = new XFATableInfo(elem->findAttr("columnWidths"));
+	newTableInfo->rowIdx = -1;
+	newTableInfo->columnIdx = 0;
+      } else if (tableInfo && !attr->getValue()->cmp("row")) {
+	++tableInfo->rowIdx;
+	tableInfo->columnIdx = 0;
+	tableInfo->rowTop += tableInfo->rowHeight;
+	tableInfo->computeRowHeight(elem);
+      }
     }
-    siblingNameIdx->replace(elemFullName, i + 1);
-  }
 
-  if (tableInfo && (elem->isElement("field") || elem->isElement("draw"))) {
-    if ((attr = elem->findAttr("colSpan"))) {
-      colSpan = atoi(attr->getValue()->getCString());
-    } else {
-      colSpan = 1;
-    }
+    // update position
+    xSubOffset = XFAFormField::getMeasurement(elem->findAttr("x"), 0);
+    ySubOffset = XFAFormField::getMeasurement(elem->findAttr("y"), 0);
+    curXOffset += xSubOffset;
+    curYOffset += ySubOffset;
+
+  } else if (elem->isElement("area")) {
+    xSubOffset = XFAFormField::getMeasurement(elem->findAttr("x"), 0);
+    ySubOffset = XFAFormField::getMeasurement(elem->findAttr("y"), 0);
+    curXOffset += xSubOffset;
+    curYOffset += ySubOffset;
+
   } else {
-    colSpan = 0;
+    xSubOffset = ySubOffset = 0;
   }
 
-  if (elem->isElement("field")) {
-    if (curPageNum == 0) {
-      curPageNum = 1;
-    }
-    xSubOffset = ySubOffset = 0;
-    columnWidth = rowHeight = 0;
-    if (tableInfo) {
-      if (tableInfo->columnIdx > 0 &&
-	  tableInfo->columnIdx <= tableInfo->nColumns) {
-	xSubOffset = tableInfo->columnRight[tableInfo->columnIdx - 1];
+  savedPageNum = curPageNum;
+  if (elem->isElement("pageSet")) {
+    inPageSet = gTrue;
+    curPageNum = 0;
+
+  } else if (elem->isElement("pageArea")) {
+    if (inPageSet) {
+      if (curPageNum < nPages) {
+	++curPageNum;
       }
-      if (tableInfo->columnIdx + colSpan <= tableInfo->nColumns) {
-	columnWidth = tableInfo->columnRight[tableInfo->columnIdx + colSpan - 1]
-	              - xSubOffset;
+      if ((contentArea = elem->findFirstChildElement("contentArea"))) {
+	pageOffsetX[curPageNum - 1] =
+	    XFAFormField::getMeasurement(contentArea->findAttr("x"), 0);
+	pageOffsetY[curPageNum - 1] =
+	    XFAFormField::getMeasurement(contentArea->findAttr("y"), 0);
+	// looks like the contentArea offset (pageOffsetX/Y) should
+	// not be added to fields defined inside the pageArea
+	// element (?)
+	xSubOffset -= pageOffsetX[curPageNum - 1];
+	ySubOffset -= pageOffsetY[curPageNum - 1];
+	curXOffset -= pageOffsetX[curPageNum - 1];
+	curYOffset -= pageOffsetY[curPageNum - 1];
       }
-      ySubOffset = tableInfo->rowTop;
-      rowHeight = tableInfo->rowHeight;
-      curXOffset += xSubOffset;
-      curYOffset += ySubOffset;
     }
-    fields->append(new XFAFormField(this, elem, name->copy(), fullName->copy(),
-				    curPageNum, curXOffset, curYOffset,
-				    columnWidth, rowHeight));
-    if (tableInfo) {
-      curXOffset -= xSubOffset;
-      curYOffset -= ySubOffset;
+  }
+
+  for (child = elem->getFirstChild(); child; child = child->getNextChild()) {
+    if (child->isElement()) {
+      scanNode((ZxElement *)child, name, fullName, inPageSet,
+	       newTableInfo, nameCount, nameIdx, fullNameCount, fullNameIdx,
+	       catalog);
     }
-  } else {
-    newTableInfo = tableInfo;
-    if (elem->isElement("subform")) {
-      if (((brk = elem->findFirstChildElement("breakBefore")) &&
-	   (attr = brk->findAttr("targetType")) &&
-	   !attr->getValue()->cmp("pageArea")) ||
-	  ((brk = elem->findFirstChildElement("break")) &&
-	   (attr = brk->findAttr("before")) &&
-	   !attr->getValue()->cmp("pageArea"))) {
-	if (curPageNum < nPages) {
-	  ++curPageNum;
-	}
-      }
-      if ((attr = elem->findAttr("layout"))) {
-	if (!attr->getValue()->cmp("table")) {
-	  newTableInfo = new XFATableInfo(elem->findAttr("columnWidths"));
-	  newTableInfo->rowIdx = -1;
-	  newTableInfo->columnIdx = 0;
-	} else if (tableInfo && !attr->getValue()->cmp("row")) {
-	  ++tableInfo->rowIdx;
-	  tableInfo->columnIdx = 0;
-	  tableInfo->rowTop += tableInfo->rowHeight;
-	  tableInfo->computeRowHeight(elem);
-	}
-      }
-      xSubOffset = XFAFormField::getMeasurement(elem->findAttr("x"), 0);
-      ySubOffset = XFAFormField::getMeasurement(elem->findAttr("y"), 0);
-      curXOffset += xSubOffset;
-      curYOffset += ySubOffset;
-    } else if (elem->isElement("area")) {
-      xSubOffset = XFAFormField::getMeasurement(elem->findAttr("x"), 0);
-      ySubOffset = XFAFormField::getMeasurement(elem->findAttr("y"), 0);
-      curXOffset += xSubOffset;
-      curYOffset += ySubOffset;
-    } else {
-      xSubOffset = ySubOffset = 0;
-    }
-    savedPageNum = curPageNum;
-    if (elem->isElement("pageSet")) {
-      inPageSet = gTrue;
-      curPageNum = 0;
-    } else if (elem->isElement("pageArea")) {
-      if (inPageSet) {
-	if (curPageNum < nPages) {
-	  ++curPageNum;
-	}
-	if ((contentArea = elem->findFirstChildElement("contentArea"))) {
-	  pageOffsetX[curPageNum - 1] =
-	      XFAFormField::getMeasurement(contentArea->findAttr("x"), 0);
-	  pageOffsetY[curPageNum - 1] =
-	      XFAFormField::getMeasurement(contentArea->findAttr("y"), 0);
-	  // looks like the contentArea offset (pageOffsetX/Y) should
-	  // not be added to fields defined inside the pageArea
-	  // element (?)
-	  xSubOffset -= pageOffsetX[curPageNum - 1];
-	  ySubOffset -= pageOffsetY[curPageNum - 1];
-	  curXOffset -= pageOffsetX[curPageNum - 1];
-	  curYOffset -= pageOffsetY[curPageNum - 1];
-	}
-      }
-    }
-    if (elemName) {
-      scanNamedNode(elem, name, fullName, inPageSet, newTableInfo);
-    } else {
-      for (child = elem->getFirstChild();
-	   child;
-	   child = child->getNextChild()) {
-	if (child->isElement()) {
-	  scanFields((ZxElement *)child, name, fullName, inPageSet,
-		     newTableInfo, siblingNameCount, siblingNameIdx);
-	}
-      }
-    }
-    curXOffset -= xSubOffset;
-    curYOffset -= ySubOffset;
-    if (newTableInfo != tableInfo) {
-      delete newTableInfo;
-    }
-    if (elem->isElement("pageSet")) {
-      pageSetNPages = curPageNum;
-      curPageNum = savedPageNum;
-      inPageSet = gFalse;
-    }
   }
 
-  if (tableInfo) {
-    tableInfo->columnIdx += colSpan;
+  curXOffset -= xSubOffset;
+  curYOffset -= ySubOffset;
+
+  if (newTableInfo != tableInfo) {
+    delete newTableInfo;
   }
 
-  if (name != parentName) {
-    delete name;
+  if (elem->isElement("pageSet")) {
+    pageSetNPages = curPageNum;
+    curPageNum = savedPageNum;
+    inPageSet = gFalse;
   }
-  if (fullName != parentFullName) {
-    delete fullName;
-  }
 }
 
 GString *XFAForm::getNodeName(ZxElement *elem) {
@@ -987,6 +1076,7 @@
 			GfxFontDict *fontDict) {
   ZxElement *uiElem;
   ZxNode *node;
+  ZxAttr *attr;
   GString *appearBuf;
   MemStream *appearStream;
   Object appearDict, appearance, resourceDict, resourceSubdict;
@@ -1001,6 +1091,14 @@
     return;
   }
 
+  // check the 'presence' attribute
+  if ((attr = xml->findAttr("presence"))) {
+    if (!attr->getValue()->cmp("hidden") ||
+	!attr->getValue()->cmp("invisible")) {
+      return;
+    }
+  }
+
   getRectangle(&xfaX, &xfaY, &xfaW, &xfaH, &pdfX, &pdfY, &pdfW, &pdfH, &rot3);
 
   // generate transform matrix
@@ -1239,7 +1337,7 @@
     }
   }
 
-  // look for <para> -- add the margin
+  // look for <para> -- add the margins
   if ((paraElem = xml->findFirstChildElement("para"))) {
     if ((attr = paraElem->findAttr("marginLeft"))) {
       t = getMeasurement(attr, 0);
@@ -1250,6 +1348,15 @@
       t = getMeasurement(attr, 0);
       *xfaW -= t;
     }
+    if ((attr = paraElem->findAttr("spaceAbove"))) {
+      t = getMeasurement(attr, 0);
+      *xfaY += t;
+      *xfaH -= t;
+    }
+    if ((attr = paraElem->findAttr("spaceBelow"))) {
+      t = getMeasurement(attr, 0);
+      *xfaH -= t;
+    }
   }
 
   // get annot rect (UL corner, width, height) in XFA coords
@@ -1507,10 +1614,10 @@
   ZxAttr *attr;
   GString *value, *value2, *barcodeType, *textLocation, *fontName, *s1, *s2;
   XFAVertAlign textAlign;
-  double wideNarrowRatio, fontSize;
+  double wideNarrowRatio, moduleWidth, moduleHeight, fontSize;
   double yText, wText, yBarcode, hBarcode, wNarrow, xx;
   GBool doText;
-  int dataLength, checksum;
+  int dataLength, errorCorrectionLevel, checksum;
   GBool bold, italic;
   char *p;
   int i, j, c;
@@ -1520,10 +1627,40 @@
     return;
   }
 
+  //--- get font
+  fontName = NULL;
+  fontSize = 0.2 * h;
+  bold = gFalse;
+  italic = gFalse;
+  if ((fontElem = xml->findFirstChildElement("font"))) {
+    if ((attr = fontElem->findAttr("typeface"))) {
+      fontName = attr->getValue()->copy();
+    }
+    if ((attr = fontElem->findAttr("weight"))) {
+      if (!attr->getValue()->cmp("bold")) {
+	bold = gTrue;
+      }
+    }
+    if ((attr = fontElem->findAttr("posture"))) {
+      if (!attr->getValue()->cmp("italic")) {
+	italic = gTrue;
+      }
+    }
+    if ((attr = fontElem->findAttr("size"))) {
+      fontSize = getMeasurement(attr, fontSize);
+    }
+  }
+  if (!fontName) {
+    fontName = new GString("Courier");
+  }
+
   //--- get field attributes
   barcodeType = NULL;
   wideNarrowRatio = 3;
+  moduleWidth = 0;
+  moduleHeight = 0;
   dataLength = 0;
+  errorCorrectionLevel = 0;
   textLocation = NULL;
   if ((uiElem = xml->findFirstChildElement("ui")) &&
       (barcodeElem = uiElem->findFirstChildElement("barcode"))) {
@@ -1544,9 +1681,18 @@
 	wideNarrowRatio = atof(s1->getCString());
       }
     }
+    if ((attr = barcodeElem->findAttr("moduleWidth"))) {
+      moduleWidth = getMeasurement(attr, (0.25 / 25.4) * 72.0); // 0.25mm
+    }
+    if ((attr = barcodeElem->findAttr("moduleHeight"))) {
+      moduleHeight = getMeasurement(attr, (0.5 / 25.4) * 72.0); // 0.5mm
+    }
     if ((attr = barcodeElem->findAttr("dataLength"))) {
       dataLength = atoi(attr->getValue()->getCString());
     }
+    if ((attr = barcodeElem->findAttr("errorCorrectionLevel"))) {
+      errorCorrectionLevel = atoi(attr->getValue()->getCString());
+    }
     if ((attr = barcodeElem->findAttr("textLocation"))) {
       textLocation = attr->getValue();
     }
@@ -1553,41 +1699,10 @@
   }
   if (!barcodeType) {
     error(errSyntaxError, -1, "Missing 'type' attribute in XFA barcode field");
+    delete fontName;
     return;
   }
-  if (!dataLength) {
-    error(errSyntaxError, -1,
-	  "Missing 'dataLength' attribute in XFA barcode field");
-    return;
-  }
 
-  //--- get font
-  fontName = NULL;
-  fontSize = 0.2 * h;
-  bold = gFalse;
-  italic = gFalse;
-  if ((fontElem = xml->findFirstChildElement("font"))) {
-    if ((attr = fontElem->findAttr("typeface"))) {
-      fontName = attr->getValue()->copy();
-    }
-    if ((attr = fontElem->findAttr("weight"))) {
-      if (!attr->getValue()->cmp("bold")) {
-	bold = gTrue;
-      }
-    }
-    if ((attr = fontElem->findAttr("posture"))) {
-      if (!attr->getValue()->cmp("italic")) {
-	italic = gTrue;
-      }
-    }
-    if ((attr = fontElem->findAttr("size"))) {
-      fontSize = getMeasurement(attr, fontSize);
-    }
-  }
-  if (!fontName) {
-    fontName = new GString("Courier");
-  }
-
   //--- compute the embedded text type position
   doText = gTrue;
   yText = yBarcode = hBarcode = 0;
@@ -1631,6 +1746,11 @@
 
   //--- draw the bar code
   if (!barcodeType->cmp("code3Of9")) {
+    if (!dataLength) {
+      error(errSyntaxError, -1,
+	    "Missing 'dataLength' attribute in XFA barcode field");
+      goto err;
+    }
     appearBuf->append("0 g\n");
     wNarrow = w / ((7 + 3 * wideNarrowRatio) * (dataLength + 2));
     xx = 0;
@@ -1652,6 +1772,11 @@
     // center the text on the drawn barcode (not the max length barcode)
     wText = (value2->getLength() + 2) * (7 + 3 * wideNarrowRatio) * wNarrow;
   } else if (!barcodeType->cmp("code128B")) {
+    if (!dataLength) {
+      error(errSyntaxError, -1,
+	    "Missing 'dataLength' attribute in XFA barcode field");
+      goto err;
+    }
     appearBuf->append("0 g\n");
     wNarrow = w / (11 * (dataLength + 3) + 2);
     xx = 0;
@@ -1688,9 +1813,14 @@
 		       xx, yBarcode, 2 * wNarrow, hBarcode);
     // center the text on the drawn barcode (not the max length barcode)
     wText = (11 * (value2->getLength() + 3) + 2) * wNarrow;
+  } else if (!barcodeType->cmp("pdf417")) {
+    drawPDF417Barcode(w, h, moduleWidth, moduleHeight, errorCorrectionLevel,
+		      value2, appearBuf);
+    doText = gFalse;
   } else {
     error(errSyntaxError, -1,
-	  "Unimplemented barcode type in XFA barcode field");
+	  "Unimplemented barcode type '{0:t}' in XFA barcode field",
+	  barcodeType);
   }
   //~ add other barcode types here
 
@@ -1702,6 +1832,8 @@
 	     xfaHAlignCenter, textAlign, 0, yText, wText, h, gTrue,
 	     fontDict, appearBuf);
   }
+
+ err:
   delete fontName;
   delete value2;
 }
@@ -2011,11 +2143,11 @@
 	c = text->getChar(i) & 0xff;
 	if (c == '(' || c == ')' || c == '\\') {
 	  appearBuf->append('\\');
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	} else if (c < 0x20 || c >= 0x80) {
 	  appearBuf->appendf("\\{0:03o}", c);
 	} else {
-	  appearBuf->append(c);
+	  appearBuf->append((char)c);
 	}
       }
       appearBuf->append(") Tj\n");
@@ -2066,7 +2198,7 @@
     for (i = 0; i < text->getLength(); ++i) {
       c = text->getChar(i) & 0xff;
       if (font && !font->isCIDFont()) {
-	charWidth = fontSize * ((Gfx8BitFont *)font)->getWidth(c);
+	charWidth = fontSize * ((Gfx8BitFont *)font)->getWidth((Guchar)c);
 	appearBuf->appendf("1 0 0 1 {0:.4f} {1:.4f} Tm\n",
 			   xx + i * tw + 0.5 * (tw - charWidth), yy);
       } else {
@@ -2076,11 +2208,11 @@
       appearBuf->append('(');
       if (c == '(' || c == ')' || c == '\\') {
 	appearBuf->append('\\');
-	appearBuf->append(c);
+	appearBuf->append((char)c);
       } else if (c < 0x20 || c >= 0x80) {
 	appearBuf->appendf("{0:.4f} 0 Td\n", w);
       } else {
-	appearBuf->append(c);
+	appearBuf->append((char)c);
       }
       appearBuf->append(") Tj\n");
     }
@@ -2136,11 +2268,11 @@
       c = text->getChar(i) & 0xff;
       if (c == '(' || c == ')' || c == '\\') {
 	appearBuf->append('\\');
-	appearBuf->append(c);
+	appearBuf->append((char)c);
       } else if (c < 0x20 || c >= 0x80) {
 	appearBuf->appendf("\\{0:03o}", c);
       } else {
-	appearBuf->append(c);
+	appearBuf->append((char)c);
       }
     }
     appearBuf->append(") Tj\n");
@@ -2322,7 +2454,7 @@
       break;
     }
     if (font && !font->isCIDFont()) {
-      dw = ((Gfx8BitFont *)font)->getWidth(c) * fontSize;
+      dw = ((Gfx8BitFont *)font)->getWidth((Guchar)c) * fontSize;
     } else {
       // otherwise, make a crude estimate
       dw = 0.5 * fontSize;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -58,13 +58,24 @@
 
   XFAForm(PDFDoc *docA, int nPagesA, ZxDoc *xmlA,
 	  Object *resourceDictA, GBool fullXFAA);
-  void scanNamedNode(ZxElement *elem, GString *name, GString *fullName,
-		     GBool inPageSet, XFATableInfo *tableInfo);
+  void scanNode(ZxElement *elem,
+		GString *parentName, GString *parentFullName,
+		GBool inPageSet, XFATableInfo *tableInfo,
+		GHash *nameCount, GHash *nameIdx,
+		GHash *fullNameCount, GHash *fullNameIdx,
+		Catalog *catalog);
   void scanNames(ZxElement *elem, GHash *nameCount);
-  void scanFields(ZxElement *elem, GString *parentName,
-		  GString *parentFullName, GBool inPageSet,
-		  XFATableInfo *tableInfo,
-		  GHash *siblingNameCount, GHash *siblingNameIdx);
+  void scanFullNames(ZxElement *elem, GHash *fullNameCount);
+  void scanField(ZxElement *elem, GString *name, GString *fullName,
+		 GBool inPageSet,
+		 XFATableInfo *tableInfo, int colSpan,
+		 Catalog *catalog);
+  void scanNonField(ZxElement *elem, GString *name, GString *fullName,
+		    GBool inPageSet,
+		    XFATableInfo *tableInfo, int colSpan,
+		    GHash *nameCount, GHash *nameIdx,
+		    GHash *fullNameCount, GHash *fullNameIdx,
+		    Catalog *catalog);
   GString *getNodeName(ZxElement *elem);
   GString *getNodeFullName(ZxElement *elem);
   GBool nodeIsBindGlobal(ZxElement *elem);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -237,8 +237,8 @@
   // skip to the first object - this shouldn't be necessary because
   // the First key is supposed to be equal to offsets[0], but just in
   // case...
-  if (i < offsets[0]) {
-    objStr.getStream()->discardChars(offsets[0] - i);
+  if (first < offsets[0]) {
+    objStr.getStream()->discardChars(offsets[0] - first);
   }
 
   // parse the objects
@@ -309,7 +309,10 @@
   streamEndsLen = 0;
   for (i = 0; i < objStrCacheSize; ++i) {
     objStrs[i] = NULL;
+    objStrLastUse[i] = 0;
   }
+  objStrCacheLength = 0;
+  objStrTime = 0;
 
   encrypted = gFalse;
   permFlags = defPermFlags;
@@ -443,6 +446,13 @@
   char buf[100];
   int n, i;
 
+  // check for a loop in the xref tables
+  if (posSet->check(*pos)) {
+    error(errSyntaxWarning, -1, "Infinite loop in xref table");
+    return gFalse;
+  }
+  posSet->add(*pos);
+
   // the xref data should either be "xref ..." (for an xref table) or
   // "nn gg obj << ... >> stream ..." (for an xref stream); possibly
   // preceded by whitespace
@@ -505,12 +515,6 @@
   GBool more;
   int first, n, newSize, gen, i, c;
 
-  if (posSet->check(*pos)) {
-    error(errSyntaxWarning, -1, "Infinite loop in xref table");
-    return gFalse;
-  }
-  posSet->add(*pos);
-
   str->setPos(start + *pos + offset);
 
   while (1) {
@@ -714,9 +718,9 @@
     obj2.free();
   }
   obj.free();
-  if (w[0] < 0 || w[0] > 4 ||
-      w[1] < 0 || w[1] > (int)sizeof(GFileOffset) ||
-      w[2] < 0 || w[2] > 4) {
+  if (w[0] < 0 || w[0] > 8 ||
+      w[1] < 0 || w[1] > 8 ||
+      w[2] < 0 || w[2] > 8) {
     goto err0;
   }
 
@@ -773,8 +777,8 @@
 }
 
 GBool XRef::readXRefStreamSection(Stream *xrefStr, int *w, int first, int n) {
-  GFileOffset offset;
-  int type, gen, c, newSize, i, j;
+  long long type, gen, offset;
+  int c, newSize, i, j;
 
   if (first + n < 0) {
     return gFalse;
@@ -810,6 +814,9 @@
       }
       offset = (offset << 8) + c;
     }
+    if (offset < 0 || offset > GFILEOFFSET_MAX) {
+      return gFalse;
+    }
     for (gen = 0, j = 0; j < w[2]; ++j) {
       if ((c = xrefStr->getChar()) == EOF) {
 	return gFalse;
@@ -816,21 +823,24 @@
       }
       gen = (gen << 8) + c;
     }
+    if (gen < 0 || gen > INT_MAX) {
+      return gFalse;
+    }
     if (entries[i].offset == (GFileOffset)-1) {
       switch (type) {
       case 0:
-	entries[i].offset = offset;
-	entries[i].gen = gen;
+	entries[i].offset = (GFileOffset)offset;
+	entries[i].gen = (int)gen;
 	entries[i].type = xrefEntryFree;
 	break;
       case 1:
-	entries[i].offset = offset;
-	entries[i].gen = gen;
+	entries[i].offset = (GFileOffset)offset;
+	entries[i].gen = (int)gen;
 	entries[i].type = xrefEntryUncompressed;
 	break;
       case 2:
-	entries[i].offset = offset;
-	entries[i].gen = gen;
+	entries[i].offset = (GFileOffset)offset;
+	entries[i].gen = (int)gen;
 	entries[i].type = xrefEntryCompressed;
 	break;
       default:
@@ -1136,7 +1146,7 @@
 }
 
 GBool XRef::getObjectStreamObject(int objStrNum, int objIdx,
-				   int objNum, Object *obj) {
+				  int objNum, Object *obj) {
   ObjectStream *objStr;
 
 #if MULTITHREADED
@@ -1145,6 +1155,7 @@
   if (!(objStr = getObjectStream(objStrNum))) {
     return gFalse;
   }
+  cleanObjectStreamCache();
   objStr->getObject(objIdx, objNum, obj);
 #if MULTITHREADED
   gUnlockMutex(&objStrsMutex);
@@ -1160,17 +1171,20 @@
   // check the MRU entry in the cache
   if (objStrs[0] && objStrs[0]->getObjStrNum() == objStrNum) {
     objStr = objStrs[0];
+    objStrLastUse[0] = objStrTime++;
     return objStr;
   }
 
   // check the rest of the cache
-  for (i = 1; i < objStrCacheSize; ++i) {
+  for (i = 1; i < objStrCacheLength; ++i) {
     if (objStrs[i] && objStrs[i]->getObjStrNum() == objStrNum) {
       objStr = objStrs[i];
       for (j = i; j > 0; --j) {
 	objStrs[j] = objStrs[j - 1];
+	objStrLastUse[j] = objStrLastUse[j - 1];
       }
       objStrs[0] = objStr;
+      objStrLastUse[0] = objStrTime++;
       return objStr;
     }
   }
@@ -1183,17 +1197,38 @@
   }
 
   // add to the cache
-  if (objStrs[objStrCacheSize - 1]) {
+  if (objStrCacheLength == objStrCacheSize) {
     delete objStrs[objStrCacheSize - 1];
+    --objStrCacheLength;
   }
-  for (j = objStrCacheSize - 1; j > 0; --j) {
+  for (j = objStrCacheLength; j > 0; --j) {
     objStrs[j] = objStrs[j - 1];
+    objStrLastUse[j] = objStrLastUse[j - 1];
   }
+  ++objStrCacheLength;
   objStrs[0] = objStr;
+  objStrLastUse[0] = objStrTime++;
 
   return objStr;
 }
 
+// If the oldest (least recently used) entry in the object stream
+// cache is more than objStrCacheTimeout accesses old (hasn't been
+// used in the last objStrCacheTimeout accesses), eject it from the
+// cache.
+void XRef::cleanObjectStreamCache() {
+  // NB: objStrTime and objStrLastUse[] are unsigned ints, so the
+  // mod-2^32 arithmetic makes the subtraction work out, even if the
+  // time wraps around.
+  if (objStrCacheLength > 1 &&
+      objStrTime - objStrLastUse[objStrCacheLength - 1]
+        > objStrCacheTimeout) {
+    delete objStrs[objStrCacheLength - 1];
+    objStrs[objStrCacheLength - 1] = NULL;
+    --objStrCacheLength;
+  }
+}
+
 Object *XRef::getDocInfo(Object *obj) {
   return trailerDict.dictLookup("Info", obj);
 }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -52,7 +52,8 @@
 
 #define xrefCacheSize 16
 
-#define objStrCacheSize 4
+#define objStrCacheSize 128
+#define objStrCacheTimeout 1000
 
 class XRef {
 public:
@@ -144,6 +145,10 @@
   int streamEndsLen;		// number of valid entries in streamEnds
   ObjectStream *		// cached object streams
     objStrs[objStrCacheSize];
+  int objStrCacheLength;	// number of valid entries in objStrs[]
+  Guint				// time of last use for each obj stream
+    objStrLastUse[objStrCacheSize];
+  Guint objStrTime;		// current time for the obj stream cache
 #if MULTITHREADED
   GMutex objStrsMutex;
 #endif
@@ -169,6 +174,7 @@
   GBool getObjectStreamObject(int objStrNum, int objIdx,
 			      int objNum, Object *obj);
   ObjectStream *getObjectStream(int objStrNum);
+  void cleanObjectStreamCache();
   GFileOffset strToFileOffset(char *s);
 };
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/config.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/config.h	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/config.h	2019-05-30 16:25:31 UTC (rev 814)
@@ -2,7 +2,7 @@
 //
 // config.h
 //
-// Copyright 1996-2017 Glyph & Cog, LLC
+// Copyright 1996-2019 Glyph & Cog, LLC
 //
 //========================================================================
 
@@ -14,25 +14,25 @@
 //------------------------------------------------------------------------
 
 // xpdf version
-#define xpdfVersion          "4.00"
-#define xpdfVersionNum       4.00
+#define xpdfVersion          "4.01"
+#define xpdfVersionNum       4.01
 #define xpdfMajorVersion     4
-#define xpdfMinorVersion     0
+#define xpdfMinorVersion     1
 #define xpdfUpdateVersion    0
 #define xpdfMajorVersionStr  "4"
-#define xpdfMinorVersionStr  "0"
+#define xpdfMinorVersionStr  "1"
 #define xpdfUpdateVersionStr "0"
 
 // supported PDF version
-#define supportedPDFVersionStr "1.7"
-#define supportedPDFVersionNum 1.7
+#define supportedPDFVersionStr "2.0"
+#define supportedPDFVersionNum 2.0
 
 // copyright notice
-#define xpdfCopyright "Copyright 1996-2017 Glyph & Cog, LLC"
+#define xpdfCopyright "Copyright 1996-2019 Glyph & Cog, LLC"
 
 // Windows resource file stuff
-#define winxpdfVersion "WinXpdf 4.00"
-#define xpdfCopyrightAmp "Copyright 1996-2017 Glyph && Cog, LLC"
+#define winxpdfVersion "WinXpdf 4.01"
+#define xpdfCopyrightAmp "Copyright 1996-2019 Glyph && Cog, LLC"
 
 //------------------------------------------------------------------------
 // paper size

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -61,7 +61,7 @@
 };
 
 int main(int argc, char *argv[]) {
-  GString *fileName;
+  char *fileName;
   UnicodeMap *uMap;
   GString *ownerPW, *userPW;
   PDFDoc *doc;
@@ -76,6 +76,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   if ((doList ? 1 : 0) +
       ((saveNum != 0) ? 1 : 0) +
@@ -90,7 +91,7 @@
     }
     goto err0;
   }
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
 
   // read config file
   globalParams = new GlobalParams(cfgFileName);
@@ -101,7 +102,6 @@
   // get mapping to output encoding
   if (!(uMap = globalParams->getTextEncoding())) {
     error(errConfig, -1, "Couldn't get text encoding");
-    delete fileName;
     goto err1;
   }
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdffonts.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdffonts.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdffonts.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -95,7 +95,7 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   GString *ownerPW, *userPW;
   GBool ok;
   Page *page;
@@ -109,6 +109,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 2 || printVersion || printHelp) {
     fprintf(stderr, "pdffonts version %s\n", xpdfVersion);
@@ -118,7 +119,7 @@
     }
     goto err0;
   }
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
 
   // read config file
   globalParams = new GlobalParams(cfgFileName);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfimages.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfimages.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfimages.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -74,7 +74,7 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   char *imgRoot;
   GString *ownerPW, *userPW;
   ImageOutputDev *imgOut;
@@ -84,6 +84,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 3 || printVersion || printHelp) {
     fprintf(stderr, "pdfimages version %s\n", xpdfVersion);
@@ -93,7 +94,7 @@
     }
     goto err0;
   }
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
   imgRoot = argv[2];
 
   // read config file

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -13,6 +13,7 @@
 #include <string.h>
 #include <time.h>
 #include <math.h>
+#include <ctype.h>
 #include "gmem.h"
 #include "gmempp.h"
 #include "parseargs.h"
@@ -30,12 +31,18 @@
 #include "CharTypes.h"
 #include "UnicodeMap.h"
 #include "TextString.h"
+#include "UTF8.h"
+#include "Zoox.h"
 #include "Error.h"
 #include "config.h"
 
-static void printInfoString(Dict *infoDict, const char *key, const char *text,
+static void printInfoString(Object *infoDict, const char *infoKey,
+			    ZxDoc *xmp, const char *xmpKey1,
+			    const char *xmpKey2,
+			    const char *text, GBool parseDate,
 			    UnicodeMap *uMap);
-static void printInfoDate(Dict *infoDict, const char *key, const char *text);
+static GString *parseInfoDate(GString *s);
+static GString *parseXMPDate(GString *s);
 static void printBox(const char *text, PDFRectangle *box);
 
 static int firstPage = 1;
@@ -84,7 +91,7 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   GString *ownerPW, *userPW;
   UnicodeMap *uMap;
   Page *page;
@@ -94,6 +101,7 @@
   double w, h, wISO, hISO;
   FILE *f;
   GString *metadata;
+  ZxDoc *xmp;
   GBool ok;
   int exitCode;
   int pg, i;
@@ -102,6 +110,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 2 || printVersion || printHelp) {
     fprintf(stderr, "pdfinfo version %s\n", xpdfVersion);
@@ -111,7 +120,7 @@
     }
     goto err0;
   }
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
 
   // read config file
   globalParams = new GlobalParams(cfgFileName);
@@ -122,7 +131,6 @@
   // get mapping to output encoding
   if (!(uMap = globalParams->getTextEncoding())) {
     error(errConfig, -1, "Couldn't get text encoding");
-    delete fileName;
     goto err1;
   }
 
@@ -165,24 +173,23 @@
 
   // print doc info
   doc->getDocInfo(&info);
-  if (info.isDict()) {
-    printInfoString(info.getDict(), "Title",        "Title:          ", uMap);
-    printInfoString(info.getDict(), "Subject",      "Subject:        ", uMap);
-    printInfoString(info.getDict(), "Keywords",     "Keywords:       ", uMap);
-    printInfoString(info.getDict(), "Author",       "Author:         ", uMap);
-    printInfoString(info.getDict(), "Creator",      "Creator:        ", uMap);
-    printInfoString(info.getDict(), "Producer",     "Producer:       ", uMap);
-    if (rawDates) {
-      printInfoString(info.getDict(), "CreationDate", "CreationDate:   ",
-		      uMap);
-      printInfoString(info.getDict(), "ModDate",      "ModDate:        ",
-		      uMap);
-    } else {
-      printInfoDate(info.getDict(),   "CreationDate", "CreationDate:   ");
-      printInfoDate(info.getDict(),   "ModDate",      "ModDate:        ");
-    }
+  if ((metadata = doc->readMetadata())) {
+    xmp = ZxDoc::loadMem(metadata->getCString(), metadata->getLength());
+  } else {
+    xmp = NULL;
   }
+  printInfoString(&info, "Title",        xmp, "dc:title",        NULL,              "Title:          ", gFalse,    uMap);
+  printInfoString(&info, "Subject",      xmp, "dc:description",  NULL,              "Subject:        ", gFalse,    uMap);
+  printInfoString(&info, "Keywords",     xmp, "pdf:Keywords",    NULL,              "Keywords:       ", gFalse,    uMap);
+  printInfoString(&info, "Author",       xmp, "dc:creator",      NULL,              "Author:         ", gFalse,    uMap);
+  printInfoString(&info, "Creator",      xmp, "xmp:CreatorTool", NULL,              "Creator:        ", gFalse,    uMap);
+  printInfoString(&info, "Producer",     xmp, "pdf:Producer",    NULL,              "Producer:       ", gFalse,    uMap);
+  printInfoString(&info, "CreationDate", xmp, "xap:CreateDate",  "xmp:CreateDate",  "CreationDate:   ", !rawDates, uMap);
+  printInfoString(&info, "ModDate",      xmp, "xap:ModifyDate",  "xmp:ModifyDate",  "ModDate:        ", !rawDates, uMap);
   info.free();
+  if (xmp) {
+    delete xmp;
+  }
 
   // print tagging info
   printf("Tagged:         %s\n",
@@ -276,11 +283,7 @@
   }
 
   // print file size
-#ifdef VMS
-  f = fopen(fileName->getCString(), "rb", "ctx=stm");
-#else
-  f = fopen(fileName->getCString(), "rb");
-#endif
+  f = openFile(fileName, "rb");
   if (f) {
     gfseek(f, 0, SEEK_END);
     printf("File size:      %u bytes\n", (Guint)gftell(f));
@@ -294,10 +297,13 @@
   printf("PDF version:    %.1f\n", doc->getPDFVersion());
 
   // print the metadata
-  if (printMetadata && (metadata = doc->readMetadata())) {
+  if (printMetadata && metadata) {
     fputs("Metadata:\n", stdout);
     fputs(metadata->getCString(), stdout);
     fputc('\n', stdout);
+  }
+
+  if (metadata) {
     delete metadata;
   }
 
@@ -318,72 +324,218 @@
   return exitCode;
 }
 
-static void printInfoString(Dict *infoDict, const char *key, const char *text,
+static void printInfoString(Object *infoDict, const char *infoKey,
+			    ZxDoc *xmp, const char *xmpKey1,
+			    const char *xmpKey2,
+			    const char *text, GBool parseDate,
 			    UnicodeMap *uMap) {
   Object obj;
   TextString *s;
   Unicode *u;
+  Unicode uu;
   char buf[8];
+  GString *value, *tmp;
+  ZxElement *rdf, *elem, *child;
+  ZxNode *node, *node2;
   int i, n;
 
-  if (infoDict->lookup(key, &obj)->isString()) {
+  value = NULL;
+
+  //-- check the info dictionary
+  if (infoDict->isDict()) {
+    if (infoDict->dictLookup(infoKey, &obj)->isString()) {
+      if (!parseDate || !(value = parseInfoDate(obj.getString()))) {
+	s = new TextString(obj.getString());
+	u = s->getUnicode();
+	value = new GString();
+	for (i = 0; i < s->getLength(); ++i) {
+	  n = uMap->mapUnicode(u[i], buf, sizeof(buf));
+	  value->append(buf, n);
+	}
+	delete s;
+      }
+    }
+    obj.free();
+  }
+
+  //-- check the XMP metadata
+  if (xmp) {
+    rdf = xmp->getRoot();
+    if (rdf->isElement("x:xmpmeta")) {
+      rdf = rdf->findFirstChildElement("rdf:RDF");
+    }
+    if (rdf && rdf->isElement("rdf:RDF")) {
+      for (node = rdf->getFirstChild(); node; node = node->getNextChild()) {
+	if (node->isElement("rdf:Description")) {
+	  if (!(elem = node->findFirstChildElement(xmpKey1)) && xmpKey2) {
+	    elem = node->findFirstChildElement(xmpKey2);
+	  }
+	  if (elem) {
+	    if ((child = elem->findFirstChildElement("rdf:Alt")) ||
+		(child = elem->findFirstChildElement("rdf:Seq"))) {
+	      if ((node2 = child->findFirstChildElement("rdf:li"))) {
+		node2 = node2->getFirstChild();
+	      }
+	    } else {
+	      node2 = elem->getFirstChild();
+	    }
+	    if (node2 && node2->isCharData()) {
+	      if (value) {
+		delete value;
+	      }
+	      if (!parseDate ||
+		  !(value = parseXMPDate(((ZxCharData *)node2)->getData()))) {
+		tmp = ((ZxCharData *)node2)->getData();
+		int i = 0;
+		value = new GString();
+		while (getUTF8(tmp, &i, &uu)) {
+		  n = uMap->mapUnicode(uu, buf, sizeof(buf));
+		  value->append(buf, n);
+		}
+	      }
+	    }
+	    break;
+	  }
+	}
+      }
+    }
+  }
+
+  if (value) {
     fputs(text, stdout);
-    s = new TextString(obj.getString());
-    u = s->getUnicode();
-    for (i = 0; i < s->getLength(); ++i) {
-      n = uMap->mapUnicode(u[i], buf, sizeof(buf));
-      fwrite(buf, 1, n, stdout);
-    }
+    fwrite(value->getCString(), 1, value->getLength(), stdout);
     fputc('\n', stdout);
-    delete s;
+    delete value;
   }
-  obj.free();
 }
 
-static void printInfoDate(Dict *infoDict, const char *key, const char *text) {
-  Object obj;
-  char *s;
+static GString *parseInfoDate(GString *s) {
   int year, mon, day, hour, min, sec, n;
   struct tm tmStruct;
   char buf[256];
+  char *p;
 
-  if (infoDict->lookup(key, &obj)->isString()) {
-    fputs(text, stdout);
-    s = obj.getString()->getCString();
-    if (s[0] == 'D' && s[1] == ':') {
-      s += 2;
-    }
-    if ((n = sscanf(s, "%4d%2d%2d%2d%2d%2d",
-		    &year, &mon, &day, &hour, &min, &sec)) >= 1) {
-      switch (n) {
-      case 1: mon = 1;
-      case 2: day = 1;
-      case 3: hour = 0;
-      case 4: min = 0;
-      case 5: sec = 0;
+  p = s->getCString();
+  if (p[0] == 'D' && p[1] == ':') {
+    p += 2;
+  }
+  if ((n = sscanf(p, "%4d%2d%2d%2d%2d%2d",
+		  &year, &mon, &day, &hour, &min, &sec)) < 1) {
+    return NULL;
+  }
+  switch (n) {
+  case 1: mon = 1;
+  case 2: day = 1;
+  case 3: hour = 0;
+  case 4: min = 0;
+  case 5: sec = 0;
+  }
+  tmStruct.tm_year = year - 1900;
+  tmStruct.tm_mon = mon - 1;
+  tmStruct.tm_mday = day;
+  tmStruct.tm_hour = hour;
+  tmStruct.tm_min = min;
+  tmStruct.tm_sec = sec;
+  tmStruct.tm_wday = -1;
+  tmStruct.tm_yday = -1;
+  tmStruct.tm_isdst = -1;
+  // compute the tm_wday and tm_yday fields
+  if (!(mktime(&tmStruct) != (time_t)-1 &&
+	strftime(buf, sizeof(buf), "%c", &tmStruct))) {
+    return NULL;
+  }
+  return new GString(buf);
+}
+
+static GString *parseXMPDate(GString *s) {
+  int year, mon, day, hour, min, sec, tz;
+  struct tm tmStruct;
+  char buf[256];
+  char *p;
+
+  p = s->getCString();
+  if (isdigit(p[0]) && isdigit(p[1]) && isdigit(p[2]) && isdigit(p[3])) {
+    buf[0] = p[0];
+    buf[1] = p[1];
+    buf[2] = p[2];
+    buf[3] = p[3];
+    buf[4] = '\0';
+    year = atoi(buf);
+    p += 4;
+  } else {
+    return NULL;
+  }
+  mon = day = 1;
+  hour = min = sec = 0;
+  tz = 2000;
+  if (p[0] == '-' && isdigit(p[1]) && isdigit(p[2])) {
+    buf[0] = p[1];
+    buf[1] = p[2];
+    buf[2] = '\0';
+    mon = atoi(buf);
+    p += 3;
+    if (p[0] == '-' && isdigit(p[1]) && isdigit(p[2])) {
+      buf[0] = p[1];
+      buf[1] = p[2];
+      buf[2] = '\0';
+      day = atoi(buf);
+      p += 3;
+      if (p[0] == 'T' && isdigit(p[1]) && isdigit(p[2]) &&
+	  p[3] == ':' && isdigit(p[4]) && isdigit(p[5])) {
+	buf[0] = p[1];
+	buf[1] = p[2];
+	buf[2] = '\0';
+	hour = atoi(buf);
+	buf[0] = p[4];
+	buf[1] = p[5];
+	buf[2] = '\0';
+	min = atoi(buf);
+	p += 6;
+	if (p[0] == ':' && isdigit(p[1]) && isdigit(p[2])) {
+	  buf[0] = p[1];
+	  buf[1] = p[2];
+	  buf[2] = '\0';
+	  sec = atoi(buf);
+	  if (p[0] == '.' && isdigit(p[1])) {
+	    p += 2;
+	  }
+	}
+	if ((p[0] == '+' || p[0] == '-') &&
+	    isdigit(p[1]) && isdigit(p[2]) && p[3] == ':' &&
+	    isdigit(p[4]) && isdigit(p[5])) {
+	  buf[0] = p[1];
+	  buf[1] = p[2];
+	  buf[2] = '\0';
+	  tz = atoi(buf);
+	  buf[0] = p[4];
+	  buf[1] = p[5];
+	  buf[2] = '\0';
+	  tz = tz * 60 + atoi(buf);
+	  tz = tz * 60;
+	  if (p[0] == '-') {
+	    tz = -tz;
+	  }
+	}
       }
-      tmStruct.tm_year = year - 1900;
-      tmStruct.tm_mon = mon - 1;
-      tmStruct.tm_mday = day;
-      tmStruct.tm_hour = hour;
-      tmStruct.tm_min = min;
-      tmStruct.tm_sec = sec;
-      tmStruct.tm_wday = -1;
-      tmStruct.tm_yday = -1;
-      tmStruct.tm_isdst = -1;
-      // compute the tm_wday and tm_yday fields
-      if (mktime(&tmStruct) != (time_t)-1 &&
-	  strftime(buf, sizeof(buf), "%c", &tmStruct)) {
-	fputs(buf, stdout);
-      } else {
-	fputs(s, stdout);
-      }
-    } else {
-      fputs(s, stdout);
     }
-    fputc('\n', stdout);
   }
-  obj.free();
+
+  tmStruct.tm_year = year - 1900;
+  tmStruct.tm_mon = mon - 1;
+  tmStruct.tm_mday = day;
+  tmStruct.tm_hour = hour;
+  tmStruct.tm_min = min;
+  tmStruct.tm_sec = sec;
+  tmStruct.tm_wday = -1;
+  tmStruct.tm_yday = -1;
+  tmStruct.tm_isdst = -1;
+  // compute the tm_wday and tm_yday fields
+  //~ this ignores the timezone
+  if (!(mktime(&tmStruct) != (time_t)-1 &&
+	strftime(buf, sizeof(buf), "%c", &tmStruct))) {
+    return NULL;
+  }
+  return new GString(buf);
 }
 
 static void printBox(const char *text, PDFRectangle *box) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -82,7 +82,7 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   char *htmlDir;
   GString *ownerPW, *userPW;
   HTMLGen *htmlGen;
@@ -94,6 +94,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc != 3 || printVersion || printHelp) {
     fprintf(stderr, "pdftohtml version %s\n", xpdfVersion);
@@ -103,7 +104,7 @@
     }
     goto err0;
   }
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
   htmlDir = argv[2];
 
   // read config file

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftopng.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftopng.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftopng.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -92,7 +92,7 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   char *pngRoot;
   GString *pngFile;
   GString *ownerPW, *userPW;
@@ -108,6 +108,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   if (mono && gray) {
     fprintf(stderr, "Specify one of -mono or -gray\n");
@@ -125,7 +126,7 @@
     }
     goto err0;
   }
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
   pngRoot = argv[2];
 
   // read config file

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -92,7 +92,7 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   char *ppmRoot;
   GString *ppmFile;
   GString *ownerPW, *userPW;
@@ -114,7 +114,7 @@
   // more info)
   fpu_control_t cw;
   _FPU_GETCW(cw);
-  cw = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
+  cw = (fpu_control_t)((cw & ~_FPU_EXTENDED) | _FPU_DOUBLE);
   _FPU_SETCW(cw);
 #endif
 
@@ -121,6 +121,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   n = 0;
   n += mono ? 1 : 0;
@@ -139,7 +140,7 @@
     }
     goto err0;
   }
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
   ppmRoot = argv[2];
 
   // read config file
@@ -218,7 +219,7 @@
   } else if (cmyk) {
     paperColor[0] = paperColor[1] = paperColor[2] = paperColor[3] = 0;
     splashOut = new SplashOutputDev(splashModeCMYK8, 1, gFalse, paperColor);
-#endif
+#endif // SPLASH_CMYK
   } else {
     paperColor[0] = paperColor[1] = paperColor[2] = 0xff;
     splashOut = new SplashOutputDev(splashModeRGB8, 1, gFalse, paperColor);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftops.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftops.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftops.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -44,7 +44,6 @@
 static GBool level3Sep = gFalse;
 static GBool doEPS = gFalse;
 static GBool doForm = gFalse;
-static GBool forceMono = gFalse;
 #if OPI_SUPPORT
 static GBool doOPI = gFalse;
 #endif
@@ -95,8 +94,6 @@
    "generate Encapsulated PostScript (EPS)"},
   {"-form",       argFlag,     &doForm,         0,
    "generate a PostScript form"},
-  {"-mono",       argFlag,     &forceMono,      0,
-   "force monochrome (grayscale) output"},
 #if OPI_SUPPORT
   {"-opi",        argFlag,     &doOPI,          0,
    "generate OPI comments"},
@@ -154,7 +151,7 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   GString *psFileName;
   PSLevel level;
   PSOutMode mode;
@@ -175,7 +172,7 @@
   // more info)
   fpu_control_t cw;
   _FPU_GETCW(cw);
-  cw = (cw & ~_FPU_EXTENDED) | _FPU_DOUBLE;
+  cw = (fpu_control_t)((cw & ~_FPU_EXTENDED) | _FPU_DOUBLE);
   _FPU_SETCW(cw);
 #endif
 
@@ -182,6 +179,7 @@
   exitCode = 99;
 
   // parse args
+  fixCommandLine(&argc, &argv);
   ok = parseArgs(argDesc, &argc, argv);
   if (!ok || argc < 2 || argc > 3 || printVersion || printHelp) {
     fprintf(stderr, "pdftops version %s\n", xpdfVersion);
@@ -230,7 +228,7 @@
   mode = doEPS ? psModeEPS
                : doForm ? psModeForm
                         : psModePS;
-  fileName = new GString(argv[1]);
+  fileName = argv[1];
 
   // read config file
   globalParams = new GlobalParams(cfgFileName);
@@ -240,7 +238,6 @@
   if (paperSize[0]) {
     if (!globalParams->setPSPaperSize(paperSize)) {
       fprintf(stderr, "Invalid paper size\n");
-      delete fileName;
       goto err0;
     }
   } else {
@@ -332,12 +329,11 @@
   if (argc == 3) {
     psFileName = new GString(argv[2]);
   } else {
-    p = fileName->getCString() + fileName->getLength() - 4;
-    if (!strcmp(p, ".pdf") || !strcmp(p, ".PDF")) {
-      psFileName = new GString(fileName->getCString(),
-			       fileName->getLength() - 4);
+    p = fileName + strlen(fileName) - 4;
+    if (strlen(fileName) > 4 && (!strcmp(p, ".pdf") || !strcmp(p, ".PDF"))) {
+      psFileName = new GString(fileName, (int)strlen(fileName) - 4);
     } else {
-      psFileName = fileName->copy();
+      psFileName = new GString(fileName);
     }
     psFileName->append(doEPS ? ".eps" : ".ps");
   }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftotext.cc	2019-01-28 00:04:18 UTC (rev 813)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftotext.cc	2019-05-30 16:25:31 UTC (rev 814)
@@ -111,13 +111,12 @@
 
 int main(int argc, char *argv[]) {
   PDFDoc *doc;
-  GString *fileName;
+  char *fileName;
   GString *textFileName;
   GString *ownerPW, *userPW;

@@ Diff output truncated at 1234567 characters. @@


More information about the pdftex-commits mailing list