]> git.lyx.org Git - features.git/commitdiff
Packaging of LyX on Windows (will need tweaking for 1.4.x).
authorAngus Leeming <leeming@lyx.org>
Mon, 6 Jun 2005 13:00:52 +0000 (13:00 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 6 Jun 2005 13:00:52 +0000 (13:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10003 a592a061-630c-0410-9148-cb99ea01b6c8

37 files changed:
development/Win32/packaging/README [new file with mode: 0644]
development/Win32/packaging/clean_dvi.py [new file with mode: 0644]
development/Win32/packaging/dtl/Makefile [new file with mode: 0644]
development/Win32/packaging/dtl/README [new file with mode: 0644]
development/Win32/packaging/dtl/dt2dv.c [new file with mode: 0644]
development/Win32/packaging/dtl/dt2dv.man [new file with mode: 0644]
development/Win32/packaging/dtl/dtl.doc [new file with mode: 0644]
development/Win32/packaging/dtl/dtl.h [new file with mode: 0644]
development/Win32/packaging/dtl/dv2dt.c [new file with mode: 0644]
development/Win32/packaging/dtl/dv2dt.man [new file with mode: 0644]
development/Win32/packaging/dtl/dvi.doc [new file with mode: 0644]
development/Win32/packaging/dtl/edited.txt [new file with mode: 0644]
development/Win32/packaging/dtl/example.tex [new file with mode: 0644]
development/Win32/packaging/dtl/hello.tex [new file with mode: 0644]
development/Win32/packaging/dtl/man2ps [new file with mode: 0644]
development/Win32/packaging/dtl/tripvdu.tex [new file with mode: 0644]
development/Win32/packaging/icons/lyx.svg [new file with mode: 0644]
development/Win32/packaging/icons/lyx_32x32.ico [new file with mode: 0644]
development/Win32/packaging/icons/lyx_32x32.png [new file with mode: 0644]
development/Win32/packaging/icons/lyx_32x32_16colors.png [new file with mode: 0644]
development/Win32/packaging/icons/lyx_doc.svg [new file with mode: 0644]
development/Win32/packaging/icons/lyx_doc_32x32.ico [new file with mode: 0644]
development/Win32/packaging/icons/lyx_doc_32x32.png [new file with mode: 0644]
development/Win32/packaging/icons/lyx_doc_32x32_16colors.png [new file with mode: 0644]
development/Win32/packaging/installer/abi_util_fileassoc.nsh [new file with mode: 0644]
development/Win32/packaging/installer/download.nsh [new file with mode: 0644]
development/Win32/packaging/installer/ioDownload.ini [new file with mode: 0644]
development/Win32/packaging/installer/ioSummary.ini [new file with mode: 0644]
development/Win32/packaging/installer/is_user_admin.nsh [new file with mode: 0644]
development/Win32/packaging/installer/lyx_installer.nsi [new file with mode: 0644]
development/Win32/packaging/installer/lyx_languages/english.nsh [new file with mode: 0644]
development/Win32/packaging/installer/lyx_languages/french.nsh [new file with mode: 0644]
development/Win32/packaging/installer/lyx_languages/german.nsh [new file with mode: 0644]
development/Win32/packaging/installer/lyx_path_prefix.C [new file with mode: 0644]
development/Win32/packaging/installer/lyxfunc.nsh [new file with mode: 0644]
development/Win32/packaging/installer/strtrim.nsh [new file with mode: 0644]
development/Win32/packaging/package_lyxwin.sh [new file with mode: 0644]

diff --git a/development/Win32/packaging/README b/development/Win32/packaging/README
new file mode 100644 (file)
index 0000000..1d88e86
--- /dev/null
@@ -0,0 +1,116 @@
+Packaging LyX 1.3.6 for Windows
+===============================
+
+Preparing the way
+=================
+
+The very first thing to do on the way to creating a LyX/Win package is
+to build the sources and install them somewhere accessible. (I've been
+using PREFIX='/J/Programs/LyX'.)
+
+Thereafter, the contents of this tree must be manipulated a
+little. I've written a little script, package_lyxwin.sh, to automate
+the process:
+
+* Copy the DLLs qt-mt3.dll, libiconv-2.dll, mingwm10.dll to the
+  $PREFIX/bin/ directory. These are needed by the LyX executable.
+
+* Strip the binaries in $PREFIX/bin/ of all debugging info.
+
+* Copy dt2dv.exe and dv2dt.exe to $PREFIX/bin/ and clean_dvi.py to
+  $PREFIX/Resources/lyx/scripts/ These are needed to enable dvips, yap
+  et al. to cope with "file names with spaces".
+
+* Add formats and converters to the $PREFIX/Resources/lyx/configure
+  script so that users can use the clean_dvi script transparently.
+
+* Remove all stuff generated by running configure. It makes sense on
+  your machine only, not for whoever is installing LyX. Specifically
+
+  xfonts/fonts.dir, xfonts/fonts.scale, doc/LaTeXConfig.lyx,
+  lyxrc.defaults, packages.lst and textclass.lst
+
+  should all be removed.
+
+Creating the LyX icons
+======================
+
+All icons are to be found in sub-directory icons/.
+
+The LyX icons, lyx_32x32.ico and lyx_doc_32x32.ico, are based on .svg
+files written and realease into the public domain by Andy Fitzsimon:
+
+http://openclipart.org/clipart/computer/icons/etiquette-theme/aps/LyX.svg
+http://openclipart.org/clipart/computer/icons/etiquette-theme/mimetype.svg
+
+lyx.svg is Andy's original.
+lyx_doc.svg is a merger of LyX.svg with mimetype.svg
+
+Working on a linux box, I used sodipodi (http://www.sodipodi.com/) to
+create the .svg file and to export these vector graphics images to
+32x32 pixel bitmaps (.png format). Thereafter I used gimp
+(http://www.gimp.org/) to generate reduced color depth versions (16,
+256 colors).
+
+Finally, on a WindowsXP machine, I used IconXP
+(http://www.aha-soft.com/iconxp/) to build the .ico files from these
+.png files at differing resolutions.
+
+Adding the LyX icons to lyx.exe
+===============================
+
+********************************************************************
+NOTE: Run 'strip' on lyx.exe before adding any images to it. 'strip'
+will not work after images have been added.
+
+$ strip lyx.exe
+j:\mingw\bin\strip.exe: lyx.exe: File in wrong format
+********************************************************************
+
+Windows executables can store various "resources", including images. I
+used ResourceHacker (http://rpi.net.au/~ajohnson/resourcehacker) to
+add the LyX icons to the .exe file.
+
+Fire up ResHacker.exe and load lyx.exe
+File>Open... lyx.exe
+
+Action>Add a new Resource...
+Open file with resource ... lyx_32x32.ico
+   Resource Type will be set to "ICONGROUP"
+Set Resource Name to "1". (No inverted commas.)
+Add Resource
+
+The icon will be shown in the main Resource Hacker window under
+Icon Group>1>0 and as Icon>5[0-3].
+
+Repeat for lyx_doc_32x32.ico, setting the Resource Name to "2".
+
+Save the modified lyx.exe. Resource Hacker will copy the original to
+lyx_original.exe. Remove it.
+
+Building the LyX installer
+==========================
+
+At this point my J:\Programs\LyX tree now contains everything that is
+to be released as a LyX/Win package. All that remains to do is to
+generate a Windows installer for it. I've written a script for NSIS
+(http://nsis.sourceforge.net/) to compile into an installer.
+
+You'll need to compile and install lyx_path_prefix.dll. From the
+comments in lyx_path_prefix.C:
+
+/* Compile the code with
+ *
+ * g++ -I/c/Program\ Files/NSIS/Contrib -Wall -shared \
+ *    lyx_path_prefix.c -o lyx_path_prefix.dll
+ *
+ * Move resulting .dll to /c/Program\ Files/NSIS/Plugins
+ */
+
+Thereafter, you'll be able to build the installer itself:
+
+$ <PATH to>/makensis lyx_installer.nsi
+
+creating lyx_setup_136.exe ready to ship.
+
+END README
diff --git a/development/Win32/packaging/clean_dvi.py b/development/Win32/packaging/clean_dvi.py
new file mode 100644 (file)
index 0000000..18f7b1a
--- /dev/null
@@ -0,0 +1,100 @@
+#! /usr/bin/env python
+
+'''
+file clean_dvi.py
+This file is part of LyX, the document processor.
+Licence details can be found in the file COPYING
+or at http://www.lyx.org/about/licence.php3
+
+author Angus Leeming
+Full author contact details are available in the file CREDITS
+or at http://www.lyx.org/about/credits.php
+
+Usage:
+    python clean_dvi.py infile.dvi outfile.dvi
+
+clean_dvi modifies the input .dvi file so that
+dvips and yap (a dvi viewer on Windows) can find
+any embedded PostScript files whose names are protected
+with "-quotes.
+
+It works by:
+1 translating the machine readable .dvi file to human
+  readable .dtl form,
+2 manipulating any references to external files
+3 translating the .dtl file back to .dvi format.
+
+It requires dv2dt and dt2dv from the DTL dviware package
+http://www.ctan.org/tex-archive/dviware/dtl/
+'''
+
+import os, re, sys
+
+def usage(prog_name):
+    return 'Usage: %s in.dvi out.dvi\n' \
+           % os.path.basename(prog_name)
+
+
+def warning(message):
+    sys.stderr.write(message + '\n')
+
+
+def error(message):
+    sys.stderr.write(message + '\n')
+    sys.exit(1)
+
+
+def manipulated_dtl(data):
+    psfile_re = re.compile(r'(.*PSfile=")(.*)(" llx=.*)')
+
+    lines = data.split('\n')
+    for i in range(len(lines)):
+        line = lines[i]
+        match = psfile_re.search(line)
+        if match != None:
+            file = match.group(2).replace('"', '')
+            lines[i] = '%s%s%s' \
+                       % ( match.group(1), file, match.group(3) )
+
+    return '\n'.join(lines)
+
+
+def main(argv):
+    # First establish that the expected information has
+    # been input on the command line and whether the
+    # required executables exist.
+    if len(argv) != 3:
+        error(usage(argv[0]))
+
+    infile  = argv[1]
+    outfile = argv[2]
+
+    if not os.path.exists(infile):
+        error('Unable to read "%s"\n' % infile)
+
+    # Convert the input .dvi file to .dtl format.
+    dv2dt_call = 'dv2dt "%s"' % infile
+    dv2dt_stdin, dv2dt_stdout, dv2dt_stderr = \
+        os.popen3(dv2dt_call, 't')
+
+    dv2dt_stdin.close()
+    dv2dt_data   = dv2dt_stdout.read()
+    dv2dt_status = dv2dt_stdout.close()
+
+    if dv2dt_status != None or len(dv2dt_data) == 0:
+        dv2dt_err = dv2dt_stderr.read()
+        error("Failed: %s\n%s\n" % ( dv2dt_call, dv2dt_err) )
+
+    # Manipulate the .dtl file.
+    dtl_data = manipulated_dtl(dv2dt_data)
+    if dtl_data == None:
+        error("Failed to manipulate the dtl file")
+
+    # Convert this .dtl file back to .dvi format.
+    dt2dv_call = 'dt2dv -si "%s"' % outfile
+    dt2dv_stdin = os.popen(dt2dv_call, 'w')
+    dt2dv_stdin.write(dtl_data)
+
+
+if __name__ == "__main__":
+    main(sys.argv)
diff --git a/development/Win32/packaging/dtl/Makefile b/development/Win32/packaging/dtl/Makefile
new file mode 100644 (file)
index 0000000..e057260
--- /dev/null
@@ -0,0 +1,151 @@
+# Makefile for dv2dt, dt2dv
+# Version 0.6.1
+# Thu 9 March 1995
+# Geoffrey Tobin
+# Nelson H. F. Beebe
+#=======================================================================
+
+BINDIR          = /usr/local/bin
+CATDIR         = $(MANDIR)/../cat$(MANEXT)
+CC              = gcc
+CFLAGS          = -O2 -Wall
+# Some compilers don't optimise correctly; for those, don't use `-O2' :
+# CFLAGS          = -Wall
+CHMOD           = /bin/chmod
+COL            = col -b
+CP              = /bin/cp
+DITROFF                = ditroff
+DITROFF                = groff
+DT2DV          = dt2dv.exe
+DV2DT          = dv2dt.exe
+EXES           = $(DT2DV) $(DV2DT)
+LDFLAGS         = -s
+LDFLAGS         =
+MAN2PS         = sh ./man2ps
+MANDIR         = /usr/local/man/man$(MANEXT)
+MANEXT         = 1
+OBJS            = dt2dv.o dv2dt.o
+RM              = /bin/rm -f
+SHELL           = /bin/sh
+
+DOCS           = README dtl.doc dvi.doc dt2dv.man dv2dt.man
+SRC            = Makefile dtl.h dt2dv.c dv2dt.c man2ps
+TESTS          = hello.tex example.tex tripvdu.tex edited.txt
+
+DTL_DBN                = $(DOCS) $(SRC) $(TESTS)
+
+#=======================================================================
+
+.SUFFIXES:     .hlp .ps .man
+
+.man.hlp:
+       $(DITROFF) -man -Tascii $< | $(COL) >$@
+
+.man.ps:
+       $(MAN2PS) < $< > $@
+
+#=======================================================================
+
+#all:  dtl check doc
+all:  dtl check
+
+doc:  dt2dv.hlp dv2dt.hlp dt2dv.ps dv2dt.ps
+
+dtl:  $(EXES)
+
+check tests:  hello example tripvdu edited
+
+$(DV2DT): dv2dt.o dtl.h
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ dv2dt.o
+
+$(DT2DV): dt2dv.o dtl.h
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ dt2dv.o
+
+hello:  hello.dtl $(EXES)
+       ./dt2dv hello.dtl hello2.dvi
+       ./dv2dt hello2.dvi hello2.dtl
+       -@diff hello.dtl hello2.dtl > hello.dif
+       @if [ -s hello.dif ] ; \
+       then echo ERROR: differences in hello.dif ; \
+       else $(RM) hello.dif ; \
+       fi
+
+hello.dtl:  hello.tex
+       tex hello
+       ./dv2dt hello.dvi hello.dtl
+
+example:  example.dtl $(EXES)
+       ./dt2dv example.dtl example2.dvi
+       ./dv2dt example2.dvi example2.dtl
+       -@diff example.dtl example2.dtl > example.dif
+       @if [ -s example.dif ] ; \
+       then echo ERROR: differences in example.dif ; \
+       else $(RM) example.dif ; \
+       fi
+
+example.dtl:  example.tex
+       tex example
+       ./dv2dt example.dvi example.dtl
+
+tripvdu:  tripvdu.dtl $(EXES)
+       ./dt2dv tripvdu.dtl tripvdu2.dvi
+       ./dv2dt tripvdu2.dvi tripvdu2.dtl
+       -@diff tripvdu.dtl tripvdu2.dtl > tripvdu.dif
+       @if [ -s tripvdu.dif ] ; \
+       then echo ERROR: differences in tripvdu.dif ; \
+       else $(RM) tripvdu.dif ; \
+       fi
+
+tripvdu.dtl:  tripvdu.tex
+       tex tripvdu
+       ./dv2dt tripvdu.dvi tripvdu.dtl
+
+# edited.txt is already a dtl file.
+
+edited:  edited.txt $(EXES)
+       ./dt2dv edited.txt edited.dvi
+       ./dv2dt edited.dvi edited2.dtl
+       ./dt2dv edited2.dtl edited2.dvi
+       ./dv2dt edited2.dvi edited3.dtl
+       @if [ -s edited.dif ] ; \
+       then echo ERROR : differences in edited.dif ; \
+       else $(RM) edited.dif ; \
+       fi
+
+clean mostlyclean:
+       -$(RM) $(OBJS)
+
+clobber: clean
+       -$(RM) $(EXES) *~ core *.log *.dvi *.dtl *.dif
+
+distclean realclean: clobber
+       -$(RM) dt2dv.hlp dv2dt.hlp dt2dv.ps dv2dt.ps
+
+install:       dtl
+       -$(MAKE) uninstall
+       $(CP) dt2dv $(BINDIR)/dt2dv
+       $(CHMOD) 775 $(BINDIR)/dt2dv
+       $(CP) dv2dt $(BINDIR)/dv2dt
+       $(CHMOD) 775 $(BINDIR)/dv2dt
+       $(CP) dt2dv.man $(MANDIR)/dt2dv.$(MANEXT)
+       $(CHMOD) 664 $(MANDIR)/dt2dv.$(MANEXT)
+       $(CP) dv2dt.man $(MANDIR)/dv2dt.$(MANEXT)
+       $(CHMOD) 664 $(MANDIR)/dv2dt.$(MANEXT)
+
+uninstall:
+       -$(RM) $(BINDIR)/dt2dv
+       -$(RM) $(BINDIR)/dv2dt
+       -$(RM) $(CATDIR)/dt2dv.$(MANEXT)
+       -$(RM) $(CATDIR)/dv2dt.$(MANEXT)
+
+dist:  dtl.tar.gz
+
+dtl.tar.gz:  $(DTL_DBN)
+       tar -czf dtl.tar.gz $(DTL_DBN)
+
+zip:  dtl.zip
+
+dtl.zip:  $(DTL_DBN)
+       zip dtl.zip $(DTL_DBN)
+
+# EOF Makefile
diff --git a/development/Win32/packaging/dtl/README b/development/Win32/packaging/dtl/README
new file mode 100644 (file)
index 0000000..6fa1547
--- /dev/null
@@ -0,0 +1,143 @@
+README for DTL package - Thu 9 March 1995
+-----------------------------------------
+Author: Geoffrey Tobin <G.Tobin@ee.latrobe.edu.au>
+Version: 0.6.1
+CTAN Archive-path: dviware/dtl
+Brief Description:
+ DTL (DVI Text Language) files are equivalent to TeX's DVI files,
+ but are humanly readable, instead of binary.  Two programs are
+ provided to translate between DVI and DTL:  dv2dt, dt2dv.
+ dt2dv warns if byte addresses or string lengths recorded in a DTL
+ file are incorrect, then overrides them.  This makes DTL files
+ editable.  It also allows quoted apostrophes (\') and quoted quotes
+ (\\) in strings.  The current DTL variety, sequences-6, separates
+ font paths into directory and font, which makes them freely editable.
+ In this release, DTL line numbers are correctly calculated, and three
+ memory leaks have been fixed.
+Keywords: dvi, TeX
+Includes:
+ Makefile  README  dt2dv.c  dtl.h  dv2dt.c
+ man2ps  dtl.doc  dvi.doc  dt2dv.man  dv2dt.man
+ hello.tex  example.tex  tripvdu.tex  edited.txt
+
+Motivation:
+
+ When TeX has typeset a document, it writes its handiwork to a DVI
+file, for DVI processing software (such as viewers, printer drivers,
+dvidvi, and dvicopy) to read.
+
+The file  dvi.doc  lists the DVI file commands, with their opcodes
+(byte values), nominal command names, arguments, and meanings.  For a
+detailed description of DVI file structure, see one of these:
+1.  Donald E. Knuth's book _TeX: The Program_;
+2.  The file tex.web, which contains source and documentation for TeX:
+        CTAN:  systems/knuth/tex/tex.web
+3.  The source for Knuth's dvitype program:
+        CTAN:  systems/knuth/texware/dvitype.web
+4.  Joachim Schrod's DVI drivers standard document, the relevant part
+    of which is at
+        CTAN:  dviware/driv-standard/level-0
+
+Sometimes human beings are interested to see exactly what TeX has
+produced, for example when viewing or printing of the DVI file gives
+unexpected results.  However, a DVI file is a compact binary
+representation, so we need software to display its contents.
+
+Binary file editors, when available, can show the DVI bytes, but not
+their meanings, except for the portions that represent embedded text.
+In particular, the command names are not shown, and the command
+boundaries are not respected.
+
+By contrast, Knuth's dvitype program is designed as an example of a
+DVI driver.  However, dvitype is inconvenient for studying the DVI
+file alone, for the following reasons:
+1.  Being a DVI driver, dvitype endeavors to read the TFM font metric
+files referenced in the DVI file.  If a TFM file is absent, dvitype
+quits with an error message.
+2.  When it starts, it prompts the user interactively for each of a
+series of options.
+3.  Even the least verbose option gives masses of information that is
+not contained in the DVI file, coming instead from a combination of
+the data in the DVI file and TFM files.
+4.  It does NOT show the DVI information in a way that accurately
+reflects the structure of the DVI file.
+5.  Its output, if redirected to a file, produces a very large file.
+6.  There is no automated procedure for converting the output of
+dvitype back to a DVI file, and doing it by hand is totally
+unreasonable.
+
+The first disadvantage is a killer if a TFM file is absent.
+Disadvantages two to four make dvitype very inconvenient for studying
+a DVI file.  The fifth problem makes dvitype's output tedious,
+disk-hungry (so one deletes it almost immediately), and unsuitable for
+file transfer.
+
+The sixth disadvantage of dvitype is important to those people who are
+interested in editing DVI files.  Since the DVI files refer explicitly
+to their own internal byte addresses, it's very easy to mess up a DVI
+file if one were to try to edit it directly, even apart from the problem
+of how to recognise a command.
+
+So an exact, concise, textual representation of a DVI file is needed,
+but dvitype does not produce one.
+
+Resolution:
+
+ Therefore, working from Joachim Schrod's description, I designed DTL
+and its conversion programs dv2dt (DVI -> DTL) and dt2dv (DTL -> DVI),
+which are provided as C sources:
+
+    dtl.h
+    dv2dt.c
+    dt2dv.c
+
+Although I was motivated by the TFM <-> PL conversion provided by
+Knuth's tftopl and pltotf programs, I deliberately designed DTL to be
+a much more concise and literal translation than the `property list'
+structure exemplified by PL.  The result is that a DTL file is
+typically three times the size of its equivalent DVI file.  The
+document  dtl.doc  lists the correspondence between the DTL command
+names and the (nominal) DVI command names.
+
+A clear advantage of an exact two-way conversion is that we can check
+(and prove) whether the converters worked truly on a given DVI file.
+The provided plain TeX files:
+    example.tex
+    tripvdu.tex
+can be used to test whether the compiled programs are behaving
+sensibly.  Whereas  example.tex  is a simple document that uses a
+variety of plain TeX commands,  tripvdu.tex  provides a kind of
+`trip test' for DVI processor programs.  Both documents are taken,
+with permission, from Andrew K. Trevorrow's dvitovdu (alias dvi2vdu)
+distribution (and are also part of the dvgt viewer distribution).
+
+The  Makefile  might have to be edited for your site, as it assumes
+gcc  for your C compiler.  Makefile compiles dv2dt and dt2dv, then
+runs  tex  on example.tex and tripvdu.tex, and also converts the
+resulting DVI files to DTL files, back to DVI files (with a change
+of name), then back again to DTL files, so that the results can be
+compared using a textual differencing program.  (Many computer systems
+have such a program; on unix, as assumed by Makefile, this is named
+`diff';  ms-dos has one named `comp'.)  This should produce a
+zero-length  .dif  file for each document, proving that the two DTL
+files are identical.
+
+A keen tester might also use a binary difference program on the DVI
+files, to check that they are identical, as they need to be.  (On unix
+systems, the `diff' program suffices for that purpose.)
+
+Note:
+
+ In representing numeric quantities, I have mainly opted to use
+decimal notation, as this is how most of us are trained to think.
+However, for the checksums in the `fd' (font definition) commands, I
+chose octal notation, as this is used for checksums in Knuth's PL
+files, against which DVI files must be compared when a DVI driver
+loads a font.
+
+Caveat:
+
+The length of DTL commands is limited by the size of the line buffer
+in dt2dv.c.
+
+End of README
diff --git a/development/Win32/packaging/dtl/dt2dv.c b/development/Win32/packaging/dtl/dt2dv.c
new file mode 100644 (file)
index 0000000..a4ab23a
--- /dev/null
@@ -0,0 +1,2850 @@
+/* dt2dv - convert human-readable "DTL" file to DVI format
+         - this is intended to invert dv2dt version 0.6.0
+   - version 0.6.1 - 14:38 GMT +11  Thu 9 March 1995
+   - Geoffrey Tobin    G.Tobin@ee.latrobe.edu.au
+   - fixes:  Michal Tomczak-Jaegermann    ntomczak@vm.ucs.ualberta.ca
+             Nelson H. F. Beebe    beebe@math.utah.edu
+   - Reference:  "The DVI Driver Standard, Level 0",
+                 by  The TUG DVI Driver Standards Committee.
+                 Appendix A, "Device-Independent File Format".
+*/
+
+/* unix version; read from stdin, write to stdout, by default. */
+
+#include <ctype.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "dtl.h"
+
+/* by default, read and write regular files */
+int rd_stdin = 0;
+int wr_stdout = 0;
+
+/* maximum number of characters in a DTL input line */
+#define MAXLINE  1024
+
+/* input line */
+typedef struct
+{
+  COUNT num;    /* current line number */
+  size_t max;   /* capacity of buf */
+  S4 wrote;     /* number of characters written into buf */
+  size_t read;  /* position in buf of next character to read from buf */
+  char * buf;   /* line buffer */
+} Line;
+
+char linebuf[MAXLINE+1];
+
+Line dtl_line = {0, 0, 0, MAXLINE, linebuf};
+
+/* a DTL token either is:
+     a quoted string (admitting an escape character),
+     or BCOM (if that is a nonempty string),
+     or ECOM (if that is a nonempty string),
+     or a string _not_ including ECOM_CHAR or space.
+*/
+
+/* maximum expected length of a DTL token */
+#define MAXTOKLEN 255
+typedef char Token[MAXTOKLEN+1];
+
+typedef unsigned char Byte;
+typedef char Boolean;
+
+#define true  1
+#define false 0
+
+/* command prefixes */
+typedef struct
+{
+    Byte first_code;
+    char * name;
+    Boolean has_suffix;
+    Byte first_suffix, last_suffix;
+} CmdPrefix;
+
+CmdPrefix  cmd_prefixes [] =
+{
+  {0,   SETCHAR, true, 0, 127},
+  {128, SET, true, 1, 4},
+  {132, SETRULE, false, 0, 0},
+  {133, PUT, true, 1, 4},
+  {137, PUTRULE, false, 0, 0},
+  {138, NOP, false, 0, 0},
+  {139, BOP, false, 0, 0},
+  {140, EOP, false, 0, 0},
+  {141, PUSH, false, 0, 0},
+  {142, POP, false, 0, 0},
+  {143, RIGHT, true, 1, 4},
+  {147, W, true, 0, 4},
+  {152, X, true, 0, 4},
+  {157, DOWN, true, 1, 4},
+  {161, Y, true, 0, 4},
+  {166, Z, true, 0, 4},
+  {171, FONTNUM, true, 0, 63},
+  {235, FONT, true, 1, 4},
+  {239, SPECIAL, true, 1, 4},
+  {243, FONTDEF, true, 1, 4},
+  {247, PRE, false, 0, 0},
+  {248, POST, false, 0, 0},
+  {249, POSTPOST, false, 0, 0},
+  {250, OPCODE, true, 250, 255}
+};
+/* cmd_prefixes[] */
+
+/* Number of DVI commands, including those officially undefined */
+#define NCMDS 256
+
+/* table of command name (string) pointers */
+typedef char * CmdTable [NCMDS];
+
+/* initially all command name pointers are NULL */
+CmdTable cmd_table;
+
+/* operation's opcode, name, number of args, string of arguments. */
+typedef struct
+{
+  int code;
+  char * name;
+  int nargs;
+  char * args;
+} op_info;
+
+/* name of table, first opcode, last opcode, pointer to opcode info. */
+typedef struct
+{
+  char * name;
+  int first;
+  int last;
+  op_info * list;
+} op_table;
+
+/* Table for opcodes 128 to 170 inclusive. */
+
+op_info  op_info_128_170 [] =
+{
+  {128, SET1, 1, "1"},
+  {129, SET2, 1, "2"},
+  {130, SET3, 1, "3"},
+  {131, SET4, 1, "-4"},
+  {132, SETRULE, 2, "-4 -4"},
+  {133, PUT1, 1, "1"},
+  {134, PUT2, 1, "2"},
+  {135, PUT3, 1, "3"},
+  {136, PUT4, 1, "-4"},
+  {137, PUTRULE, 2, "-4 -4"},
+  {138, NOP, 0, ""},
+  /* bop:  not counting last argument, a signed address: */
+  {139, BOP, 10, "-4 -4 -4 -4 -4 -4 -4 -4 -4 -4"},
+  {140, EOP, 0, ""},
+  {141, PUSH, 0, ""},
+  {142, POP, 0, ""},
+  {143, RIGHT1, 1, "-1"},
+  {144, RIGHT2, 1, "-2"},
+  {145, RIGHT3, 1, "-3"},
+  {146, RIGHT4, 1, "-4"},
+  {147, W0, 0, ""},
+  {148, W1, 1, "-1"},
+  {149, W2, 1, "-2"},
+  {150, W3, 1, "-3"},
+  {151, W4, 1, "-4"},
+  {152, X0, 0, ""},
+  {153, X1, 1, "-1"},
+  {154, X2, 1, "-2"},
+  {155, X3, 1, "-3"},
+  {156, X4, 1, "-4"},
+  {157, DOWN1, 1, "-1"},
+  {158, DOWN2, 1, "-2"},
+  {159, DOWN3, 1, "-3"},
+  {160, DOWN4, 1, "-4"},
+  {161, Y0, 0, ""},
+  {162, Y1, 1, "-1"},
+  {163, Y2, 1, "-2"},
+  {164, Y3, 1, "-3"},
+  {165, Y4, 1, "-4"},
+  {166, Z0, 0, ""},
+  {167, Z1, 1, "-1"},
+  {168, Z2, 1, "-2"},
+  {169, Z3, 1, "-3"},
+  {170, Z4, 1, "-4"}
+};
+/* op_info  op_info_128_170 [] */
+
+op_table  op_128_170  =  {"op_128_170", 128, 170, op_info_128_170};
+
+/* Table for fnt1 to fnt4 (opcodes 235 to 238) inclusive. */
+
+op_info  fnt_n [] =
+{
+  {235, FONT1, 1, "1"},
+  {236, FONT2, 1, "2"},
+  {237, FONT3, 1, "3"},
+  {238, FONT4, 1, "-4"}
+};
+/* op_info  fnt_n [] */
+
+op_table  fnt  =  {FONT, 235, 238, fnt_n};
+
+
+/* Function prototypes */
+
+Void mem_viol ARGS((int sig));
+Void give_help (VOID);
+int parse ARGS((char * s));
+Void process ARGS((char * s));
+
+Void no_op (VOID);
+Void dtl_stdin (VOID);
+Void dvi_stdout (VOID);
+
+int open_dtl ARGS((char * dtl_file, FILE ** pdtl));
+int open_dvi ARGS((char * dvi_file, FILE ** pdvi));
+
+int dt2dv ARGS((FILE * dtl, FILE * dvi));
+
+Void * gmalloc ARGS((long int size));
+
+Void dinfo (VOID);
+Void dexit ARGS((int n));
+
+int cons_cmds ARGS((int nprefixes, CmdPrefix * prefix, CmdTable cmds));
+Void free_cmds ARGS((CmdTable cmd_table));
+
+int get_line ARGS((FILE * fp, Line * line, int max));
+int read_line_char ARGS((FILE * fp, int * ch));
+int read_char ARGS((FILE * fp, int * ch));
+int unread_char (VOID);
+int read_string_char ARGS((FILE * fp, int * ch));
+
+COUNT read_variety ARGS((FILE * dtl));
+COUNT read_token ARGS((FILE * dtl, char * token));
+COUNT skip_space ARGS((FILE * fp, int * ch));
+COUNT read_misc ARGS((FILE * fp, Token token));
+COUNT read_mes ARGS((FILE * fp, char * token));
+
+int find_command ARGS((char * command, int * opcode));
+int xfer_args ARGS((FILE * dtl, FILE * dvi, int opcode));
+
+int set_seq ARGS((FILE * dtl, FILE * dvi));
+
+int check_byte ARGS((int byte));
+int put_byte ARGS((int onebyte, FILE * dvi));
+
+U4 xfer_hex ARGS((int n,  FILE * dtl,  FILE * dvi));
+U4 xfer_oct ARGS((int n,  FILE * dtl,  FILE * dvi));
+U4 xfer_unsigned ARGS((int n,  FILE * dtl,  FILE * dvi));
+S4 xfer_signed   ARGS((int n,  FILE * dtl,  FILE * dvi));
+
+int check_bmes ARGS((FILE * dtl));
+int check_emes ARGS((FILE * dtl));
+
+Void init_Lstring ARGS((Lstring * lsp, long int n));
+Void de_init_Lstring ARGS((Lstring * lsp));
+Lstring * alloc_Lstring ARGS((long int n));
+Void free_Lstring ARGS((Lstring * lstr));
+Void ls_putb ARGS((int ch, Lstring * lstr));
+
+S4 get_Lstring ARGS((FILE * dtl, Lstring * lstr));
+Void put_Lstring ARGS((const Lstring * lstr, FILE * dvi));
+U4 xfer_len_string ARGS((int n, FILE * dtl, FILE * dvi));
+
+U4 get_unsigned ARGS((FILE * dtl));
+S4 get_signed   ARGS((FILE * dtl));
+
+int put_unsigned ARGS((int n, U4 unum, FILE * dvi));
+int put_signed   ARGS((int n, S4 snum, FILE * dvi));
+
+S4 xfer_bop_address ARGS((FILE * dtl,  FILE * dvi));
+S4 xfer_postamble_address ARGS((FILE * dtl,  FILE * dvi));
+
+int put_table ARGS((op_table table, int opcode, FILE * dtl, FILE * dvi));
+
+U4 special ARGS((FILE * dtl,  FILE * dvi,  int n));
+int fontdef ARGS((FILE * dtl,  FILE * dvi,  int n));
+
+U4 preamble ARGS((FILE * dtl,  FILE * dvi));
+int postamble ARGS((FILE * dtl,  FILE * dvi));
+int post_post ARGS((FILE * dtl,  FILE * dvi));
+
+
+typedef struct
+{
+  char * keyword;  /* command line option keyword */
+  int * p_var;     /* pointer to option variable */
+  char * desc;     /* description of keyword and value */
+  Void (* p_fn) (VOID);  /* pointer to function called when option is set */
+} Options;
+
+Options opts[] =
+{
+  {"-debug", &debug, "detailed debugging", no_op},
+  {"-group", &group, "each DTL command is in parentheses", no_op},
+  {"-si", &rd_stdin, "read all DTL commands from standard input", dtl_stdin},
+  {"-so", &wr_stdout, "write all DVI commands to standard output", dvi_stdout},
+  {NULL, NULL, NULL, NULL}
+};
+/* opts[] */
+
+char * progname = "";  /* intended for name of this program */
+int nfile = 0;  /* number of filename arguments on the command line */
+
+#define PRINT_PROGNAME  fprintf (stderr, "%s ", progname)
+
+/* Harbison & Steele (1991) warn that some C implementations */
+/* of free() do not treat NULL pointers correctly. */
+#define gfree(p) {if (p) free (p);}
+
+
+FILE * dtl_fp = NULL;
+FILE * dvi_fp = NULL;
+
+char * dtl_filename = "";
+char * dvi_filename = "";
+
+
+int
+main
+#ifdef STDC
+  (int argc,  char * argv[])
+#else
+  (argc,  argv)
+  int argc;
+  char * argv[];
+#endif
+{
+  Void (*handler) ARGS((int));  /* Previous signal handler */
+  int i;
+
+  progname = argv[0];  /* name of this program */
+
+  /* memory violation signal handler */
+
+  handler = (Void (*) ARGS((int))) signal (SIGSEGV, mem_viol);
+
+#ifndef __DATE__
+#define __DATE__ ""
+#endif
+
+#ifndef __TIME__
+#define __TIME__ ""
+#endif
+
+#if STDC
+#define C_LEVEL ""
+#else /* NOT STDC */
+#define C_LEVEL "non-"
+#endif /* NOT STDC */
+
+  /* message about program and compiler */
+  /* NB:  LTU EE's Sun/OS library is BSD, even though gcc 2.2.2 is ANSI */
+
+  fprintf (stderr, "\n");
+  fprintf (stderr,
+    "Program \"%s\" version %s compiled %s %s in %sstandard C.\n",
+    progname, VERSION, __DATE__, __TIME__, C_LEVEL);
+
+  /* interpret command line arguments */
+
+  nfile = 0;
+  dtl_fp = dvi_fp = NULL;
+  dtl_filename = dvi_filename = "";
+
+  for (i=1; i < argc; i++)
+  {
+    /* parse options, followed by any explicit filenames */
+    parse (argv[i]);
+  }
+
+  if (nfile != 2)  /* not exactly two files specified, so give help */
+    give_help();
+  else
+    /* the real works */
+    dt2dv (dtl_fp, dvi_fp);
+
+  return 0;  /* OK */
+}
+/* end main */
+
+
+Void
+mem_viol
+#ifdef STDC
+  (int sig)
+#else
+  (sig)
+  int sig;
+#endif
+{
+  Void (* handler) ARGS((int));
+  handler = (Void (*) ARGS((int))) signal (SIGSEGV, mem_viol);
+  if (sig != SIGSEGV)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(mem_viol) : called with wrong signal!\n");
+  }
+  PRINT_PROGNAME;
+  fprintf (stderr, "(mem_viol) : RUNTIME MEMORY ERROR : memory violation, ");
+  fprintf (stderr, "dtl line >= ");
+  fprintf (stderr, WF, dtl_line.num);
+  fprintf (stderr, "\n");
+  dexit (1);
+}
+/* mem_viol */
+
+
+Void
+give_help (VOID)
+{
+  int i;
+  char * keyword;
+  fprintf (stderr, "usage:   ");
+  PRINT_PROGNAME;
+  fprintf (stderr, "[options]  dtl_file  dvi_file");
+  fprintf (stderr, "\n");
+  for (i=0; (keyword = opts[i].keyword) != NULL; i++)
+  {
+    fprintf (stderr, "    ");
+    fprintf (stderr, "[%s]", keyword);
+    fprintf (stderr, "    ");
+    fprintf (stderr, "%s", opts[i].desc);
+    fprintf (stderr, "\n");
+  }
+  fprintf (stderr, "Messages, like this one, go to stderr.\n");
+}
+/* give_help */
+
+
+Void no_op (VOID)
+/* do nothing */
+{
+}
+
+Void dtl_stdin (VOID)
+{
+  extern FILE * dtl_fp;
+  extern int nfile;
+
+  dtl_fp = stdin;
+  dtl_filename = "Standard Input";
+  ++ nfile;
+}
+
+Void dvi_stdout (VOID)
+{
+  extern FILE * dvi_fp;
+  extern int nfile;
+
+  /* ! Perilous to monitors! */
+  dvi_fp = stdout;
+  dvi_filename = "Standard Output";
+  ++ nfile;
+}
+
+
+int
+parse
+#ifdef STDC
+  (char * s)
+#else
+  (s)
+  char * s;
+#endif
+/* parse one command-line argument, `s' */
+{
+  int i;
+  char * keyword;
+  for (i=0; (keyword = opts[i].keyword) != NULL; i++)
+  {
+    if (strncmp (s, keyword, strlen (keyword)) == 0)
+    {
+      Void (*pfn) (VOID);
+      (*(opts[i].p_var)) = 1;  /* turn option on */
+      if ((pfn = opts[i].p_fn) != NULL)
+        (*pfn) ();    /* call option function */
+      return i;
+    }
+  }
+  /* reached here, so not an option: assume it's a filename */
+  process (s);
+  return i;
+}
+/* parse */
+
+
+int
+open_dtl
+#ifdef STDC
+  (char * dtl_file, FILE ** pdtl)
+#else
+  (dtl_file, pdtl)
+  char * dtl_file;
+  FILE ** pdtl;
+#endif
+/* I:  dtl_file;  I:  pdtl;  O:  *pdtl. */
+{
+  extern char * dtl_filename;
+
+  dtl_filename = dtl_file;
+
+  if (dtl_filename == NULL)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(open_dtl) : INTERNAL ERROR : dtl file's name is NULL.\n");
+    dexit (1);
+  }
+
+  if (pdtl == NULL)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(open_dtl) : INTERNAL ERROR : address of dtl variable is NULL.\n");
+    dexit (1);
+  }
+
+  *pdtl = fopen (dtl_file, "r");
+
+  if (*pdtl == NULL)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(open_dtl) : DTL FILE ERROR : Cannot open \"%s\" for text reading.\n",
+      dtl_file);
+    dexit (1);
+  }
+
+  return 1;  /* OK */
+}
+/* open_dtl */
+
+
+int
+open_dvi
+#ifdef STDC
+  (char * dvi_file, FILE ** pdvi)
+#else
+  (dvi_file, pdvi)
+  char * dvi_file;
+  FILE ** pdvi;
+#endif
+/* I:  dvi_file;  I:  pdvi;  O:  *pdvi. */
+{
+  extern char * dvi_filename;
+
+  dvi_filename = dvi_file;
+
+  if (dvi_filename == NULL)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+    "(open_dvi) : INTERNAL ERROR : dvi file's name is NULL.\n");
+    dexit (1);
+  }
+
+  if (pdvi == NULL)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+    "(open_dvi) : INTERNAL ERROR : address of dvi variable is NULL.\n");
+    dexit (1);
+  }
+
+  *pdvi = fopen (dvi_file, "wb");
+
+  if (*pdvi == NULL)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(open_dvi) : DVI FILE ERROR : Cannot open \"%s\" for binary writing.\n",
+      dvi_file);
+    dexit (1);
+  }
+
+  return 1;  /* OK */
+}
+/* open_dvi */
+
+
+Void
+process
+#ifdef STDC
+  (char * s)
+#else
+  (s)
+  char * s;
+#endif
+{
+  extern FILE * dtl_fp, * dvi_fp;
+  extern int nfile;
+  if (dtl_fp == NULL)  /* first filename assumed to be DTL input */
+  {
+    open_dtl (s, &dtl_fp);
+  }
+  else if (dvi_fp == NULL)  /* second filename assumed to be DVI output */
+  {
+    open_dvi (s, &dvi_fp);
+  }
+  else
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(process) : at most two filenames allowed.\n");
+    exit (1);
+  }
+  ++ nfile;
+}
+/* process */
+
+
+COUNT dtl_read = 0;  /* bytes read from dtl file */
+COUNT dvi_written = 0;  /* bytes written to dvi file */
+word_t last_bop_address = -1;  /* byte address of last bop; first bop uses -1 */
+word_t postamble_address = -1;  /* byte address of postamble */
+COUNT ncom = 0;  /* commands successfully read and interpreted from dtl file */
+COUNT com_read = 0;  /* bytes read in current (command and arguments), */
+                      /* since and including the opening BCOM_CHAR, if any */
+
+
+int
+put_byte
+#ifdef STDC
+  (int byte, FILE * dvi)
+#else
+  (byte, dvi)
+  int byte;
+  FILE * dvi;
+#endif
+/* write byte into dvi file */
+{
+  check_byte (byte);
+/*  if (fprintf (dvi, "%c", byte) != 1) */
+  if (fprintf (dvi, "%c", byte) < 0)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(put_byte) : DVI FILE ERROR (%s) : cannot write to dvi file.\n",
+      dtl_filename);
+    dexit (1);
+  }
+  ++ dvi_written;
+  return 1;  /* OK */
+}
+/* put_byte */
+
+
+int
+dt2dv
+#ifdef STDC
+  (FILE * dtl, FILE * dvi)
+#else
+  (dtl, dvi)
+  FILE * dtl;
+  FILE * dvi;
+#endif
+{
+  int nprefixes = 0;  /* number of prefixes in cmd_prefixes[] list. */
+  static Token dtl_cmd = "";  /* DTL command name */
+  COUNT nread = 0;  /* number of bytes read by a function from dtl file. */
+
+  nprefixes = sizeof (cmd_prefixes) / sizeof (CmdPrefix);
+
+  /* Construct array of all NCMDS == 256 DTL commands */
+
+  (Void) cons_cmds (nprefixes, cmd_prefixes, cmd_table);
+
+  /* DTL commands have the form "[ ]*command arg ... arg[ ]*", */
+  /* possibly enclosed in a BCOM, ECOM pair, */
+  /* and are separated by optional whitespace, typically newlines. */
+  /* That is, each command and its arguments are parenthesised, */
+  /* with optional spaces after the BCOM and before the ECOM, if any. */
+
+  /* dt2dv is now at the very start of the DTL file */
+
+  dtl_line.num = 0;
+  dtl_read = 0;
+
+  /* The very first thing should be the "variety" signature */
+
+  nread = read_variety (dtl);
+
+  /* while not end of dtl file or reading error, */
+  /*   read, interpret, and write commands */
+
+  while (!feof (dtl))
+  {
+    int opcode;
+
+    com_read = 0;
+
+    if (group)
+    {
+      /* BCOM check */
+      static Token token = "";  /* DTL token */
+      nread = read_token (dtl, token);
+      /* test for end of input, or reading error */
+      if (strlen (token) == 0)
+      {
+       if (debug)
+       {
+          PRINT_PROGNAME;
+         fprintf (stderr, "(dt2dv) : end of input, or reading error.\n");
+       }
+       break;
+      }
+      /* test whether this command begins correctly */
+      else if (strcmp (token, BCOM) != 0)
+      {
+        PRINT_PROGNAME;
+       fprintf (stderr, "(dt2dv) : DTL FILE ERROR (%s) : ", dtl_filename);
+        fprintf (stderr, "command must begin with \"%s\", ", BCOM);
+        fprintf (stderr, "not `%c' (char %d).\n", token[0], token[0]);
+       dexit (1);
+      }
+      /* end BCOM check */
+    }
+
+    /* read the command name */
+    nread = read_token (dtl, dtl_cmd);
+    /* test for end of input, or reading error */
+    if (strlen (dtl_cmd) == 0)
+    {
+      if (debug)
+      {
+        PRINT_PROGNAME;
+       fprintf (stderr,
+         "(dt2dv) : end of input, or reading error.\n");
+      }
+      break;
+    }
+    else
+    {
+      if (debug)
+      {
+        PRINT_PROGNAME;
+       fprintf (stderr, "(dt2dv) : command ");
+        fprintf (stderr, WF, ncom);
+        fprintf (stderr, " = \"%s\".\n", dtl_cmd);
+      }
+
+      /* find opcode for this command */
+      if (find_command (dtl_cmd, &opcode) == 1)
+      {
+       /* write the opcode, if we can */
+       put_byte (opcode, dvi);
+
+       /* treat the arguments, if any */
+       xfer_args (dtl, dvi, opcode);
+      }
+      else if (dtl_cmd[0] == BSEQ_CHAR)
+      {
+       /* sequence of font characters for SETCHAR */
+       set_seq (dtl, dvi);
+      }
+      else
+      {
+        PRINT_PROGNAME;
+       fprintf (stderr,
+         "(dt2dv) : DTL FILE ERROR (%s) : unknown command \"%s\".\n",
+         dtl_filename, dtl_cmd);
+       dexit (1);
+      }
+    }
+
+    if (group)
+    {
+      /* seek ECOM after command's last argument and optional whitespace */
+      static Token token = "";  /* DTL token */
+      nread = read_token (dtl, token);
+      /* test for end of input, or reading error */
+      if (strlen (token) == 0)
+      {
+       if (debug)
+       {
+          PRINT_PROGNAME;
+         fprintf (stderr,
+           "(dt2dv) : end of input, or reading error.\n");
+       }
+       break;
+      }
+      if (strcmp (token, ECOM) != 0)
+      {
+        PRINT_PROGNAME;
+       fprintf (stderr, "(dt2dv) : DTL FILE ERROR (%s) : ", dtl_filename);
+        fprintf (stderr, "ECOM (\"%s\") expected, not `%c' (char %d).\n",
+         ECOM, token[0], token[0]);
+       dexit (1);
+      }
+      /* end ECOM check */
+    }
+
+    ++ ncom;  /* one more command successfully read and interpreted */
+  }
+  /* end while */
+
+  PRINT_PROGNAME;
+  fprintf (stderr, "(dt2dv) :\n");
+  fprintf (stderr, "Read (from file \"%s\") ", dtl_filename);
+  fprintf (stderr, WF, dtl_read);
+  fprintf (stderr, " DTL bytes (");
+  fprintf (stderr, UF4, dtl_line.num);
+  fprintf (stderr, " lines);\n");
+  fprintf (stderr, "wrote (to file \"%s\") ", dvi_filename);
+  fprintf (stderr, WF, dvi_written);
+  fprintf (stderr, " DVI bytes;\n");
+  fprintf (stderr, "completely interpreted ");
+  fprintf (stderr, WF, ncom);
+  fprintf (stderr, " DVI command%s.\n", (ncom == 1 ? "" : "s"));
+  fprintf (stderr, "\n");
+
+  (Void) free_cmds (cmd_table);
+
+  return 1;  /* OK */
+}
+/* dt2dv */
+
+
+Void *
+gmalloc
+#ifdef STDC
+  (long int size)
+#else
+  (size)
+  long int size;
+#endif
+{
+  Void * p = NULL;
+  if (size < 1)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(gmalloc) : INTERNAL ERROR : ");
+    fprintf (stderr,
+      "unreasonable request to malloc %ld bytes\n",
+      size);
+    dexit (1);
+  }
+  p = (Void *) malloc ((size_t) size);
+  if (p == NULL)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(gmalloc) : MEMORY ALLOCATION ERROR : ");
+    fprintf (stderr,
+      "operating system failed to malloc %ld bytes\n",
+      size);
+    dexit (1);
+  }
+  return (p);
+}
+/* gmalloc */
+
+
+Void
+dinfo (VOID)
+{
+  PRINT_PROGNAME;
+  fprintf (stderr, "(dinfo) : ");
+  fprintf (stderr, "Current DTL input line ");
+  fprintf (stderr, UF4, dtl_line.num);
+  fprintf (stderr, " :\n");
+  fprintf (stderr, "\"%s\"\n", dtl_line.buf);
+  fprintf (stderr, "Read ");
+  fprintf (stderr, WF, dtl_read);
+  fprintf (stderr, " DTL bytes (");
+  fprintf (stderr, WF, com_read);
+  fprintf (stderr, " in current command), wrote ");
+  fprintf (stderr, WF, dvi_written);
+  fprintf (stderr, " DVI bytes.\n");
+  fprintf (stderr, "Successfully interpreted ");
+  fprintf (stderr, WF, ncom);
+  fprintf (stderr, " DVI command%s.\n", (ncom == 1 ? "" : "s"));
+}
+/* dinfo */
+
+
+Void
+dexit
+#ifdef STDC
+  (int n)
+#else
+  (n)
+  int n;
+#endif
+{
+  dinfo();
+  PRINT_PROGNAME;
+  fprintf (stderr, "(dexit) : exiting with status %d.\n", n);
+  exit (n);
+}
+/* dexit */
+
+
+int
+cons_cmds
+#ifdef STDC
+  (int nprefixes, CmdPrefix * prefix, CmdTable cmds)
+#else
+  (nprefixes, prefix, cmds)
+  int nprefixes;
+  CmdPrefix * prefix;
+  CmdTable cmds;
+#endif
+{
+  int code;  /* first opcode for a given command prefix */
+  int opcode;  /* command's opcode */
+  int nsuffixes;  /* number of commands with a given prefix */
+  int isuffix;  /**** integer suffix, of at most three digits ****/
+  String suffix;  /* suffix string generated from integer suffix */
+  size_t plen = 0;  /* prefix length */
+  size_t slen;  /* suffix length */
+  size_t clen;  /* whole command name length */
+  int i, j;  /* loop indices */
+
+  for (i=0; i < nprefixes; prefix++, i++)
+  {
+    code = prefix->first_code;
+    if (code < 0 || code > 255)
+    {
+      PRINT_PROGNAME;
+      fprintf (stderr, "(cons_cmds) : INTERNAL ERROR : ");
+      fprintf (stderr,
+        "prefix listed internally with code = %d, must be 0 to 255\n",
+        code);
+      dexit (1);
+    }
+    if (prefix->has_suffix)
+    {
+      plen = strlen (prefix->name);
+      /**** Suffixes in DTL are Integers, in Sequence */
+      if (prefix->last_suffix < prefix->first_suffix)
+      {
+        PRINT_PROGNAME;
+        fprintf (stderr, "(cons_cmds) : INTERNAL ERROR : ");
+        fprintf (stderr,
+          "prefix's last suffix %d < first suffix (%d)\n",
+          prefix->last_suffix, prefix->first_suffix);
+        dexit (1);
+      }
+      nsuffixes = prefix->last_suffix - prefix->first_suffix + 1;
+      opcode = prefix->first_code;
+      for (j=0; j < nsuffixes; j++, opcode++)
+      {
+        isuffix = prefix->first_suffix + j;
+        if (0 <= code && code <= 127)  /* SETCHAR */
+        {
+          /* SETCHAR's suffix is written in uppercase hexadecimal */
+          sprintf (suffix, "%02X", isuffix);
+        }
+        else  /* 128 <= code && code <= 255 */  /* other DTL commands */
+        {
+          /* other commands' suffices are written in decimal */
+          sprintf (suffix, "%d", isuffix);
+        }
+        slen = strlen (suffix);
+        clen = plen + slen;
+        cmds[opcode] = (char *) gmalloc (clen+1);
+        strcpy (cmds[opcode], prefix->name);
+        strcat (cmds[opcode], suffix);
+      }
+    }
+    else /* command name = prefix */
+    {
+      plen = strlen (prefix->name);
+      clen = plen;
+      opcode = prefix->first_code;
+      cmds[opcode] = (char *) gmalloc (clen+1);
+      strcpy (cmds[opcode], prefix->name);
+    }
+  }
+
+  return 1;  /* OK */
+}
+/* cons_cmds */
+
+
+Void
+free_cmds
+#ifdef STDC
+  (CmdTable cmd_table)
+#else
+  (cmd_table)
+  CmdTable cmd_table;
+#endif
+{
+  int i;
+  for (i=0; i < NCMDS; i++)
+    gfree (cmd_table[i]);
+}
+/* free_cmds */
+
+
+int
+get_line
+#ifdef STDC
+  (FILE * fp, Line * line, int max)
+#else
+  (fp, line, max)
+  FILE * fp;
+  Line * line;
+  int max;
+#endif
+/* read a (Line *) line from fp, return length */
+/* adapted from K&R (second, alias ANSI C, edition, 1988), page 165 */
+{
+  if (fgets (line->buf, max, fp) == NULL)
+    return 0;
+  else
+  {
+    ++ line->num;
+    line->wrote = strlen (line->buf);
+    line->read = 0;
+    return 1;
+  }
+}
+/* get_line */
+
+
+int
+read_line_char
+#ifdef STDC
+  (FILE * fp, int * ch)
+#else
+  (fp, ch)
+  FILE * fp;
+  int * ch;
+#endif
+/* read one character from dtl_line if possible, */
+/* otherwise read another dtl_line from fp */
+/* return 1 if a character is read, 0 if at end of fp file */
+{
+  extern Line dtl_line;
+  if (dtl_line.wrote == 0 || dtl_line.read >= dtl_line.wrote)
+  {
+    int line_status;
+    /* refill line buffer */
+    line_status = get_line (fp, &dtl_line, MAXLINE);
+    if (line_status == 0)
+    {
+      /* at end of DTL file */
+      if (debug)
+      {
+        PRINT_PROGNAME;
+        fprintf (stderr, "(read_line_char) : end of DTL file\n");
+        dinfo();
+      }
+      return 0;
+    }
+    else
+    {
+      /* new DTL line was read */
+      if (debug)
+      {
+        PRINT_PROGNAME;
+        fprintf (stderr, "(read_line_char) : new DTL input line:\n");
+        fprintf (stderr, "\"%s\"\n", dtl_line.buf);
+      }
+    }
+  }
+  *ch = dtl_line.buf [dtl_line.read ++];
+  ++ dtl_read;
+  ++ com_read;  /* count another DTL command character */
+  return 1;
+}
+/* read_line_char */
+
+
+int
+read_char
+#ifdef STDC
+  (FILE * fp, int * ch)
+#else
+  (fp, ch)
+  FILE * fp;
+  int * ch;
+#endif
+/* Read next character, if any, from file fp. */
+/* Write it into *ch. */
+/* If no character is read, then *ch value < 0. */
+/* Return 1 if OK, 0 if EOF or error. */
+{
+  int status = 1;
+  int c;  /* in case ch points awry, we still have something in c. */
+
+  c = EOF;
+  if (read_line_char (fp, &c) == 0)
+  {
+    /* end of fp file, or error reading it */
+    status = 0;
+  }
+  else
+  {
+    if (c > 255)
+    {
+      PRINT_PROGNAME;
+      fprintf (stderr,
+        "(read_char) : character %d not in range 0 to 255\n",
+        c);
+      dinfo();
+      status = 0;
+    }
+    else if ( ! isprint (c) && ! isspace (c))
+    {
+      PRINT_PROGNAME;
+      fprintf (stderr,
+        "(read_char) : character %d %s.\n",
+        c,
+        "not printable and not white space");
+      dinfo();
+      status = 0;
+    }
+  }
+  *ch = c;
+
+  return status;
+}
+/* read_char */
+
+
+COUNT
+read_variety
+#ifdef STDC
+  (FILE * dtl)
+#else
+  (dtl)
+  FILE * dtl;
+#endif
+/* read and check DTL variety signature */
+/* return number of DTL bytes written */
+/* DTL variety is _NEVER_ grouped by BCOM and ECOM. */
+/* Uniformity here enables the program easily to modify its behavior. */
+{
+  COUNT vread = 0;  /* number of DTL bytes read by read_variety */
+  COUNT nread = 0;  /* number of DTL bytes read by read_token */
+  static Token token = "";
+
+  /* read the DTL VARIETY keyword */
+  nread = read_token (dtl, token);
+  vread += nread;
+  /* test whether signature begins correctly */
+  if (strcmp (token, "variety") != 0)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(read_variety) : DTL FILE ERROR (%s) : ", dtl_filename);
+    fprintf (stderr, "DTL signature must begin with \"%s\", not \"%s\".\n",
+      "variety", token);
+    dexit (1);
+  }
+
+  /* read the DTL variety */
+  nread = read_token (dtl, token);
+  vread += nread;
+  /* test whether variety is correct */
+  if (strcmp (token, VARIETY) != 0)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(read_variety) : DTL FILE ERROR (%s) : ", dtl_filename);
+    fprintf (stderr, "DTL variety must be \"%s\", not \"%s\".\n",
+      VARIETY, token);
+    dexit (1);
+  }
+
+  PRINT_PROGNAME;
+  fprintf (stderr, "(read_variety) : DTL variety %s is OK.\n", VARIETY);
+
+  return vread;  /* OK */
+}
+/* read_variety */
+
+
+COUNT
+skip_space
+#ifdef STDC
+  (FILE * fp, int * ch)
+#else
+  (fp, ch)
+  FILE * fp;
+  int * ch;
+#endif
+/* Skip whitespace characters in file fp. */
+/* Write in *ch the last character read from fp, */
+/*   or < 0 if fp could not be read. */
+/* Return number of characters read from fp. */
+{
+  int c;  /* character read (if any) */
+  COUNT count;  /* number (0 or more) of whitespace characters read */
+  int nchar;  /* number (0 or 1) of characters read by read_char */
+
+  /* loop ends at:  end of fp file, or reading error, or not a white space */
+  for (count=0;  ((nchar = read_char (fp, &c)) == 1 && isspace (c));  ++count)
+  {
+    /* otherwise, more white spaces to skip */
+    if (debug)
+    {
+      /* report when each DTL end of line is reached */
+      if (c == '\n')
+      {
+        PRINT_PROGNAME;
+        fprintf (stderr, "(skip_space) : ");
+        fprintf (stderr, "end of DTL line (at least) ");
+        fprintf (stderr, WF, dtl_line.num);
+        fprintf (stderr, "\n");
+      }
+    }
+  }
+
+  if (nchar == 0)
+  {
+    c = -1;
+  }
+
+  *ch = c;  /* c will be < 0 if read_char could not read fp */
+  return (count + nchar);
+}
+/* skip_space */
+
+
+COUNT
+read_token
+#ifdef STDC
+  (FILE * dtl, char * token)
+#else
+  (dtl, token)
+  FILE * dtl;
+  char * token;
+#endif
+/* read next token from dtl file. */
+/* return number of DTL bytes read. */
+/* A token is one of:
+     a string from BMES_CHAR to the next unescaped EMES_CHAR, inclusive;
+     BCOM or ECOM, unless these are empty strings;
+     BSEQ or ESEQ;
+     any other sequence of non-whitespace characters.
+*/
+{
+  COUNT nread;  /* number of DTL bytes read by read_token */
+  int ch;  /* most recent character read */
+
+  nread = 0;
+
+  /* obtain first non-space character */
+  /* add to nread the number of characters read from dtl by skip_space */
+  nread += skip_space (dtl, &ch);
+
+  if (ch < 0)
+  {
+    /* end of dtl file */
+    /* write an empty token */
+    strcpy (token, "");
+    if (debug)
+    {
+      PRINT_PROGNAME;
+      fprintf (stderr, "(read_token) : end of dtl file.\n");
+    }
+  }
+  else if (group && ch == BCOM_CHAR)
+  {
+    strcpy (token, BCOM);
+  }
+  else if (group && ch == ECOM_CHAR)
+  {
+    strcpy (token, ECOM);
+  }
+  else
+  {
+    token[0] = ch;
+    token[1] = '\0';
+    if (ch == BMES_CHAR)  /* string token; read until unescaped EMES_CHAR */
+    {
+      nread += read_mes (dtl, token+1);
+    }
+    else if (ch == BSEQ_CHAR || ch == ESEQ_CHAR)
+    {
+      /* token is complete */
+    }
+    else  /* any other string not containing (ECOM_CHAR or) whitespace */
+    {
+      nread += read_misc (dtl, token+1);
+    }
+  }
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(read_token) : token = \"%s\"\n", token);
+  }
+
+  return (nread);  /* number of bytes read from dtl file */
+}
+/* read_token */
+
+
+#define CHAR_OK  1
+#define CHAR_FAIL  0
+#define CHAR_EOS  (-1)
+
+int
+read_string_char
+#ifdef STDC
+  (FILE * fp, int * ch)
+#else
+  (fp, ch)
+  FILE * fp;
+  int * ch;
+#endif
+{
+  int status = CHAR_OK;  /* OK so far */
+  int c;
+
+  if (read_char (fp, &c) == 0)
+    status = CHAR_FAIL;  /* fail */
+
+  if (c == EMES_CHAR)  /* end-of-string char */
+  {
+    status = CHAR_EOS;  /* end of string */
+  }
+  else if (c == ESC_CHAR)  /* escape character */
+  {
+    /* accept the next character literally, even ESC_CHAR and EMES_CHAR */
+    if (read_char (fp, &c) == 0)
+      status = CHAR_FAIL;  /* fail */
+  }
+
+  *ch = c;
+  return status;
+}
+/* read_string_char */
+
+
+COUNT
+read_misc
+#ifdef STDC
+  (FILE * fp, Token token)
+#else
+  (fp, token)
+  FILE * fp;
+  Token token;
+#endif
+{
+  int c;
+  int count;
+ /* loop ends at:  end of fp file, or reading error, or a space */
+  for (count=0;  count <= MAXTOKLEN;  ++count)
+  {
+    if (read_char (fp, &c) == 0  ||  isspace (c))
+      break;
+    if (group && c == ECOM_CHAR)
+    {
+      (Void) unread_char ();
+      break;
+    }
+
+    token[count] = c;
+  }
+  token[count] = '\0';
+  return count;
+}
+/* read_misc */
+
+
+COUNT
+read_mes
+#ifdef STDC
+  (FILE * fp, char * token)
+#else
+  (fp, token)
+  FILE * fp;
+  char * token;
+#endif
+/* called **AFTER** a BMES_CHAR has been read */
+/* read file fp for characters up to next unescaped EMES_CHAR */
+/* this is called a "string token" */
+/* write string, including EMES_CHAR, into token[] */
+/* return number of characters read from fp */
+{
+  COUNT dtl_count;  /* number of DTL characters read by read_mes from fp */
+  int more;  /* flag more == 0 to terminate loop */
+  int escape;  /* flag escape == 1 if previous character was ESC_CHAR */
+  int ch;  /* current DTL character */
+
+  escape = 0;
+  more = 1;
+  dtl_count = 0;
+  while (more)
+  {
+    if (read_char (fp, &ch) == 0)
+    {
+      /* end of fp file, or reading error */
+      more = 0;
+    }
+    else  /* error checking passed */
+    {
+      ++ dtl_count;
+      if (ch == EMES_CHAR && escape == 0)  /* end of string */
+      {
+        /* include final EMES_CHAR */
+        * token ++ = ch;
+        more = 0;
+      }
+      else if (ch == ESC_CHAR && escape == 0)
+      {
+        /* next character is not end of string */
+        escape = 1;
+      }
+      else
+      {
+        /* store any other character, */
+        /* including escaped EMES_CHAR and ESC_CHAR*/
+        * token ++ = ch;
+        escape = 0;
+      }
+    }
+  }
+  * token = '\0';
+  return dtl_count;
+}
+/* read_mes */
+
+
+int
+unread_char (VOID)
+/* wind input back, to allow rereading of one character */
+/* return 1 if this works, 0 on error */
+{
+  extern Line dtl_line;
+  int status;
+  if (dtl_line.read > 0)
+  {
+    -- dtl_line.read;  /* back up one character in dtl_line */
+    -- dtl_read;  /* correct the count of DTL characters */
+    -- com_read;  /* count another DTL command character */
+    status = 1;  /* OK */
+  }
+  else /* current DTL line is empty */
+  {
+    status = 0;  /* error */
+  }
+  return status;
+}
+/* unread_char */
+
+
+int
+find_command
+#ifdef STDC
+  (char * command, int * opcode)
+#else
+  (command, opcode)
+  char * command;
+  int * opcode;
+#endif
+{
+  int found;
+  int i;
+
+  found = 0;
+  for (i=0; i < NCMDS; i++)
+  {
+    if ((cmd_table[i] != 0) && (strcmp (command, cmd_table[i]) == 0))
+    {
+      found = 1;
+      break;
+    }
+  }
+
+  *opcode = i;
+
+  return found;
+}
+/* find_command */
+
+
+int
+check_byte
+#ifdef STDC
+  (int byte)
+#else
+  (byte)
+  int byte;
+#endif
+{
+  if (byte < 0 || byte > 255)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(check_byte) : INTERNAL ERROR : ");
+    fprintf (stderr, "byte %d not in the range of 0 to 255.\n", byte);
+    dexit (1);
+  }
+  return 1;  /* OK */
+}
+/* check_byte */
+
+
+int
+xfer_args
+#ifdef STDC
+  (FILE * dtl, FILE * dvi, int opcode)
+#else
+  (dtl, dvi, opcode)
+  FILE * dtl;
+  FILE * dvi;
+  int opcode;
+#endif
+{
+  int n;
+
+  if (opcode >= 0 && opcode <= 127)
+    ;  /* SETCHAR uses no data */
+  else if (opcode >= 128 && opcode <= 170)
+  {
+    word_t this_bop_address = last_bop_address;
+
+    if (opcode == 139)  /* BOP */
+    {
+      this_bop_address = dvi_written - 1;
+    }
+    put_table (op_128_170, opcode, dtl, dvi);
+    if (opcode == 139)  /* BOP */
+    {
+      xfer_bop_address (dtl, dvi);
+      last_bop_address = this_bop_address;
+    }
+  }
+  else if (opcode >= 171 && opcode <= 234)
+    ;  /* FONTNUM uses no data */
+  else if (opcode >= 235 && opcode <= 238)
+    put_table (fnt, opcode, dtl, dvi);
+  else if (opcode >= 239 && opcode <= 242)
+  {
+    n = opcode - 238;
+    special (dtl, dvi, n);
+  }
+  else if (opcode >= 243 && opcode <= 246)
+  {
+    n = opcode - 242;
+    fontdef (dtl, dvi, n);
+  }
+  else if (opcode == 247)
+    preamble (dtl, dvi);
+  else if (opcode == 248)
+    postamble (dtl, dvi);
+  else if (opcode == 249)
+    post_post (dtl, dvi);
+  else if (opcode >= 250 && opcode <= 255)
+    ;  /* these, undefined, opcodes use no data */
+  else
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(xfer_args) : opcode %d not handled.\n",
+      opcode);
+  }
+
+  return 1;  /* OK */
+}
+/* xfer_args */
+
+
+int
+set_seq
+#ifdef STDC
+  (FILE * dtl, FILE * dvi)
+#else
+  (dtl, dvi)
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* Called _after_ a BSEQ_CHAR command */
+/* Read bytes from dtl file, */
+/* writing corresponding SETCHAR or SET1 commands to DVI file, */
+/* _until_ unescaped ESEQ_CHAR is found */
+/* Return 1 if OK, 0 on error */
+/****  dt2dv assumes 8 bit characters,      ****/
+/****  but some day one might change that.  ****/
+{
+  int status = 1;  /* status = 1 if OK, 0 if error */
+  int more;  /* sequence of font characters continuing? */
+  int escape = 0;  /* flag set if previous character was an escape */
+  int ch;  /* character read from DTL file */
+  more = 1;
+  while (more)
+  {
+    /* ignore read_char status, to allow unprintable characters */
+    (Void) read_char (dtl, &ch);
+    /* but check for end of dtl file, or serious file reading error */
+    if (ch < 0)
+    {
+      PRINT_PROGNAME;
+      fprintf (stderr, "(set_seq) : ");
+      fprintf (stderr, "end of dtl file, ");
+      fprintf (stderr, "or serious dtl file reading error\n");
+      dinfo();
+      more = 0;
+      status = 0;  /* bad news */
+    }
+    else  /* read dtl file, okay */
+    {
+      if (ch == ESC_CHAR && escape == 0)  /* escape next character */
+      {
+        escape = 1;
+      }
+      else
+      {
+        if (ch == ESEQ_CHAR && escape == 0)  /* end of sequence */
+        {
+          more = 0;
+        }
+        else if (ch <= 127)  /* can use SETCHAR */
+        {
+          put_byte (ch, dvi);
+        }
+        else if (ch <= 255)  /* can use SET1 */
+        {
+          put_byte (128, dvi);  /* SET1 opcode */
+          put_unsigned (1, (U4) ch, dvi);
+        }
+        else
+        {
+          PRINT_PROGNAME;
+          fprintf (stderr, "(set_seq) : ");
+          fprintf (stderr,
+            "ERROR : DTL character %d is not in range 0 to 255\n",
+            ch);
+          dexit (1);
+          more = 0;
+          status = 0;  /* Error, because dt2dv assumes 8 bit characters */
+        }
+        escape = 0;  /* current ch is not an escape character */
+      }
+    }
+  }
+  return status;
+}
+/* set_seq */
+
+
+U4
+xfer_hex
+#ifdef STDC
+  (int n, FILE * dtl, FILE * dvi)
+#else
+  (n, dtl, dvi)
+  int n;
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* translate unsigned n-byte hexadecimal number from dtl to dvi file. */
+/* return value of hexadecimal number */
+{
+  U4 unum = 0;  /* at most this space needed */
+  COUNT nread = 0;  /* number of DTL bytes read by read_token */
+  int nconv = 0;  /* number of arguments converted by sscanf */
+  static Token token = "";  /* DTL token */
+
+  if (n < 1 || n > 4)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(xfer_hex) : INTERNAL ERROR : asked for %d bytes.  Must be 1 to 4.\n",
+      n);
+    dexit (1);
+  }
+
+  nread = read_token (dtl, token);
+
+  nconv = sscanf (token, XF4, &unum);
+
+  if (nconv < 1)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_hex) : DTL FILE ERROR (%s) :  %s \"%s\".\n",
+      dtl_filename, "hexadecimal number expected, not", token);
+    dexit (1);
+  }
+
+  put_unsigned (n, unum, dvi);
+
+  return unum;
+}
+/* xfer_hex */
+
+
+U4
+xfer_oct
+#ifdef STDC
+  (int n, FILE * dtl, FILE * dvi)
+#else
+  (n, dtl, dvi)
+  int n;
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* translate unsigned n-byte octal number from dtl to dvi file. */
+/* return value of octal number */
+{
+  U4 unum = 0;  /* at most this space needed */
+  COUNT nread = 0;  /* number of DTL bytes read by read_token */
+  int nconv = 0;  /* number of arguments converted by sscanf */
+  static Token token = "";  /* DTL token */
+
+  if (n < 1 || n > 4)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(xfer_oct) : INTERNAL ERROR : asked for %d bytes.  Must be 1 to 4.\n",
+      n);
+    dexit (1);
+  }
+
+  nread = read_token (dtl, token);
+
+  nconv = sscanf (token, OF4, &unum);
+
+  if (nconv < 1)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_oct) : DTL FILE ERROR (%s) :  %s \"%s\".\n",
+      dtl_filename, "octal number expected, not", token);
+    dexit (1);
+  }
+
+  put_unsigned (n, unum, dvi);
+
+  return unum;
+}
+/* xfer_oct */
+
+
+U4
+xfer_unsigned
+#ifdef STDC
+  (int n, FILE * dtl, FILE * dvi)
+#else
+  (n, dtl, dvi)
+  int n;
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* translate unsigned n-byte number from dtl to dvi file. */
+/* return value of unsigned number */
+{
+  U4 unum = 0;  /* at most this space needed */
+
+  unum = get_unsigned (dtl);
+  put_unsigned (n, unum, dvi);
+
+  return unum;
+}
+/* xfer_unsigned */
+
+
+S4
+xfer_signed
+#ifdef STDC
+  (int n, FILE * dtl, FILE * dvi)
+#else
+  (n, dtl, dvi)
+  int n;
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* translate signed n-byte number from dtl to dvi file. */
+/* return value of signed number */
+{
+  S4 snum = 0;
+
+  snum = get_signed (dtl);
+  put_signed (n, snum, dvi);
+
+  return snum;
+}
+/* xfer_signed */
+
+
+U4
+get_unsigned
+#ifdef STDC
+  (FILE * dtl)
+#else
+  (dtl)
+  FILE * dtl;
+#endif
+/* read unsigned number from dtl file. */
+/* return value of unsigned number */
+{
+  U4 unum = 0;  /* at most this space needed */
+  COUNT nread = 0;  /* number of DTL bytes read by read_token */
+  int nconv = 0;  /* number of arguments converted by sscanf */
+  static Token token = "";  /* DTL token */
+
+  nread = read_token (dtl, token);
+
+  nconv = sscanf (token, UF4, &unum);
+
+  if (nconv < 1)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(get_unsigned) : DTL FILE ERROR (%s) :  %s \"%s\".\n",
+      dtl_filename, "unsigned number expected, not", token);
+    dexit (1);
+  }
+
+  return unum;
+}
+/* get_unsigned */
+
+
+S4
+get_signed
+#ifdef STDC
+  (FILE * dtl)
+#else
+  (dtl)
+  FILE * dtl;
+#endif
+/* read signed number from dtl file. */
+/* return value of signed number */
+{
+  S4 snum = 0;
+  COUNT nread = 0;  /* number of DTL bytes read by read_token */
+  int nconv = 0;  /* number of sscanf arguments converted and assigned */
+  static Token token = "";
+
+  nread = read_token (dtl, token);
+
+  nconv = sscanf (token, SF4, &snum);
+
+  if (nconv < 1)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(get_signed) : DTL FILE ERROR (%s) :  %s \"%s\".\n",
+      dtl_filename, "signed number expected, not", token);
+    dexit (1);
+  }
+
+  return snum;
+}
+/* get_signed */
+
+
+int
+put_unsigned
+#ifdef STDC
+  (int n, U4 unum, FILE * dvi)
+#else
+  (n, unum, dvi)
+  int n;
+  U4 unum;
+  FILE * dvi;
+#endif
+/* put unsigned in-byte integer to dvi file */
+/* DVI format uses Big-endian storage of numbers: */
+/* most significant byte is first. */
+/* return number of bytes written. */
+{
+  Byte ubyte[4];  /* at most 4 bytes needed in DVI format */
+  int i;
+
+  if (n < 1 || n > 4)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(put_unsigned) : INTERNAL ERROR : asked for %d bytes.  Must be 1 to 4.\n",
+      n);
+    dexit (1);
+  }
+
+  /* Big-endian storage. */
+  for (i = 0; i < n; i++)
+  {
+    ubyte[i] = (Byte) (unum % 256);
+    unum /= 256;
+  }
+  /* Reverse order for big-endian representation. */
+  for (i = n-1;  i >= 0;  i--)
+  {
+    put_byte ((int) ubyte[i], dvi);
+  }
+
+  return n;
+}
+/* put_unsigned */
+
+
+int
+put_signed
+#ifdef STDC
+  (int n, S4 snum, FILE * dvi)
+#else
+  (n, snum, dvi)
+  int n;
+  S4 snum;
+  FILE * dvi;
+#endif
+/* put signed in-byte integer to dvi file */
+/* DVI format uses 2's complement Big-endian storage of signed numbers: */
+/* most significant byte is first. */
+/* return number of bytes written. */
+{
+  /* Will this deal properly with the sign? */
+
+  if (n < 1 || n > 4)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(put_signed) : INTERNAL ERROR : asked for %d bytes.  Must be 1 to 4.\n",
+      n);
+    dexit (1);
+  }
+
+  /* How do we ensure 2's complement representation? */
+  /* Here's a trick that I hope is portable, given ANSI C. */
+  /* See K&R (2nd edition), Appendix A6.2 "Integral Conversions". */
+
+  /* Convert snum to U4 data type */
+  put_unsigned (n, (U4) snum, dvi);
+
+  return n;
+}
+/* put_signed */
+
+
+int
+check_bmes
+#ifdef STDC
+  (FILE * dtl)
+#else
+  (dtl)
+  FILE * dtl;
+#endif
+/* check that a BMES_CHAR is the next non-whitespace character in dtl */
+{
+  int ch;  /* next non-whitespace character in dtl */
+
+  /* `(Void)' because we ignore the number of spaces skipped */
+  (Void) skip_space (dtl, &ch);
+
+  if (ch < 0)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(check_bmes) : DTL FILE ERROR (%s) : ",
+      dtl_filename);
+    fprintf (stderr, "end of dtl file, or reading error\n");
+    dexit (1);
+  }
+
+  if (ch != BMES_CHAR)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(check_bmes) : DTL FILE ERROR (%s) : ",
+      dtl_filename);
+    fprintf (stderr, "BMES_CHAR (`%c') %s, not `%c' (char %d).\n",
+      BMES_CHAR, "expected before string", ch, ch);
+    dexit (1);
+  }
+
+  return 1;  /* OK */
+}
+/* check_bmes */
+
+
+int
+check_emes
+#ifdef STDC
+  (FILE * dtl)
+#else
+  (dtl)
+  FILE * dtl;
+#endif
+/* check that an EMES_CHAR is the next character in dtl */
+{
+  int ch;  /* dtl character */
+
+  if (read_char (dtl, &ch) == 0)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(check_emes) : DTL FILE ERROR (%s) : ",
+      dtl_filename);
+    fprintf (stderr, "end of dtl file, or reading error\n");
+    dexit (1);
+  }
+
+  if (ch != EMES_CHAR)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(check_emes) : DTL FILE ERROR (%s) : ",
+      dtl_filename);
+    fprintf (stderr, "EMES_CHAR (`%c') %s, not `%c' (char %d).\n",
+      EMES_CHAR, "expected to follow string", ch, ch);
+    dexit (1);
+  }
+
+  return 1;  /* OK */
+}
+/* check_emes */
+
+
+/* Size typically used in this program for Lstring variables */
+#define LSIZE 1024
+
+
+Void
+init_Lstring
+#ifdef STDC
+  (Lstring * lsp, long int n)
+#else
+  (lsp, n)
+  Lstring * lsp;
+  long int n;
+#endif
+{
+  lsp->l = 0;
+  lsp->m = n;
+  lsp->s = (char *) gmalloc (n);
+}
+/* init_Lstring */
+
+
+Void
+de_init_Lstring
+#ifdef STDC
+  (Lstring * lsp)
+#else
+  (lsp)
+  Lstring * lsp;
+#endif
+{
+  lsp->l = 0;
+  lsp->m = 0;
+  free (lsp->s);
+  lsp->s = NULL;  /* to be sure */
+}
+/* de_init_Lstring */
+
+
+Lstring *
+alloc_Lstring
+#ifdef STDC
+  (long int n)
+#else
+  (n)
+  long int n;
+#endif
+{
+  Lstring * lsp;
+  lsp = (Lstring *) gmalloc (sizeof (Lstring));
+  init_Lstring (lsp, n);
+  return (lsp);
+}
+/* alloc_Lstring */
+
+
+Void
+free_Lstring
+#ifdef STDC
+  (Lstring * lstr)
+#else
+  (lstr)
+  Lstring * lstr;
+#endif
+{
+  free (lstr->s);
+  free (lstr);
+}
+/* free_Lstring */
+
+
+Void
+ls_putb
+#ifdef STDC
+  (int ch, Lstring * lstr)
+#else
+  (ch, lstr)
+  int ch;
+  Lstring * lstr;
+#endif
+/* write byte ch into Lstring *lstr */
+{
+  if (lstr->l >= lstr->m)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(ls_putb) : ERROR : No more room in Lstring.\n");
+    dexit (1);
+  }
+  else
+  {
+    lstr->s [(lstr->l)++] = ch;
+  }
+}
+/* ls_putb */
+
+
+long int
+get_Lstring
+#ifdef STDC
+  (FILE * dtl, Lstring * lstr)
+#else
+  (dtl, lstr)
+  FILE * dtl;
+  Lstring * lstr;
+#endif
+/* get a string from dtl file, store as an Lstring in *lstr. */
+/* lstr must already be allocated and initialised. */
+/* return length of Lstring *lstr */
+{
+  U4 nch;
+  int char_status = CHAR_OK;  /* OK so far */
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(get_Lstring) : entering get_Lstring.\n");
+  }
+
+  check_bmes (dtl);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(get_Lstring) : string is: \"");
+  }
+
+  for (nch=0; ; nch++)
+  {
+    int ch;
+
+    char_status = read_string_char (dtl, &ch);
+
+    if (char_status == CHAR_FAIL)
+    {
+      /* end of dtl file, or reading error */
+      fprintf (stderr, "\n");
+      PRINT_PROGNAME;
+      fprintf (stderr, "(get_Lstring) : DTL FILE ERROR (%s) : ",
+        dtl_filename);
+      fprintf (stderr, "cannot read string[");
+      fprintf (stderr, UF4, nch);
+      fprintf (stderr, "] from dtl file.\n");
+      dexit (1);
+    }
+
+    if (debug)
+    {
+      fprintf (stderr, "%c", ch);
+    }
+
+    if (char_status == CHAR_EOS)
+    {
+      if (ch != EMES_CHAR)
+      {
+        PRINT_PROGNAME;
+        fprintf (stderr, "(get_Lstring) : INTERNAL ERROR : ");
+        fprintf (stderr, "char_status = CHAR_FAIL,\n");
+        fprintf (stderr,
+          "but ch = %c (char %d) is not EMES_CHAR = %c (char %d)\n",
+          ch, ch, EMES_CHAR, EMES_CHAR);
+        dexit (1);
+      }
+      (Void) unread_char ();
+      break;  /* end of string */
+    }
+    else if (char_status == CHAR_OK)
+    {
+      ls_putb (ch, lstr);
+    }
+    else
+    {
+        PRINT_PROGNAME;
+        fprintf (stderr, "(get_Lstring) : INTERNAL ERROR : ");
+        fprintf (stderr, "char_status = %d is unfamiliar!\n", char_status);
+        dexit (1);
+    }
+  }
+  /* end for */
+
+  if (debug)
+  {
+    fprintf (stderr, "\".\n");
+  }
+
+  check_emes (dtl);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(get_Lstring) : leaving get_Lstring.\n");
+  }
+
+  return (lstr->l);
+}
+/* get_Lstring */
+
+
+Void
+put_Lstring
+#ifdef STDC
+  (const Lstring * lstr, FILE * dvi)
+#else
+  (str, dvi)
+  Lstring lstr;
+  FILE * dvi;
+#endif
+{
+  size_t fwret;
+  fwret = fwrite ((lstr->s), sizeof (char), (size_t) (lstr->l), dvi);
+
+  dvi_written += fwret;
+
+  if (fwret < lstr->l)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(put_Lstring) : DVI File ERROR : not all bytes written ");
+    fprintf (stderr, "(%ld of %ld).\n",
+      (long int) fwret, (long int) (lstr->l));
+    dexit (1);
+  }
+}
+/* put_Lstring */
+
+
+U4
+xfer_len_string
+#ifdef STDC
+  (int n, FILE * dtl, FILE * dvi)
+#else
+  (n, dtl, dvi)
+  int n;
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* transfer (length and) quoted string from dtl to dvi file, */
+/* return number of bytes written to dvi file. */
+{
+  U4 k, k2;
+  Lstring lstr;
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_len_string) : entering xfer_len_string.\n");
+  }
+
+  init_Lstring (&lstr, LSIZE);
+
+  /* k[n] : length of special string */
+
+  k = get_unsigned (dtl);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_len_string) : string's nominal length k = ");
+    fprintf (stderr, UF4, k);
+    fprintf (stderr, " characters.\n");
+  }
+
+  k2 = get_Lstring (dtl, &lstr);
+
+  if (k2 != k)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_len_string) : WARNING : string length (");
+    fprintf (stderr, UF4, k);
+    fprintf (stderr, ") in DTL file is wrong\n");
+    fprintf (stderr, "Writing correct value (");
+    fprintf (stderr, UF4, k2);
+    fprintf (stderr, ") to DVI file\n");
+  }
+
+  put_unsigned (n, k2, dvi);
+
+  put_Lstring (&lstr, dvi);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_len_string) : leaving xfer_len_string.\n");
+  }
+
+  de_init_Lstring (&lstr);
+
+  return (n + k2);
+}
+/* xfer_len_string */
+
+
+S4
+xfer_bop_address
+#ifdef STDC
+  (FILE * dtl, FILE * dvi)
+#else
+  (dtl, dvi)
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* translate signed 4-byte bop address from dtl to dvi file. */
+/* return value of bop address written to DVI file */
+{
+  S4 snum = 0;  /* at most this space needed for byte address */
+  COUNT nread = 0;  /* number of DTL bytes read by read_token */
+  int nconv = 0;  /* number of arguments converted by sscanf */
+  static Token token = "";  /* DTL token */
+
+  nread += read_token (dtl, token);
+
+  nconv = sscanf (token, SF4, &snum);
+
+  if (nconv != 1)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_bop_address) : DTL FILE ERROR (%s) : ",
+      dtl_filename);
+    fprintf (stderr, "signed number expected, not \"%s\".\n", token);
+    dexit (1);
+  }
+
+  if (snum != last_bop_address)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_bop_address) : WARNING : byte address (");
+    fprintf (stderr, WF, snum);
+    fprintf (stderr, ")\n");
+    fprintf (stderr, "for previous bop in DTL file is wrong\n");
+    fprintf (stderr, "Writing correct value (");
+    fprintf (stderr, WF, last_bop_address);
+    fprintf (stderr, ") to DVI file\n");
+  }
+
+  put_signed (4, last_bop_address, dvi);
+
+  return last_bop_address;
+}
+/* xfer_bop_address */
+
+
+S4
+xfer_postamble_address
+#ifdef STDC
+  (FILE * dtl, FILE * dvi)
+#else
+  (dtl, dvi)
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* translate signed 4-byte postamble address from dtl to dvi file. */
+/* return value of postamble address written to DVI file */
+{
+  S4 snum = 0;  /* at most this space needed for byte address */
+  COUNT nread = 0;  /* number of DTL bytes read by read_token */
+  int nconv = 0;  /* number of arguments converted by sscanf */
+  static Token token = "";  /* DTL token */
+
+  nread += read_token (dtl, token);
+
+  nconv = sscanf (token, SF4, &snum);
+
+  if (nconv != 1)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_postamble_address) : DTL FILE ERROR (%s) : ",
+      dtl_filename);
+    fprintf (stderr, "signed number expected, not \"%s\".\n", token);
+    dexit (1);
+  }
+
+  if (snum != postamble_address)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(xfer_postamble_address) : WARNING : byte address (");
+    fprintf (stderr, WF, snum);
+    fprintf (stderr, ")\n");
+    fprintf (stderr, "for postamble in DTL file is wrong\n");
+    fprintf (stderr, "Writing correct value (");
+    fprintf (stderr, WF, postamble_address);
+    fprintf (stderr, ") to DVI file\n");
+  }
+
+  put_signed (4, postamble_address, dvi);
+
+  return postamble_address;
+}
+/* xfer_postamble_address */
+
+
+int
+put_table
+#ifdef STDC
+  (op_table table, int opcode, FILE * dtl, FILE * dvi)
+#else
+  (table, opcode, dtl, dvi)
+  op_table table;
+  int opcode;
+  FILE * dtl;
+  FILE * dvi;
+#endif
+{
+  /* table:  {char * name; int first, last; op_info * list; }; */
+  /* op_info:   {int code; char * name; int nargs; char * args; }; */
+
+  op_info op;  /* entry in table */
+  int i;
+  int pos;  /* current position in string being scanned */
+  static String args = "";
+
+  /* Defensive programming. */
+  if (opcode < table.first || opcode > table.last)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(put_table) : DTL FILE (OR INTERNAL) ERROR : opcode %d ", opcode);
+    fprintf (stderr, "is outside table %s [ %d to %d ] !\n",
+      table.name, table.first, table.last);
+    dexit (1);
+  }
+
+  op = table.list [ opcode - table.first ];
+
+  /* More defensive programming. */
+  if (opcode != op.code)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr,
+      "(put_table) : INTERNAL ERROR : opcode %d for command \"%s\"",
+      opcode, op.name);
+    fprintf (stderr, " faulty in table \"%s\".\n", table.name);
+    dexit (1);
+  }
+
+  /* process all the arguments, according to size and sign */
+
+  strncpy (args, op.args, MAXSTRLEN);
+
+  pos = 0;
+  for (i=0; i < op.nargs; i++)
+  {
+    int argtype = 0;
+    int nscan = 0;  /* number of bytes read by sscanf */
+    int nconv = 0;  /* number of sscanf arguments converted & assigned */
+
+    /* sscanf() does NOT advance over its input: */
+    /* C strings lack internal state information, which C files have. */
+    /* On Sun/OS, sscanf calls ungetc on the string it reads, */
+    /* which therefore has to be writable. */
+
+    nconv = sscanf (args + pos, "%d%n", &argtype, &nscan);
+
+    if (nconv < 1 || nscan < 1)
+    {
+      PRINT_PROGNAME;
+      fprintf (stderr,
+        "(put_table) : INTERNAL ERROR : internal read of table %s failed!\n",
+        table.name);
+      dexit (1);
+    }
+
+    pos += nscan;
+
+    if (argtype < 0)
+      xfer_signed (-argtype, dtl, dvi);
+    else
+      xfer_unsigned (argtype, dtl, dvi);
+  }
+  /* end for */
+
+  return 1;  /* OK */
+}
+/* put_table */
+
+
+/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+
+
+U4
+special
+#ifdef STDC
+  (FILE * dtl,  FILE * dvi,  int n)
+#else
+  (dtl,  dvi,  n)
+  FILE * dtl;
+  FILE * dvi;
+  int n;
+#endif
+/* read special (1 <= n <= 4 byte) data from dtl, and write in dvi */
+/* return number of bytes written */
+{
+  U4  nk;
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(special) : entering special.\n");
+  }
+
+  if (n < 1 || n > 4)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(special) : DTL FILE ERROR (%s) : special %d, ",
+      dtl_filename, n);
+    fprintf (stderr, "range is 1 to 4.\n");
+    dexit (1);
+  }
+
+  /* k[n] : length of special string */
+  /* x[k] : special string */
+  /* nk = n + k */
+  nk = xfer_len_string (n, dtl, dvi);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(special) : leaving special.\n");
+  }
+
+  return (nk);
+}
+/* special */
+
+
+int
+fontdef
+#ifdef STDC
+  (FILE * dtl,  FILE * dvi,  int suffix)
+#else
+  (dtl,  dvi,  suffix)
+  FILE * dtl;
+  FILE * dvi;
+  int suffix;
+#endif
+/* read fontdef fnt_def1 .. fnt_def4 from dtl, and write in dvi */
+/* suffix is the fontdef suffix : 1 to 4 */
+/* return number of bytes written */
+{
+  U4  a, l, a2, l2;
+  U4 k;
+  Lstring lstr1, lstr2;
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(fontdef) : entering fontdef.\n");
+  }
+
+  if (suffix < 1 || suffix > 4)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(fontdef) : DTL FILE ERROR (%s) : ",
+      dtl_filename);
+    fprintf (stderr, "font def %d, but range is 1 to 4.\n", suffix);
+    dexit (1);
+  }
+
+  init_Lstring (&lstr1, LSIZE);
+  init_Lstring (&lstr2, LSIZE);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(fontdef) : about to read font number.\n");
+  }
+
+  /* k[suffix] : font number */
+  if (suffix == 4)
+    k = xfer_signed (suffix, dtl, dvi);
+  else
+    k = xfer_unsigned (suffix, dtl, dvi);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(fontdef) : font ");
+    fprintf (stderr, UF4, k);
+    fprintf (stderr, ".\n");
+  }
+
+#ifdef HEX_CHECKSUM
+  /* c[4] : (hexadecimal) checksum : I (gt) would prefer this */
+  xfer_hex (4, dtl, dvi);
+#else /*NOT HEX_CHECKSUM */
+  /* c[4] : checksum (octal, for comparison with tftopl's .pl file) */
+  xfer_oct (4, dtl, dvi);
+#endif
+
+  /* s[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* d[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* If DTL file's edited, a and l may be wrong. */
+
+  /* a[1] : length of font `area' (directory) portion of pathname string */
+  a = get_unsigned (dtl);
+
+  /* l[1] : length of font portion of pathname string */
+  l = get_unsigned (dtl);
+
+  /* n[a+l] : font pathname string <= area + font */
+
+  a2 = get_Lstring (dtl, &lstr1);
+
+  if (a2 != a)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(fontdef) : WARNING : font area string's length (");
+    fprintf (stderr, UF4, a);
+    fprintf (stderr, ") in DTL file is wrong\n");
+    fprintf (stderr, "Writing correct value (");
+    fprintf (stderr, UF4, a2);
+    fprintf (stderr, ") to DVI file\n");
+  }
+
+  put_unsigned (1, a2, dvi);
+
+  l2 = get_Lstring (dtl, &lstr2);
+
+  if (l2 != l)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(fontdef) : WARNING : font string's length (");
+    fprintf (stderr, UF4, l);
+    fprintf (stderr, ") in DTL file is wrong\n");
+    fprintf (stderr, "Writing correct value (");
+    fprintf (stderr, UF4, l2);
+    fprintf (stderr, ") to DVI file\n");
+  }
+
+  put_unsigned (1, l2, dvi);
+
+  put_Lstring (&lstr1, dvi);
+  put_Lstring (&lstr2, dvi);
+
+  de_init_Lstring (&lstr2);
+  de_init_Lstring (&lstr1);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(fontdef) : leaving fontdef.\n");
+  }
+
+  return (suffix + 4*4 + 2*1 + a2 + l2);
+}
+/* fontdef */
+
+
+U4
+preamble
+#ifdef STDC
+  (FILE * dtl,  FILE * dvi)
+#else
+  (dtl,  dvi)
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* read preamble from dtl, and write in dvi */
+/* return number of bytes written */
+{
+  U4  k1;
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(preamble) : entering preamble.\n");
+  }
+
+  /* i[1] */
+  xfer_unsigned (1, dtl, dvi);
+
+  /* num[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* den[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* mag[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* k[1] : length of comment */
+  /* x[k] : comment string */
+  /* k1 = 1 + k */
+  k1 = xfer_len_string (1, dtl, dvi);
+
+  if (debug)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(preamble) : leaving preamble.\n");
+  }
+
+  return (1 + 3*4 + k1);
+}
+/* preamble */
+
+
+int
+postamble
+#ifdef STDC
+  (FILE * dtl,  FILE * dvi)
+#else
+  (dtl,  dvi)
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* read postamble from dtl, and write in dvi */
+/* return number of bytes written */
+{
+  postamble_address = dvi_written - 1;
+
+  /* p[4] : DVI address of previous bop command */
+  /*        --- unsigned? --- or signed, as I assume? */
+  /* For, surely  p  should be  -1  if the DVI file has NO bop? */
+  xfer_bop_address (dtl, dvi);
+
+  /* num[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* den[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* mag[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* l[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* u[4] */
+  xfer_unsigned (4, dtl, dvi);
+
+  /* s[2] */
+  xfer_unsigned (2, dtl, dvi);
+
+  /* t[2] */
+  xfer_unsigned (2, dtl, dvi);
+
+  return (6*4 + 2*2);
+}
+/* postamble */
+
+
+int
+post_post
+#ifdef STDC
+  (FILE * dtl,  FILE * dvi)
+#else
+  (dtl,  dvi)
+  FILE * dtl;
+  FILE * dvi;
+#endif
+/* read post_post from dtl, and write in dvi */
+/* return number of bytes written */
+{
+  /* hope I'm writing the "223" bytes in an 8-bit clean way */
+  int n223 = 0;  /* number of "223" bytes in final padding */
+
+  /* q[4] : DVI address of post command */
+  /*        --- unsigned? --- or signed, as I assume? */
+  /* what happens if there is NO postamble command? */
+  /* shouldn't  q  be  -1  then? */
+
+  xfer_postamble_address (dtl, dvi);
+
+  /* i[1] : DVI identification byte = 2 */
+  xfer_unsigned (1, dtl, dvi);
+
+  for (n223 = 0;  true;  n223++)
+  {
+    COUNT nread = 0;  /* number of DTL bytes read by read_token */
+    static Token token;
+
+    strcpy (token, "");
+
+    nread = read_token (dtl, token);
+
+    /* check whether end of dtl file */
+    if (nread == 0)
+    {
+      if (group)
+      {
+       /* dtl file shouldn't end before an ECOM */
+        PRINT_PROGNAME;
+       fprintf (stderr, "(post_post) : DTL FILE ERROR (%s) : ",
+          dtl_filename);
+        fprintf (stderr, "premature end of DTL file!\n");
+       fprintf (stderr,
+         "%d complete iterations of \"padding byte\" loop;\n", n223);
+       fprintf (stderr, "troublesome token = \"%s\"\n", token);
+       dexit (1);
+      }
+      /* leave the "223" loop */
+      break;
+    }
+    else if (strcmp (token, "223") == 0)
+    {
+      /* token is a "223" padding byte */
+      /* loop again */
+    }
+    else
+    {
+      /* read a non-empty token that wasn't "223" */
+      (Void) unread_char ();
+      if (group)
+      {
+       if (strcmp (token, ECOM) == 0)
+       {
+         /* end of DTL's post_post command */
+       }
+       else
+       {
+         /* error : expected end of post_post */
+          PRINT_PROGNAME;
+         fprintf (stderr, "(post_post) : DTL FILE ERROR (%s) : ",
+            dtl_filename);
+         fprintf (stderr, "token \"%s\" should be ECOM (\"%s\")\n",
+            token, ECOM);
+         dexit (1);
+       }
+      }
+      /* leave the "223" loop */
+      break;
+    }
+  }
+  /* end for */
+
+  if (n223 < 4)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(post_post) : DTL FILE ERROR (%s) : \n",
+      dtl_filename);
+    fprintf (stderr, "fewer than four `223' padding bytes.\n");
+    fprintf (stderr, "Will write at least four `223' padding bytes.\n");
+  }
+
+  /* check whether the DVI file size is a multiple of 4 bytes */
+  if ((dvi_written + n223) % 4 != 0)
+  {
+    PRINT_PROGNAME;
+    fprintf (stderr, "(post_post) : WARNING : \n");
+    fprintf (stderr, "DVI size ");
+    fprintf (stderr, WF, dvi_written);
+    fprintf (stderr, " (bytes) wouldn't be a multiple of 4 !\n");
+    fprintf (stderr,
+      "Will write (at least four) `223' padding bytes until it is.\n");
+  }
+
+  /* final padding of DVI file by "223" bytes to a multiple of 4 bytes, */
+  /* with at least 4 bytes */
+
+  for (n223 = 0;  (n223 < 4) || (dvi_written % 4 != 0);  n223++)
+  {
+    /* add a "223" padding byte */
+    put_byte (223, dvi);
+  }
+
+  return (4 + 1 + n223);
+}
+/* post_post */
+
+
+/* end of dt2dv.c */
diff --git a/development/Win32/packaging/dtl/dt2dv.man b/development/Win32/packaging/dtl/dt2dv.man
new file mode 100644 (file)
index 0000000..d3b4726
--- /dev/null
@@ -0,0 +1,156 @@
+.\" ====================================================================
+.\"  @Troff-man-file{
+.\"     author          = "Nelson H. F. Beebe and Geoffrey R. D. Tobin",
+.\"     version         = "0.6.0",
+.\"     date            = "08 March 1995",
+.\"     time            = "19:57:00 GMT +11",
+.\"     filename        = "dt2dv.man",
+.\"     address         = "Center for Scientific Computing
+.\"                        Department of Mathematics
+.\"                        University of Utah
+.\"                        Salt Lake City, UT 84112
+.\"                        USA",
+.\"     telephone       = "+1 801 581 5254",
+.\"     FAX             = "+1 801 581 4148",
+.\"     checksum        = "03708 156 634 4989",
+.\"     email           = "beebe@math.utah.edu (Internet)",
+.\"     codetable       = "ISO/ASCII",
+.\"     keywords        = "DVI, TeX",
+.\"     supported       = "no",
+.\"     docstring       = "This file contains the UNIX manual pages
+.\"                        for the dt2dv utility, a program for
+.\"                        converting a DTL text representation of a TeX
+.\"                        DVI file, usually produced by the companion
+.\"                        dv2dt utility, back to a binary DVI file.
+.\"
+.\"                        The checksum field above contains a CRC-16
+.\"                        checksum as the first value, followed by the
+.\"                        equivalent of the standard UNIX wc (word
+.\"                        count) utility output of lines, words, and
+.\"                        characters.  This is produced by Robert
+.\"                        Solovay's checksum utility.",
+.\"  }
+.\" ====================================================================
+.if t .ds Te T\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X
+.if n .ds Te TeX
+.TH DT2DV 1 "08 March 1995" "Version 0.6.0"
+.\"======================================================================
+.SH NAME
+dt2dv \- convert a DTL text representation of a TeX DVI file to a binary DVI file
+.\"======================================================================
+.SH SYNOPSIS
+.B dt2dv
+.RB [ \-debug ]
+.RB [ \-group ]
+.RB [ \-si ]
+.RB [ \-so ]
+.I [input-DTL-file]
+.I [output-DVI-file]
+.PP
+In the absence of the
+.B \-si
+and
+.B \-so
+options,
+both file arguments are
+.IR required
+in the order
+.B input-DTL-file output-DVI-file .
+But also see the OPTIONS section below.
+No default file extensions are supplied.
+.\"======================================================================
+.SH DESCRIPTION
+.B dt2dv
+converts a text representation of a \*(Te\& DVI
+file, usually produced by the companion
+.BR dv2dt (1)
+utility, back to a binary DVI file. DTL
+.RI ( "DVI Text Language" )
+files can be edited, with care, and then restored
+to DVI form for processing by any \*(Te\& DVI
+driver program.  In DTL files, font directory names
+and font names are preceded by a length field,
+which must be updated if the names are modified.
+.PP
+.BR dvitype (1)
+can also display a textual representation of DVI
+files, but in some implementations at least, it
+cannot be used in batch mode, and its output is
+not well-suited for conversion back to a DVI file.
+.PP
+The format of \*(Te\& DVI files is fully described
+in
+Donald E. Knuth,
+.IR "\*(Te\&: The Program" ,
+Addison-Wesley (1986), ISBN 0-201-13437-3, as well
+as in the
+.BR dvitype (1)
+literate program source code.  Brief descriptions
+of the DTL and DVI formats are given in
+.BR dv2dt (1).
+.\"======================================================================
+.SH OPTIONS
+.\"-----------------------------------------------
+.TP \w'\-debug'u+3n
+.B \-debug
+Turn on detailed debugging output.
+.\"-----------------------------------------------
+.TP
+.B \-group
+Expect each DTL command to be in parentheses.
+.\"-----------------------------------------------
+.TP
+.B \-si
+Read all DTL commands from standard input.
+.\"-----------------------------------------------
+.TP
+.B \-so
+Write all DVI commands to standard output.
+.\"======================================================================
+.SH "SEE ALSO"
+.BR dv2dt (1),
+.BR dvitype (1),
+.BR tex (1).
+.\"======================================================================
+.SH FILES
+.TP \w'\fI*.dvi\fP'u+3n
+.I *.dvi
+binary \*(Te\& DVI file.
+.TP
+.I *.dtl
+text representation of a \*(Te\& DVI file in
+.I "DVI Text Language"
+format.
+.\"======================================================================
+.SH AUTHOR
+.B dt2dv
+and
+.BR dv2dt (1)
+were written by
+.RS
+.nf
+Geoffrey Tobin
+Department of Electronic Engineering
+La Trobe University
+Bundoora, Victoria 3083
+Australia
+Tel: +61 3 479 3736
+FAX: +61 3 479 3025
+Email: <G.Tobin@ee.latrobe.edu.au>
+.fi
+.RE
+.PP
+These manual pages were written primarily by
+.RS
+.nf
+Nelson H. F. Beebe, Ph.D.
+Center for Scientific Computing
+Department of Mathematics
+University of Utah
+Salt Lake City, UT 84112
+Tel: +1 801 581 5254
+FAX: +1 801 581 4148
+Email: <beebe@math.utah.edu>
+.fi
+.RE
+.\"==============================[The End]==============================
diff --git a/development/Win32/packaging/dtl/dtl.doc b/development/Win32/packaging/dtl/dtl.doc
new file mode 100644 (file)
index 0000000..b170e0f
--- /dev/null
@@ -0,0 +1,77 @@
+``dtl.doc''
+Wed 8 March 1995
+Geoffrey Tobin
+
+Correspondence between DTL and DVI files.
+-----------------------------------------
+
+DTL variety sequences-6, version 0.6.0
+--------------------------------------
+
+Note:  `DTL' stands for `Device-Independent Text Language', and is an
+ASCII text representation of a DVI file.
+
+References for DVI file structure:
+----------------------------------
+In this distribution:
+
+        dvi.doc
+
+In the TeX archives:
+
+        CTAN:  dviware/driv-standard/level-0/dvistd0.tex
+    "The DVI Driver Standard, Level 0",
+    by  The TUG DVI Driver Standards Committee  (now defunct)
+    chaired by Joachim Schrod.
+    Appendix A, "Device-Independent File Format",
+    section A.2, "Summary of DVI commands".
+
+DTL Commands
+------------
+
+    variety <variety-name>  Specifies name of DTL file type.
+
+Naturally, `variety' has no DVI equivalent.
+
+The other DTL commands correspond one-to-one with DVI commands, but I
+have used briefer names (except for `special') than those used in the
+DVI standards document.
+
+    DTL  :  DVI 
+
+    (text)  :  series of set_char commands, for printable ASCII text
+    \(   :  literal ASCII left parenthesis in (text)
+    \)   :  literal ASCII right parenthesis in (text)
+    \\   :  literal ASCII backslash in (text)
+    \"   :  literal ASCII double quote in (text)
+    \XY  :  set_char for character with hexadecimal code XY,
+            not in parentheses, but by itself for readability
+    s1, s2, s2, s3  :  set, with (1,2,3,4)-byte charcodes
+    sr   :  set_rule
+    p1, p2, p2, p3  :  put, with (1,2,3,4)-byte charcodes
+    pr   :  put_rule
+    nop  :  nop (do nothing)
+    bop  :  bop (beginning of page)
+    eop  :  eop (end of page)
+    [    :  push
+    ]    :  pop
+    r1, r2, r3, r4   :  right, with (1,2,3,4)-byte argument
+    w0, w1, w2, w3, w4  :  as in DVI
+    x0, x1, x2, x3, x4  :  as in DVI
+    d1, d2, d3, d4   :  down, with (1,2,3,4)-byte argument
+    y0, y1, y2, y3, y4  :  as in DVI
+    z0, z1, z2, z3, z4  :  as in DVI
+    fn  :  fnt_num (set current font to font number in 0 to 63)
+    f1, f2, f3, f4  :  fnt (set current font to (1,2,3,4)-byte font number)
+    special  :  xxx (special commands with (1,2,3,4)-byte string length)
+    fd  :  fnt_def (assign a number to a named font)
+    pre  :  preamble
+    post  :  post (begin postamble)
+    post_post  :  post_post (end postamble)
+    opcode  :  undefined DVI command (250 to 255)
+
+---------------
+EOF ``dtl.doc''
+---------------
diff --git a/development/Win32/packaging/dtl/dtl.h b/development/Win32/packaging/dtl/dtl.h
new file mode 100644 (file)
index 0000000..e1e7e04
--- /dev/null
@@ -0,0 +1,174 @@
+/* dtl.h
+   - header for dv2dt.c and dt2dv.c, conversion programs
+     for human-readable "DTL" <-> DVI.
+   - (ANSI C) version 0.6.0 - 18:31 GMT +11  Wed 8 March 1995
+   - author: Geoffrey Tobin    G.Tobin@ee.latrobe.edu.au
+   - patch:  Michal Tomczak-Jaegermann   ntomczak@vm.ucs.ualberta.ca
+   - Reference:  "The DVI Driver Standard, Level 0",
+                 by  The TUG DVI Driver Standards Committee.
+                 Appendix A, "Device-Independent File Format".
+*/
+
+/* variety of DTL produced */
+#define  VARIETY  "sequences-6"
+
+/* version of DTL programs */
+#define VERSION "0.6.0"
+
+/* Test for ANSI/ISO Standard C */
+#if (defined(__cplusplus) || defined(__STDC__) || defined(c_plusplus))
+#define STDC 1
+#else
+#define STDC 0
+#endif
+
+/* Version (Traditional or ANSI) of C affects prototype and type definitions */
+#if STDC
+#define ARGS(parenthesized_list) parenthesized_list
+#else /* NOT STDC */
+#define ARGS(parenthesized_list) ()
+#endif /* NOT STDC */
+
+#if STDC
+#define Void void
+#define VOID void
+#define FILE_BEGIN SEEK_SET
+#else  /* NOT STDC */
+#define Void int
+#define VOID
+#define FILE_BEGIN 0
+#endif /* NOT STDC */
+
+/* types to store 4 byte signed and unsigned integers */
+typedef long  S4;
+typedef unsigned long  U4;
+/* scanf and printf formats to read or write those */
+#define SF4  "%ld"
+#define UF4  "%lu"
+/* 4 byte hexadecimal */
+/* #define XF4  "%04lx" */
+#define XF4  "%lx"
+/* 4 byte octal */
+#define OF4  "%lo"
+
+/* type for byte count for DVI file */
+/* COUNT must be large enough to hold a U4 (unsigned 4 byte) value */
+typedef U4  COUNT;
+
+/* size of a TeX and DVI word is 32 bits; in some systems a `long int' is needed */
+typedef long int word_t;
+/* format for a DVI word */
+#define WF "%ld"
+
+/* string of 8-bit characters for machine: keyboard, screen, memory */
+
+#define MAXSTRLEN 256
+typedef char String[MAXSTRLEN+1];
+
+/* string s of length l and maximum length m */
+typedef struct {int l; int m; char * s;} Lstring;
+
+int debug = 0;  /* normally, debugging is off */
+
+/* Is each DTL command parenthesised by a BCOM and an ECOM? */
+
+int group = 0;  /* by default, no grouping */
+
+/* signals of beginning and end of a command and its arguments */
+/* these apply only if group is nonzero */
+
+# define  BCOM  "{"
+# define  ECOM  "}"
+
+# define BCOM_CHAR '{'
+# define ECOM_CHAR '}'
+
+/* beginning and end of a message string */
+
+#define  BMES  "'"
+#define  EMES  BMES
+
+#define  BMES_CHAR  '\''
+#define  EMES_CHAR  BMES_CHAR
+
+/* beginning and end of sequence of font characters */
+
+#define  BSEQ  "("
+#define  ESEQ  ")"
+
+#define  BSEQ_CHAR  '('
+#define  ESEQ_CHAR  ')'
+
+/* escape and quote characters */
+
+#define  ESC_CHAR  '\\'
+#define  QUOTE_CHAR  '\"'
+
+/* command names in DTL */
+
+#define  SETCHAR  "\\"
+#define  SET      "s"
+#define  SET1     "s1"
+#define  SET2     "s2"
+#define  SET3     "s3"
+#define  SET4     "s4"
+#define  SETRULE  "sr"
+#define  PUT      "p"
+#define  PUT1     "p1"
+#define  PUT2     "p2"
+#define  PUT3     "p3"
+#define  PUT4     "p4"
+#define  PUTRULE  "pr"
+#define  NOP      "nop"
+#define  BOP      "bop"
+#define  EOP      "eop"
+#define  PUSH     "["
+#define  POP      "]"
+#define  RIGHT    "r"
+#define  RIGHT1   "r1"
+#define  RIGHT2   "r2"
+#define  RIGHT3   "r3"
+#define  RIGHT4   "r4"
+#define  W        "w"
+#define  W0       "w0"
+#define  W1       "w1"
+#define  W2       "w2"
+#define  W3       "w3"
+#define  W4       "w4"
+#define  X        "x"
+#define  X0       "x0"
+#define  X1       "x1"
+#define  X2       "x2"
+#define  X3       "x3"
+#define  X4       "x4"
+#define  DOWN     "d"
+#define  DOWN1    "d1"
+#define  DOWN2    "d2"
+#define  DOWN3    "d3"
+#define  DOWN4    "d4"
+#define  Y        "y"
+#define  Y0       "y0"
+#define  Y1       "y1"
+#define  Y2       "y2"
+#define  Y3       "y3"
+#define  Y4       "y4"
+#define  Z        "z"
+#define  Z0       "z0"
+#define  Z1       "z1"
+#define  Z2       "z2"
+#define  Z3       "z3"
+#define  Z4       "z4"
+#define  FONT     "f"
+#define  FONT1    "f1"
+#define  FONT2    "f2"
+#define  FONT3    "f3"
+#define  FONT4    "f4"
+#define  FONTDEF  "fd"
+#define  FONTNUM  "fn"
+#define  SPECIAL  "special"
+#define  PRE      "pre"
+#define  POST     "post"
+#define  POSTPOST "post_post"
+#define  OPCODE   "opcode"
+
+/* end dtl.h */
diff --git a/development/Win32/packaging/dtl/dv2dt.c b/development/Win32/packaging/dtl/dv2dt.c
new file mode 100644 (file)
index 0000000..5f9fd39
--- /dev/null
@@ -0,0 +1,919 @@
+/* dv2dt - convert DVI file to human-readable "DTL" format.
+   - (ANSI C) version 0.6.0 - 17:54 GMT +11  Wed 8 March 1995
+   - author:  Geoffrey Tobin    ecsgrt@luxor.latrobe.edu.au
+   - patch:  Michal Tomczak-Jaegermann   ntomczak@vm.ucs.ualberta.ca
+   - Reference:  "The DVI Driver Standard, Level 0",
+                 by  The TUG DVI Driver Standards Committee.
+                 Appendix A, "Device-Independent File Format".
+*/
+
+/* unix version; read from stdin, write to stdout, by default. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "dtl.h"
+
+#define PRINT_BCOM   if (group) fprintf (dtl, "%s", BCOM)
+#define PRINT_ECOM   if (group) fprintf (dtl, "%s", ECOM)
+
+/*
+  operation's:
+     opcode,
+     name,
+     number of args,
+     string of arguments.
+*/
+struct op_info_st {int code; char * name; int nargs; char * args; };
+
+typedef  struct op_info_st  op_info;
+
+/*
+  table's:
+     name,
+     first opcode,
+     last opcode,
+     pointer to opcode info.
+*/
+struct op_table_st {char * name; int first; int last; op_info * list; };
+
+typedef  struct op_table_st  op_table;
+
+/* Table for opcodes 128 to 170 inclusive. */
+
+op_info  op_info_128_170 [] =
+{
+  {128, "s1", 1, "1"},
+  {129, "s2", 1, "2"},
+  {130, "s3", 1, "3"},
+  {131, "s4", 1, "-4"},
+  {132, "sr", 2, "-4 -4"},
+  {133, "p1", 1, "1"},
+  {134, "p2", 1, "2"},
+  {135, "p3", 1, "3"},
+  {136, "p4", 1, "-4"},
+  {137, "pr", 2, "-4 -4"},
+  {138, "nop", 0, ""},
+  {139, "bop", 11, "-4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4"},
+  {140, "eop", 0, ""},
+  {141, "[", 0, ""},
+  {142, "]", 0, ""},
+  {143, "r1", 1, "-1"},
+  {144, "r2", 1, "-2"},
+  {145, "r3", 1, "-3"},
+  {146, "r4", 1, "-4"},
+  {147, "w0", 0, ""},
+  {148, "w1", 1, "-1"},
+  {149, "w2", 1, "-2"},
+  {150, "w3", 1, "-3"},
+  {151, "w4", 1, "-4"},
+  {152, "x0", 0, ""},
+  {153, "x1", 1, "-1"},
+  {154, "x2", 1, "-2"},
+  {155, "x3", 1, "-3"},
+  {156, "x4", 1, "-4"},
+  {157, "d1", 1, "-1"},
+  {158, "d2", 1, "-2"},
+  {159, "d3", 1, "-3"},
+  {160, "d4", 1, "-4"},
+  {161, "y0", 0, ""},
+  {162, "y1", 1, "-1"},
+  {163, "y2", 1, "-2"},
+  {164, "y3", 1, "-3"},
+  {165, "y4", 1, "-4"},
+  {166, "z0", 0, ""},
+  {167, "z1", 1, "-1"},
+  {168, "z2", 1, "-2"},
+  {169, "z3", 1, "-3"},
+  {170, "z4", 1, "-4"}
+};  /* op_info  op_info_128_170 [] */
+
+op_table  op_128_170  =  {"op_128_170", 128, 170, op_info_128_170};
+
+/* Table for font with 1 to 4 bytes (opcodes 235 to 238) inclusive. */
+
+op_info  fnt_n [] =
+{
+  {235, "f1", 1, "1"},
+  {236, "f2", 1, "2"},
+  {237, "f3", 1, "3"},
+  {238, "f4", 1, "-4"}
+};  /* op_info  fnt_n [] */
+
+op_table  fnt  =  {"f", 235, 238, fnt_n};
+
+
+/* function prototypes */
+
+int open_dvi ARGS((char * dvi_file, FILE ** dvi));
+int open_dtl ARGS((char * dtl_file, FILE ** dtl));
+int dv2dt ARGS((FILE * dvi, FILE * dtl));
+
+COUNT wunsigned ARGS((int n,  FILE * dvi,  FILE * dtl));
+COUNT wsigned   ARGS((int n,  FILE * dvi,  FILE * dtl));
+S4 rsigned   ARGS((int n,  FILE * dvi));
+U4 runsigned ARGS((int n,  FILE * dvi));
+
+COUNT wtable ARGS((op_table table, int opcode, FILE * dvi, FILE * dtl));
+
+COUNT setseq ARGS((int opcode, FILE * dvi, FILE * dtl));
+Void setpchar ARGS((int charcode, FILE * dtl));
+Void xferstring ARGS((int k, FILE * dvi, FILE * dtl));
+
+COUNT special ARGS((FILE * dvi,  FILE * dtl,  int n));
+COUNT fontdef ARGS((FILE * dvi,  FILE * dtl,  int n));
+COUNT preamble  ARGS((FILE * dvi,  FILE * dtl));
+COUNT postamble ARGS((FILE * dvi,  FILE * dtl));
+COUNT postpost  ARGS((FILE * dvi,  FILE * dtl));
+
+
+String program;  /* name of dv2dt program */
+
+int
+main
+#ifdef STDC
+  (int argc,  char * argv[])
+#else
+  (argc, argv)
+  int argc;
+  char * argv[];
+#endif
+{
+  FILE * dvi = stdin;
+  FILE * dtl = stdout;
+
+  /* Watch out:  C's standard library's string functions are dicey */
+  strncpy (program, argv[0], MAXSTRLEN);
+
+  if (argc > 1)
+    open_dvi (argv[1], &dvi);
+
+  if (argc > 2)
+    open_dtl (argv[2], &dtl);
+
+  dv2dt (dvi, dtl);
+
+  return 0;  /* OK */
+}
+/* end main */
+
+int
+open_dvi
+#ifdef STDC
+  (char * dvi_file, FILE ** pdvi)
+#else
+  (dvi_file, pdvi)
+  char * dvi_file;
+  FILE ** pdvi;
+#endif
+/* I:  dvi_file;  I:  pdvi;  O:  *pdvi. */
+{
+  if (pdvi == NULL)
+  {
+    fprintf (stderr, "%s:  address of dvi variable is NULL.\n", program);
+    exit (1);
+  }
+
+  *pdvi = fopen (dvi_file, "rb");
+
+  if (*pdvi == NULL)
+  {
+    fprintf (stderr, "%s:  Cannot open \"%s\" for binary reading.\n",
+      program, dvi_file);
+    exit (1);
+  }
+
+  return 1;  /* OK */
+}
+/* open_dvi */
+
+int
+open_dtl
+#ifdef STDC
+  (char * dtl_file, FILE ** pdtl)
+#else
+  (dtl_file, pdtl)
+  char * dtl_file;
+  FILE ** pdtl;
+#endif
+/* I:  dtl_file;  I:  pdtl;  O:  *pdtl. */
+{
+  if (pdtl == NULL)
+  {
+    fprintf (stderr, "%s:  address of dtl variable is NULL.\n", program);
+    exit (1);
+  }
+
+  *pdtl = fopen (dtl_file, "w");
+
+  if (*pdtl == NULL)
+  {
+    fprintf (stderr, "%s:  Cannot open \"%s\" for text writing.\n",
+      program, dtl_file);
+    exit (1);
+  }
+
+  return 1;  /* OK */
+}
+/* open_dtl */
+
+int
+dv2dt
+#ifdef STDC
+  (FILE * dvi, FILE * dtl)
+#else
+  (dvi, dtl)
+  FILE * dvi;
+  FILE * dtl;
+#endif
+{
+  int opcode;
+  COUNT count;  /* intended to count bytes to DVI file; as yet unused. */
+
+  PRINT_BCOM;
+  fprintf (dtl, "variety ");
+/*  fprintf (dtl, BMES); */
+  fprintf (dtl, VARIETY);
+/*  fprintf (dtl, EMES); */
+  PRINT_ECOM;
+  fprintf (dtl, "\n");
+
+  /* start counting DVI bytes */
+  count = 0;
+  while ((opcode = fgetc (dvi)) != EOF)
+  {
+    PRINT_BCOM;  /* start of command and parameters */
+    if (opcode < 0 || opcode > 255)
+    {
+      count += 1;
+      fprintf (stderr, "%s:  Non-byte from \"fgetc()\"!\n", program);
+      exit (1);
+    }
+    else if (opcode <= 127)
+    {
+      /* setchar commands */
+      /* count += 1; */
+      /* fprintf (dtl, "%s%d", SETCHAR, opcode); */
+      count +=
+      setseq (opcode, dvi, dtl);
+    }
+    else if (opcode >= 128 && opcode <= 170)
+    {
+      count +=
+      wtable (op_128_170, opcode, dvi, dtl);
+    }
+    else if (opcode >= 171 && opcode <= 234)
+    {
+      count += 1;
+      fprintf (dtl, "%s%d", FONTNUM, opcode - 171);
+    }
+    else if (opcode >= 235 && opcode <= 238)
+    {
+      count +=
+      wtable (fnt, opcode, dvi, dtl);
+    }
+    else if (opcode >= 239 && opcode <= 242)
+    {
+      count +=
+      special (dvi, dtl, opcode - 238);
+    }
+    else if (opcode >= 243 && opcode <= 246)
+    {
+      count +=
+      fontdef (dvi, dtl, opcode - 242);
+    }
+    else if (opcode == 247)
+    {
+      count +=
+      preamble (dvi, dtl);
+    }
+    else if (opcode == 248)
+    {
+      count +=
+      postamble (dvi, dtl);
+    }
+    else if (opcode == 249)
+    {
+      count +=
+      postpost (dvi, dtl);
+    }
+    else if (opcode >= 250 && opcode <= 255)
+    {
+      count += 1;
+      fprintf (dtl, "opcode%d", opcode);
+    }
+    else
+    {
+      count += 1;
+      fprintf (stderr, "%s:  unknown byte.\n", program);
+      exit (1);
+    }
+    PRINT_ECOM;  /* end of command and parameters */
+    fprintf (dtl, "\n");
+    if (fflush (dtl) == EOF)
+    {
+      fprintf (stderr, "%s:  fflush on dtl file gave write error!\n", program);
+      exit (1);
+    }
+  } /* end while */
+
+  return 1;  /* OK */
+}
+/* dv2dt */
+
+
+COUNT
+wunsigned
+#ifdef STDC
+  (int n, FILE * dvi, FILE * dtl)
+#else
+  (n, dvi, dtl)
+  int n;
+  FILE * dvi;
+  FILE * dtl;
+#endif
+{
+  U4 unum;
+
+  fprintf (dtl, " ");
+  unum = runsigned (n, dvi);
+  fprintf (dtl, UF4, unum);
+  return n;
+}
+/* end wunsigned */
+
+COUNT
+wsigned
+#ifdef STDC
+  (int n, FILE * dvi, FILE * dtl)
+#else
+  (n, dvi, dtl)
+  int n;
+  FILE * dvi;
+  FILE * dtl;
+#endif
+{
+  S4 snum;
+
+  fprintf (dtl, " ");
+  snum = rsigned (n, dvi);
+  fprintf (dtl, SF4, snum);
+  return n;
+}
+/* end wsigned */
+
+U4
+runsigned
+#ifdef STDC
+  (int n,  FILE * dvi)
+#else
+  (n, dvi)
+  int n;
+  FILE * dvi;
+#endif
+/* read 1 <= n <= 4 bytes for an unsigned integer from dvi file */
+/* DVI format uses Big-endian storage of numbers. */
+{
+  U4 integer;
+  int ibyte = 0;
+  int i;
+
+  if (n < 1 || n > 4)
+  {
+    fprintf (stderr,
+      "%s:  runsigned() asked for %d bytes.  Must be 1 to 4.\n", program, n);
+    exit (1);
+  }
+
+  /* Following calculation works iff storage is big-endian. */
+  integer = 0;
+  for (i = 0; i < n; i++)
+  {
+    integer *= 256;
+    ibyte = fgetc (dvi);
+    integer += ibyte;
+  }
+
+  return integer;
+}
+/* end runsigned */
+
+S4
+rsigned
+#ifdef STDC
+  (int n,  FILE * dvi)
+#else
+  (n, dvi)
+  int n;
+  FILE * dvi;
+#endif
+/* read 1 <= n <= 4 bytes for a signed integer from dvi file */
+/* DVI format uses Big-endian storage of numbers. */
+{
+  S4 integer;
+  int ibyte = 0;
+  int i;
+
+  if (n < 1 || n > 4)
+  {
+    fprintf (stderr,
+      "%s:  rsigned() asked for %d bytes.  Must be 1 to 4.\n", program, n);
+    exit (1);
+  }
+
+  /* Following calculation works iff storage is big-endian. */
+  integer = 0;
+  for (i = 0; i < n; i++)
+  {
+    integer *= 256;
+    ibyte = fgetc (dvi);
+    /* Big-endian implies sign byte is first byte. */
+    if (i == 0 && ibyte >= 128)
+    {
+      ibyte -= 256;
+    }
+    integer += ibyte;
+  }
+
+  return integer;
+}
+/* end rsigned */
+
+COUNT
+wtable
+#ifdef STDC
+  (op_table table, int opcode, FILE * dvi, FILE * dtl)
+#else
+  (table, opcode, dvi, dtl)
+  op_table table;
+  int opcode;
+  FILE * dvi;
+  FILE * dtl;
+#endif
+/* write command with given opcode in given table */
+/* return number of DVI bytes in this command */
+{
+  op_info op;  /* pointer into table of operations and arguments */
+  COUNT bcount = 0;  /* number of bytes in arguments of this opcode */
+  String args;  /* arguments string */
+  int i;  /* count of arguments read from args */
+  int pos;  /* position in args */
+
+  /* Defensive programming. */
+  if (opcode < table.first || opcode > table.last)
+  {
+    fprintf (stderr,
+      "%s: opcode %d is outside table %s [ %d to %d ] !\n",
+      program, opcode, table.name, table.first, table.last);
+    exit (1);
+  }
+
+  op = table.list [opcode - table.first];
+
+  /* Further defensive programming. */
+  if (op.code != opcode)
+  {
+    fprintf (stderr, "%s: internal table %s wrong!\n", program, table.name);
+    exit (1);
+  }
+
+  bcount = 1;
+  fprintf (dtl, "%s", op.name);
+
+  /* NB:  sscanf does an ungetc, */
+  /*      so args must be writable. */
+
+  strncpy (args, op.args, MAXSTRLEN);
+
+  pos = 0;
+  for (i = 0; i < op.nargs; i++)
+  {
+    int argtype;  /* sign and number of bytes in current argument */
+    int nconv;  /* number of successful conversions from args */
+    int nread;  /* number of bytes read from args */
+
+    nconv = sscanf (args + pos, "%d%n", &argtype, &nread);
+
+    /* internal consistency checks */
+    if (nconv != 1 || nread <= 0)
+    {
+      fprintf (stderr,
+        "%s: internal read of table %s failed!\n", program, table.name);
+      exit (1);
+    }
+
+    pos += nread;
+
+    bcount += ( argtype < 0 ?
+               wsigned  (-argtype, dvi, dtl) :
+               wunsigned (argtype, dvi, dtl)  ) ;
+  } /* end for */
+
+  return bcount;
+
+}
+/* wtable */
+
+COUNT
+setseq
+#ifdef STDC
+  (int opcode, FILE * dvi, FILE * dtl)
+#else
+  (opcode, dvi, dtl)
+  int opcode;
+  FILE * dvi;
+  FILE * dtl;
+#endif
+/* write a sequence of setchar commands */
+/* return count of DVI bytes interpreted into DTL */
+{
+  int charcode = opcode;  /* fortuitous */
+  int ccount = 0;
+
+  if (!isprint (charcode))
+  {
+    ccount = 1;
+    fprintf (dtl, "%s%02X", SETCHAR, opcode);
+  }
+  else
+  {
+    /* start of sequence of font characters */
+    fprintf (dtl, BSEQ);
+
+    /* first character */
+    ccount = 1;
+    setpchar (charcode, dtl);
+
+    /* subsequent characters */
+    while ((opcode = fgetc (dvi)) != EOF)
+    {
+      if (opcode < 0 || opcode > 127)
+      {
+        break;  /* not a setchar command, so sequence has ended */
+      }
+      charcode = opcode;  /* fortuitous */
+      if (!isprint (charcode))  /* not printable ascii */
+      {
+        break;  /* end of font character sequence, as for other commands */
+      }
+      else  /* printable ASCII */
+      {
+        ccount += 1;
+        setpchar (charcode, dtl);
+      }
+    }  /* end for loop */
+
+    /* prepare to reread opcode of next DVI command */
+    if (ungetc (opcode, dvi) == EOF)
+    {
+      fprintf (stderr, "setseq:  cannot push back a byte\n");
+      exit (1);
+    }
+
+    /* end of sequence of font characters */
+    fprintf (dtl, ESEQ);
+  }
+  return ccount;
+}
+/* setseq */
+
+Void
+setpchar
+#ifdef STDC
+  (int charcode, FILE * dtl)
+#else
+  (charcode, dtl)
+  int charcode;
+  FILE * dtl;
+#endif
+/* set printable character */
+{
+  switch (charcode)
+  {
+    case ESC_CHAR:
+      fprintf (dtl, "%c", ESC_CHAR);
+      fprintf (dtl, "%c", ESC_CHAR);
+      break;
+    case QUOTE_CHAR:
+      fprintf (dtl, "%c", ESC_CHAR);
+      fprintf (dtl, "%c", QUOTE_CHAR);
+      break;
+    case BSEQ_CHAR:
+      fprintf (dtl, "%c", ESC_CHAR);
+      fprintf (dtl, "%c", BSEQ_CHAR);
+      break;
+    case ESEQ_CHAR:
+      fprintf (dtl, "%c", ESC_CHAR);
+      fprintf (dtl, "%c", ESEQ_CHAR);
+      break;
+    default:
+      fprintf (dtl, "%c", charcode);
+      break;
+  }
+}
+/* setpchar */
+
+Void
+xferstring
+#ifdef STDC
+  (int k, FILE * dvi, FILE * dtl)
+#else
+  (k, dvi, dtl)
+  int k;
+  FILE * dvi;
+  FILE * dtl;
+#endif
+/* copy string of k characters from dvi file to dtl file */
+{
+  int i;
+  int ch;
+
+  fprintf (dtl, " ");
+  fprintf (dtl, "'");
+  for (i=0; i < k; i++)
+  {
+    ch = fgetc (dvi);
+    if (ch == ESC_CHAR || ch == EMES_CHAR)
+    {
+      fprintf (dtl, "%c", ESC_CHAR);
+    }
+    fprintf (dtl, "%c", ch);
+  }
+  fprintf (dtl, "'");
+}
+/* xferstring */
+
+COUNT
+special
+#ifdef STDC
+  (FILE * dvi,  FILE * dtl,  int n)
+#else
+  (dvi, dtl, n)
+  FILE * dvi;
+  FILE * dtl;
+  int n;
+#endif
+/* read special 1 .. 4 from dvi and write in dtl */
+/* return number of DVI bytes interpreted into DTL */
+{
+  U4  k;
+
+  if (n < 1 || n > 4)
+  {
+    fprintf (stderr, "%s:  special %d, range is 1 to 4.\n", program, n);
+    exit (1);
+  }
+
+  fprintf (dtl, "%s%d", SPECIAL, n);
+
+  /* k[n] = length of special string */
+  fprintf (dtl, " ");
+  k = runsigned (n, dvi);
+  fprintf (dtl, UF4, k);
+
+  /* x[k] = special string */
+  xferstring (k, dvi, dtl);
+
+  return (1 + n + k);
+}
+/* end special */
+
+COUNT
+fontdef
+#ifdef STDC
+  (FILE * dvi,  FILE * dtl,  int n)
+#else
+  (dvi,  dtl,  n)
+  FILE * dvi;
+  FILE * dtl;
+  int n;
+#endif
+/* read fontdef 1 .. 4 from dvi and write in dtl */
+/* return number of DVI bytes interpreted into DTL */
+{
+  U4 ku, c, s, d, a, l;
+  S4 ks;
+
+  if (n < 1 || n > 4)
+  {
+    fprintf (stderr, "%s:  font def %d, range is 1 to 4.\n", program, n);
+    exit (1);
+  }
+
+  fprintf (dtl, "%s%d", FONTDEF, n);
+
+  /* k[n] = font number */
+  fprintf (dtl, " ");
+  if (n == 4)
+  {
+    ks = rsigned (n, dvi);
+    fprintf (dtl, SF4, ks);
+  }
+  else
+  {
+    ku = runsigned (n, dvi);
+    fprintf (dtl, UF4, ku);
+  }
+
+  /* c[4] = checksum */
+  fprintf (dtl, " ");
+  c = runsigned (4, dvi);
+#ifdef HEX_CHECKSUM
+  fprintf (dtl, XF4, c);
+#else /* NOT HEX_CHECKSUM */
+  /* write in octal, to allow quick comparison with tftopl's output */
+  fprintf (dtl, OF4, c);
+#endif
+
+  /* s[4] = scale factor */
+  fprintf (dtl, " ");
+  s = runsigned (4, dvi);
+  fprintf (dtl, UF4, s);
+
+  /* d[4] = design size */
+  fprintf (dtl, " ");
+  d = runsigned (4, dvi);
+  fprintf (dtl, UF4, d);
+
+  /* a[1] = length of area (directory) name */
+  a = runsigned (1, dvi);
+  fprintf (dtl, " ");
+  fprintf (dtl, UF4, a);
+
+  /* l[1] = length of font name */
+  l = runsigned (1, dvi);
+  fprintf (dtl, " ");
+  fprintf (dtl, UF4, l);
+
+  /* n[a+l] = font pathname string => area (directory) + font */
+  xferstring (a, dvi, dtl);
+  xferstring (l, dvi, dtl);
+
+  return (1 + n + 4 + 4 + 4 + 1 + 1 + a + l);
+}
+/* end fontdef */
+
+COUNT
+preamble
+#ifdef STDC
+  (FILE * dvi,  FILE * dtl)
+#else
+  (dvi,  dtl)
+  FILE * dvi;
+  FILE * dtl;
+#endif
+/* read preamble from dvi and write in dtl */
+/* return number of DVI bytes interpreted into DTL */
+{
+  U4 id, num, den, mag, k;
+
+  fprintf (dtl, "pre");
+
+  /* i[1] = DVI format identification */
+  fprintf (dtl, " ");
+  id = runsigned (1, dvi);
+  fprintf (dtl, UF4, id);
+
+  /* num[4] = numerator of DVI unit */
+  fprintf (dtl, " ");
+  num = runsigned (4, dvi);
+  fprintf (dtl, UF4, num);
+
+  /* den[4] = denominator of DVI unit */
+  fprintf (dtl, " ");
+  den = runsigned (4, dvi);
+  fprintf (dtl, UF4, den);
+
+  /* mag[4] = 1000 x magnification */
+  fprintf (dtl, " ");
+  mag = runsigned (4, dvi);
+  fprintf (dtl, UF4, mag);
+
+  /* k[1] = length of comment */
+  fprintf (dtl, " ");
+  k = runsigned (1, dvi);
+  fprintf (dtl, UF4, k);
+
+  /* x[k] = comment string */
+  xferstring (k, dvi, dtl);
+
+  return (1 + 1 + 4 + 4 + 4 + 1 + k);
+}
+/* end preamble */
+
+COUNT
+postamble
+#ifdef STDC
+  (FILE * dvi,  FILE * dtl)
+#else
+  (dvi,  dtl)
+  FILE * dvi;
+  FILE * dtl;
+#endif
+/* read postamble from dvi and write in dtl */
+/* return number of bytes */
+{
+  U4 p, num, den, mag, l, u, s, t;
+
+  fprintf (dtl, "post");
+
+  /* p[4] = pointer to final bop */
+  fprintf (dtl, " ");
+  p = runsigned (4, dvi);
+  fprintf (dtl, UF4, p);
+
+  /* num[4] = numerator of DVI unit */
+  fprintf (dtl, " ");
+  num = runsigned (4, dvi);
+  fprintf (dtl, UF4, num);
+
+  /* den[4] = denominator of DVI unit */
+  fprintf (dtl, " ");
+  den = runsigned (4, dvi);
+  fprintf (dtl, UF4, den);
+
+  /* mag[4] = 1000 x magnification */
+  fprintf (dtl, " ");
+  mag = runsigned (4, dvi);
+  fprintf (dtl, UF4, mag);
+
+  /* l[4] = height + depth of tallest page */
+  fprintf (dtl, " ");
+  l = runsigned (4, dvi);
+  fprintf (dtl, UF4, l);
+
+  /* u[4] = width of widest page */
+  fprintf (dtl, " ");
+  u = runsigned (4, dvi);
+  fprintf (dtl, UF4, u);
+
+  /* s[2] = maximum stack depth */
+  fprintf (dtl, " ");
+  s = runsigned (2, dvi);
+  fprintf (dtl, UF4, s);
+
+  /* t[2] = total number of pages (bop commands) */
+  fprintf (dtl, " ");
+  t = runsigned (2, dvi);
+  fprintf (dtl, UF4, t);
+
+/*  return (29);  */
+  return (1 + 4 + 4 + 4 + 4 + 4 + 4 + 2 + 2);
+}
+/* end postamble */
+
+COUNT
+postpost
+#ifdef STDC
+  (FILE * dvi,  FILE * dtl)
+#else
+  (dvi,  dtl)
+  FILE * dvi;
+  FILE * dtl;
+#endif
+/* read post_post from dvi and write in dtl */
+/* return number of bytes */
+{
+  U4 q, id;
+  int b223;  /* hope this is 8-bit clean */
+  int n223;  /* number of "223" bytes in final padding */
+
+  fprintf (dtl, "post_post");
+
+  /* q[4] = pointer to post command */
+  fprintf (dtl, " ");
+  q = runsigned (4, dvi);
+  fprintf (dtl, UF4, q);
+
+  /* i[1] = DVI identification byte */
+  fprintf (dtl, " ");
+  id = runsigned (1, dvi);
+  fprintf (dtl, UF4, id);
+
+  /* final padding by "223" bytes */
+  /* hope this way of obtaining b223 is 8-bit clean */
+  for (n223 = 0; (b223 = fgetc (dvi)) == 223; n223++)
+  {
+    fprintf (dtl, " ");
+    fprintf (dtl, "%d", 223);
+  }
+  if (n223 < 4)
+  {
+    fprintf (stderr,
+      "%s:  bad post_post:  fewer than four \"223\" bytes.\n", program);
+    exit (1);
+  }
+  if (b223 != EOF)
+  {
+    fprintf (stderr,
+      "%s:  bad post_post:  doesn't end with a \"223\".\n", program);
+    exit (1);
+  }
+
+  return (1 + 4 + 1 + n223);
+}
+/* end postpost */
+
+/* end of "dv2dt.c" */
diff --git a/development/Win32/packaging/dtl/dv2dt.man b/development/Win32/packaging/dtl/dv2dt.man
new file mode 100644 (file)
index 0000000..79f6368
--- /dev/null
@@ -0,0 +1,715 @@
+.\" ====================================================================
+.\"  @Troff-man-file{
+.\"     author          = "Nelson H. F. Beebe and Geoffrey Tobin",
+.\"     version         = "0.6.0",
+.\"     date            = "08 March 1995",
+.\"     time            = "19:52:00 GMT +11",
+.\"     filename        = "dv2dt.man",
+.\"     address         = "Center for Scientific Computing
+.\"                        Department of Mathematics
+.\"                        University of Utah
+.\"                        Salt Lake City, UT 84112
+.\"                        USA",
+.\"     telephone       = "+1 801 581 5254",
+.\"     FAX             = "+1 801 581 4148",
+.\"     checksum        = "32328 715 2191 12898",
+.\"     email           = "beebe@math.utah.edu (Internet)",
+.\"     codetable       = "ISO/ASCII",
+.\"     keywords        = "DVI, TeX",
+.\"     supported       = "no",
+.\"     docstring       = "This file contains the UNIX manual pages
+.\"                        for the dv2dt utility, a program for
+.\"                        converting a binary TeX DVI file to an
+.\"                        editable text representation in DTL (DVI Text
+.\"                        Language).  The companion dt2dv utility can
+.\"                        convert the output DTL file back to a binary
+.\"                        DVI file.
+.\"
+.\"                        The checksum field above contains a CRC-16
+.\"                        checksum as the first value, followed by the
+.\"                        equivalent of the standard UNIX wc (word
+.\"                        count) utility output of lines, words, and
+.\"                        characters.  This is produced by Robert
+.\"                        Solovay's checksum utility.",
+.\"  }
+.\" ====================================================================
+.if t .ds Te T\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X
+.if n .ds Te TeX
+.if t .ds Xe X\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'T
+.if n .ds Xe XeT
+.TH DV2DT 1 "08 March 1995" "Version 0.6.0"
+.\"======================================================================
+.SH NAME
+dv2dt \- convert a binary TeX DVI file to DTL text representation
+.\"======================================================================
+.SH SYNOPSIS
+.B dv2dt
+.I input-DVI-file
+.I output-DTL-file
+.PP
+If the filenames are omitted, then
+.I stdin
+and
+.I stdout
+are assumed.
+.\"======================================================================
+.SH DESCRIPTION
+.B dv2dt
+converts a binary \*(Te\& DVI file to an editable
+text file in DTL
+.RI ( "DVI Text Language" )
+format.  The companion
+.BR dt2dv (1)
+utility can convert the DTL file back to a binary
+DVI file.
+.\"======================================================================
+.SH "DVI COMMAND DESCRIPTION"
+\*(Te\& DVI files contain a compact binary
+description of typeset pages, as a stream of
+operation code bytes, each immediately followed by
+zero or more parameter bytes.  The format of DVI
+files is fully described in Donald E. Knuth,
+.IR "\*(Te\&: The Program" ,
+Addison-Wesley (1986), ISBN 0-201-13437-3, as well
+as in the
+.BR dvitype (1)
+literate program source code.
+.PP
+For convenience, we provide a summary of DVI
+commands here.  In the following list, operation
+code bytes are given as unsigned decimal values,
+followed by their symbolic names (not present in
+the DVI file), and a short description.  A
+designation like
+.I b[+n]
+means that the operation code byte is followed by
+a parameter
+.I b
+which uses
+.I n
+bytes, and is signed.  Without the plus sign, the
+parameter is unsigned.  Signed integer parameter
+values are always represented in two's complement
+arithmetic, which is the system followed by most
+computers manufactured today, including all
+personal computers and workstations.
+.if n .TP \w'\fI128_set1__c[1]\fP'u+3n
+.if t .TP \w'\fI243_fnt_def1__k[1]_c[4]_s[4]_d[4]_a[1]_l[1]_n[a+l]\fP'u+3n
+.I "0 set_char_0"
+Set character 0 from current font.
+.TP
+.I .\|.\|.
+.TP
+.I "127 set_char_127"
+Set character 127 from current font.
+.TP
+.I "128 set1  c[1]"
+Set 1-byte unsigned character (uchar) number
+.IR c .
+.TP
+.I "129 set2  c[2]"
+Set 2-byte uchar number
+.IR c .
+.TP
+.I "130 set3  c[3]"
+Set 3-byte uchar number
+.IR c .
+.TP
+.I "131 set4  c[+4]"
+Set 4-byte signed character (schar) number
+.IR c .
+.TP
+.I "132 set_rule  a[+4]  b[+4]"
+Set rule, height
+.IR a ,
+width
+.IR b .
+.TP
+.I "133 put1  c[1]"
+Put 1-byte uchar
+.IR c .
+.TP
+.I "134 put2  c[2]"
+Put 2-byte uchar
+.IR c .
+.TP
+.I "135 put3  c[3]"
+Put 3-byte uchar
+.IR c .
+.TP
+.I "136 put4  c[+4]"
+Put 4-byte schar
+.IR c .
+.TP
+.I "137 put_rule  a[+4]  b[+4]"
+Put rule, height
+.IR a ,
+width
+.IR b .
+.TP
+.I "138 nop"
+Do nothing.
+.TP
+.I "139 bop  c0[+4]  .\|.\|.  c9[+4]  p[+4]"
+Beginning of page.  The parameters
+.I "c0  .\|.\|.  c9"
+are the \*(Te\& page counters, the contents of
+\*(Te\& count registers
+.IR "\ecount0  .\|.\|.  \ecount9" .
+The parameter
+.I p
+is the byte offset from the beginning of the DVI
+file of the previous
+.I bop
+operation code byte.  The first such command in
+the file has
+.IR "p = \-1" .
+.TP
+.I "140 eop"
+End of page.
+.TP
+.I "141 push"
+Push
+.RI ( h,v,w,x,y,z )
+onto stack.
+.TP
+.I "142 pop"
+Pop
+.RI ( h,v,w,x,y,z )
+from stack.
+.TP
+.I "143 right1  b[+1]"
+Move right
+.I b
+units.
+.TP
+.I "144 right2  b[+2]"
+Move right
+.I b
+units.
+.TP
+.I "145 right3  b[+3]"
+Move right
+.I b
+units.
+.TP
+.I "146 right4  b[+4]"
+Move right
+.I b
+units.
+.TP
+.I "147 w0"
+Move right
+.I w
+units.
+.TP
+.I "148 w1  b[+1]"
+Move right
+.I b
+units, and set
+.IR "w = b" .
+.TP
+.I "149 w2  b[+2]"
+Move right
+.I b
+units, and set
+.IR "w = b" .
+.TP
+.I "150 w3  b[+3]"
+Move right
+.I b
+units, and set
+.IR "w = b" .
+.TP
+.I "151 w4  b[+4]"
+Move right
+.I b
+units, and set
+.IR "w = b" .
+.TP
+.I "152 x0"
+Move right
+.I x
+units.
+.TP
+.I "153 x1  b[+1]"
+Move right
+.I b
+units, and set
+.IR "x = b" .
+.TP
+.I "154 x2  b[+2]"
+Move right
+.I b
+units, and set
+.IR "x = b" .
+.TP
+.I "155 x3  b[+3]"
+Move right
+.I b
+units, and set
+.IR "x = b" .
+.TP
+.I "156 x4  b[+4]"
+Move right
+.I b
+units, and set
+.IR "x = b" .
+.TP
+.I "157 down1  a[+1]"
+Move down
+.I a
+units.
+.TP
+.I "158 down2  a[+2]"
+Move down
+.I a
+units.
+.TP
+.I "159 down3  a[+3]"
+Move down
+.I a
+units.
+.TP
+.I "160 down4  a[+4]"
+Move down
+.I a
+units.
+.TP
+.I "161 y0"
+Move right
+.I y
+units.
+.TP
+.I "162 y1  a[+1]"
+Move right
+.I a
+units, and set
+.IR "y = a" .
+.TP
+.I "163 y2  a[+2]"
+Move right
+.I a
+units, and set
+.IR "y = a" .
+.TP
+.I "164 y3  a[+3]"
+Move right
+.I a
+units, and set
+.IR "y = a" .
+.TP
+.I "165 y4  a[+4]"
+Move right
+.I a
+units, and set
+.IR "y = a" .
+.TP
+.I "166 z0"
+Move right
+.I z
+units.
+.TP
+.I "167 z1  a[+1]"
+Move right
+.I a
+units, and set
+.IR "z = a" .
+.TP
+.I "168 z2  a[+2]"
+Move right
+.I a
+units, and set
+.IR "z = a" .
+.TP
+.I "169 z3  a[+3]"
+Move right
+.I a
+units, and set
+.IR "z = a" .
+.TP
+.I "170 z4  a[+4]"
+Move right
+.I a
+units, and set
+.IR "z = a" .
+.TP
+.I "171 fnt_num_0"
+Set current font number
+.IR "(f) = 0" .
+.TP
+.I .\|.\|.
+.TP
+.I "234 fnt_num_63"
+Set
+.IR "f = 63" .
+.TP
+.I "235 fnt1  k[1]"
+Set
+.IR "f = k" .
+.TP
+.I "236 fnt2  k[2]"
+Set
+.IR "f = k" .
+.TP
+.I "237 fnt3  k[3]"
+Set
+.IR "f = k" .
+.TP
+.I "238 fnt4  k[+4]"
+Set
+.IR "f = k" .
+.TP
+.I "239 xxx1  k[1]  x[k]"
+Special string
+.I x
+with
+.I k
+bytes.
+.TP
+.I "240 xxx2  k[2]  x[k]"
+Special string
+.I x
+with
+.I k
+bytes.
+.TP
+.I "241 xxx3  k[3]  x[k]"
+Special string
+.I x
+with
+.I k
+bytes.
+.TP
+.I "242 xxx4  k[4]  x[k]"
+Special string
+.I x
+with (unsigned)
+.I k
+bytes.
+.TP
+.I "243 fnt_def1  k[1] c[4] s[4] d[4] a[1] l[1] n[a+l]"
+Define font
+.IR k .
+The parameters are:
+.RS
+.TP \w'\fIm\fP'u+3n
+.I c
+Checksum for TFM file.
+.TP
+.I s
+Scale factor, in DVI units.
+.TP
+.I d
+Design size, in DVI units.
+.TP
+.I a
+Length of the ``area'' or directory.
+.TP
+.I l
+Length of the font name.
+.TP
+.I n
+Area and font name string(s).
+.RE
+.TP
+.I "244 fnt_def2  k[2] c[4] s[4] d[4] a[1] l[1] n[a+l]"
+Define font
+.IR k .
+.TP
+.I "245 fnt_def3  k[3] c[4] s[4] d[4] a[1] l[1] n[a+l]"
+Define font
+.IR k .
+.TP
+.I "246 fnt_def4  k[+4] c[4] s[4] d[4] a[1] l[1] n[a+l]"
+Define font
+.IR k .
+.TP
+.I "247 pre  i[1]  num[4]  den[4]  mag[4]  k[1]  x[k]"
+Begin preamble.  The parameters are:
+.RS
+.TP \w'\fInum\fP'u+3n
+.I i
+DVI format.  Standard \*(Te\& has
+.IR "ID = 2" ,
+and \*(Te\&-\*(Xe\& has
+.IR "ID = 3" .
+.TP
+.I num
+Numerator of 100 nm / DVI unit.
+.TP
+.I den
+Denominator of 100 nm / DVI unit.
+.TP
+.I mag
+1000 * magnification.
+.TP
+.I k
+Comment length.
+.TP
+.I x
+Comment string.
+.RE
+.TP
+.I "248 post  p[4] num[4] den[4] mag[4] l[4] u[4] s[2] t[2]"
+Begin postamble.  The parameters are:
+.RS
+.TP \w'\fInum\fP'u+3n
+.I p
+Pointer to final bop.
+.TP
+.I "num, den, mag"
+Duplicates of values in preamble.
+.TP
+.I l
+Height-plus-depth of tallest page, in DVI units.
+.TP
+.I u
+Width of widest page, in DVI units.
+.TP
+.I s
+Maximum stack depth needed to process this DVI file.
+.TP
+.I t
+Total number of pages
+.RI ( bop
+commands) present.
+.RE
+.TP
+.I "249 post_post  q[4] i[1] 223 .\|.\|. 223"
+End postamble.  The parameters are:
+.RS
+.TP \w'\fI223\fP'u+3n
+.I q
+Byte offset from the beginning of the DVI file to
+the
+.I post
+command that started the postamble.
+.TP
+.I i
+DVI format ID, as in the preamble.
+.TP
+.I
+223
+At least four
+.I 223
+bytes.
+.RE
+.TP
+.I "250"
+Undefined.
+.TP
+.I .\|.\|.
+.TP
+.I "255"
+Undefined.
+.\"======================================================================
+.SH "DTL COMMAND DESCRIPTION"
+A DTL file contains one line per command, with a
+limit of 1024 characters per line.  Each command
+contains a symbolic operation name, followed by
+zero or more parameter values.  The parameter
+value descriptions are not repeated here; they can
+be found in the previous section.
+.TP \w'\fIw0,_w1,_w2,_w3,_w4\fP'u+3n
+variety <variety-name>
+This command specifies the name of the DTL file
+type; it has no DVI file equivalent.
+.TP
+.I (text)
+Series of set_char commands, for printable ASCII text.
+.TP
+.I \e(
+Literal ASCII left parenthesis in (text).
+.TP
+.I \e)
+Literal ASCII right parenthesis in (text).
+.TP
+.I \e\e
+Literal ASCII backslash in (text).
+.TP
+.I \e"
+Literal ASCII double quote in (text).
+.TP
+.I \eXY
+Set_char for character with hexadecimal code XY,
+not in parentheses, but by itself for readability.
+.TP
+.I "s1, s2, s2, s3"
+Set, with (1,2,3,4)-byte charcodes.
+.TP
+.I sr
+.IR set_rule .
+.TP
+.I "p1, p2, p2, p3"
+Put, with (1,2,3,4)-byte charcodes.
+.TP
+.I pr
+.IR put_rule .
+.TP
+.I nop
+.I nop
+(do nothing).
+.TP
+.I bop
+.I bop
+(beginning of page).
+.TP
+.I eop
+.I eop
+(end of page).
+.TP
+.I [
+Push.
+.TP
+.I ]
+Pop.
+.TP
+.I "r1, r2, r3, r4"
+Right, with (1,2,3,4)-byte argument.
+.TP
+.I "w0, w1, w2, w3, w4"
+As in DVI.
+.TP
+.I "x0, x1, x2, x3, x4"
+As in DVI.
+.TP
+.I "d1, d2, d3, d4"
+Down, with (1,2,3,4)-byte argument.
+.TP
+.I "y0, y1, y2, y3, y4"
+As in DVI.
+.TP
+.I "z0, z1, z2, z3, z4"
+As in DVI.
+.TP
+.I fn
+.I fnt_num
+(set current font to font number in 0 to 63).
+.TP
+.I "f1, f2, f3, f4"
+.I fnt
+(set current font to (1,2,3,4)-byte font number).
+.TP
+.I special
+.I xxx
+(special commands with (1,2,3,4)-byte string length).
+.TP
+.I fd
+.I fnt_def
+(assign a number to a named font).
+.TP
+.I pre
+Preamble.
+.TP
+.I post
+.I post
+(begin postamble).
+.TP
+.I post_post
+.I post_post
+(end postamble).
+.TP
+.I opcode
+Undefined DVI command (250 to 255).
+.\"======================================================================
+.SH "SAMPLE DTL FILE"
+The following 2-line \*(Te\& file
+.RS
+.nf
+Hello.
+\ebye
+.fi
+.RE
+when processed with the commands
+.RS
+.nf
+tex hello.tex
+dv2dt hello.dvi hello.dtl
+.fi
+.RE
+produces this DTL file:
+.RS
+.nf
+variety sequences-6
+pre 2 25400000 473628672 1000 27 ' TeX output 1995.03.02:2334'
+bop 1 0 0 0 0 0 0 0 0 0 -1
+[
+d3 -917504
+]
+d4 42152922
+[
+d4 -41497562
+[
+r3 1310720
+fd1 0 11374260171 655360 655360 0 5 '' 'cmr10'
+fn0
+(Hello.)
+]
+]
+d3 1572864
+[
+r4 15229091
+(1)
+]
+eop
+post 42 25400000 473628672 1000 43725786 30785863 2 1
+fd1 0 11374260171 655360 655360 0 5 'cmr10'
+post_post 152 2 223 223 223 223
+.fi
+.RE
+The command
+.RS
+.nf
+dt2dv hello.dtl hello.dvi
+.fi
+.RE
+will reconstruct the original DVI file.
+.\"======================================================================
+.SH "SEE ALSO"
+.BR dt2dv (1),
+.BR dvitype (1),
+.BR tex (1).
+.\"======================================================================
+.SH FILES
+.TP \w'\fI*.dvi\fP'u+3n
+.I *.dvi
+binary \*(Te\& DVI file.
+.TP
+.I *.dtl
+text representation of a \*(Te\& DVI file in
+.I "DVI Text Language"
+format.
+.\"======================================================================
+.SH AUTHOR
+.B dv2dt
+and
+.BR dt2dv (1)
+were written by
+.RS
+.nf
+Geoffrey Tobin
+Department of Electronic Engineering
+La Trobe University
+Bundoora, Victoria 3083
+Australia
+Tel: +61 3 479 3736
+FAX: +61 3 479 3025
+Email: <G.Tobin@ee.latrobe.edu.au>
+.fi
+.RE
+.PP
+These manual pages were primarily written by
+.RS
+.nf
+Nelson H. F. Beebe, Ph.D.
+Center for Scientific Computing
+Department of Mathematics
+University of Utah
+Salt Lake City, UT 84112
+Tel: +1 801 581 5254
+FAX: +1 801 581 4148
+Email: <beebe@math.utah.edu>
+.fi
+.RE
+.\"==============================[The End]==============================
diff --git a/development/Win32/packaging/dtl/dvi.doc b/development/Win32/packaging/dtl/dvi.doc
new file mode 100644 (file)
index 0000000..738d871
--- /dev/null
@@ -0,0 +1,154 @@
+``dvi.doc''
+Mon 27 Feb 1995
+Geoffrey Tobin
+
+Description of the DVI file structure.
+--------------------------------------
+
+Reference:
+----------
+
+        CTAN:  dviware/driv-standard/level-0/dvistd0.tex
+
+    "The DVI Driver Standard, Level 0",
+    by  The TUG DVI Driver Standards Committee  (now defunct)
+    chaired by Joachim Schrod.
+    Appendix A, "Device-Independent File Format",
+    section A.2, "Summary of DVI commands".
+
+
+DVI Commands
+------------
+Listed in the free format:
+"Opcode  Symbol  Parameter[Signed? Bytes]  ...  Action".
+
+    
+    0    set_char_0    -  set character 0 from current font
+    ...
+    127  set_char_127  -  set character 127 from current font
+
+    128  set1  c[1]    -  set 1-byte unsigned character (uchar) number c
+    129  set2  c[2]    -  set 2-byte uchar number c
+    130  set3  c[3]    -  set 3-byte uchar number c
+    131  set4  c[+4]   -  set 4-byte signed character (schar) number c
+
+    132  set_rule  a[+4]  b[+4]  -  set rule, height a, width b
+
+    133  put1  c[1]   -  put 1-byte uchar c
+    134  put2  c[2]   -  put 2-byte uchar
+    135  put3  c[3]   -  put 3-byte uchar
+    136  put4  c[+4]  -  put 4-byte schar
+
+    137  put_rule  a[+4]  b[+4]  -  put rule, height a, width b
+
+    138  nop  -  do nothing
+
+    139  bop  c0[+4]  ...  c9[+4]  p[+4]  -  beginning of page
+    140  eop                              -  end of page
+
+    141  push  -  push (h,v,w,x,y,z) onto stack
+    142  pop   -  pop  (h,v,w,x,y,z) from stack
+
+    143  right1  b[+1]  -  move right b units
+    144  right2  b[+2]  -  move right b units
+    145  right3  b[+3]  -  move right b units
+    146  right4  b[+4]  -  move right b units
+
+    147  w0         -  move right w units
+    148  w1  b[+1]  -  move right b units, and set w = b
+    149  w2  b[+2]  -  move right b units, and set w = b
+    150  w3  b[+3]  -  move right b units, and set w = b
+    151  w4  b[+4]  -  move right b units, and set w = b
+
+    152  x0         -  move right x units
+    153  x1  b[+1]  -  move right b units, and set x = b
+    154  x2  b[+2]  -  move right b units, and set x = b
+    155  x3  b[+3]  -  move right b units, and set x = b
+    156  x4  b[+4]  -  move right b units, and set x = b
+
+    157  down1  a[+1]  -  move down a units
+    158  down2  a[+2]  -  move down a units
+    159  down3  a[+3]  -  move down a units
+    160  down4  a[+4]  -  move down a units
+
+    161  y0         -  move right y units
+    162  y1  a[+1]  -  move right a units, and set y = a
+    163  y2  a[+2]  -  move right a units, and set y = a
+    164  y3  a[+3]  -  move right a units, and set y = a
+    165  y4  a[+4]  -  move right a units, and set y = a
+
+    166  z0         -  move right z units
+    167  z1  a[+1]  -  move right a units, and set z = a
+    168  z2  a[+2]  -  move right a units, and set z = a
+    169  z3  a[+3]  -  move right a units, and set z = a
+    170  z4  a[+4]  -  move right a units, and set z = a
+
+    171  fnt_num_0    -  set current font number (f) = 0
+    ...
+    234  fnt_num_63   -  set f = 63
+
+    235  fnt1  k[1]   -  set f = k
+    236  fnt2  k[2]   -  set f = k
+    237  fnt3  k[3]   -  set f = k
+    238  fnt4  k[+4]  -  set f = k
+
+    239  xxx1  k[1]  x[k]  -  special string x with k bytes
+    240  xxx2  k[2]  x[k]  -  special string x with k bytes
+    241  xxx3  k[3]  x[k]  -  special string x with k bytes
+    242  xxx4  k[4]  x[k]  -  special string x with (unsigned) k bytes
+
+    243  fnt_def1  k[1] c[4] s[4] d[4] a[1] l[1] n[a+l]   -  define font k
+    244  fnt_def2  k[2] c[4] s[4] d[4] a[1] l[1] n[a+l]   -  define font k
+    245  fnt_def3  k[3] c[4] s[4] d[4] a[1] l[1] n[a+l]   -  define font k
+    246  fnt_def4  k[+4] c[4] s[4] d[4] a[1] l[1] n[a+l]  -  define font k
+
+    247  pre  i[1]  num[4]  den[4]  mag[4]  k[1]  x[k]  -  begin preamble
+
+    248  post  p[4] num[4] den[4] mag[4] l[4] u[4] s[2] t[2]  -  begin postamble
+    249  post_post  q[4] i[1] 223 ... 223                     -  end postamble
+
+    250  -  undefined
+    ...
+    255  -  undefined
+
+In bop:
+
+    c0[+4] ... c9[+4]  =  page counters, \`a la TeX.
+    p[+4]  =  pointer to previous bop (its byte address); first bop has p = -1 .
+
+In the font definitions:
+
+    c[4]  =  check sum for TFM file.
+    s[4]  =  scale factor, in DVI units.
+    d[4]  =  design size, in DVI units.
+    a[1]  =  length of the "area" or directory.
+    l[1]  =  length of the font name.
+    n[a+l]  =  area and font name string(s).
+
+In the preamble:
+
+    i[1]  =  DVI format ID  =  2, except  TeX-XeT  has  3.
+    num[4]  =  numerator   of 100 nm / DVI unit.
+    den[4]  =  denominator of 100 nm / DVI unit.
+    mag[4]  =  1000 * magnification.
+    k[1]  =  comment length.
+    x[k]  =  comment string.
+
+In the postamble:
+
+    p[4]  =  pointer to final bop.
+    num[4], den[4], mag[4]  =  duplicates of values in preamble.
+    l[4]  =  height-plus-depth of tallest page, in DVI units.
+    u[4]  =  width of widest page, in DVI units.
+    s[2]  =  maximum stack depth needed to process this DVI file.
+    t[2]  =  total number of pages (bop commands) present.
+
+In the post-postamble:
+
+    q[4]  =  pointer to the "post" command that started the postamble.
+    i[1]  =  DVI format ID, as in the preamble.
+    223 ... 223  =  at least four "223" bytes.
+
+---------------
+EOF ``dvi.doc''
+---------------
diff --git a/development/Win32/packaging/dtl/edited.txt b/development/Win32/packaging/dtl/edited.txt
new file mode 100644 (file)
index 0000000..05126d1
--- /dev/null
@@ -0,0 +1,3854 @@
+variety sequences-6
+pre 2 25400000 473628672 1000 27 '\'TeX output 1995.03.08:2032*ADDED_JUNK*'
+bop 1 0 0 0 0 0 0 0 0 0 -1
+[
+d3 -917504
+]
+d4 45941966
+[
+d4 -44998066
+[
+r4 8497024
+fd1 50 11374260171 1359216 655360 0 5 '~/test/pl/' 'cmr10'
+fn50
+(T)
+[
+r3 -226584
+d3 292608
+(E)
+]
+r3 528538
+(Xnical)
+r3 453072
+(T)
+r3 -37758
+(yp)
+r3 37757
+(esetting)
+]
+d3 6662197
+[
+fd1 23 3274421126 655360 655360 0 6 '' 'cmbx10'
+fn23
+(What)
+w3 251220
+(is)
+w0
+(T)
+[
+r3 -125636
+d3 145635
+(E)
+]
+r3 275315
+(X?)
+]
+z3 1291389
+[
+r3 1310720
+fd1 0 11374260171 655360 655360 0 5 '' 'cmr10'
+fn0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w3 287604
+(\(pronounced)
+w0
+(\\tec)
+x2 -18205
+(k\"\))
+w0
+(is)
+w0
+(a)
+w0
+(computerized)
+w0
+(t)
+x0
+(yp)
+r2 18205
+(esetting)
+w0
+(system)
+w0
+(dev)
+x0
+(elop)
+r2 18205
+(ed)
+w0
+(b)
+x0
+(y)
+w0
+(Donald)
+w0
+(Kn)
+x0
+(uth)
+w0
+(and)
+]
+y3 786432
+[
+(others)
+w3 223564
+(at)
+w0
+(Stanford)
+w0
+(Univ)
+w2 -18205
+(ersit)
+w0
+(y)
+r3 -54614
+(.)
+r3 306603
+(It)
+w3 223564
+(is)
+w0
+(used)
+w0
+(to)
+w0
+(create)
+w0
+(high-qualit)
+x2 -18205
+(y)
+w0
+(do)
+r2 18205
+(cumen)
+x0
+(ts,)
+r3 224841
+(particularly)
+w0
+(those)
+w0
+(con)
+x0
+(taining)
+]
+y0
+[
+(mathematics.)
+r3 372135
+(The)
+w3 245408
+(name)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(is)
+w0
+(an)
+w0
+(upp)
+r2 18205
+(ercase)
+w0
+(form)
+w0
+(of)
+w0
+(the)
+w0
+(Greek)
+w0
+(letters)
+w0
+fd1 6 1350061076 655360 655360 0 6 '' 'cmmi10'
+fn6
+\1C
+r3 74183
+\0F
+\1F
+fn0
+(,)
+r3 252146
+(the)
+w0
+\0C
+(rst)
+w0
+(three)
+w0
+(letters)
+w0
+(of)
+w0
+(a)
+]
+y0
+[
+(Greek)
+w3 211436
+(w)
+x2 -18205
+(ord)
+w0
+(meaning)
+w0
+fd1 33 16053430112 655360 655360 0 6 '' 'cmsl10'
+fn33
+(art)
+w0
+fn0
+(as)
+w0
+(w)
+x0
+(ell)
+w0
+(as)
+w0
+fn33
+(tec)
+x0
+(hnology)
+fn0
+(.)
+r3 288932
+(The)
+w0
+(lo)
+x0
+(w)
+x0
+(ering)
+w0
+(of)
+w0
+(the)
+w0
+(\\E\")
+r3 211429
+(is)
+w0
+(a)
+w0
+(reminder)
+w0
+(that)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(is)
+w0
+(ab)
+r2 18205
+(out)
+]
+y0
+[
+(t)
+w2 -18205
+(yp)
+x2 18205
+(esetting,)
+r3 231398
+(whic)
+w0
+(h)
+w3 228809
+(can)
+w0
+(b)
+x0
+(e)
+w0
+(though)
+r2 -18205
+(t)
+w0
+(of)
+w0
+(as)
+w0
+(the)
+w0
+(next)
+w0
+(stage)
+w0
+(b)
+x0
+(ey)
+x2 -18205
+(ond)
+w0
+(w)
+x0
+(ord)
+w0
+(pro)
+r2 18205
+(cessing.)
+r3 322338
+(On)
+w0
+(devices)
+w0
+(where)
+w0
+(suc)
+x0
+(h)
+]
+y0
+[
+(lo)
+w2 -18205
+(w)
+w0
+(ering)
+w3 218453
+(is)
+w0
+(di)
+\0E
+(cult)
+w0
+(or)
+w0
+(imp)
+r2 18205
+(ossible)
+w0
+(y)
+x2 -18205
+(ou)
+w0
+(ma)
+x0
+(y)
+w0
+(see)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(written)
+w0
+(as)
+w0
+fd1 29 33772436170 655360 655360 0 6 '' 'cmtt10'
+fn29
+(TeX)
+fn0
+(.)
+]
+z0
+[
+r3 1310720
+(Most)
+w3 289550
+(w)
+x2 -18205
+(ord)
+w0
+(pro)
+r2 18205
+(cessors)
+w0
+(allo)
+x0
+(w)
+w0
+(y)
+x0
+(ou)
+w0
+(to)
+w0
+(create)
+w0
+(and)
+w0
+(mo)
+x2 18205
+(dify)
+w0
+(a)
+w0
+(do)
+x0
+(cumen)
+x2 -18205
+(t)
+w0
+(in)
+x0
+(teractiv)
+x0
+(ely)
+w0
+(|)
+w0
+(what)
+w0
+(y)
+x0
+(ou)
+w0
+(see)
+]
+y0
+[
+(on)
+w3 278277
+(the)
+w0
+(screen)
+w0
+(is)
+w0
+(usually)
+w0
+(what)
+w0
+(y)
+x2 -18205
+(our)
+w0
+(output)
+w0
+(will)
+w0
+(lo)
+r2 18205
+(ok)
+w0
+(lik)
+x0
+(e.)
+r3 470743
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(do)
+r2 18205
+(es)
+w0
+fd1 36 37500023472 655360 655360 0 6 '' 'cmti10'
+fn36
+(not)
+w0
+fn0
+(w)
+x0
+(ork)
+w0
+(in)
+w0
+(this)
+w0
+(w)
+x0
+(a)
+x0
+(y)
+r3 -54614
+(.)
+r3 470743
+(Lik)
+x0
+(e)
+w0
+(other)
+]
+y0
+[
+(t)
+x2 -18205
+(yp)
+r2 18205
+(esetting)
+w3 233773
+(systems)
+w0
+(\(suc)
+x0
+(h)
+w0
+(as)
+w0
+(SCRIBE)
+r3 233758
+(and)
+w0
+fn33
+(tro)
+\0B
+r3 126826
+fn0
+(\),)
+r3 237603
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(is)
+w0
+(kno)
+x0
+(wn)
+w0
+(as)
+w0
+(a)
+w0
+(\\do)
+r2 18205
+(cumen)
+x0
+(t)
+w0
+(compiler\".)
+r3 337231
+(Using)
+w0
+(y)
+x0
+(our)
+]
+y0
+[
+(fa)
+w2 -18205
+(v)
+w0
+(ourite)
+w3 208726
+(text)
+w0
+(editor)
+w0
+(y)
+x2 -18205
+(ou)
+w0
+(need)
+w0
+(to)
+w0
+(create)
+w0
+(a)
+w0
+\0C
+(le)
+w0
+(con)
+x0
+(taining)
+w0
+(the)
+w0
+(text)
+w0
+(of)
+w0
+(y)
+x0
+(our)
+w0
+(man)
+x0
+(uscript)
+w0
+(along)
+w0
+(with)
+w0
+(the)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+]
+y0
+[
+(t)
+x2 -18205
+(yp)
+r2 18205
+(esetting)
+w3 180582
+(commands.)
+r3 278648
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(giv)
+x0
+(es)
+w0
+(y)
+x0
+(ou)
+w0
+(the)
+w0
+(abilit)
+x0
+(y)
+w0
+(to)
+w0
+(pro)
+r2 18205
+(duce)
+w0
+(prin)
+x0
+(ted)
+w0
+(matter)
+w0
+(with)
+w0
+(a)
+w0
+(qualit)
+x0
+(y)
+w0
+(matc)
+x0
+(hing)
+w0
+(that)
+]
+y0
+[
+(found)
+w3 229642
+(in)
+w0
+(b)
+w2 18205
+(o)
+w0
+(oks,)
+r3 232439
+(dep)
+w0
+(ending)
+w3 229642
+(on)
+w0
+(the)
+w0
+(output)
+w0
+(device.)
+r3 324837
+(Adelaide)
+w0
+(Univ)
+w2 -18205
+(ersit)
+w0
+(y)
+w3 229642
+(has)
+w0
+(an)
+w0
+fd1 43 21413374024 655360 655360 0 7 '' 'cmcsc10'
+fn43
+(ima)
+r2 -14564
+(gen)
+w0
+fn0
+(laser)
+w0
+(prin)
+r2 -18205
+(ter)
+w0
+(with)
+]
+y0
+[
+(a)
+w3 253600
+(resolution)
+w0
+(of)
+w0
+(240)
+w0
+(dots)
+w0
+(p)
+r2 18205
+(er)
+w0
+(inc)
+x2 -18205
+(h.)
+r3 396711
+(This)
+w0
+(publication)
+w0
+(sho)
+x0
+(ws)
+w0
+(b)
+r2 18205
+(oth)
+w0
+(the)
+w0
+(capabilities)
+w0
+(of)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(and)
+w0
+(the)
+w0
+(output)
+]
+y0
+[
+(qualit)
+x2 -18205
+(y)
+w3 218453
+(of)
+w0
+(the)
+w0
+(laser)
+w0
+(prin)
+x0
+(ter.)
+]
+d3 2000498
+[
+fn23
+(F)
+r3 -62805
+(on)
+r2 -20935
+(ts)
+]
+z0
+[
+r3 1310720
+fn0
+(One)
+w3 191328
+(of)
+w0
+(the)
+w0
+(more)
+w0
+(ob)
+x2 -18205
+(vious)
+w0
+(adv)
+r3 -36409
+(an)
+x0
+(tages)
+w0
+(of)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(is)
+w0
+(the)
+w0
+(large)
+w0
+(range)
+w0
+(of)
+w0
+(fon)
+x0
+(ts)
+w0
+(from)
+w0
+(whic)
+x0
+(h)
+w0
+(y)
+x0
+(ou)
+w0
+(can)
+w0
+(c)
+x0
+(ho)
+r2 18205
+(ose.)
+r3 282230
+(A)
+]
+y0
+[
+(fon)
+x2 -18205
+(t)
+w3 184195
+(is)
+w0
+(a)
+w0
+(collection)
+w0
+(of)
+w0
+(c)
+x0
+(haracters)
+w0
+(eac)
+x0
+(h)
+w0
+(ha)
+x0
+(ving)
+w0
+(a)
+w0
+(similar)
+w0
+(size)
+w0
+(and)
+w0
+(st)
+x0
+(yle.)
+r3 279852
+(Some)
+w0
+(of)
+w0
+(the)
+w0
+(fon)
+x0
+(ts)
+w0
+(curren)
+x0
+(tly)
+w0
+(a)
+x0
+(v)
+r3 -36409
+(ailable)
+]
+y0
+[
+(include:)
+]
+y3 1398888
+[
+[
+w3 1542753
+(roman)
+w0
+fn33
+(slan)
+r2 -18205
+(ted)
+w0
+fn36
+(italic)
+w0
+fn23
+(b)
+r2 20935
+(oldface)
+w0
+fn29
+(typewriter)
+w0
+fd1 19 15510736522 655360 655360 0 6 '' 'cmss10'
+fn19
+(sans)
+r3 218453
+(serif)
+w0
+fn43
+(small)
+r3 247578
+(caps)
+]
+]
+y0
+[
+fn0
+(Man)
+x2 -18205
+(y)
+w3 218453
+(of)
+w0
+(these)
+w0
+(also)
+w0
+(come)
+w0
+(in)
+w0
+(a)
+w0
+(v)
+r3 -36409
+(ariet)
+x0
+(y)
+w0
+(of)
+w0
+(sizes:)
+]
+d3 1749323
+[
+[
+r3 5158746
+fn50
+(from)
+w3 453072
+(the)
+w0
+(v)
+r3 -37758
+(ery)
+w0
+(big)
+fn0
+(,)
+x3 436906
+fd1 1 15755105707 589824 589824 0 4 '' 'cmr9'
+fn1
+(to)
+w3 202068
+(the)
+w0
+(v)
+r2 -16839
+(ery)
+w0
+(small)
+fn0
+(,)
+x0
+fd1 5 20600715532 327680 327680 0 4 '' 'cmr5'
+fn5
+(to)
+w3 154740
+(the)
+w0
+(ridiculous)
+fn0
+(.)
+]
+]
+y0
+[
+(Apart)
+w3 195079
+(from)
+w0
+(a)
+w0
+(large)
+w0
+(selection)
+w0
+(of)
+w0
+(mathematical)
+w0
+(sym)
+w2 -18205
+(b)
+x2 18205
+(ols,)
+r3 199754
+(man)
+w0
+(y)
+w3 195079
+(sp)
+x0
+(ecial)
+w0
+(c)
+x2 -18205
+(haracters)
+w0
+(and)
+w0
+(accen)
+x0
+(ts)
+w0
+(are)
+w0
+(a)
+x0
+(v)
+r3 -36409
+(ailable:)
+]
+y0
+[
+[
+[
+[
+[
+[
+[
+[
+r3 1427428
+d2 -19753
+(c)
+]
+]
+]
+[
+[
+[
+r3 1245383
+fd1 12 4110426232 655360 655360 0 6 '' 'cmsy10'
+fn12
+\0D
+]
+]
+]
+]
+]
+[
+r3 3146127
+fn36
+($)
+]
+[
+[
+r3 4895543
+fn12
+(x)
+]
+]
+[
+[
+r3 6432199
+({)
+]
+]
+[
+[
+r3 8078080
+(y)
+]
+]
+[
+[
+r4 9614734
+(z)
+]
+]
+[
+r4 11151388
+\0E
+]
+[
+r4 12724452
+\0D
+]
+[
+r4 14625196
+( )
+]
+[
+r4 16525940
+(!)
+]
+[
+r4 18426684
+(4)
+]
+[
+r4 20254610
+(|)
+]
+[
+r4 22009719
+fn0
+\12
+r3 -327681
+(a)
+]
+[
+r4 23564578
+\13
+r3 -309476
+(e)
+]
+[
+r4 25119437
+\18
+r3 -291271
+(c)
+]
+[
+r4 26656091
+(^)
+r3 -327681
+(o)
+]
+[
+r4 28247360
+\7F
+r3 -345886
+(u)
+]
+]
+]
+]
+y0
+[
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w3 193975
+(do)
+r2 18205
+(es)
+w0
+(a)
+w0
+(few)
+w0
+(subtle)
+w0
+(things)
+w0
+(automatically)
+r3 -54614
+(.)
+r3 283112
+(Certain)
+w0
+(sequences)
+w0
+(of)
+w0
+(c)
+x2 -18205
+(haracters)
+w0
+(in)
+w0
+(y)
+x0
+(our)
+w0
+(text)
+w0
+(will)
+w0
+(b)
+r2 18205
+(e)
+w0
+(replaced)
+]
+y3 786432
+[
+(b)
+x2 -18205
+(y)
+w3 195273
+fn33
+(ligatures)
+w0
+fn0
+(in)
+w0
+(the)
+w0
+(prin)
+x0
+(ted)
+w0
+(output)
+w0
+(\(consider)
+w0
+(the)
+w0
+(\\)
+fn29
+(ffi)
+fn0
+(\")
+w0
+(in)
+w0
+(\\di)
+\0E
+(cult\"\),)
+r3 199910
+(while)
+w0
+(other)
+w0
+(pairs)
+w0
+(of)
+w0
+(c)
+x0
+(haracters)
+w0
+(need)
+]
+y0
+[
+(to)
+w3 240111
+(b)
+x2 18205
+(e)
+w0
+fn33
+(k)
+r2 -18205
+(erned)
+w0
+fn0
+(\(e.g.,)
+r3 245525
+(the)
+w0
+(\\o\")
+w0
+(and)
+w0
+(\\x\")
+w0
+(in)
+w0
+(\\b)
+x0
+(o)
+r2 -18205
+(x\")
+w0
+(lo)
+x0
+(ok)
+w0
+(b)
+x0
+(etter)
+w0
+(if)
+w0
+(they)
+w0
+(are)
+w0
+(mo)
+w2 -18205
+(v)
+w0
+(ed)
+w3 240111
+(closer)
+w0
+(together\).)
+r3 356245
+(The)
+w0
+(range)
+]
+y0
+[
+(and)
+w3 218453
+(qualit)
+x2 -18205
+(y)
+w0
+(of)
+w0
+(fon)
+x0
+(ts)
+w0
+(a)
+x0
+(v)
+r3 -36409
+(ailable)
+w0
+(will)
+w0
+(con)
+x0
+(tin)
+x0
+(ue)
+w0
+(to)
+w0
+(impro)
+x0
+(v)
+x0
+(e.)
+]
+d3 2000498
+[
+fn23
+(Mathematics)
+]
+z0
+[
+r3 1310720
+fn0
+(A)
+r3 270774
+(ma)
+r3 36408
+(jor)
+w3 270827
+(design)
+w0
+(goal)
+w0
+(of)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(w)
+x2 -18205
+(as)
+w0
+(to)
+w0
+(simplify)
+w0
+(the)
+w0
+(task)
+w0
+(of)
+w0
+(t)
+x0
+(yp)
+r2 18205
+(esetting)
+w0
+(mathematics)
+w0
+(|)
+w0
+(and)
+w0
+(to)
+w0
+(do)
+w0
+(it)
+]
+y0
+[
+(prop)
+x2 18205
+(erly)
+r3 -54614
+(.)
+r3 356376
+(Mathematicians)
+w3 240155
+(will)
+w0
+(b)
+x0
+(e)
+w0
+(pleasan)
+x2 -18205
+(tly)
+w0
+(surprised)
+w0
+(at)
+w0
+(the)
+w0
+(ease)
+w0
+(with)
+w0
+(whic)
+x0
+(h)
+w0
+(form)
+x0
+(ulae)
+w0
+(and)
+w0
+(expressions)
+]
+y0
+[
+(can)
+w3 171378
+(b)
+r2 18205
+(e)
+w0
+(created;)
+r3 187070
+(from)
+w0
+(simple)
+w0
+(in-line)
+w0
+(equations)
+w0
+(suc)
+r2 -18205
+(h)
+w0
+(as)
+w0
+fn6
+(e)
+[
+d3 -237825
+fd1 9 6031313562 458752 458752 0 5 '' 'cmmi7'
+fn9
+(i)
+\19
+]
+r3 723155
+fn0
+(=)
+x3 182040
+fn12
+\00
+fn0
+(1)
+w0
+(and)
+w0
+fn6
+(f)
+[
+d3 98303
+fn9
+(n)
+fd1 3 33144720122 458752 458752 0 4 '' 'cmr7'
+fn3
+(+2)
+]
+r3 1202329
+fn0
+(=)
+x0
+fn6
+(f)
+[
+d3 98303
+fn9
+(n)
+fn3
+(+1)
+]
+r3 1071773
+fn0
+(+)
+r3 51484
+fn6
+(f)
+[
+d3 98303
+fn9
+(n)
+]
+r3 356734
+fn0
+(,)
+r3 180793
+(to)
+w0
+(more)
+w0
+(extra)
+w2 -18205
+(v)
+r3 -36409
+(agan)
+w0
+(t)
+]
+y0
+[
+(displa)
+r2 -18205
+(ys:)
+]
+d3 1283093
+[
+[
+[
+[
+r4 9051774
+d3 -622596
+fd1 18 37254272422 655360 655360 0 6 '' 'cmex10'
+fn18
+(X)
+]
+]
+d3 788255
+[
+r4 9044832
+fn9
+(k)
+r2 11074
+fd1 15 11710361205 458752 458752 0 5 '' 'cmsy7'
+fn15
+\15
+fn3
+(1)
+]
+]
+[
+[
+r4 10114572
+d3 -606895
+fn18
+(p)
+]
+[
+r4 10769933
+d3 -606895
+pr 26213 2515167
+d3 606895
+[
+fn6
+(x)
+[
+d3 98303
+fn9
+(k)
+]
+r3 468080
+fn12
+\00
+[
+r3 145632
+fn0
+(ln)
+]
+r3 800991
+fn6
+(k)
+]
+]
+]
+r4 14122501
+fn12
+(6)
+fn0
+(=)
+[
+r3 837401
+d3 -892025
+fn18
+(Z)
+]
+[
+d3 -730007
+[
+r3 1492762
+fn15
+(1)
+]
+d3 1327120
+[
+r3 1201491
+fn3
+(0)
+]
+]
+[
+[
+[
+d3 -443356
+[
+r3 2235866
+fn6
+(e)
+[
+d3 -237825
+fn15
+\00
+fn9
+(x)
+[
+d3 -197774
+fn5
+(3)
+]
+]
+r3 1140965
+fn0
+(+)
+[
+[
+r3 145632
+d3 -472040
+fn12
+(p)
+]
+[
+r3 691767
+d3 -472040
+pr 26213 374556
+d3 472040
+[
+fn6
+(x)
+]
+]
+]
+]
+r3 2235866
+d3 292622
+pr 26213 3022167
+d3 703781
+[
+[
+[
+r2 29925
+fn0
+(\()
+]
+r3 284788
+(123)
+w3 145632
+fn12
+\00
+w0
+fn6
+(x)
+[
+fn0
+(\))
+]
+]
+[
+r3 2698240
+d3 -329502
+fn3
+(3)
+]
+]
+]
+]
+]
+r3 5445900
+fn6
+(dx)
+]
+d3 1840951
+[
+fn0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w3 234265
+(lo)
+r2 18205
+(oks)
+w0
+(after)
+w0
+(most)
+w0
+(of)
+w0
+(the)
+w0
+(nitt)
+x2 -18205
+(y)
+w0
+(gritt)
+x0
+(y)
+w0
+(details,)
+r3 238217
+(suc)
+x0
+(h)
+w0
+(as)
+w0
+(spacing)
+w0
+(things)
+w0
+(correctly)
+w0
+(and)
+w0
+(c)
+x0
+(ho)
+r2 18205
+(osing)
+w0
+(the)
+w0
+(righ)
+x0
+(t)
+]
+y0
+[
+(sizes)
+w3 219059
+(for)
+w0
+(sup)
+x2 18205
+(erscripts,)
+w3 219210
+(paren)
+r2 -18205
+(theses,)
+w0
+(square)
+w3 219059
+(ro)
+x0
+(ot)
+w0
+(signs)
+w0
+(etc.)
+r3 293088
+(\(The)
+w0
+(disco)
+w2 -18205
+(v)
+w0
+(erer)
+w3 219059
+(of)
+w0
+(the)
+w0
+(ab)
+x0
+(o)
+w2 -18205
+(v)
+w0
+(e)
+w3 219059
+(relation)
+w0
+(wishes)
+w0
+(to)
+]
+y0
+[
+(remain)
+r3 218453
+(anon)
+r2 -18205
+(ymous.\))
+]
+]
+d3 1572864
+[
+r4 14755470
+(1)
+]
+eop
+bop 2 0 0 0 0 0 0 0 0 0 42
+[
+d3 -917504
+]
+d4 45941966
+[
+d4 -45286606
+[
+fn23
+(Alignmen)
+r2 -20935
+(t)
+]
+z3 1310720
+[
+r3 1310720
+fn0
+(The)
+w3 233605
+(preparation)
+w0
+(of)
+w0
+(tabular)
+w0
+(material)
+w0
+(suc)
+r2 -18205
+(h)
+w0
+(as)
+w0
+(in)
+w0
+(lists)
+w0
+(and)
+w0
+(matrices)
+w0
+(can)
+w0
+(b)
+x2 18205
+(e)
+w0
+(a)
+w0
+(tedious)
+w0
+(job)
+w0
+(for)
+w0
+(a)
+w0
+(p)
+x0
+(erson)
+]
+y3 786432
+[
+(armed)
+w3 246414
+(only)
+w0
+(with)
+w0
+(a)
+w0
+(t)
+r2 -18205
+(yp)
+x2 18205
+(ewriter)
+w0
+(and)
+w0
+(a)
+w0
+(b)
+x0
+(ottle)
+w0
+(of)
+w0
+(correction)
+w0
+\0D
+(uid.)
+r3 375153
+(With)
+w0
+(a)
+w0
+(little)
+w0
+(help)
+w0
+(from)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X,)
+w0
+(computers)
+]
+y0
+[
+(can)
+w3 218453
+(mak)
+x2 -18205
+(e)
+w0
+(it)
+w0
+(so)
+w0
+(m)
+x0
+(uc)
+x0
+(h)
+w0
+(easier:)
+]
+d3 4351589
+[
+[
+r3 1026505
+d3 -3473407
+pr 26214 16577003
+z3 557056
+[
+[
+d3 229376
+sr 786432 26214
+]
+[
+r3 4548394
+(Oldest)
+x3 218453
+(pla)
+w2 -18205
+(y)
+w0
+(ers)
+x0
+(to)
+x0
+(represen)
+w0
+(t)
+]
+[
+r4 16550791
+d3 229376
+sr 786432 26214
+]
+]
+y0
+[
+[
+d3 229376
+sr 786432 26214
+]
+[
+r3 4814178
+(England)
+w3 218453
+(in)
+w0
+(a)
+w0
+(T)
+r3 -54614
+(est)
+w0
+(Matc)
+r2 -18205
+(h)
+]
+[
+r4 16550791
+d3 229376
+sr 786432 26214
+]
+]
+y3 255590
+pr 26214 16577003
+z0
+[
+[
+d3 229376
+sr 786432 26214
+]
+[
+r3 2004253
+(Name)
+]
+[
+r3 5638900
+d3 229376
+sr 786432 26214
+]
+[
+r3 7203972
+(Age)
+]
+[
+r4 9853302
+d3 229376
+sr 786432 26214
+]
+[
+r4 12282175
+(V)
+r3 -54614
+(ersus)
+]
+[
+r4 16550791
+d3 229376
+sr 786432 26214
+]
+]
+y0
+pr 26214 16577003
+z0
+[
+[
+d3 229376
+sr 786432 26214
+]
+[
+r3 836891
+(W.Rho)
+r2 18205
+(des)
+]
+[
+r3 5638900
+d3 229376
+sr 786432 26214
+]
+[
+r3 6475791
+(52y)
+r3 218453
+(165d)
+]
+[
+r4 9853302
+d3 229376
+sr 786432 26214
+]
+[
+r4 10690193
+(W)
+r3 -54614
+(est)
+w3 218453
+(Indies,)
+w0
+(1930)
+]
+[
+r4 16550791
+d3 229376
+sr 786432 26214
+]
+]
+y0
+pr 26214 16577003
+z0
+[
+[
+d3 229376
+sr 786432 26214
+]
+[
+r3 836891
+(W.G.Grace)
+]
+[
+r3 5638900
+d3 229376
+sr 786432 26214
+]
+[
+r3 6475791
+(50y)
+r3 218453
+(320d)
+]
+[
+r4 9853302
+d3 229376
+sr 786432 26214
+]
+[
+r4 11383780
+(Australia,)
+r3 218453
+(1899)
+]
+[
+r4 16550791
+d3 229376
+sr 786432 26214
+]
+]
+y0
+pr 26214 16577003
+z0
+[
+[
+d3 229376
+sr 786432 26214
+]
+[
+r3 836891
+(G.Gunn)
+]
+[
+r3 5638900
+d3 229376
+sr 786432 26214
+]
+[
+r3 6475791
+(50y)
+r3 218453
+(303d)
+]
+[
+r4 9853302
+d3 229376
+sr 786432 26214
+]
+[
+r4 10690193
+(W)
+r3 -54614
+(est)
+w3 218453
+(Indies,)
+w0
+(1929)
+]
+[
+r4 16550791
+d3 229376
+sr 786432 26214
+]
+]
+y0
+pr 26214 16577003
+z0
+[
+[
+d3 229376
+sr 786432 26214
+]
+[
+r3 836891
+(J.Southerton)
+fn1
+(*)
+]
+[
+r3 5638900
+d3 229376
+sr 786432 26214
+]
+[
+r3 6475791
+fn0
+(49y)
+r3 218453
+(139d)
+]
+[
+r4 9853302
+d3 229376
+sr 786432 26214
+]
+[
+r4 11383780
+(Australia,)
+r3 218453
+(1877)
+]
+[
+r4 16550791
+d3 229376
+sr 786432 26214
+]
+]
+y0
+pr 26214 16577003
+d3 753664
+[
+[
+fn1
+(*)
+w3 202068
+(\(This)
+w0
+(w)
+r2 -16839
+(as)
+w0
+(actually)
+w0
+(his)
+w0
+(T)
+r3 -50517
+(est)
+w0
+(debut.\))
+]
+]
+]
+r4 19971651
+fn6
+(A)
+w3 182040
+fn0
+(=)
+[
+[
+d3 -1710506
+[
+w0
+fn18
+(0)
+]
+d3 1153446
+[
+w0
+(B)
+]
+d3 393220
+[
+w0
+(B)
+]
+d3 419433
+[
+w0
+(@)
+]
+]
+[
+d3 -1361692
+[
+[
+r3 966613
+fn6
+(a)
+[
+d3 98303
+fn3
+(11)
+]
+]
+[
+r3 2727444
+fn6
+(a)
+[
+d3 98303
+fn3
+(12)
+]
+]
+[
+[
+r3 4386367
+fn6
+(:)
+w3 109224
+(:)
+w0
+(:)
+]
+]
+[
+r3 5908219
+(a)
+[
+d3 98303
+fn3
+(1)
+fn9
+(n)
+]
+]
+]
+y0
+[
+[
+r3 966613
+fn6
+(a)
+[
+d3 98303
+fn3
+(21)
+]
+]
+[
+r3 2727444
+fn6
+(a)
+[
+d3 98303
+fn3
+(22)
+]
+]
+[
+[
+r3 4386367
+fn6
+(:)
+w3 109224
+(:)
+w0
+(:)
+]
+]
+[
+r3 5908219
+(a)
+[
+d3 98303
+fn3
+(2)
+fn9
+(n)
+]
+]
+]
+d3 1150519
+[
+[
+[
+d3 -524288
+[
+r3 1326418
+fn0
+(.)
+]
+y3 262144
+[
+r3 1326418
+(.)
+]
+y0
+[
+r3 1326418
+(.)
+]
+]
+]
+[
+[
+d3 -524288
+[
+r3 3087249
+(.)
+]
+y3 262144
+[
+r3 3087249
+(.)
+]
+y0
+[
+r3 3087249
+(.)
+]
+]
+]
+[
+[
+[
+d3 -458752
+[
+r3 4422775
+(.)
+]
+]
+[
+r3 4677636
+d3 -262144
+(.)
+]
+[
+r3 4932497
+d3 -65536
+(.)
+]
+]
+]
+[
+[
+d3 -524288
+[
+r3 6299389
+(.)
+]
+y3 262144
+[
+r3 6299389
+(.)
+]
+y0
+[
+r3 6299389
+(.)
+]
+]
+]
+]
+y0
+[
+[
+r3 864705
+fn6
+(a)
+[
+d3 98303
+fn9
+(m)
+fn3
+(1)
+]
+]
+[
+r3 2625536
+fn6
+(a)
+[
+d3 98303
+fn9
+(m)
+fn3
+(2)
+]
+]
+[
+[
+r3 4386367
+fn6
+(:)
+w3 109224
+(:)
+w0
+(:)
+]
+]
+[
+r3 5806311
+(a)
+[
+d3 98303
+fn9
+(mn)
+]
+]
+]
+y0
+]
+[
+d3 -1710506
+[
+r3 7083736
+fn18
+(1)
+]
+d3 1153446
+[
+r3 7083736
+(C)
+]
+d3 393220
+[
+r3 7083736
+(C)
+]
+d3 419433
+[
+r3 7083736
+(A)
+]
+]
+]
+]
+d3 5003308
+[
+fn23
+(Other)
+r3 251220
+(features)
+]
+z0
+[
+r3 1310720
+fn0
+(Space)
+w3 276499
+(do)
+x2 18205
+(es)
+w0
+(not)
+w0
+(p)
+x0
+(ermit)
+w0
+(examples)
+w0
+(of)
+w0
+(all)
+w0
+(the)
+w0
+(things)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(can)
+w0
+(do.)
+r3 465410
+(Here)
+w0
+(are)
+w0
+(some)
+w0
+(more)
+w0
+(features)
+w0
+(y)
+r2 -18205
+(ou)
+]
+y0
+[
+(migh)
+w2 -18205
+(t)
+x3 218453
+(lik)
+w0
+(e)
+x0
+(to)
+x0
+(kno)
+w0
+(w)
+x0
+(ab)
+r2 18205
+(out:)
+]
+z0
+[
+[
+r3 655359
+fn12
+\0F
+]
+r3 1310720
+fn0
+(Multi-column)
+w3 218453
+(output)
+w0
+(can)
+w0
+(b)
+r2 18205
+(e)
+w0
+(generated.)
+]
+y0
+[
+[
+r3 655359
+fn12
+\0F
+]
+r3 1310720
+fn0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w3 161606
+(has)
+w0
+(a)
+w0
+(v)
+x2 -18205
+(ery)
+w0
+(sophisticated)
+w0
+(paragraph)
+w0
+(building)
+w0
+(algorithm)
+w0
+(and)
+w0
+(rarely)
+w0
+(needs)
+w0
+(to)
+w0
+(resort)
+w0
+(to)
+w0
+(h)
+x0
+(yphenation.)
+]
+y0
+[
+r3 1310720
+(P)
+x2 -18205
+(aragraphs)
+w3 218453
+(can)
+w0
+(b)
+r2 18205
+(e)
+w0
+(inden)
+x0
+(ted)
+w0
+(and)
+w0
+(shap)
+r2 18205
+(ed)
+w0
+(in)
+w0
+(man)
+x0
+(y)
+w0
+(di)
+\0B
+(eren)
+x0
+(t)
+w0
+(w)
+x0
+(a)
+x0
+(ys.)
+]
+y0
+[
+[
+r3 655359
+fn12
+\0F
+]
+r3 1310720
+fn0
+(Automatic)
+w3 218453
+(insertion)
+w0
+(of)
+w0
+(fo)
+x2 18205
+(otnotes,)
+[
+fn12
+(y)
+]
+r3 509724
+fn0
+(running)
+w0
+(heads,)
+w0
+(page)
+w0
+(n)
+w2 -18205
+(um)
+w0
+(b)
+x0
+(ers)
+r3 218453
+(etc.)
+]
+y0
+[
+[
+r3 655359
+fn12
+\0F
+]
+r3 1310720
+fn0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w3 247230
+(mak)
+x2 -18205
+(es)
+w0
+(pro)
+x0
+(vision)
+w0
+(for)
+w0
+(generating)
+w0
+(a)
+w0
+(table)
+w0
+(of)
+w0
+(con)
+x0
+(ten)
+x0
+(ts,)
+r3 254424
+(a)
+w0
+(bibliograph)
+x0
+(y)
+r3 -54614
+(,)
+r3 254424
+(ev)
+x0
+(en)
+w0
+(an)
+w0
+(index.)
+r3 377602
+(Automatic)
+]
+y0
+[
+r3 1310720
+(section)
+x3 218453
+(n)
+w2 -18205
+(um)
+w0
+(b)
+w2 18205
+(ering)
+x0
+(and)
+x0
+(cross)
+x0
+(referencing)
+x0
+(are)
+x0
+(also)
+x0
+(p)
+w0
+(ossible.)
+]
+y0
+[
+[
+r3 655359
+fn12
+\0F
+]
+r3 1310720
+fn0
+(A)
+r3 189261
+(p)
+r2 18205
+(o)
+w2 -18205
+(w)
+w0
+(erful)
+w3 189289
+(macro)
+w0
+(facilit)
+x2 -18205
+(y)
+w0
+(is)
+w0
+(built)
+w0
+(in)
+x0
+(to)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X.)
+w0
+(This)
+w0
+(lets)
+w0
+(y)
+x0
+(ou)
+w0
+(do)
+w0
+(some)
+w0
+(v)
+x0
+(ery)
+w0
+(useful)
+w0
+(things,)
+r3 195122
+(lik)
+x0
+(e)
+w0
+(creating)
+w0
+(an)
+]
+y0
+[
+r3 1310720
+(abbreviation)
+w3 207360
+(for)
+w0
+(a)
+w0
+(commonly)
+w0
+(used)
+w0
+(phrase,)
+r3 209578
+(or)
+w0
+(de)
+\0C
+(ning)
+w0
+(a)
+w0
+(new)
+w0
+(command)
+w0
+(that)
+w0
+(will)
+w0
+(ha)
+w2 -18205
+(v)
+w0
+(e)
+w3 207360
+(v)
+r3 -36409
+(arying)
+w0
+(e)
+\0B
+(ects)
+]
+y0
+[
+r3 1310720
+(dep)
+r2 18205
+(ending)
+w3 273457
+(on)
+w0
+(the)
+w0
+(parameters)
+w0
+(it)
+w0
+(is)
+w0
+(giv)
+x2 -18205
+(en.)
+r3 456282
+(A)
+r3 273401
+(macro)
+w0
+(pac)
+x0
+(k)
+r3 -36409
+(age)
+w0
+(can)
+w0
+(enhance)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(b)
+x0
+(y)
+w0
+(making)
+w0
+(it)
+w0
+(m)
+x0
+(uc)
+x0
+(h)
+]
+y0
+[
+r3 1310720
+(easier)
+w3 218453
+(to)
+w0
+(generate)
+w0
+(a)
+w0
+(do)
+r2 18205
+(cumen)
+r2 -18205
+(t)
+w0
+(in)
+w0
+(a)
+w0
+(prede)
+\0C
+(ned)
+w0
+(format.)
+]
+d3 2097152
+[
+fn23
+(What)
+w3 251220
+(CAN'T)
+w0
+(T)
+[
+r3 -125636
+d3 145635
+(E)
+]
+r3 275315
+(X)
+w0
+(do?)
+]
+z0
+[
+r3 1310720
+fn0
+(Complex)
+w3 242946
+(graphics)
+w0
+(suc)
+x2 -18205
+(h)
+w0
+(as)
+w0
+(diagrams)
+w0
+(and)
+w0
+(illustrations)
+w0
+(p)
+r2 18205
+(ose)
+w0
+(a)
+w0
+(ma)
+r3 36408
+(jor)
+w0
+(problem)
+w0
+(|)
+w0
+(at)
+w0
+(the)
+w0
+(momen)
+x0
+(t)
+w0
+(y)
+x0
+(ou)
+]
+y0
+[
+(ha)
+w2 -18205
+(v)
+w0
+(e)
+w3 243107
+(to)
+w0
+(lea)
+w2 -18205
+(v)
+w0
+(e)
+w3 243107
+(an)
+w0
+(appropriate)
+w0
+(amoun)
+r2 -18205
+(t)
+w0
+(of)
+w0
+(blank)
+w0
+(space)
+w0
+(and)
+w0
+(paste)
+w0
+(them)
+w0
+(in)
+w0
+(later.)
+r3 365233
+(Graphic)
+w0
+(facilities)
+w0
+(are)
+w0
+(the)
+]
+y0
+[
+(sub)
+r3 36408
+(ject)
+w3 218453
+(of)
+w0
+(curren)
+x2 -18205
+(t)
+w0
+(researc)
+x0
+(h.)
+]
+d3 2097152
+[
+fn23
+(T)
+[
+r3 -125636
+d3 145635
+(E)
+]
+r3 275315
+(X)
+w3 251220
+(and)
+w0
+(V)
+r3 -83740
+(AX/VMS)
+]
+z0
+[
+r3 1310720
+fn0
+(The)
+w3 185026
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(source)
+w0
+\0C
+(le)
+w0
+(used)
+w0
+(to)
+w0
+(generate)
+w0
+(this)
+w0
+(do)
+r2 18205
+(cumen)
+x2 -18205
+(t)
+w0
+(is)
+w0
+(a)
+x0
+(v)
+r3 -36409
+(ailable)
+w0
+(for)
+w0
+(insp)
+r2 18205
+(ection)
+w0
+(on)
+w0
+(an)
+x0
+(y)
+w0
+(V)
+r3 -72819
+(AX)
+r3 184993
+(no)
+r2 18205
+(de)
+w0
+(that)
+]
+y0
+[
+(has)
+w3 218453
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X|)
+w0
+(just)
+w0
+(t)
+x2 -18205
+(yp)
+r2 18205
+(e)
+w0
+(`)
+fn29
+(scroll)
+r3 344061
+(tex_inputs:example.tex)
+fn0
+('.)
+r3 291271
+(A)
+w0
+(few)
+w0
+(steps)
+w0
+(are)
+w0
+(needed)
+w0
+(to)
+w0
+(prin)
+x0
+(t)
+w0
+(suc)
+x0
+(h)
+w0
+(a)
+w0
+\0C
+(le:)
+]
+z0
+[
+[
+r3 145633
+(\(1\))
+]
+r3 1310720
+(T)
+r2 -18205
+(yp)
+x2 18205
+(e)
+w3 221172
+(`)
+fn29
+(tex)
+r3 344061
+(example)
+fn0
+(')
+w0
+(to)
+w0
+(\\compile\")
+w0
+(the)
+w0
+\0C
+(le.)
+r3 299428
+(\(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(lo)
+x0
+(oks)
+w0
+(for)
+w0
+(a)
+w0
+fn29
+(.tex)
+w0
+fn0
+\0C
+(le)
+w0
+(b)
+r2 -18205
+(y)
+w0
+(default.)
+r3 299428
+(If)
+w0
+(it)
+w0
+(can't)
+w0
+\0C
+(nd)
+w0
+(the)
+]
+y0
+[
+r3 1310720
+(giv)
+x2 -18205
+(en)
+w3 194490
+\0C
+(le)
+w0
+(in)
+w0
+(y)
+x0
+(our)
+w0
+(curren)
+x0
+(t)
+w0
+(directory)
+w0
+(it)
+w0
+(will)
+w0
+(lo)
+r2 18205
+(ok)
+w0
+(in)
+w0
+fn29
+(tex_inputs)
+fn0
+(.\))
+r3 283284
+(Tw)
+x0
+(o)
+w0
+(new)
+w0
+\0C
+(les)
+w0
+(will)
+w0
+(b)
+r2 18205
+(e)
+w0
+(created)
+w0
+(in)
+w0
+(y)
+x0
+(our)
+]
+y0
+[
+r3 1310720
+(curren)
+x2 -18205
+(t)
+w3 231698
+(directory:)
+r3 317761
+fn29
+(example.dvi)
+w0
+fn0
+(and)
+w0
+fn29
+(example.lis)
+fn0
+(.)
+r3 331007
+(The)
+w0
+(former)
+w0
+(is)
+w0
+(a)
+w0
+(device)
+w0
+(indep)
+r2 18205
+(enden)
+x0
+(t)
+w0
+(description)
+]
+y0
+[
+r3 1310720
+(of)
+w3 218453
+(the)
+w0
+(do)
+r2 18205
+(cumen)
+r2 -18205
+(t;)
+w0
+(the)
+w0
+(latter)
+w0
+(is)
+w0
+(simply)
+w0
+(a)
+w0
+(log)
+w0
+(of)
+w0
+(the)
+w0
+(T)
+[
+r3 -109250
+d3 141084
+(E)
+]
+r3 254840
+(X)
+w0
+(run.)
+]
+y0
+[
+[
+r3 145633
+(\(2\))
+]
+r3 1310720
+(T)
+r2 -18205
+(yp)
+x2 18205
+(e)
+w3 186484
+(`)
+fn29
+(dvitovdu)
+r3 344061
+(example)
+fn0
+(')
+w0
+(to)
+w0
+(preview)
+w0
+(the)
+w0
+(do)
+x0
+(cumen)
+r2 -18205
+(t)
+w0
+(on)
+w0
+(a)
+w0
+(terminal)
+w0
+(screen.)
+r3 280615
+(This)
+w0
+(program)
+w0
+(can)
+w0
+(b)
+x0
+(e)
+w0
+(used)
+]
+y0
+[
+r3 1310720
+(to)
+w3 218453
+(detect)
+w0
+(a)
+w0
+(v)
+r3 -36409
+(ariet)
+x2 -18205
+(y)
+w0
+(of)
+w0
+(formatting)
+w0
+(problems,)
+w0
+(sa)
+x0
+(ving)
+w0
+(b)
+x2 18205
+(oth)
+w0
+(time)
+w0
+(and)
+w0
+(pap)
+x0
+(er.)
+]
+y0
+[
+[
+r3 145633
+(\(3\))
+]
+r3 1310720
+(T)
+x2 -18205
+(yp)
+r2 18205
+(e)
+w3 263820
+(`)
+fn29
+(imprint)
+r3 344061
+(example)
+fn0
+(')
+w0
+(to)
+w0
+(prin)
+x0
+(t)
+w0
+(the)
+w0
+(do)
+r2 18205
+(cumen)
+x0
+(t.)
+r3 427373
+(\(Note)
+w0
+(that)
+w0
+(the)
+w0
+(D)
+x0
+(VIto)
+r3 -98300
+(VDU)
+x3 263775
+(and)
+w0
+(IMPRINT)
+x0
+(com-)
+]
+y0
+[
+r3 1310720
+(mands)
+w3 218453
+(accept)
+w0
+(a)
+w0
+fn29
+(.dvi)
+w0
+fn0
+\0C
+(le)
+w0
+(b)
+r2 -18205
+(y)
+w0
+(default\).)
+]
+z0
+[
+r3 1310720
+(Detailed)
+w3 218453
+(help)
+w0
+(on)
+w0
+(all)
+w0
+(these)
+w0
+(commands)
+w0
+(is)
+w0
+(a)
+x2 -18205
+(v)
+r3 -36409
+(ailable)
+w0
+(on-line)
+w0
+(|)
+w0
+(try)
+w0
+(t)
+x0
+(yping)
+w0
+(`)
+fn29
+(help)
+r3 344061
+(tex)
+fn0
+(')
+w0
+(to)
+w0
+(get)
+w0
+(started.)
+]
+d3 4533411
+pr 26214 9472573
+d3 727450
+[
+[
+[
+r3 691769
+fn12
+(y)
+]
+]
+r3 1310720
+fn1
+(Here)
+w3 202068
+(is)
+w0
+(a)
+w0
+(fo)
+r2 16839
+(otnote.)
+]
+]
+d3 1572864
+[
+r4 14755470
+fn0
+(2)
+]
+eop
+post 4784 25400000 473628672 1000 47514830 29838620 9 2
+fd1 50 11374260171 1359216 655360 0 5 '' 'cmr10'
+fd1 43 21413374024 655360 655360 0 7 '' 'cmcsc10'
+fd1 36 37500023472 655360 655360 0 6 '' 'cmti10'
+fd1 33 16053430112 655360 655360 0 6 '' 'cmsl10'
+fd1 29 33772436170 655360 655360 0 6 '' 'cmtt10'
+fd1 23 3274421126 655360 655360 0 6 '' 'cmbx10'
+fd1 19 15510736522 655360 655360 0 6 '' 'cmss10'
+fd1 18 37254272422 655360 655360 0 6 '' 'cmex10'
+fd1 15 11710361205 458752 458752 0 5 '' 'cmsy7'
+fd1 12 4110426232 655360 655360 0 6 '' 'cmsy10'
+fd1 9 6031313562 458752 458752 0 5 '' 'cmmi7'
+fd1 6 1350061076 655360 655360 0 6 '' 'cmmi10'
+fd1 5 20600715532 327680 327680 0 4 '' 'cmr5'
+fd1 3 33144720122 458752 458752 0 4 '' 'cmr7'
+fd1 1 15755105707 589824 589824 0 4 '' 'cmr9'
+fd1 0 11374260171 655360 655360 0 5 '' 'cmr10'
+post_post 9603 2 223 223 223 223 223 223 223
diff --git a/development/Win32/packaging/dtl/example.tex b/development/Win32/packaging/dtl/example.tex
new file mode 100644 (file)
index 0000000..858ad3b
--- /dev/null
@@ -0,0 +1,232 @@
+% This is the TeX source file for the "TeXnical Typesetting" document.
+% Notice how you can put in comments?  If TeX sees a % it simply ignores
+% the rest of the line.
+
+% A4 paper is 8.3in wide and 11.7in high; we set the page dimensions so that
+% there are 1in margins all around:
+\hsize 6.3in                           % page width
+\vsize 9.7in                           % page height
+
+\parskip 8pt plus 2pt minus 1pt        % glue before a paragraph
+
+% Define a few extra fonts for later use:
+\font\bigrm=cmr10 scaled\magstep4      % big version of the standard roman font
+\font\ninerm=cmr9                      % 9pt roman
+\font\fiverm=cmr5                      % 5pt roman
+\font\sm=cmcsc10                       % caps and small caps
+\font\ss=cmss10                        % sans serif
+
+% Here's a macro that we'll use to produce all subheadings:
+\def\subhead#1{\bigskip                % extra glue before subheading
+               \noindent{\bf #1}\par   % unindented boldface subheading
+               \nobreak}               % prevent a page break after subheading
+
+\centerline{\bigrm \TeX nical Typesetting}
+
+\vskip 2.5cm                           % dimensions can be metric
+
+\subhead{What is \TeX?}
+
+\TeX\ (pronounced ``teck'') is a computerized typesetting system developed by
+Donald Knuth and others at Stanford University.  It is used to create
+high-quality documents, particularly those containing mathematics.
+The name \TeX\ is an uppercase form of the Greek letters $\tau\epsilon\chi$,
+the first three letters of a Greek word meaning {\sl art} as well as
+{\sl technology}.
+The lowering of the ``E'' is a reminder that \TeX\ is about typesetting,
+which can be thought of as the next stage beyond word processing.
+On devices where such lowering is difficult or impossible you may see \TeX\
+written as {\tt TeX}.
+
+% the above blank line ends the first paragraph
+
+Most word processors allow you to
+create and modify a document interactively --- what
+you see on the screen is usually what your output will look like.
+\TeX\ does {\it not} work in this way.
+Like other typesetting systems (such as SCRIBE and
+{\sl troff\/}), \TeX\ is known as a ``document compiler''.  Using your
+favourite text editor you need to create a file containing the
+text of your manuscript along with the \TeX\ typesetting commands.
+\TeX\ gives you the ability to produce printed matter with a quality
+matching that found in books, depending on the output device.
+Adelaide University has an {\sm imagen} laser printer
+with a resolution of 240 dots per inch.
+This publication shows both the capabilities of \TeX\ and
+the output quality of the laser printer.
+
+\subhead{Fonts}
+
+One of the more obvious advantages of \TeX\ is the large range of fonts from
+which you can choose.  A font is a collection of characters each having a
+similar size and style.  Some of the fonts currently available include:
+$$        % enter display math mode just to get space above and below \line
+\line
+  {\hfil  % infinitely stretchable glue
+   \rm roman\hfil  \sl slanted\hfil  \it italic\hfil  \bf boldface\hfil
+   \tt typewriter\hfil  \ss sans serif\hfil  \sm small caps\hfil
+  }       % take care to ensure each { has a matching }
+$$
+Many of these also come in a variety of sizes:
+$$
+\centerline{{\bigrm from the very big},~         % extra space after comma
+              {\ninerm to the very small},~
+                {\fiverm to the ridiculous}.}
+$$
+Apart from a large selection of mathematical symbols,
+many special characters and accents are available:
+$$
+\vbox
+  {\tabskip 10pt plus 1fil   % glue before and after all columns
+   \halign to\hsize
+     {& \hfil#\hfil\cr       % specify a variable number of centred columns
+      \copyright& \it\$& \S& \P& \dag& \ddag&
+        $\circ$& $\bigcirc$&   % some symbols must be accessed from math mode
+          $\leftarrow$& $\rightarrow$& $\triangle$& $\clubsuit$&
+            \`a& \'e& \c c& \^o& \"u\cr
+     }
+  }
+$$
+\TeX\ does a few subtle things automatically.
+Certain sequences of characters in your text will
+be replaced by {\sl ligatures} in the printed output (consider the ``{\tt ffi}''
+in ``difficult''), while other pairs of characters need to be {\sl kerned}
+(e.g., the ``o'' and ``x'' in ``box'' look better if they are moved closer
+together).  The range and quality of fonts available will continue to improve.
+
+\subhead{Mathematics}
+
+A major design goal of \TeX\ was to simplify the task of typesetting
+mathematics --- and to do it properly.  Mathematicians will be pleasantly
+surprised at the ease with which formulae and expressions can be created;
+from simple in-line equations
+such as $e^{i\pi}=-1$ and $f_{n+2}=f_{n+1}+f_n$, to more extravagant displays:
+$$
+\sum_{k\ge1} \sqrt{x_k-\ln k}\quad\ne\quad
+\int_{0}^\infty {e^{-x^3}+\sqrt{x} \over \left(123-x\right)^3} \,dx
+$$
+\TeX\ looks after most of the nitty gritty details, such as spacing things
+correctly and choosing the right sizes for superscripts, parentheses,
+square root signs etc.  (The discoverer of the above relation wishes to
+remain anonymous.)
+
+\subhead{Alignment}
+
+The preparation of tabular material such as in lists and matrices can be a
+tedious job for a person armed only with a typewriter and a bottle of
+correction fluid.  With a little help from \TeX, computers can make it so
+much easier:
+$$
+\vcenter                               % a vertically centred \vbox
+  {\tabskip 0pt                        % no space before column 1
+   \halign to 3.5in                    % width of table
+     {\strut#&                         % col 1 is a strut
+       \vrule#\tabskip .5em plus2em&   % col 2 is a vrule; also set col spacing
+        #\hfil&                        % col 3 is left justified
+         \vrule#&                      % col 4 is a vrule
+          \hfil#\hfil&                 % col 5 is centred
+           \vrule#&                    % col 6 is a vrule
+            \hfil#&                    % col 7 is right justified
+             \vrule#\tabskip 0pt       % col 8 is a vrule; no space after it
+              \cr                      % end of the preamble
+      \noalign{\hrule}
+      & & \multispan5 \hfil Oldest players to represent\hfil& \cr
+      & & \multispan5 \hfil England in a Test Match\hfil& \cr
+      \noalign{\hrule}
+      & & \omit\hfil Name\hfil& &      % \omit ignores template in preamble
+            \omit\hfil Age\hfil& &
+              \omit\hfil Versus\hfil& \cr
+      \noalign{\hrule}
+      & & W.Rhodes& & 52y 165d& & West Indies, 1930& \cr
+      \noalign{\hrule}
+      & & W.G.Grace& & 50y 320d& & Australia, 1899& \cr
+      \noalign{\hrule}
+      & & G.Gunn& & 50y 303d& & West Indies, 1929& \cr
+      \noalign{\hrule}
+      & & J.Southerton{\ninerm*}& & 49y 139d& & Australia, 1877& \cr
+      \noalign{\hrule\smallskip}
+      & \multispan7\ninerm* (This was actually his Test debut.)\hfil \cr
+     }
+  }
+\hskip .5in           % space between table and matrix
+A=\pmatrix            % parenthesized matrix
+    {a_{11}& a_{12}& \ldots& a_{1n}\cr
+     a_{21}& a_{22}& \ldots& a_{2n}\cr
+     \vdots& \vdots& \ddots& \vdots\cr
+     a_{m1}& a_{m2}& \ldots& a_{mn}\cr
+    }
+$$
+
+\vskip -\the\belowdisplayskip      % avoid too much space below display
+
+\subhead{Other features}
+
+Space does not permit examples of all the things \TeX\ can do.  Here are some
+more features you might like to know about:
+
+\item{$\bullet$}
+Multi-column output can be generated.
+
+{\parskip=0pt       % temporarily turn off the skipping between paragraphs
+\item{$\bullet$}
+\TeX\ has a very sophisticated paragraph building algorithm and rarely needs
+to resort to hyphenation.  Paragraphs can be indented and shaped in many
+different ways.
+
+\item{$\bullet$}
+Automatic insertion of footnotes,\footnote{\dag}{\ninerm Here is
+a footnote.} running heads, page numbers etc.
+
+\item{$\bullet$}
+\TeX\ makes provision for generating a table of contents, a bibliography, even
+an index.  Automatic section numbering and cross referencing are also possible.
+
+\item{$\bullet$}
+A powerful macro facility is built into \TeX.  This lets you do some very
+useful things, like creating an abbreviation for a commonly used phrase, or
+defining a new command that will have varying effects depending on the
+parameters it is given.  A macro package can enhance \TeX\ by making it much
+easier to generate a document in a predefined format.
+\par                % end the last paragraph BEFORE ending the group
+}                   % \parskip will now revert to its previous value
+
+\subhead{What CAN'T \TeX\ do?}
+
+Complex graphics such as diagrams and illustrations pose
+a major problem --- at the moment you have to leave an appropriate amount of
+blank space and paste them in later.
+Graphic facilities are the subject of current research.
+
+\subhead{\TeX\ and VAX/VMS}
+
+The \TeX\ source file used to generate this document is available for
+inspection on any VAX node that has \TeX ---
+just type `{\tt scroll tex\char'137 inputs:example.tex}'.
+A few steps are needed to print such a file:
+
+\item{(1)}
+Type `{\tt tex example}' to ``compile'' the file.
+(\TeX\ looks for a {\tt .tex} file by default.  If it can't find the given
+file in your current directory it will look in {\tt tex\char'137 inputs}.)
+Two new files will be created in your current directory:
+{\tt example.dvi} and {\tt example.lis}.
+The former is a device independent description of the document;
+the latter is simply a log of the \TeX\ run.
+
+{\parskip=0pt    % temporarily turn off \parskip
+\item{(2)}
+Type `{\tt dvitovdu example}' to preview the document on a terminal screen.
+This program can be used to detect a variety of formatting problems,
+saving both time and paper.
+
+\item{(3)}
+Type `{\tt imprint example}' to print the document.
+(Note that the DVIto\kern-.15em VDU and IMPRINT commands
+accept a {\tt .dvi} file by default).
+
+}                % restore \parskip
+
+Detailed help on all these commands is available on-line --- try typing
+`{\tt help tex}' to get started.
+
+\bye
diff --git a/development/Win32/packaging/dtl/hello.tex b/development/Win32/packaging/dtl/hello.tex
new file mode 100644 (file)
index 0000000..63f8d53
--- /dev/null
@@ -0,0 +1,2 @@
+Hello.
+\bye
diff --git a/development/Win32/packaging/dtl/man2ps b/development/Win32/packaging/dtl/man2ps
new file mode 100644 (file)
index 0000000..8d0f230
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Filter for converting "troff -mxx" to PostScript.  This script is
+# normally linked to the names man2ps, ms2ps, me2ps, and mm2ps.
+#
+# Usage:
+#      man2ps [<] cc.1   >cc.ps
+#      me2ps  [<] foo.me >foo.ps
+#      mm2ps  [<] foo.mm >foo.ps
+#      ms2ps  [<] foo.ms >foo.ps
+#
+# [08-May-1993]
+
+# Choose a troff format according to the scrip name.
+case `basename $0` in
+       man*)   FORMAT=-man ;;
+       me*)    FORMAT=-me ;;
+       mm*)    FORMAT=-mm ;;
+       ms*)    FORMAT=-ms ;;
+       *)      echo "Unknown troff format:" ; exit 1 ;;
+esac
+
+# We can use either GNU groff or Sun Solaris troff + dpost
+if [ -x /usr/local/bin/groff ]
+then   # GNU groff
+       TROFF="groff $FORMAT"
+       TROFF2PS="cat"
+elif [ -x /usr/lib/lp/postscript/dpost ]
+then   # Solaris 2.1
+       TROFF="troff $FORMAT"
+       TROFF2PS="/usr/lib/lp/postscript/dpost"
+else
+       echo "Cannot find troff-to-PostScript filter"
+       exit 1
+fi
+
+tbl $* | eqn | $TROFF | $TROFF2PS
diff --git a/development/Win32/packaging/dtl/tripvdu.tex b/development/Win32/packaging/dtl/tripvdu.tex
new file mode 100644 (file)
index 0000000..e8b9254
--- /dev/null
@@ -0,0 +1,279 @@
+% TeX source file for creating TRIPVDU.DVI, a torture file for DVItoVDU
+% (using the same philosophy as Donald Knuth's torture test for TeX).
+
+\nopagenumbers
+\topskip 0pt
+\parindent 0pt
+\parskip 0pt
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 1
+% This page is completely empty but has some \special stuff.
+
+\message{Empty page.}
+\null
+\special{DVItoVDU should warn user that it is ignoring this stuff.}
+\special{And this.}
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 2
+% This page has 1 black pixel at (0,0).
+
+\message{1 black pixel at (0,0).}
+\hrule height 1sp width 1sp depth 0sp
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 3
+% This page will fill an A4 sheet with black pixels, assuming A4 paper is
+% 8.3in by 11.7in and (0,0) is 1in from the top and left edges.
+
+\message{A4 sheet full of black pixels.}
+{% change page size and location temporarily
+\hsize 10in
+\vsize 12in
+\hoffset -1in
+\voffset -1in
+% Because ref pts of rules are at BOTTOM left corner we first need to output
+% a rule that will guarantee Minv = -1in, then output the large rule with
+% slightly less than A4 height.
+\hrule height 1sp      width 8.299in depth 0sp
+\hrule height 11.695in width 8.299in depth 0sp
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 4
+% This page is 1 pixel wider than page 3.
+% DVItoVDU should detect that page is too wide for A4 paper.
+
+\message{As above but 1 pixel too wide.}
+\hrule height 1sp      width 8.301in depth 0sp
+\hrule height 11.695in width 8.301in depth 0sp
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 5
+% This page is 1 pixel longer than page 3.
+% DVItoVDU should detect that page is too low for A4 paper.
+
+\message{As above but 1 pixel too low.}
+\hrule height 11.701in width 8.299in depth 0sp
+\vfil\eject
+
+}% reset page size and location
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 6
+% This page has a rulelist with a full ruletable (= 300 rules).
+% Note that DVItoVDU does not impose any limits
+% on the number of rules or characters in a page.  Pages 6 to 9
+% test the list manipulating code in DVIReader and DVItoVDU.
+
+\message{Page with ruletablesize rules.}
+\newcount\temp
+\temp=300
+\loop\ifnum\temp>0
+   \hrule height 1sp width \hsize   % 1 pixel high
+   \vfil
+   \advance\temp by -1
+\repeat
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 7
+% This page has ruletablesize+1 rules (so rulelist has 2 nodes).
+
+\message{Page with ruletablesize+1 rules.}
+\temp=301
+\loop\ifnum\temp>0
+   \hrule height 1sp width \hsize   % 1 pixel high
+   \vfil
+   \advance\temp by -1
+\repeat
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 8
+% This page has a charlist with a full chartable (= 3000 characters).
+
+\message{Page with chartablesize characters from one font.}
+\font\small=cmr5
+{\small \offinterlineskip
+ \temp=30
+ \loop\ifnum\temp>0
+    \leftline{iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+              iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii} % 100 chars
+    \advance\temp by -1
+ \repeat
+}
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 9
+% This page has chartablesize+1 characters (so charlist has 2 nodes).
+
+\message{Page with chartablesize+1 characters from one font.}
+{\small \offinterlineskip
+ \temp=30
+ \loop\ifnum\temp>0
+    \leftline{iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+              iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii} % 100 chars
+    \advance\temp by -1
+ \repeat
+ \leftline{i}                      % the extra character
+}
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 10
+
+\message{Multiple TeX page counters.}
+\footline={\hss\tenrm\folio\hss}   % turn on page numbers
+\pageno=0
+\count1=1 \count2=2 \count3=3 \count4=4  \count9=9
+\noindent
+This is \TeX\ page [0.1.2.3.4.....9].
+\vfil\eject
+
+\count1=0 \count2=0 \count3=0 \count4=0  \count9=0   % reset TeX counters
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 11
+
+\message{Negative TeX page.}
+\pageno=-11
+\noindent
+This is \TeX\ page [-11].
+\vfil\eject
+
+\pageno=12         % DVI page = TeX page again
+\nopagenumbers     % turn off page numbers again
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 12
+% This page has characters from many fonts.
+% Note that the page is off the right edge of A4 paper.
+
+\message{Page with characters from many fonts.}
+% avoid redefining plain TeX's \i, \j etc.
+\font\Fb=cmr5
+\font\Fc=cmr5 scaled\magstep5
+\font\Fe=cmr10 scaled\magstep5
+\font\Fg=cmbx10
+\font\Fh=cmbx10 scaled\magstep5
+\font\Fj=cmsl10
+\font\Fk=cmsl10 scaled\magstep5
+\font\Fm=cmtt10
+\font\Fn=cmtt10 scaled\magstep5
+\font\Fo=cmss10
+\font\Fp=cmcsc10
+\font\Fq=cmdunh10
+
+\leftline{\Fb These characters are from CMR5 at mag 1000.}
+\leftline{\Fc These characters are from CMR5 at mag 2488.}
+\leftline{\tenrm These characters are from CMR10 at mag 1000.}
+\leftline{\Fe These characters are from CMR10 at mag 2488.}
+\leftline{\Fg These characters are from CMBX10 at mag 1000.}
+\leftline{\Fh These characters are from CMBX10 at mag 2488.}
+\leftline{\Fj These characters are from CMSL10 at mag 1000.}
+\leftline{\Fk These characters are from CMSL10 at mag 2488.}
+\leftline{\Fm These characters are from CMTT10 at mag 1000.}
+\leftline{\Fn These characters are from CMTT10 at mag 2488.}
+\leftline{\Fo These characters are from CMSS10 at mag 1000.}
+\leftline{\Fp These characters are from CMCSC10 at mag 1000.}
+\leftline{\Fq These characters are from CMDUNH10 at mag 1000.}
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 13
+% This page has characters from many fonts, some of which have no corresponding
+% PXL file.  DVItoVDU should warn user about non-existent font files and
+% continue as best it can by loading dummy font info.
+% Note that the page is off the right edge of A4 paper.
+
+\message{Page with characters from fonts at unknown magnifications.}
+% PXL files do not exist at the requested magnifications:
+\font\Fr=cmr5 scaled 500
+\font\Fs=cmr5 scaled 3000
+\font\Ft=cmr10 scaled 200
+\font\Fu=cmr10 scaled 5000
+\font\Fv=cmsl10 scaled 49
+\font\Fw=cmsl10 scaled 10000
+
+\leftline{\Fr CMR5 at mag 500 does not exist.}
+\leftline{\Fb These characters are from CMR5 at mag 1000.}
+\leftline{\Fs CMR5 at mag 3000 does not exist.}
+\leftline{\Ft CMR10 at mag 200 does not exist.}
+\leftline{\tenrm These characters are from CMR10 at mag 1000.}
+\leftline{\Fu CMR10 at mag 5000 does not exist.}
+\leftline{\Fv CMSL10 at mag 49 does not exist.}
+\leftline{\Fj These characters are from CMSL10 at mag 1000.}
+\leftline{\Fw CMSL10 at mag 10000 does not exist.}
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 14
+% This page has a paragraph illustrating most of the characters from the
+% standard roman TeX text font.
+
+\message{Standard paragraph.}
+\rm
+Our task is to create a paragraph illustrating what a typical piece of text
+looks like in the standard \TeX\ font.  It should be stressed that not all
+\TeX\ fonts can be used for typesetting text.  We need to show most of the
+characters in this font---for instance, something like ``the quick brown fox
+jumps over a lazy dog'' would use all the lower-case letters.  Hmmm \dots\
+how about ``THE QUICK BROWN FOX JUMPS OVER 9876543210 LAZY DOGS'' to make
+sure we show all the upper-case letters and digits?  Such a paragraph would
+hardly be typical!  Then there's ligatures (try and fit in words like
+fluffy, waffle, firefly, difficult) and examples of kerning (boxer, cooked,
+vowel).  Not to mention the various accents and other special letters:
+prot\'eg\'e, r\^ole, na\"\i ve, \AE sop's \OE vres en fran\c cais.
+But how do we put all this stuff into a paragraph that makes sense!?
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 15
+
+\message{Page in bottom half of A4 paper.}
+\null\vfil
+\centerline{Page in bottom half of A4 paper.}
+\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 16
+
+\message{Page completely above left of A4 paper.}
+\voffset -3in
+\hoffset -9in
+\leftline{Page completely above left of A4 paper.}
+\vfil\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 17
+
+\message{Page completely below right of A4 paper.}
+\voffset 3in
+\hoffset 9in
+\null\vfil
+\rightline{Page completely below right of A4 paper.}
+\eject
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% DVI page 18
+
+\message{Page beyond all edges of A4 paper.}
+\voffset -3in
+\hoffset -3in
+\vsize 15in
+\hsize 15in
+\line{Page beyond all edges of A4 paper.\hfil
+      Page beyond all edges of A4 paper.}
+\vfil
+\line{Page beyond all edges of A4 paper.\hfil
+      Page beyond all edges of A4 paper.}
+\eject
+\voffset 0in \hoffset 0in       % offsets back to normal
+
+\bye
diff --git a/development/Win32/packaging/icons/lyx.svg b/development/Win32/packaging/icons/lyx.svg
new file mode 100644 (file)
index 0000000..9d49776
--- /dev/null
@@ -0,0 +1,433 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   id="svg1"
+   sodipodi:version="0.32"
+   inkscape:version="0.39cvs"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   width="128.00000pt"
+   height="128.00000pt"
+   sodipodi:docbase="/home/andy/Desktop/etiquette-icons-0.4/scalable/apps"
+   sodipodi:docname="TeX.svg">
+  <defs
+     id="defs3">
+    <linearGradient
+       id="linearGradient1806">
+      <stop
+         style="stop-color:#000000;stop-opacity:0.40677965;"
+         offset="0.0000000"
+         id="stop1807" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.073446326;"
+         offset="0.64777780"
+         id="stop3276" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.0000000;"
+         offset="1.0000000"
+         id="stop1808" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1518">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.74226803;"
+         offset="0.0000000"
+         id="stop1519" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.0000000;"
+         offset="1.0000000"
+         id="stop1520" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1512">
+      <stop
+         style="stop-color:#000000;stop-opacity:0.54639173;"
+         offset="0.0000000"
+         id="stop1513" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.0000000;"
+         offset="1.0000000"
+         id="stop1514" />
+    </linearGradient>
+    <pattern
+       width="130.00000"
+       height="96.000000"
+       id="pattern903">
+      <image
+         xlink:href="/home/andy/Desktop/lux.png"
+         sodipodi:absref="/home/andy/Desktop/lux.png"
+         width="130.00000"
+         height="96.000000"
+         id="image904" />
+    </pattern>
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1515"
+       x1="0.14117648"
+       y1="0.17073171"
+       x2="0.74117649"
+       y2="0.45121950" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1517"
+       x1="0.56209153"
+       y1="-3.2146594e-17"
+       x2="0.56862748"
+       y2="0.64843750" />
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1522"
+       x1="0.34108528"
+       y1="1.0468750"
+       x2="0.33333334"
+       y2="0.46093750" />
+    <radialGradient
+       xlink:href="#linearGradient1518"
+       id="radialGradient1524" />
+    <radialGradient
+       xlink:href="#linearGradient1518"
+       id="radialGradient1525" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1527"
+       x1="0.99291223"
+       y1="0.38505521"
+       x2="-0.12118133"
+       y2="0.38729247" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1529"
+       x1="0.99346405"
+       y1="1.6406250"
+       x2="0.71241832"
+       y2="0.62500000" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1531"
+       x1="0.92941177"
+       y1="0.35714287"
+       x2="0.32629615"
+       y2="0.35714287" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1533"
+       x1="0.69879520"
+       y1="0.61718750"
+       x2="0.44176707"
+       y2="0.32812500" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1535"
+       x1="0.0039215689"
+       y1="0.94642860"
+       x2="0.45490196"
+       y2="0.58928573" />
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1537"
+       x1="0.33070865"
+       y1="1.2265625"
+       x2="0.43307087"
+       y2="0.42968750" />
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1539"
+       x1="0.16788322"
+       y1="1.0312500"
+       x2="0.63503647"
+       y2="0.45312500" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1659"
+       x1="0.40458015"
+       y1="1.3828125"
+       x2="0.35877863"
+       y2="0.54687500" />
+    <radialGradient
+       xlink:href="#linearGradient1806"
+       id="radialGradient1977"
+       cx="0.50000000"
+       cy="0.50000000"
+       r="0.50000000"
+       fx="0.50000000"
+       fy="0.50000000" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1734"
+       x1="0.67319918"
+       y1="0.99825197"
+       x2="0.47887364"
+       y2="0.30443147"
+       gradientTransform="scale(0.906215,1.103491)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0000000"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.2279853"
+     inkscape:cx="57.933129"
+     inkscape:cy="15.420322"
+     inkscape:window-width="420"
+     inkscape:window-height="491"
+     inkscape:window-x="97"
+     inkscape:window-y="125" />
+  <g
+     id="g1540"
+     transform="matrix(1.429413,-3.932010e-2,3.932010e-2,1.429413,6.816050,14.52049)"
+     style="">
+    <path
+       style="fill:#212121;fill-rule:evenodd;stroke-width:0.57499999;"
+       d="M 24.859391,31.907937 C 23.419824,24.350211 24.964801,11.778293 30.054438,8.9789918 C 35.144076,6.1796912 40.379124,5.3034583 41.760605,9.7424375 C 43.243834,14.508354 39.448349,16.768623 34.704351,20.597833 C 29.745701,24.600304 28.340109,28.103497 24.859391,31.907937 z "
+       id="path917"
+       sodipodi:nodetypes="cczzc" />
+  </g>
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#radialGradient1977);fill-opacity:0.75000000;fill-rule:evenodd;stroke-width:1.0000000pt;"
+     id="path1976"
+     sodipodi:cx="41.875938"
+     sodipodi:cy="37.865574"
+     sodipodi:rx="12.562782"
+     sodipodi:ry="12.562782"
+     d="M 54.438721 37.865574 A 12.562782 12.562782 0 1 0 29.313156,37.865574 A 12.562782 12.562782 0 1 0 54.438721 37.865574 z"
+     transform="matrix(6.757552,0.000000,0.000000,3.357903,-212.4401,-10.33593)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#radialGradient1977);fill-opacity:0.75000000;fill-rule:evenodd;stroke-width:1.0000000pt;"
+     id="path1724"
+     sodipodi:cx="41.875938"
+     sodipodi:cy="37.865574"
+     sodipodi:rx="12.562782"
+     sodipodi:ry="12.562782"
+     d="M 54.438721 37.865574 A 12.562782 12.562782 0 1 0 29.313156,37.865574 A 12.562782 12.562782 0 1 0 54.438721 37.865574 z"
+     transform="matrix(6.757552,0.000000,0.000000,3.357903,-196.6048,-24.73160)" />
+  <path
+     style="fill:#618bb4;fill-rule:evenodd;stroke-width:0.57499999;fill-opacity:1.0000000;"
+     d="M 25.193706,48.176692 C 25.193706,48.176692 24.939224,26.545733 44.025365,23.491950 C 63.111506,20.438168 70.109757,49.449102 68.710107,54.029776 C 67.310457,58.610450 49.351398,70.044503 37.645232,66.227275 C 25.939066,62.410047 26.975079,57.338040 25.193706,48.176692 z "
+     id="path918"
+     sodipodi:nodetypes="cczcc"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:url(#linearGradient1529);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 28.074289,48.939744 C 28.074289,48.939744 27.844841,29.436670 45.053436,26.683294 C 62.262031,23.929920 69.374917,51.234223 67.309886,54.217047 C 65.244854,57.199869 51.477978,62.247724 40.923373,58.806005 C 30.368769,55.364286 29.680425,57.199869 28.074289,48.939744 z "
+     id="path1528"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:url(#linearGradient1517);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 25.891950,48.915464 C 25.891950,48.915464 25.637468,27.284505 44.723609,24.230722 C 63.809750,21.176940 71.698688,51.460283 69.408351,54.768548 C 67.118014,58.076812 51.849101,63.675413 40.142935,59.858185 C 28.436769,56.040957 27.673323,58.076812 25.891950,48.915464 z "
+     id="path1516"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:#a2360f;fill-rule:evenodd;stroke-width:0.57499999;fill-opacity:1.0000000;"
+     d="M 40.717100,73.115916 C 40.717100,68.916965 50.070907,54.562023 54.040131,54.343356 C 58.099053,54.119748 55.986013,56.829076 59.039796,56.574594 C 62.093578,56.320112 67.183216,56.574594 68.201143,59.882859 C 69.219071,63.191123 69.473553,72.606953 66.165288,73.370398 C 62.857024,74.133844 60.057723,74.897290 58.276350,77.442108 C 56.494977,79.986927 51.150858,84.567601 46.061220,82.277264 C 41.078519,80.035049 40.717100,77.314867 40.717100,73.115916 z "
+     id="path916"
+     sodipodi:nodetypes="czcccczz"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:#e7d417;fill-opacity:0.44654086;fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 47.842593,75.406253 C 48.097075,73.879362 50.387412,62.936641 53.186712,61.155268 C 55.986013,59.373895 54.204640,62.936641 55.222568,64.718014 C 56.240495,66.499388 61.330133,59.373895 61.330133,62.427678 C 61.330133,65.481460 56.749459,67.517315 59.803241,67.008351 C 62.857024,66.499388 71.254926,63.954569 66.928734,67.262833 C 62.602542,70.571098 60.312205,75.406253 57.258423,73.879362 C 54.204640,72.352471 53.186712,77.187626 50.641894,77.187626 C 48.097075,77.187626 47.588111,77.187626 47.842593,75.406253 z "
+     id="path922"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:url(#linearGradient1537);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 40.983128,72.559266 C 40.983128,68.360315 50.336933,54.005373 54.306163,53.786706 C 58.365083,53.563098 56.252043,56.272426 59.305823,56.017944 C 62.359603,55.763462 67.449243,56.017944 68.467173,59.326209 C 69.485103,62.634473 69.739583,72.050303 66.431313,72.813748 C 63.123053,73.577194 60.323753,74.340640 58.542383,76.885458 C 56.761003,79.430277 51.416883,84.010951 46.327253,81.720614 C 41.344547,79.478399 40.983128,76.758217 40.983128,72.559266 z "
+     id="path1536"
+     sodipodi:nodetypes="czcccczz"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:url(#linearGradient1515);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 51.150857,44.868428 L 78.634900,52.757366 L 100.26586,36.979490 L 51.150857,44.868428 z "
+     id="path910"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:#bd3200;fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 50.387412,44.359464 L 100.26586,30.108479 L 76.344563,49.194620 L 50.387412,44.359464 z "
+     id="path909"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:#f4f4f4;fill-rule:evenodd;stroke-width:0.47612661;"
+     id="path914"
+     sodipodi:cx="61.584614"
+     sodipodi:cy="30.108479"
+     sodipodi:rx="8.9068661"
+     sodipodi:ry="8.9068661"
+     d="M 70.491480 30.108479 A 8.9068661 8.9068661 0 1 0 52.677748,30.108479 A 8.9068661 8.9068661 0 1 0 70.491480 30.108479 z"
+     transform="matrix(1.726901,0.000000,0.000000,1.726901,-13.97865,2.029577)" />
+  <path
+     style="fill:#a2360f;fill-rule:evenodd;stroke-width:0.57499999;fill-opacity:1.0000000;"
+     d="M 27.993007,55.556667 C 27.993007,55.556667 27.484043,58.355967 29.774380,60.900786 C 32.064717,63.445605 41.480546,72.097989 38.172282,77.187626 C 34.864017,82.277264 26.211633,82.786228 23.157851,79.223481 C 20.104068,75.660735 8.9068657,71.080061 9.1613476,69.298688 C 9.4158295,67.517315 5.0896376,58.610449 11.960648,58.101486 C 18.831659,57.592522 23.412333,53.011848 25.448188,52.757366 C 27.484043,52.502884 28.247488,53.775294 27.993007,55.556667 z "
+     id="path915"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:#e7d417;fill-opacity:0.42767295;fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 26.211633,61.409750 C 26.211633,61.409750 28.756452,67.517315 31.301271,70.825580 C 33.846090,74.133844 30.537825,78.714518 27.229561,75.660735 C 23.921297,72.606953 13.487540,70.316616 13.742021,67.262833 C 13.996503,64.209051 18.322695,69.807652 19.086141,67.262833 C 19.849586,64.718014 13.996503,58.864931 17.050286,59.628377 C 20.104068,60.391823 22.394405,68.026279 23.157851,63.700087 C 23.921297,59.373895 22.903369,55.556667 26.211633,61.409750 z "
+     id="path921"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:url(#linearGradient1539);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 28.286502,55.412556 C 28.286502,55.412556 27.777538,58.211856 30.067875,60.756675 C 32.358212,63.301494 41.774041,71.953878 38.465777,77.043515 C 35.157512,82.133153 26.505128,82.642117 23.451346,79.079370 C 20.397563,75.516624 9.2003609,70.935950 9.4548429,69.154577 C 9.7093249,67.373204 5.3831329,58.466338 12.254143,57.957375 C 19.125154,57.448411 23.705828,52.867737 25.741683,52.613255 C 27.777538,52.358773 28.540983,53.631183 28.286502,55.412556 z "
+     id="path1538"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:#e4d66e;fill-rule:evenodd;stroke-width:0.59175676;"
+     id="path1510"
+     sodipodi:cx="61.584614"
+     sodipodi:cy="30.108479"
+     sodipodi:rx="8.9068661"
+     sodipodi:ry="8.9068661"
+     d="M 70.491480 30.108479 A 8.9068661 8.9068661 0 1 0 52.677748,30.108479 A 8.9068661 8.9068661 0 1 0 70.491480 30.108479 z"
+     transform="matrix(1.389462,0.000000,0.000000,1.389462,7.172151,12.65069)" />
+  <path
+     sodipodi:type="arc"
+     style="fill-rule:evenodd;stroke-width:0.57499999;"
+     id="path912"
+     sodipodi:cx="61.584614"
+     sodipodi:cy="31.126406"
+     sodipodi:rx="5.8530831"
+     sodipodi:ry="5.8530831"
+     d="M 67.437697 31.126406 A 5.8530831 5.8530831 0 1 0 55.731531,31.126406 A 5.8530831 5.8530831 0 1 0 67.437697 31.126406 z"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.286480,10.63843)" />
+  <path
+     style="fill:#45800c;fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 25.957152,48.431174 C 25.957152,48.431174 31.810235,47.922210 29.774380,50.975993 C 27.738525,54.029776 20.867514,55.047703 25.193706,56.320112 C 29.519898,57.592522 52.423267,58.101486 54.968086,59.373895 C 57.512904,60.646304 50.132930,68.535243 45.297774,67.008351 C 40.462619,65.481460 33.591608,59.119413 26.466115,60.137341 C 19.340623,61.155268 12.469612,65.226978 12.215130,60.900786 C 11.960648,56.574594 17.559250,49.703584 25.957152,48.431174 z "
+     id="path919"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:url(#linearGradient1535);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 28.123743,46.722923 C 28.123743,46.722923 33.733476,46.235120 31.782264,49.161938 C 29.831053,52.088756 23.245714,53.064361 27.392038,54.283868 C 31.538363,55.503375 53.489492,55.991179 55.928506,57.210685 C 58.367520,58.430192 51.294379,65.991137 46.660251,64.527728 C 42.026124,63.064320 35.440785,56.966784 28.611545,57.942390 C 21.782305,58.917995 15.196966,62.820418 14.953065,58.674094 C 14.709163,54.527769 20.074995,47.942431 28.123743,46.722923 z "
+     id="path1534"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:#52980f;fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 68.710107,53.011848 C 68.710107,53.011848 77.616973,55.811149 72.272853,56.829076 C 66.928734,57.847004 53.695676,56.574594 49.878448,59.119413 C 46.061220,61.664232 41.735028,69.807652 44.788811,71.334543 C 47.842593,72.861435 55.986013,64.209051 63.111506,62.936641 C 70.236998,61.664232 85.505911,62.427678 86.269357,59.882859 C 87.032802,57.338040 72.447502,49.641836 69.648201,49.641836 C 66.848901,49.641836 68.710107,53.011848 68.710107,53.011848 z "
+     id="path920"
+     sodipodi:nodetypes="cccccccc"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#linearGradient1522);fill-rule:evenodd;stroke-width:0.62365168;"
+     id="path1523"
+     sodipodi:cx="41.989510"
+     sodipodi:cy="35.452599"
+     sodipodi:rx="9.1613474"
+     sodipodi:ry="9.1613474"
+     d="M 51.150857 35.452599 A 9.1613474 9.1613474 0 1 0 32.828162,35.452599 A 9.1613474 9.1613474 0 1 0 51.150857 35.452599 z"
+     transform="matrix(1.318402,0.000000,0.000000,1.318402,36.93339,7.749206)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:#f4f4f4;fill-rule:evenodd;stroke-width:0.49186331;"
+     id="path923"
+     sodipodi:cx="41.989510"
+     sodipodi:cy="35.452599"
+     sodipodi:rx="9.1613474"
+     sodipodi:ry="9.1613474"
+     d="M 51.150857 35.452599 A 9.1613474 9.1613474 0 1 0 32.828162,35.452599 A 9.1613474 9.1613474 0 1 0 51.150857 35.452599 z"
+     transform="matrix(1.671651,0.000000,0.000000,1.671651,-3.918064,5.232760)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:#e4d66e;fill-rule:evenodd;stroke-width:0.62365168;"
+     id="path913"
+     sodipodi:cx="41.989510"
+     sodipodi:cy="35.452599"
+     sodipodi:rx="9.1613474"
+     sodipodi:ry="9.1613474"
+     d="M 51.150857 35.452599 A 9.1613474 9.1613474 0 1 0 32.828162,35.452599 A 9.1613474 9.1613474 0 1 0 51.150857 35.452599 z"
+     transform="matrix(1.318402,0.000000,0.000000,1.318402,11.09669,17.21056)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#linearGradient1522);fill-rule:evenodd;stroke-width:0.62365168;"
+     id="path1521"
+     sodipodi:cx="41.989510"
+     sodipodi:cy="35.452599"
+     sodipodi:rx="9.1613474"
+     sodipodi:ry="9.1613474"
+     d="M 51.150857 35.452599 A 9.1613474 9.1613474 0 1 0 32.828162,35.452599 A 9.1613474 9.1613474 0 1 0 51.150857 35.452599 z"
+     transform="matrix(1.318402,0.000000,0.000000,1.318402,11.09667,16.84664)" />
+  <path
+     sodipodi:type="arc"
+     style="fill-rule:evenodd;stroke-width:0.57499999;"
+     id="path911"
+     sodipodi:cx="42.243992"
+     sodipodi:cy="36.216045"
+     sodipodi:rx="6.1075649"
+     sodipodi:ry="6.1075649"
+     d="M 48.351557 36.216045 A 6.1075649 6.1075649 0 1 0 36.136427,36.216045 A 6.1075649 6.1075649 0 1 0 48.351557 36.216045 z"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.971427,11.22306)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#radialGradient1524);fill-rule:evenodd;stroke-width:1.1081090;"
+     id="path1509"
+     sodipodi:cx="42.243992"
+     sodipodi:cy="36.216045"
+     sodipodi:rx="6.1075649"
+     sodipodi:ry="6.1075649"
+     d="M 48.351557 36.216045 A 6.1075649 6.1075649 0 1 0 36.136427,36.216045 A 6.1075649 6.1075649 0 1 0 48.351557 36.216045 z"
+     transform="matrix(1.099494,0.000000,0.000000,1.099494,18.05623,20.13574)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#radialGradient1525);fill-rule:evenodd;stroke-width:1.1081090;"
+     id="path1511"
+     sodipodi:cx="42.243992"
+     sodipodi:cy="36.216045"
+     sodipodi:rx="6.1075649"
+     sodipodi:ry="6.1075649"
+     d="M 48.351557 36.216045 A 6.1075649 6.1075649 0 1 0 36.136427,36.216045 A 6.1075649 6.1075649 0 1 0 48.351557 36.216045 z"
+     transform="matrix(1.099494,0.000000,0.000000,1.099494,44.87933,12.47874)" />
+  <path
+     style="fill:url(#linearGradient1531);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 55.758098,43.619804 L 96.835997,31.883262 L 77.135370,47.601846 L 55.758098,43.619804 z "
+     id="path1530"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <path
+     style="fill:url(#linearGradient1533);fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 67.743635,52.574355 C 67.743635,52.574355 76.650495,55.373656 71.306375,56.391583 C 65.962265,57.409511 52.729203,56.137101 48.911975,58.681920 C 45.094747,61.226739 40.768555,69.370159 43.822338,70.897050 C 46.876120,72.423942 55.019540,63.771558 62.145035,62.499148 C 69.270525,61.226739 84.539435,61.990185 85.302885,59.445366 C 86.066325,56.900547 71.481025,49.204343 68.681725,49.204343 C 65.882425,49.204343 67.743635,52.574355 67.743635,52.574355 z "
+     id="path1532"
+     sodipodi:nodetypes="cccccccc"
+     transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+  <g
+     id="g1657"
+     transform="matrix(1.219881,-3.355633e-2,3.355633e-2,1.219881,15.12310,17.23540)"
+     style="fill:url(#linearGradient1527);">
+    <path
+       style="fill-rule:evenodd;stroke-width:0.57499999;"
+       d="M 24.859391,31.907937 C 23.419824,24.350211 24.964801,11.778293 30.054438,8.9789918 C 35.144076,6.1796912 40.379124,5.3034583 41.760605,9.7424375 C 43.243834,14.508354 39.448349,16.768623 34.704351,20.597833 C 29.745701,24.600304 28.340109,28.103497 24.859391,31.907937 z "
+       id="path1658"
+       sodipodi:nodetypes="cczzc" />
+  </g>
+  <path
+     style="fill:url(#linearGradient1734);fill-opacity:0.44654086;fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 74.490374,118.99279 C 74.854272,116.80940 78.129348,101.16181 82.132218,98.614531 C 86.135090,96.067249 83.587809,101.16181 85.043399,103.70910 C 86.498988,106.25638 93.776936,96.067249 93.776936,100.43402 C 93.776936,104.80079 87.226783,107.71197 91.593550,106.98417 C 95.960320,106.25638 107.96894,102.61740 101.78268,107.34807 C 95.596422,112.07874 92.321346,118.99279 87.954578,116.80940 C 83.587809,114.62602 82.132218,121.54007 78.493246,121.54007 C 74.854272,121.54007 74.126476,121.54007 74.490374,118.99279 z "
+     id="path1726" />
+  <path
+     style="fill:url(#linearGradient1659);fill-opacity:0.42767295;fill-rule:evenodd;stroke-width:0.57499999;"
+     d="M 43.559096,98.978428 C 43.559096,98.978428 47.198070,107.71197 50.837044,112.44264 C 54.476018,117.17330 49.745352,123.72345 45.014686,119.35669 C 40.284021,114.98992 25.364228,111.71484 25.728125,107.34807 C 26.092022,102.98130 32.278278,110.98705 33.369970,107.34807 C 34.461662,103.70910 26.092022,95.339454 30.458791,96.431147 C 34.825559,97.522839 38.100636,108.43976 39.192328,102.25351 C 40.284021,96.067249 38.828431,90.608789 43.559096,98.978428 z "
+     id="path1729" />
+  <text
+     xml:space="preserve"
+     style="font-size:12.000000;stroke-width:1.0000000pt;font-family:helvetica;"
+     x="0.69148552"
+     y="182.14601"
+     id="text1067"><tspan
+       id="tspan1068">LyX</tspan></text>
+  <text
+     xml:space="preserve"
+     style="font-size:12.000000;stroke-width:1.0000000pt;font-family:helvetica;"
+     x="62.452923"
+     y="762.71289"
+     id="text1070"
+     transform="scale(0.246729,0.246729)"><tspan
+       id="tspan1071">Created by Andrew Fitzsimon</tspan><tspan
+       sodipodi:role="line"
+       id="tspan1831"
+       x="62.452923"
+       y="774.71289">trace of the LyX Logo</tspan></text>
+</svg>
diff --git a/development/Win32/packaging/icons/lyx_32x32.ico b/development/Win32/packaging/icons/lyx_32x32.ico
new file mode 100644 (file)
index 0000000..dc4132f
Binary files /dev/null and b/development/Win32/packaging/icons/lyx_32x32.ico differ
diff --git a/development/Win32/packaging/icons/lyx_32x32.png b/development/Win32/packaging/icons/lyx_32x32.png
new file mode 100644 (file)
index 0000000..a5deed1
Binary files /dev/null and b/development/Win32/packaging/icons/lyx_32x32.png differ
diff --git a/development/Win32/packaging/icons/lyx_32x32_16colors.png b/development/Win32/packaging/icons/lyx_32x32_16colors.png
new file mode 100644 (file)
index 0000000..3ce99a9
Binary files /dev/null and b/development/Win32/packaging/icons/lyx_32x32_16colors.png differ
diff --git a/development/Win32/packaging/icons/lyx_doc.svg b/development/Win32/packaging/icons/lyx_doc.svg
new file mode 100644 (file)
index 0000000..8742d23
--- /dev/null
@@ -0,0 +1,761 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+<svg
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   id="svg1"
+   sodipodi:version="0.34"
+   inkscape:version="0.39cvs"
+   width="128.00000pt"
+   height="128.00000pt"
+   sodipodi:docname="/home/angus/lyx_doc.svg"
+   sodipodi:docbase="/home/angus">
+  <defs
+     id="defs3">
+    <linearGradient
+       id="linearGradient1806">
+      <stop
+         style="stop-color:#000000;stop-opacity:0.40677965;"
+         offset="0.0000000"
+         id="stop1807" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.073446326;"
+         offset="0.64777780"
+         id="stop3276" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.0000000;"
+         offset="1.0000000"
+         id="stop1808" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1518">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.74226803;"
+         offset="0.0000000"
+         id="stop1519" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0.0000000;"
+         offset="1.0000000"
+         id="stop1520" />
+    </linearGradient>
+    <linearGradient
+       id="linearGradient1512">
+      <stop
+         style="stop-color:#000000;stop-opacity:0.54639173;"
+         offset="0.0000000"
+         id="stop1513" />
+      <stop
+         style="stop-color:#000000;stop-opacity:0.0000000;"
+         offset="1.0000000"
+         id="stop1514" />
+    </linearGradient>
+    <pattern
+       width="130.00000"
+       height="96.000000"
+       id="pattern903">
+      <image
+         xlink:href="/home/andy/Desktop/lux.png"
+         sodipodi:absref="/home/andy/Desktop/lux.png"
+         width="130.00000"
+         height="96.000000"
+         id="image904" />
+    </pattern>
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1515"
+       x1="0.14117648"
+       y1="0.17073171"
+       x2="0.74117649"
+       y2="0.45121950" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1517"
+       x1="0.56209153"
+       y1="-3.2146594e-17"
+       x2="0.56862748"
+       y2="0.64843750" />
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1522"
+       x1="0.34108528"
+       y1="1.0468750"
+       x2="0.33333334"
+       y2="0.46093750" />
+    <radialGradient
+       xlink:href="#linearGradient1518"
+       id="radialGradient1524" />
+    <radialGradient
+       xlink:href="#linearGradient1518"
+       id="radialGradient1525" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1527"
+       x1="0.99291223"
+       y1="0.38505521"
+       x2="-0.12118133"
+       y2="0.38729247" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1529"
+       x1="0.99346405"
+       y1="1.6406250"
+       x2="0.71241832"
+       y2="0.62500000" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1531"
+       x1="0.92941177"
+       y1="0.35714287"
+       x2="0.32629615"
+       y2="0.35714287" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1533"
+       x1="0.69879520"
+       y1="0.61718750"
+       x2="0.44176707"
+       y2="0.32812500" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1535"
+       x1="0.0039215689"
+       y1="0.94642860"
+       x2="0.45490196"
+       y2="0.58928573" />
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1537"
+       x1="0.33070865"
+       y1="1.2265625"
+       x2="0.43307087"
+       y2="0.42968750" />
+    <linearGradient
+       xlink:href="#linearGradient1512"
+       id="linearGradient1539"
+       x1="0.16788322"
+       y1="1.0312500"
+       x2="0.63503647"
+       y2="0.45312500" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1659"
+       x1="0.40458015"
+       y1="1.3828125"
+       x2="0.35877863"
+       y2="0.54687500" />
+    <radialGradient
+       xlink:href="#linearGradient1806"
+       id="radialGradient1977"
+       cx="0.50000000"
+       cy="0.50000000"
+       r="0.50000000"
+       fx="0.50000000"
+       fy="0.50000000" />
+    <linearGradient
+       xlink:href="#linearGradient1518"
+       id="linearGradient1734"
+       x1="0.67319918"
+       y1="0.99825197"
+       x2="0.47887364"
+       y2="0.30443147"
+       gradientTransform="scale(0.906215,1.103491)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0000000"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1.2279853"
+     inkscape:cx="57.933129"
+     inkscape:cy="15.420322"
+     inkscape:window-width="420"
+     inkscape:window-height="491"
+     inkscape:window-x="97"
+     inkscape:window-y="125" />
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#radialGradient1977);fill-opacity:0.75000000;fill-rule:evenodd;stroke-width:1.0000000pt;"
+     id="path1976"
+     sodipodi:cx="41.875938"
+     sodipodi:cy="37.865574"
+     sodipodi:rx="12.562782"
+     sodipodi:ry="12.562782"
+     d="M 54.43872 37.86557 A 12.56278 12.56278 0 1 0 29.31316 37.86557 A 12.56278 12.56278 0 1 0  54.43872 37.86557 z"
+     transform="matrix(6.757552,0.000000,0.000000,3.357903,-212.4401,-10.33593)" />
+  <path
+     sodipodi:type="arc"
+     style="fill:url(#radialGradient1977);fill-opacity:0.75000000;fill-rule:evenodd;stroke-width:1.0000000pt;"
+     id="path1724"
+     sodipodi:cx="41.875938"
+     sodipodi:cy="37.865574"
+     sodipodi:rx="12.562782"
+     sodipodi:ry="12.562782"
+     d="M 54.43872 37.86557 A 12.56278 12.56278 0 1 0 29.31316 37.86557 A 12.56278 12.56278 0 1 0  54.43872 37.86557 z"
+     transform="matrix(6.757552,0.000000,0.000000,3.357903,-196.6048,-24.73160)" />
+  <text
+     xml:space="preserve"
+     style="font-size:12.000000;stroke-width:1.0000000pt;font-family:helvetica;"
+     x="0.69148552"
+     y="182.14601"
+     id="text1067"><tspan
+   id="tspan1068">LyX</tspan></text>
+  <text
+     xml:space="preserve"
+     style="font-size:12.000000;stroke-width:1.0000000pt;font-family:helvetica;"
+     x="62.452923"
+     y="762.71289"
+     id="text1070"
+     transform="scale(0.246729,0.246729)"><tspan
+   id="tspan1071">Created by Andrew Fitzsimon</tspan><tspan
+   sodipodi:role="line"
+   id="tspan1831"
+   x="62.4529228"
+   y="774.712891">trace of the LyX Logo</tspan></text>
+  <g
+     id="g764"
+     transform="translate(0,7.086601)">
+    <g
+       id="g678"
+       transform="translate(-3.086827,-7.202625)">
+      <defs
+         id="defs679">
+        <linearGradient
+           id="linearGradient1507">
+          <stop
+             id="stop1508"
+             offset="0.0000000"
+             style="stop-color:#000000;stop-opacity:0.095505618;" />
+          <stop
+             id="stop1510"
+             offset="1.0000000"
+             style="stop-color:#000000;stop-opacity:0.0000000;" />
+        </linearGradient>
+        <linearGradient
+           id="linearGradient852"
+           xlink:href="#linearGradient1507" />
+        <linearGradient
+           id="linearGradient844"
+           xlink:href="#linearGradient1507" />
+        <linearGradient
+           id="linearGradient845"
+           x1="1.3833333"
+           x2="0.10833333"
+           y1="0.49019608"
+           y2="0.50490195"
+           xlink:href="#linearGradient841" />
+        <linearGradient
+           id="linearGradient840"
+           x1="-0.22348484"
+           x2="0.59469700"
+           y1="0.38235295"
+           y2="0.46568626"
+           xlink:href="#linearGradient853" />
+        <linearGradient
+           id="linearGradient849"
+           x1="0.010563380"
+           x2="1.2288733"
+           y1="0.43229166"
+           y2="0.46354166"
+           xlink:href="#linearGradient846" />
+        <radialGradient
+           cx="0.50000000"
+           cy="0.50000000"
+           fx="0.50000000"
+           fy="0.14942528"
+           id="radialGradient864"
+           r="0.50000000"
+           xlink:href="#linearGradient853" />
+        <linearGradient
+           id="linearGradient841">
+          <stop
+             id="stop842"
+             offset="0.00000000"
+             style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+          <stop
+             id="stop843"
+             offset="1.0000000"
+             style="stop-color:#ffffff;stop-opacity:0.00000000;" />
+        </linearGradient>
+        <linearGradient
+           id="linearGradient1290">
+          <stop
+             id="stop1291"
+             offset="0.0000000"
+             style="stop-color:#b2a269;stop-opacity:1.0000000;" />
+          <stop
+             id="stop1292"
+             offset="1.0000000"
+             style="stop-color:#6d5b18;stop-opacity:1.0000000;" />
+        </linearGradient>
+        <linearGradient
+           id="linearGradient860"
+           x1="0.47535211"
+           x2="0.50000000"
+           y1="0.81081080"
+           y2="-0.74324322"
+           xlink:href="#linearGradient1290" />
+        <linearGradient
+           id="linearGradient851"
+           x1="0.39788732"
+           x2="0.80985916"
+           y1="0.32222223"
+           y2="0.35555556"
+           xlink:href="#linearGradient846" />
+        <linearGradient
+           id="linearGradient858"
+           x1="0.64285713"
+           x2="0.57142860"
+           y1="1.2647059"
+           y2="0.049019609"
+           xlink:href="#linearGradient846" />
+        <linearGradient
+           id="linearGradient846">
+          <stop
+             id="stop847"
+             offset="0.00000000"
+             style="stop-color:#e7e7e7;stop-opacity:1.0000000;" />
+          <stop
+             id="stop848"
+             offset="1.0000000"
+             style="stop-color:#a5a5a5;stop-opacity:1.0000000;" />
+        </linearGradient>
+        <linearGradient
+           id="linearGradient850"
+           xlink:href="#linearGradient846" />
+        <linearGradient
+           id="linearGradient859"
+           x1="1.4647887"
+           x2="0.26408452"
+           y1="-1.1486486"
+           y2="1.2905406"
+           xlink:href="#linearGradient853" />
+        <linearGradient
+           id="linearGradient853">
+          <stop
+             id="stop854"
+             offset="0.00000000"
+             style="stop-color:#000000;stop-opacity:0.29752067;" />
+          <stop
+             id="stop855"
+             offset="1.0000000"
+             style="stop-color:#000000;stop-opacity:0.00000000;" />
+        </linearGradient>
+        <radialGradient
+           cx="0.50000000"
+           cy="0.50000000"
+           fx="0.50704223"
+           fy="0.29885057"
+           id="radialGradient861"
+           r="0.50000000"
+           xlink:href="#linearGradient853" />
+        <linearGradient
+           id="linearGradient1501">
+          <stop
+             id="stop1502"
+             offset="0.0000000"
+             style="stop-color:#ffffff;stop-opacity:1.0000000;" />
+          <stop
+             id="stop1504"
+             offset="1.0000000"
+             style="stop-color:#ffffff;stop-opacity:0.0000000;" />
+        </linearGradient>
+        <linearGradient
+           id="linearGradient1492">
+          <stop
+             id="stop1493"
+             offset="0.0000000"
+             style="stop-color:#cbcbcb;stop-opacity:1.0000000;" />
+          <stop
+             id="stop1496"
+             offset="0.34923077"
+             style="stop-color:#f0f0f0;stop-opacity:1.0000000;" />
+          <stop
+             id="stop1494"
+             offset="1.0000000"
+             style="stop-color:#e2e2e2;stop-opacity:1.0000000;" />
+        </linearGradient>
+        <linearGradient
+           id="linearGradient1495"
+           x1="0.92307693"
+           x2="0.14529915"
+           y1="0.16406250"
+           y2="1.1718750"
+           xlink:href="#linearGradient1492" />
+        <linearGradient
+           id="linearGradient1497"
+           x1="0.63247865"
+           x2="-0.37606838"
+           y1="0.32812500"
+           y2="1.3281250"
+           xlink:href="#linearGradient1492" />
+        <linearGradient
+           id="linearGradient1499"
+           x1="0.85826772"
+           x2="0.062992126"
+           y1="0.14062500"
+           y2="0.54687500"
+           xlink:href="#linearGradient1501" />
+        <linearGradient
+           id="linearGradient1506"
+           x1="0.052173913"
+           x2="0.78260869"
+           y1="0.97656250"
+           y2="0.0078125000"
+           xlink:href="#linearGradient1507" />
+        <linearGradient
+           id="linearGradient1556"
+           x1="0.31111112"
+           x2="0.62222224"
+           y1="-0.56250000"
+           y2="0.79687500"
+           xlink:href="#linearGradient1507" />
+        <radialGradient
+           cx="0.50000000"
+           cy="0.89285713"
+           fx="0.54117650"
+           fy="3.5200000"
+           id="radialGradient856"
+           r="0.54606670"
+           xlink:href="#linearGradient841" />
+        <linearGradient
+           id="linearGradient1944"
+           xlink:href="#linearGradient841" />
+      </defs>
+      <sodipodi:namedview
+         inkscape:cx="28.450752"
+         inkscape:cy="97.214075"
+         inkscape:pageopacity="0.0"
+         inkscape:pageshadow="2"
+         inkscape:window-height="491"
+         inkscape:window-width="390"
+         inkscape:window-x="323"
+         inkscape:window-y="53"
+         inkscape:zoom="4.7658944"
+         bordercolor="#666666"
+         borderopacity="1.0"
+         id="namedview721"
+         pagecolor="#ffffff" />
+      <path
+         sodipodi:nodetypes="cccccccccccccccc"
+         d="M 17.159384,6.3292894 L 17.159384,43.068526 L 17.159384,79.807768 L 17.159384,116.54700 L 17.159384,153.28624 L 50.687024,153.28624 L 84.214664,153.28624 L 117.74230,153.28624 L 151.26994,153.28624 L 151.26994,116.54700 L 151.26994,79.807768 L 151.26994,43.068526 L 117.74230,6.3292894 L 84.214664,6.3292894 L 50.687024,6.3292894 L 17.159384,6.3292894 z "
+         id="path930"
+         style="fill:#ffffff;fill-rule:evenodd;stroke-width:0.42649043;stroke-opacity:0.36477986;" />
+      <g
+         id="g1552"
+         style="fill:#000000;fill-opacity:0.069182344;"
+         transform="matrix(0.304171,0.000000,0.000000,0.297572,-36.70399,-112.4880)">
+        <path
+           sodipodi:nodetypes="cccccccccccccccc"
+           d="M 173.35959,408.81260 L 173.35959,531.07360 L 173.35959,653.33460 L 173.35959,775.59560 L 173.35959,897.85660 L 282.12187,897.85660 L 390.88417,897.85660 L 499.64646,897.85660 L 608.40874,897.85660 L 608.40874,775.59560 L 608.40874,653.33460 L 608.40874,531.07360 L 499.64646,408.81260 L 390.88417,408.81260 L 282.12187,408.81260 L 173.35959,408.81260 z "
+           id="path1505"
+           style="fill-opacity:0.069182344;fill-rule:evenodd;stroke-width:0.95407495pt;fill:#000000;" />
+        <path
+           d="M 170.12500,407.18750 C 170.12500,571.82292 170.12500,736.45833 170.12500,901.09375 C 317.30208,901.09375 464.47917,901.09375 611.65625,901.09375 C 611.65625,777.33333 611.65625,653.57292 611.65625,529.81250 C 574.80918,488.38978 537.97604,446.95335 501.09375,405.56250 C 390.77083,405.56250 280.44792,405.56250 170.12500,405.56250 C 170.12500,405.89583 170.12500,406.97917 170.12500,407.18750 z "
+           id="path725"
+           style="fill-opacity:0.069182344;fill-rule:evenodd;stroke-width:0.95407495pt;fill:#000000;" />
+        <path
+           d="M 166.87500,403.93750 C 166.87500,570.73958 166.87500,737.54167 166.87500,904.34375 C 316.21875,904.34375 465.56250,904.34375 614.90625,904.34375 C 614.90625,779.08333 614.90625,653.82292 614.90625,528.56250 C 577.45517,486.47298 540.01754,444.37017 502.53125,402.31250 C 390.64583,402.31250 278.76042,402.31250 166.87500,402.31250 C 166.87500,402.64583 166.87500,403.72917 166.87500,403.93750 z "
+           id="path1543"
+           style="fill-opacity:0.069182344;fill-rule:evenodd;stroke-width:0.95407495pt;fill:#000000;" />
+      </g>
+      <path
+         sodipodi:nodetypes="cccccccccccccccc"
+         d="M 297.99034,136.74154 L 297.99034,260.57234 L 297.99034,384.40315 L 297.99034,508.23395 L 297.99034,632.06475 L 410.99634,632.06475 L 524.00235,632.06475 L 637.00835,632.06475 L 750.01435,632.06475 L 750.01435,508.23395 L 750.01435,384.40315 L 750.01435,260.57234 L 637.00835,136.74154 L 524.00235,136.74154 L 410.99634,136.74154 L 297.99034,136.74154 z "
+         id="rect900"
+         style="fill:url(#linearGradient1495);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.4375000;stroke-opacity:0.36477986;"
+         transform="matrix(0.296689,0.000000,0.000000,0.296689,-71.19601,-34.05825)" />
+      <path
+         sodipodi:nodetypes="cccc"
+         d="M 750.01435,260.57234 C 715.94460,250.48602 671.79788,251.91624 638.44792,257.66516 C 644.20618,220.71628 644.92597,174.41021 637.00835,136.74154 L 750.01435,260.57234 z "
+         id="path906"
+         style="fill:url(#linearGradient1497);fill-opacity:1;fill-rule:evenodd;stroke-width:0.95407495pt;"
+         transform="matrix(0.296689,0.000000,0.000000,0.296689,-71.19601,-34.05825)" />
+      <path
+         sodipodi:nodetypes="cccczc"
+         d="M 301.30655,174.90867 L 299.27069,628.90434 L 743.08709,628.90434 L 743.34157,516.67783 C 733.41677,520.49506 633.15091,378.49417 506.92790,384.60173 C 380.59029,390.71484 413.27857,193.23136 301.30655,174.90867 z "
+         id="path1500"
+         style="fill:url(#linearGradient1499);fill-opacity:1;fill-rule:evenodd;stroke-width:1.0000000pt;"
+         transform="matrix(0.296689,0.000000,0.000000,0.296689,-71.19601,-34.05825)" />
+      <metadata
+         id="metadata730">
+        <rdf:RDF
+           xmlns:cc="http://web.resource.org/cc/"
+           xmlns:dc="http://purl.org/dc/elements/1.1/"
+           xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+          <cc:Work
+             rdf:about="">
+            <dc:title>Etiquette Icons</dc:title>
+            <dc:description />
+            <dc:subject>
+              <rdf:Bag>
+                <rdf:li>hash</rdf:li>
+                <rdf:li>icons</rdf:li>
+                <rdf:li>computer</rdf:li>
+                <rdf:li />
+              </rdf:Bag>
+            </dc:subject>
+            <dc:publisher>
+              <cc:Agent
+                 rdf:about="http://www.openclipart.org">
+                <dc:title>Andy Fitzsimon</dc:title>
+              </cc:Agent>
+            </dc:publisher>
+            <dc:creator>
+              <cc:Agent
+                 rdf:about="">
+                <dc:title>Andy Fitzsimon</dc:title>
+              </cc:Agent>
+            </dc:creator>
+            <dc:rights>
+              <cc:Agent
+                 rdf:about="">
+                <dc:title>Andy Fitzsimon</dc:title>
+              </cc:Agent>
+            </dc:rights>
+            <dc:date />
+            <dc:format>image/svg+xml</dc:format>
+            <dc:type
+               rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+            <cc:license
+               rdf:resource="http://web.resource.org/cc/PublicDomain">
+              <dc:date />
+            </cc:license>
+            <dc:language>en</dc:language>
+          </cc:Work>
+          <cc:License
+             rdf:about="http://web.resource.org/cc/PublicDomain">
+            <cc:permits
+               rdf:resource="http://web.resource.org/cc/Reproduction" />
+            <cc:permits
+               rdf:resource="http://web.resource.org/cc/Distribution" />
+            <cc:permits
+               rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+          </cc:License>
+        </rdf:RDF>
+      </metadata>
+    </g>
+    <g
+       id="g731"
+       transform="matrix(0.8,0,0,0.8,16.7711,15.21633)">
+      <g
+         id="g1540"
+         transform="matrix(1.429413,-3.932010e-2,3.932010e-2,1.429413,6.816050,14.52049)"
+         style="">
+        <path
+           style="fill:#212121;fill-rule:evenodd;stroke-width:0.57499999;"
+           d="M 24.859391,31.907937 C 23.419824,24.350211 24.964801,11.778293 30.054438,8.9789918 C 35.144076,6.1796912 40.379124,5.3034583 41.760605,9.7424375 C 43.243834,14.508354 39.448349,16.768623 34.704351,20.597833 C 29.745701,24.600304 28.340109,28.103497 24.859391,31.907937 z "
+           id="path917"
+           sodipodi:nodetypes="cczzc" />
+      </g>
+      <path
+         style="fill:#618bb4;fill-rule:evenodd;stroke-width:0.57499999;fill-opacity:1.0000000;"
+         d="M 25.193706,48.176692 C 25.193706,48.176692 24.939224,26.545733 44.025365,23.491950 C 63.111506,20.438168 70.109757,49.449102 68.710107,54.029776 C 67.310457,58.610450 49.351398,70.044503 37.645232,66.227275 C 25.939066,62.410047 26.975079,57.338040 25.193706,48.176692 z "
+         id="path918"
+         sodipodi:nodetypes="cczcc"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:url(#linearGradient1529);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 28.074289,48.939744 C 28.074289,48.939744 27.844841,29.436670 45.053436,26.683294 C 62.262031,23.929920 69.374917,51.234223 67.309886,54.217047 C 65.244854,57.199869 51.477978,62.247724 40.923373,58.806005 C 30.368769,55.364286 29.680425,57.199869 28.074289,48.939744 z "
+         id="path1528"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:url(#linearGradient1517);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 25.891950,48.915464 C 25.891950,48.915464 25.637468,27.284505 44.723609,24.230722 C 63.809750,21.176940 71.698688,51.460283 69.408351,54.768548 C 67.118014,58.076812 51.849101,63.675413 40.142935,59.858185 C 28.436769,56.040957 27.673323,58.076812 25.891950,48.915464 z "
+         id="path1516"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:#a2360f;fill-rule:evenodd;stroke-width:0.57499999;fill-opacity:1.0000000;"
+         d="M 40.717100,73.115916 C 40.717100,68.916965 50.070907,54.562023 54.040131,54.343356 C 58.099053,54.119748 55.986013,56.829076 59.039796,56.574594 C 62.093578,56.320112 67.183216,56.574594 68.201143,59.882859 C 69.219071,63.191123 69.473553,72.606953 66.165288,73.370398 C 62.857024,74.133844 60.057723,74.897290 58.276350,77.442108 C 56.494977,79.986927 51.150858,84.567601 46.061220,82.277264 C 41.078519,80.035049 40.717100,77.314867 40.717100,73.115916 z "
+         id="path916"
+         sodipodi:nodetypes="czcccczz"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:#e7d417;fill-opacity:0.44654086;fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 47.842593,75.406253 C 48.097075,73.879362 50.387412,62.936641 53.186712,61.155268 C 55.986013,59.373895 54.204640,62.936641 55.222568,64.718014 C 56.240495,66.499388 61.330133,59.373895 61.330133,62.427678 C 61.330133,65.481460 56.749459,67.517315 59.803241,67.008351 C 62.857024,66.499388 71.254926,63.954569 66.928734,67.262833 C 62.602542,70.571098 60.312205,75.406253 57.258423,73.879362 C 54.204640,72.352471 53.186712,77.187626 50.641894,77.187626 C 48.097075,77.187626 47.588111,77.187626 47.842593,75.406253 z "
+         id="path922"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:url(#linearGradient1537);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 40.983128,72.559266 C 40.983128,68.360315 50.336933,54.005373 54.306163,53.786706 C 58.365083,53.563098 56.252043,56.272426 59.305823,56.017944 C 62.359603,55.763462 67.449243,56.017944 68.467173,59.326209 C 69.485103,62.634473 69.739583,72.050303 66.431313,72.813748 C 63.123053,73.577194 60.323753,74.340640 58.542383,76.885458 C 56.761003,79.430277 51.416883,84.010951 46.327253,81.720614 C 41.344547,79.478399 40.983128,76.758217 40.983128,72.559266 z "
+         id="path1536"
+         sodipodi:nodetypes="czcccczz"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:url(#linearGradient1515);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 51.150857,44.868428 L 78.634900,52.757366 L 100.26586,36.979490 L 51.150857,44.868428 z "
+         id="path910"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:#bd3200;fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 50.387412,44.359464 L 100.26586,30.108479 L 76.344563,49.194620 L 50.387412,44.359464 z "
+         id="path909"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:#f4f4f4;fill-rule:evenodd;stroke-width:0.47612661;"
+         id="path914"
+         sodipodi:cx="61.584614"
+         sodipodi:cy="30.108479"
+         sodipodi:rx="8.9068661"
+         sodipodi:ry="8.9068661"
+         d="M 70.49148 30.10848 A 8.906866 8.906866 0 1 0 52.67775 30.10848 A 8.906866 8.906866 0 1 0  70.49148 30.10848 z"
+         transform="matrix(1.726901,0.000000,0.000000,1.726901,-13.97865,2.029577)" />
+      <path
+         style="fill:#a2360f;fill-rule:evenodd;stroke-width:0.57499999;fill-opacity:1.0000000;"
+         d="M 27.993007,55.556667 C 27.993007,55.556667 27.484043,58.355967 29.774380,60.900786 C 32.064717,63.445605 41.480546,72.097989 38.172282,77.187626 C 34.864017,82.277264 26.211633,82.786228 23.157851,79.223481 C 20.104068,75.660735 8.9068657,71.080061 9.1613476,69.298688 C 9.4158295,67.517315 5.0896376,58.610449 11.960648,58.101486 C 18.831659,57.592522 23.412333,53.011848 25.448188,52.757366 C 27.484043,52.502884 28.247488,53.775294 27.993007,55.556667 z "
+         id="path915"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:#e7d417;fill-opacity:0.42767295;fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 26.211633,61.409750 C 26.211633,61.409750 28.756452,67.517315 31.301271,70.825580 C 33.846090,74.133844 30.537825,78.714518 27.229561,75.660735 C 23.921297,72.606953 13.487540,70.316616 13.742021,67.262833 C 13.996503,64.209051 18.322695,69.807652 19.086141,67.262833 C 19.849586,64.718014 13.996503,58.864931 17.050286,59.628377 C 20.104068,60.391823 22.394405,68.026279 23.157851,63.700087 C 23.921297,59.373895 22.903369,55.556667 26.211633,61.409750 z "
+         id="path921"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:url(#linearGradient1539);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 28.286502,55.412556 C 28.286502,55.412556 27.777538,58.211856 30.067875,60.756675 C 32.358212,63.301494 41.774041,71.953878 38.465777,77.043515 C 35.157512,82.133153 26.505128,82.642117 23.451346,79.079370 C 20.397563,75.516624 9.2003609,70.935950 9.4548429,69.154577 C 9.7093249,67.373204 5.3831329,58.466338 12.254143,57.957375 C 19.125154,57.448411 23.705828,52.867737 25.741683,52.613255 C 27.777538,52.358773 28.540983,53.631183 28.286502,55.412556 z "
+         id="path1538"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:#e4d66e;fill-rule:evenodd;stroke-width:0.59175676;"
+         id="path1510"
+         sodipodi:cx="61.584614"
+         sodipodi:cy="30.108479"
+         sodipodi:rx="8.9068661"
+         sodipodi:ry="8.9068661"
+         d="M 70.49148 30.10848 A 8.906866 8.906866 0 1 0 52.67775 30.10848 A 8.906866 8.906866 0 1 0  70.49148 30.10848 z"
+         transform="matrix(1.389462,0.000000,0.000000,1.389462,7.172151,12.65069)" />
+      <path
+         sodipodi:type="arc"
+         style="fill-rule:evenodd;stroke-width:0.57499999;"
+         id="path912"
+         sodipodi:cx="61.584614"
+         sodipodi:cy="31.126406"
+         sodipodi:rx="5.8530831"
+         sodipodi:ry="5.8530831"
+         d="M 67.4377 31.12641 A 5.853083 5.853083 0 1 0 55.73153 31.12641 A 5.853083 5.853083 0 1 0  67.4377 31.12641 z"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.286480,10.63843)" />
+      <path
+         style="fill:#45800c;fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 25.957152,48.431174 C 25.957152,48.431174 31.810235,47.922210 29.774380,50.975993 C 27.738525,54.029776 20.867514,55.047703 25.193706,56.320112 C 29.519898,57.592522 52.423267,58.101486 54.968086,59.373895 C 57.512904,60.646304 50.132930,68.535243 45.297774,67.008351 C 40.462619,65.481460 33.591608,59.119413 26.466115,60.137341 C 19.340623,61.155268 12.469612,65.226978 12.215130,60.900786 C 11.960648,56.574594 17.559250,49.703584 25.957152,48.431174 z "
+         id="path919"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:url(#linearGradient1535);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 28.123743,46.722923 C 28.123743,46.722923 33.733476,46.235120 31.782264,49.161938 C 29.831053,52.088756 23.245714,53.064361 27.392038,54.283868 C 31.538363,55.503375 53.489492,55.991179 55.928506,57.210685 C 58.367520,58.430192 51.294379,65.991137 46.660251,64.527728 C 42.026124,63.064320 35.440785,56.966784 28.611545,57.942390 C 21.782305,58.917995 15.196966,62.820418 14.953065,58.674094 C 14.709163,54.527769 20.074995,47.942431 28.123743,46.722923 z "
+         id="path1534"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:#52980f;fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 68.710107,53.011848 C 68.710107,53.011848 77.616973,55.811149 72.272853,56.829076 C 66.928734,57.847004 53.695676,56.574594 49.878448,59.119413 C 46.061220,61.664232 41.735028,69.807652 44.788811,71.334543 C 47.842593,72.861435 55.986013,64.209051 63.111506,62.936641 C 70.236998,61.664232 85.505911,62.427678 86.269357,59.882859 C 87.032802,57.338040 72.447502,49.641836 69.648201,49.641836 C 66.848901,49.641836 68.710107,53.011848 68.710107,53.011848 z "
+         id="path920"
+         sodipodi:nodetypes="cccccccc"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:url(#linearGradient1522);fill-rule:evenodd;stroke-width:0.62365168;"
+         id="path1523"
+         sodipodi:cx="41.989510"
+         sodipodi:cy="35.452599"
+         sodipodi:rx="9.1613474"
+         sodipodi:ry="9.1613474"
+         d="M 51.15086 35.4526 A 9.161347 9.161347 0 1 0 32.82816 35.4526 A 9.161347 9.161347 0 1 0  51.15086 35.4526 z"
+         transform="matrix(1.318402,0.000000,0.000000,1.318402,36.93339,7.749206)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:#f4f4f4;fill-rule:evenodd;stroke-width:0.49186331;"
+         id="path923"
+         sodipodi:cx="41.989510"
+         sodipodi:cy="35.452599"
+         sodipodi:rx="9.1613474"
+         sodipodi:ry="9.1613474"
+         d="M 51.15086 35.4526 A 9.161347 9.161347 0 1 0 32.82816 35.4526 A 9.161347 9.161347 0 1 0  51.15086 35.4526 z"
+         transform="matrix(1.671651,0.000000,0.000000,1.671651,-3.918064,5.232760)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:#e4d66e;fill-rule:evenodd;stroke-width:0.62365168;"
+         id="path913"
+         sodipodi:cx="41.989510"
+         sodipodi:cy="35.452599"
+         sodipodi:rx="9.1613474"
+         sodipodi:ry="9.1613474"
+         d="M 51.15086 35.4526 A 9.161347 9.161347 0 1 0 32.82816 35.4526 A 9.161347 9.161347 0 1 0  51.15086 35.4526 z"
+         transform="matrix(1.318402,0.000000,0.000000,1.318402,11.09669,17.21056)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:url(#linearGradient1522);fill-rule:evenodd;stroke-width:0.62365168;"
+         id="path1521"
+         sodipodi:cx="41.989510"
+         sodipodi:cy="35.452599"
+         sodipodi:rx="9.1613474"
+         sodipodi:ry="9.1613474"
+         d="M 51.15086 35.4526 A 9.161347 9.161347 0 1 0 32.82816 35.4526 A 9.161347 9.161347 0 1 0  51.15086 35.4526 z"
+         transform="matrix(1.318402,0.000000,0.000000,1.318402,11.09667,16.84664)" />
+      <path
+         sodipodi:type="arc"
+         style="fill-rule:evenodd;stroke-width:0.57499999;"
+         id="path911"
+         sodipodi:cx="42.243992"
+         sodipodi:cy="36.216045"
+         sodipodi:rx="6.1075649"
+         sodipodi:ry="6.1075649"
+         d="M 48.35155 36.21605 A 6.107565 6.107565 0 1 0 36.13643 36.21605 A 6.107565 6.107565 0 1 0  48.35155 36.21605 z"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.971427,11.22306)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:url(#radialGradient1524);fill-rule:evenodd;stroke-width:1.1081090;"
+         id="path1509"
+         sodipodi:cx="42.243992"
+         sodipodi:cy="36.216045"
+         sodipodi:rx="6.1075649"
+         sodipodi:ry="6.1075649"
+         d="M 48.35155 36.21605 A 6.107565 6.107565 0 1 0 36.13643 36.21605 A 6.107565 6.107565 0 1 0  48.35155 36.21605 z"
+         transform="matrix(1.099494,0.000000,0.000000,1.099494,18.05623,20.13574)" />
+      <path
+         sodipodi:type="arc"
+         style="fill:url(#radialGradient1525);fill-rule:evenodd;stroke-width:1.1081090;"
+         id="path1511"
+         sodipodi:cx="42.243992"
+         sodipodi:cy="36.216045"
+         sodipodi:rx="6.1075649"
+         sodipodi:ry="6.1075649"
+         d="M 48.35155 36.21605 A 6.107565 6.107565 0 1 0 36.13643 36.21605 A 6.107565 6.107565 0 1 0  48.35155 36.21605 z"
+         transform="matrix(1.099494,0.000000,0.000000,1.099494,44.87933,12.47874)" />
+      <path
+         style="fill:url(#linearGradient1531);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 55.758098,43.619804 L 96.835997,31.883262 L 77.135370,47.601846 L 55.758098,43.619804 z "
+         id="path1530"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <path
+         style="fill:url(#linearGradient1533);fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 67.743635,52.574355 C 67.743635,52.574355 76.650495,55.373656 71.306375,56.391583 C 65.962265,57.409511 52.729203,56.137101 48.911975,58.681920 C 45.094747,61.226739 40.768555,69.370159 43.822338,70.897050 C 46.876120,72.423942 55.019540,63.771558 62.145035,62.499148 C 69.270525,61.226739 84.539435,61.990185 85.302885,59.445366 C 86.066325,56.900547 71.481025,49.204343 68.681725,49.204343 C 65.882425,49.204343 67.743635,52.574355 67.743635,52.574355 z "
+         id="path1532"
+         sodipodi:nodetypes="cccccccc"
+         transform="matrix(1.429954,0.000000,0.000000,1.429954,6.412650,11.07234)" />
+      <g
+         id="g1657"
+         transform="matrix(1.219881,-3.355633e-2,3.355633e-2,1.219881,15.12310,17.23540)"
+         style="fill:url(#linearGradient1527);">
+        <path
+           style="fill-rule:evenodd;stroke-width:0.57499999;"
+           d="M 24.859391,31.907937 C 23.419824,24.350211 24.964801,11.778293 30.054438,8.9789918 C 35.144076,6.1796912 40.379124,5.3034583 41.760605,9.7424375 C 43.243834,14.508354 39.448349,16.768623 34.704351,20.597833 C 29.745701,24.600304 28.340109,28.103497 24.859391,31.907937 z "
+           id="path1658"
+           sodipodi:nodetypes="cczzc" />
+      </g>
+      <path
+         style="fill:url(#linearGradient1734);fill-opacity:0.44654086;fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 74.490374,118.99279 C 74.854272,116.80940 78.129348,101.16181 82.132218,98.614531 C 86.135090,96.067249 83.587809,101.16181 85.043399,103.70910 C 86.498988,106.25638 93.776936,96.067249 93.776936,100.43402 C 93.776936,104.80079 87.226783,107.71197 91.593550,106.98417 C 95.960320,106.25638 107.96894,102.61740 101.78268,107.34807 C 95.596422,112.07874 92.321346,118.99279 87.954578,116.80940 C 83.587809,114.62602 82.132218,121.54007 78.493246,121.54007 C 74.854272,121.54007 74.126476,121.54007 74.490374,118.99279 z "
+         id="path1726" />
+      <path
+         style="fill:url(#linearGradient1659);fill-opacity:0.42767295;fill-rule:evenodd;stroke-width:0.57499999;"
+         d="M 43.559096,98.978428 C 43.559096,98.978428 47.198070,107.71197 50.837044,112.44264 C 54.476018,117.17330 49.745352,123.72345 45.014686,119.35669 C 40.284021,114.98992 25.364228,111.71484 25.728125,107.34807 C 26.092022,102.98130 32.278278,110.98705 33.369970,107.34807 C 34.461662,103.70910 26.092022,95.339454 30.458791,96.431147 C 34.825559,97.522839 38.100636,108.43976 39.192328,102.25351 C 40.284021,96.067249 38.828431,90.608789 43.559096,98.978428 z "
+         id="path1729" />
+    </g>
+  </g>
+</svg>
diff --git a/development/Win32/packaging/icons/lyx_doc_32x32.ico b/development/Win32/packaging/icons/lyx_doc_32x32.ico
new file mode 100644 (file)
index 0000000..6d1a7f6
Binary files /dev/null and b/development/Win32/packaging/icons/lyx_doc_32x32.ico differ
diff --git a/development/Win32/packaging/icons/lyx_doc_32x32.png b/development/Win32/packaging/icons/lyx_doc_32x32.png
new file mode 100644 (file)
index 0000000..a3b4c9a
Binary files /dev/null and b/development/Win32/packaging/icons/lyx_doc_32x32.png differ
diff --git a/development/Win32/packaging/icons/lyx_doc_32x32_16colors.png b/development/Win32/packaging/icons/lyx_doc_32x32_16colors.png
new file mode 100644 (file)
index 0000000..0e49c29
Binary files /dev/null and b/development/Win32/packaging/icons/lyx_doc_32x32_16colors.png differ
diff --git a/development/Win32/packaging/installer/abi_util_fileassoc.nsh b/development/Win32/packaging/installer/abi_util_fileassoc.nsh
new file mode 100644 (file)
index 0000000..d73124e
--- /dev/null
@@ -0,0 +1,109 @@
+;Title          AbiWord for Windows, NSIS v2 series installer script
+;FileDesc       Utility functions to set and save/restore file extension to application associations
+
+
+!ifndef _ABI_UTIL_FILEASSOC_NSH_
+!define _ABI_UTIL_FILEASSOC_NSH_
+
+
+!ifdef HAVE_SYSTEM_PLUGIN
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; RefreshShellIcons based on 
+;; http://nsis.sourceforge.net/archive/nsisweb.php?page=236&instances=0
+;; by jerome tremblay - april 2003
+
+!define SHCNE_ASSOCCHANGED 0x08000000
+!define SHCNF_IDLIST 0
+
+Function RefreshShellIcons
+  System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
+  (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
+FunctionEnd
+
+!define RefreshShellIcons "call RefreshShellIcons"
+!else
+!define RefreshShellIcons
+!endif ; HAVE_SYSTEM_PLUGIN
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; parts from http://nsis.sourceforge.net/archive/viewpage.php?pageid=282 by Vytautas
+;; Will add the registry entries to associate the given file extension with the
+;; previously set (see CreateApplicationAssociation) appType.  I.e. indicate to
+;; open documents with this extension using the application specified by appType
+;; registry entry.  If the extension is currently associated with a different
+;; appType, it will store the current association in the "prior_appType" key.
+
+!macro CreateFileAssociation extension appType contentType
+  !define skipBackupLbl "skipBackup_${__LINE__}"
+  push $0
+
+  ; back up old value of extension (.ext) if it exists
+  ReadRegStr $0 HKCR "${extension}" ""                     ; read current value
+  StrCmp $0 "" "${skipBackupLbl}"                          ; nothing, then skip storing old value
+    StrCmp $0 "${appType}" "${skipBackupLbl}"              ; only store if old is different than current
+      WriteRegStr HKCR "${extension}" "prior_value" "$0"   ; actually store the old association
+
+  "${skipBackupLbl}:"
+    ; Write File Associations
+    WriteRegStr HKCR "${extension}" "" "${appType}"
+    WriteRegStr HKCR "${extension}" "Content Type" "${contentType}"
+    ; Force shell refresh (so icons updated as needed)
+    ${RefreshShellIcons}
+
+  pop $0
+  !undef skipBackupLbl
+!macroend
+!define CreateFileAssociation "!insertmacro CreateFileAssociation"
+
+
+!macro CreateApplicationAssociation appType appName appDesc defIcon exeCmd
+  WriteRegStr HKCR "${appType}" "" "${appDesc}"
+  WriteRegStr HKCR "${appType}\shell" "" "open"
+  WriteRegStr HKCR "${appType}\DefaultIcon" "" "${defIcon}"
+
+  ; Basic command to open the file (pass filename as argv[1] to program executable)
+  WriteRegStr HKCR "${appType}\shell\open\command" "" '"${exeCmd}" "%1"'
+
+  ; To open file via DDE (OLE, ie via already active instance) instead of in a new process
+  ; Here for those who want to locally enable, not normally used as having each document
+  ; open in a new process while more resource intensive means a crash with one document
+  ; won't cause loss of work with other open documents.
+;  WriteRegStr HKCR "${appType}\shell\open\command" "" "${exeCmd}"
+;  WriteRegStr HKCR "${appType}\shell\open\ddeexec" "" '[Open("%1")]'
+;  WriteRegStr HKCR "${appType}\shell\open\ddeexec\application" "" "${appName}"
+;  WriteRegStr HKCR "${appType}\shell\open\ddeexec\topic" "" "System"
+
+  ; If editing file is a different action than simply opening file
+;  WriteRegStr HKCR "${appType}\shell\edit" "" "Edit Options File"
+;  WriteRegStr HKCR "${appType}\shell\edit\command" "" '"${exeCmd}" "%1"'
+
+!macroend
+!define CreateApplicationAssociation "!insertmacro CreateApplicationAssociation"
+
+
+; check if a file extension is associated with us and if so delete it
+!macro RemoveFileAssociation extension appType
+       push $0
+       push $1
+
+       ReadRegStr $0 HKCR "${extension}" ""
+       StrCmp "$0" "${appType}" 0 Skip_Del_File_Assoc.${extension}
+               ReadRegStr $0 HKCR "${extension}" "prior_value"
+               StrCmp "$0" "" "DeleteFA.${extension}" 0     ; if "prior_value" is not empty
+                       ReadRegStr $1 HKCR "$0" ""             ; restore previous association
+                       StrCmp "$1" "" DeleteFA.${extension}   ; only if it is still valid (has something defined)
+                       WriteRegStr HKCR "${extension}" "" $0             ; actually restore prior association
+                       DeleteRegValue HKCR "${extension}" "prior_value"  ; and remove stored value
+                       Goto Skip_Del_File_Assoc.${extension}
+               DeleteFA.${extension}:                       ; else delete file association key
+                       DeleteRegKey HKCR "${extension}"       ; actually remove file assoications
+
+       Skip_Del_File_Assoc.${extension}:
+       pop $1
+       pop $0
+!macroend
+!define RemoveFileAssociation "!insertmacro RemoveFileAssociation"
+
+
+!endif ; _ABI_UTIL_FILEASSOC_NSH_
diff --git a/development/Win32/packaging/installer/download.nsh b/development/Win32/packaging/installer/download.nsh
new file mode 100644 (file)
index 0000000..3cd3a57
--- /dev/null
@@ -0,0 +1,419 @@
+; File download.nsh
+; This file is part of LyX, the document processor.
+; http://www.lyx.org/
+; Licence details can be found in the file COPYING or copy at
+; http://www.lyx.org/about/license.php3
+
+; Author Angus Leeming
+; Full author contact details are available in file CREDITS or copy at
+; http://www.lyx.org/about/credits.php
+
+!ifndef _DOWNLOAD_NSH_
+!define _DOWNLOAD_NSH_
+
+!include "lyxfunc.nsh"
+!include "LogicLib.nsh"
+
+!insertmacro LYX_DEFFUNC `ReadDownloadValues`
+!insertmacro LYX_DEFFUNC `EnableBrowseControls`
+!insertmacro LYX_DEFFUNC `DownloadEnter`
+!insertmacro LYX_DEFFUNC `DownloadLeave`
+
+
+!macro LYX_FUNCTION_ReadDownloadValues
+  !insertmacro LYX_FUNC `ReadDownloadValues`
+
+    ; The stack contains:
+    ; TOP
+    ; FolderPath
+    ; SelectFolder
+    ; Download
+    ; DoNothing
+
+    ; After this point:
+    ; $0 = FolderPath
+    ; $1 = SelectFolder
+    ; $2 = Download
+    ; $3 = DoNothing
+    ; $4 = temp
+
+    Exch $0
+    Exch
+    Exch $1
+    Exch 2
+    Exch $2
+    Exch 3
+    Exch $3
+
+    ; Populate the registers with the values in the widgets.
+
+    ; DoNothing.
+    ; If the widget is disabled then set DoNothing ($3) to 0.
+    ; Otherwise, set it equal to the "state" variable of the field.
+    !insertmacro MUI_INSTALLOPTIONS_READ $3 "ioDownload.ini" "Field 2" "Flags"
+    IntOp $3 $3 & DISABLED
+    ${if} $3 == 1
+      StrCpy $3 0
+    ${else}
+      !insertmacro MUI_INSTALLOPTIONS_READ $3 "ioDownload.ini" "Field 2" "State"
+    ${endif}
+
+    ; Download
+    !insertmacro MUI_INSTALLOPTIONS_READ $2 "ioDownload.ini" "Field 3" "State"
+    ; SelectFolder
+    !insertmacro MUI_INSTALLOPTIONS_READ $1 "ioDownload.ini" "Field 4" "State"
+    ; FolderPath
+    !insertmacro MUI_INSTALLOPTIONS_READ $0 "ioDownload.ini" "Field 5" "State"
+
+    ; Return output to user.
+    ; The stack available to the user contains:
+    ; TOP
+    ; Modified FolderPath
+    ; Modified SelectFolder
+    ; Modified Download
+    ; Modified DoNothing
+
+    ; $0 = FolderPath
+    ; $1 = SelectFolder
+    ; $2 = Download
+    ; $3 = DoNothing
+
+    Exch $3
+    Exch 3
+    Exch $2
+    Exch 2
+    Exch $1
+    Exch
+    Exch $0
+  FunctionEnd
+!macroend
+
+
+!macro LYX_FUNCTION_EnableBrowseControls
+  !insertmacro LYX_FUNC `EnableBrowseControls`
+
+    ; After this point:
+    ; $0 = SelectFolder
+    ; $1 = temp
+    ; $2 = temp
+    ; $3 = temp
+
+    Push $0
+    Push $1
+    Push $2
+    Push $3
+
+    ; Populate the registers with the values in the widgets.
+    ; We're interested only in $0 (SelectFolder) here.
+    ${ReadDownloadValues} $1 $2 $0 $3
+
+    ; Get the dialog HWND, storing it in $1
+    FindWindow $1 "#32770" "" $HWNDPARENT
+
+    ; To get the HWND of the controls use:
+    ; GetDlgItem (output var)
+    ; (hwnd of the custom dialog) (1200 + Field number - 1)
+
+    ; Get the Browse textbox ID
+    GetDlgItem $2 $1 1204
+    ; Enable it if the SelectFolder ($0) checkbox is selected.
+    EnableWindow $2 $0
+
+    ; get Browse button ID
+    GetDlgItem $2 $1 1205
+    ; Enable it if the Folder checkbox is selected.
+    EnableWindow $2 $0
+
+    ; Remove temporaries from stack.
+    Pop $3
+    Pop $2
+    Pop $1
+    Pop $0
+  FunctionEnd
+!macroend
+
+
+!macro DownloadEnter_Private ExePath RegistryKey RegistrySubKey RemoveFromPath AddtoPath Required DownloadLabel HomeLabel PageHeader PageDescription
+ !define skipBackupLbl "skipBackup_${__LINE__}"
+
+  StrCpy ${ExePath} ""
+  ReadRegStr ${ExePath} HKLM "${RegistryKey}" "${RegistrySubKey}"
+
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 1" "Text" ""
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 2" "Text" "$(DownloadPageField2)"
+
+  Push $0
+  ${if} ${Required} == 1
+    StrCpy $0 "NOTIFY"
+  ${else}
+    StrCpy $0 "DISABLED"
+  ${endif}
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 2" "Flags" $0
+  Pop $0
+
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 2" "State" "0"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 3" "Text" "${DownloadLabel}"
+  !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 4" "Text" "${HomeLabel}"
+
+  ${if} ${ExePath} == ""
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 3" "State" "1"
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 4" "State" "0"
+    !insertmacro MUI_INSTALLOPTIONS_READ $0 "ioDownload.ini" "Field 5" "Flags"
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "Flags" $0|DISABLED
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "State" ""
+  ${else}
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 3" "State" "0"
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 4" "State" "1"
+
+    ${StrRep} "${ExePath}" "${ExePath}" "${RemoveFromPath}" ""
+    StrCpy ${ExePath} "${ExePath}${AddtoPath}"
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioDownload.ini" "Field 5" "State" "${ExePath}"
+  ${endif}
+
+  ClearErrors
+
+  !insertmacro MUI_HEADER_TEXT "${PageHeader}" "${PageDescription}"
+  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioDownload.ini"
+ !undef skipBackupLbl
+!macroend
+
+
+!macro LYX_FUNCTION_DownloadEnter
+  !insertmacro LYX_FUNC `DownloadEnter`
+
+    ; The stack contains:
+    ; TOP
+    ; ExePath
+    ; RegistryKey
+    ; RegistrySubKey
+    ; RemoveFromPath
+    ; AddtoPath
+    ; Required
+    ; DownloadLabel
+    ; HomeLabel
+    ; PageHeader
+    ; PageDescription
+
+    ; After this point:
+    ; $0 = ExePath
+    ; $1 = RegistryKey
+    ; $2 = RegistrySubKey
+    ; $3 = RemoveFromPath
+    ; $4 = AddtoPath
+    ; $5 = Required
+    ; $6 = DownloadLabel
+    ; $7 = HomeLabel
+    ; $8 = PageHeader
+    ; $9 = PageDescription
+
+    Exch $0
+    Exch
+    Exch $1
+    Exch 2
+    Exch $2
+    Exch 3
+    Exch $3
+    Exch 4
+    Exch $4
+    Exch 5
+    Exch $5
+    Exch 6
+    Exch $6
+    Exch 7
+    Exch $7
+    Exch 8
+    Exch $8
+    Exch 9
+    Exch $9
+
+    ; Use a macro simply to make life understandable.
+    !insertmacro DownloadEnter_Private "$0" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
+
+    ; Return output to user.
+    Exch $9
+    Exch 9
+    Exch $8
+    Exch 8
+    Exch $7
+    Exch 7
+    Exch $6
+    Exch 6
+    Exch $5
+    Exch 5
+    Exch $4
+    Exch 4
+    Exch $3
+    Exch 3
+    Exch $2
+    Exch 2
+    Exch $1
+    Exch
+    Exch $0
+  FunctionEnd
+!macroend
+
+
+!macro DownloadLeave_Private DoNotRequire Download FolderPath URL EnterFolder ExeName InvalidFolder
+ !define skipBackupLbl "skipBackup_${__LINE__}"
+  !insertmacro MUI_INSTALLOPTIONS_READ $0 "ioDownload.ini" "Settings" "State"
+
+  StrCmp $0 0 go_on  ; Next button?
+
+  ${EnableBrowseControls}
+  Abort ; Return to the page
+
+go_on:
+   ${ReadDownloadValues} ${DoNotRequire} ${Download} $0 ${FolderPath}
+
+  ${if} ${DoNotRequire} == 1
+    ;
+  ${elseif} ${Download} == 1
+    StrCpy ${FolderPath} ""
+    ExecShell open "${URL}"
+  ${else}
+    ${StrTrim} ${FolderPath}
+
+    ${if} ${FolderPath} == ""
+      MessageBox MB_OK "${EnterFolder}"
+      Abort
+    ${endif}
+
+    ${if} ${FileExists} "${FolderPath}"
+      ${StrRep} ${FolderPath} ${FolderPath} "${ExeName}" ""
+
+      ${if} ${FileExists} "${FolderPath}${ExeName}"
+      ${else}
+        MessageBox MB_OK "${InvalidFolder}"
+        Abort
+      ${endif}
+    ${else}
+      MessageBox MB_OK "${InvalidFolder}"
+      Abort
+    ${endif}
+  ${endif}
+ !undef skipBackupLbl
+!macroend
+
+
+!macro LYX_FUNCTION_DownloadLeave
+  !insertmacro LYX_FUNC `DownloadLeave`
+
+    ; The stack contains:
+    ; TOP
+    ; DoNotRequire
+    ; Download
+    ; FolderPath
+    ; URL
+    ; EnterFolder
+    ; ExeName
+    ; InvalidFolder
+
+    ; After this point:
+    ; $0 = DoNotRequire
+    ; $1 = Download
+    ; $2 = FolderPath
+    ; $3 = URL
+    ; $4 = EnterFolder
+    ; $5 = ExeName
+    ; $6 = InvalidFolder
+
+    Exch $0
+    Exch
+    Exch $1
+    Exch 2
+    Exch $2
+    Exch 3
+    Exch $3
+    Exch 4
+    Exch $4
+    Exch 5
+    Exch $5
+    Exch 6
+    Exch $6
+
+    ; Use a macro simply to make life understandable.
+    !insertmacro DownloadLeave_Private "$0" "$1" "$2" "$3" "$4" "$5" "$6"
+
+    ; Return output to user.
+    Exch $6
+    Exch 6
+    Exch $5
+    Exch 5
+    Exch $4
+    Exch 4
+    Exch $3
+    Exch 3
+    Exch $2
+    Exch 2
+    Exch $1
+    Exch
+    Exch $0
+  FunctionEnd
+!macroend
+
+
+!macro LYX_FUNCTION_ReadDownloadValues_Call DoNothing Download SelectFolder FolderPath
+  Push `${DoNothing}`
+  Push `${Download}`
+  Push `${SelectFolder}`
+  Push `${FolderPath}`
+  Call ReadDownloadValues
+  Pop `${FolderPath}`
+  Pop `${SelectFolder}`
+  Pop `${Download}`
+  Pop `${DoNothing}`
+!macroend
+
+
+!macro LYX_FUNCTION_EnableBrowseControls_Call
+  Call EnableBrowseControls
+!macroend
+
+
+!macro LYX_FUNCTION_DownloadEnter_Call ExePath RegistryKey RegistrySubKey RemoveFromPath AddtoPath Required DownloadLabel HomeLabel PageHeader PageDescription
+  Push `${PageDescription}`
+  Push `${PageHeader}`
+  Push `${HomeLabel}`
+  Push `${DownloadLabel}`
+  Push `${Required}`
+  Push `${AddtoPath}`
+  Push `${RemoveFromPath}`
+  Push `${RegistrySubKey}`
+  Push `${RegistryKey}`
+  Push `${ExePath}`
+  Call DownloadEnter
+  ; Empty the stack of all the stuff we've just added.
+  ; We're not interested in keeping it, so just fill $0 repeatedly.
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+!macroend
+
+
+!macro LYX_FUNCTION_DownloadLeave_Call DoNotRequire Download FolderPath URL EnterFolder ExeName InvalidFolder
+  Push `${InvalidFolder}`
+  Push `${ExeName}`
+  Push `${EnterFolder}`
+  Push `${URL}`
+  Push `${FolderPath}`
+  Push `${Download}`
+  Push `${DoNotRequire}`
+  Call DownloadLeave
+  ; Empty the stack of all the stuff we've just added.
+  Pop `${DoNotRequire}`
+  Pop `${Download}`
+  Pop `${FolderPath}`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+  Pop `$0`
+!macroend
+
+!endif ; _DOWNLOAD_NSH_
diff --git a/development/Win32/packaging/installer/ioDownload.ini b/development/Win32/packaging/installer/ioDownload.ini
new file mode 100644 (file)
index 0000000..a249d7c
--- /dev/null
@@ -0,0 +1,42 @@
+[Settings]
+NumFields=5
+
+[Field 1]
+Type=Label
+Left=5
+Right=-1
+Top=0
+Bottom=10 
+
+[Field 2]
+Type=RadioButton
+Left=0
+Right=-1
+Top=11
+Bottom=22
+State=0
+Flags=NOTIFY
+
+[Field 3]
+Type=RadioButton
+Left=0
+Right=-1
+Top=23
+Bottom=34
+Flags=NOTIFY
+
+[Field 4]
+Type=RadioButton
+Left=0
+Right=-1
+Top=35
+Bottom=46
+Flags=NOTIFY
+
+[Field 5]
+Type=DirRequest
+Left=5
+Right=-1
+Top=47
+Bottom=58
+Flags=PATH_MUST_EXIST
\ No newline at end of file
diff --git a/development/Win32/packaging/installer/ioSummary.ini b/development/Win32/packaging/installer/ioSummary.ini
new file mode 100644 (file)
index 0000000..7dfd51d
--- /dev/null
@@ -0,0 +1,16 @@
+[Settings]
+NumFields=2
+
+[Field 1]
+Type=Label
+Left=5
+Right=-1
+Top=0
+Bottom=10
+
+[Field 2]
+Type=Label
+Left=5
+Right=-1
+Top=11
+Bottom=50
diff --git a/development/Win32/packaging/installer/is_user_admin.nsh b/development/Win32/packaging/installer/is_user_admin.nsh
new file mode 100644 (file)
index 0000000..81f60bf
--- /dev/null
@@ -0,0 +1,75 @@
+; Author: Lilla (lilla@earthlink.net) 2003-06-13
+; function IsUserAdmin uses plugin \NSIS\PlusgIns\UserInfo.dll
+; This function is based upon code in \NSIS\Contrib\UserInfo\UserInfo.nsi
+; This function was tested under NSIS 2 beta 4 (latest CVS as of this writing).
+;
+; Usage:
+;   Call IsUserAdmin
+;   Pop $R0   ; at this point $R0 is "true" or "false"
+;
+
+; Modified May 2005 by Angus Leeming, placing the original function
+; body inside a macro and defining functions IsUserAdmin and un.IsUserAdmin
+; in terms of this macro.
+; Allows the function us.IsUserAdmin to be used inside the installer.
+
+!ifndef _IS_USER_ADMIN_NSH_
+!define _IS_USER_ADMIN_NSH_
+
+!macro IsUserAdmin_private
+  !define skipBackupLbl "skipBackup_${__LINE__}"
+
+Push $R0
+Push $R1
+Push $R2
+
+ClearErrors
+UserInfo::GetName
+IfErrors Win9x
+Pop $R1
+UserInfo::GetAccountType
+Pop $R2
+
+StrCmp $R2 "Admin" 0 Continue
+; Observation: I get here when running Win98SE. (Lilla)
+; The functions UserInfo.dll looks for are there on Win98 too, 
+; but just don't work. So UserInfo.dll, knowing that admin isn't required
+; on Win98, returns admin anyway. (per kichik)
+; MessageBox MB_OK 'User "$R1" is in the Administrators group'
+StrCpy $R0 "true"
+Goto Done
+
+Continue:
+; You should still check for an empty string because the functions
+; UserInfo.dll looks for may not be present on Windows 95. (per kichik)
+StrCmp $R2 "" Win9x
+StrCpy $R0 "false"
+;MessageBox MB_OK 'User "$R1" is in the "$R2" group'
+Goto Done
+
+Win9x:
+; comment/message below is by UserInfo.nsi author:
+; This one means you don't need to care about admin or
+; not admin because Windows 9x doesn't either
+;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!"
+StrCpy $R0 "true"
+
+Done:
+;MessageBox MB_OK 'User= "$R1"  AccountType= "$R2"  IsUserAdmin= "$R0"'
+
+Pop $R2
+Pop $R1
+Exch $R0
+
+  !undef skipBackupLbl
+!macroend
+
+Function IsUserAdmin
+!insertmacro IsUserAdmin_private
+FunctionEnd
+
+Function un.IsUserAdmin
+!insertmacro IsUserAdmin_private
+FunctionEnd
+
+!endif ; _IS_USER_ADMIN_NSH_
diff --git a/development/Win32/packaging/installer/lyx_installer.nsi b/development/Win32/packaging/installer/lyx_installer.nsi
new file mode 100644 (file)
index 0000000..3273cf2
--- /dev/null
@@ -0,0 +1,578 @@
+; Lyx for Windows, NSIS v2 series installer script
+
+; File lyx_installer.nsi
+; This file is part of LyX, the document processor.
+; http://www.lyx.org/
+; Licence details can be found in the file COPYING or copy at
+; http://www.lyx.org/about/license.php3
+
+; Author Angus Leeming
+; Full author contact details are available in file CREDITS or copy at
+; http://www.lyx.org/about/credits.php
+
+; This script requires NSIS 2.06 and above
+; http://nsis.sourceforge.net/
+;--------------------------------
+
+; Do a Cyclic Redundancy Check to make sure the installer
+; was not corrupted by the download.
+CRCCheck force
+
+; Make the installer as small as possible.
+SetCompressor lzma
+
+;--------------------------------
+; You should need to change only these macros...
+
+!define PRODUCT_NAME "LyX"
+!define PRODUCT_VERSION "1.3.6"
+!define PRODUCT_LICENSE_FILE "..\..\..\..\COPYING"
+!define PRODUCT_SOURCEDIR "J:\Programs\LyX"
+!define PRODUCT_EXE "$INSTDIR\bin\lyx.exe"
+!define PRODUCT_EXT ".lyx"
+!define PRODUCT_MIME_TYPE "application/lyx"
+!define PRODUCT_UNINSTALL_EXE "$INSTDIR\uninstall.exe"
+
+!define INSTALLER_EXE "lyx_setup_136.exe"
+!define INSTALLER_ICON "..\icons\lyx_32x32.ico"
+
+; Replaced by HKLM or HKCU depending on SetShellVarContext.
+!define PRODUCT_ROOT_KEY "SHCTX"
+
+!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\lyx.exe"
+!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
+
+;--------------------------------
+; Make some of the information above available to NSIS.
+
+Name "${PRODUCT_NAME}"
+OutFile "${INSTALLER_EXE}"
+InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
+
+;--------------------------------
+!include "MUI.nsh"
+!include "LogicLib.nsh"
+!include "StrFunc.nsh"
+!include "strtrim.nsh"
+!include "download.nsh"
+
+; Declare used functions
+${StrLoc}
+${StrRep}
+${StrTrim}
+${ReadDownloadValues}
+${EnableBrowseControls}
+${DownloadEnter}
+${DownloadLeave}
+
+; Grabbed from
+; http://nsis.sourceforge.net/archive/viewpage.php?pageid=275
+!include "is_user_admin.nsh"
+
+; Grabbed from
+; http://abiword.pchasm.org/source/cvs/abiword-cvs/abi/src/pkg/win/setup/NSISv2/abi_util_fileassoc.nsh
+; Use the Abiword macros to help set up associations with the file extension.
+; in the Registry.
+!include "abi_util_fileassoc.nsh"
+
+;--------------------------------
+; Variables
+
+Var MinSYSPath
+Var DownloadMinSYS
+
+Var PythonPath
+Var DownloadPython
+
+Var DoNotRequireMiKTeX
+Var MiKTeXPath
+Var DownloadMiKTeX
+
+Var DoNotRequirePerl
+Var PerlPath
+Var DownloadPerl
+
+Var DoNotRequireImageMagick
+Var ImageMagickPath
+Var DownloadImageMagick
+
+Var DoNotRequireGhostscript
+Var GhostscriptPath
+Var DownloadGhostscript
+
+Var DoNotInstallLyX
+Var PathPrefix
+
+Var CreateFileAssociations
+Var CreateDesktopIcon
+Var StartmenuFolder
+Var ProductRootKey
+
+;--------------------------------
+
+; Remember the installer language
+!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
+!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
+!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
+
+!define MUI_ABORTWARNING
+!define MUI_ICON "${INSTALLER_ICON}"
+!define MUI_UNICON "${INSTALLER_ICON}"
+
+; Welcome page
+!insertmacro MUI_PAGE_WELCOME
+
+Page custom DownloadMinSYS DownloadMinSYS_LeaveFunction
+Page custom DownloadPython DownloadPython_LeaveFunction
+Page custom DownloadMiKTeX DownloadMiKTeX_LeaveFunction
+Page custom DownloadPerl DownloadPerl_LeaveFunction
+Page custom DownloadImageMagick DownloadImageMagick_LeaveFunction
+Page custom DownloadGhostscript DownloadGhostscript_LeaveFunction
+Page custom SummariseDownloads SummariseDownloads_LeaveFunction
+
+; Show the license.
+!insertmacro MUI_PAGE_LICENSE "${PRODUCT_LICENSE_FILE}"
+
+; Specify the installation directory.
+!insertmacro MUI_PAGE_DIRECTORY
+
+; Define which components to install.
+!insertmacro MUI_PAGE_COMPONENTS
+
+; Specify where to install program shortcuts.
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_ROOT_KEY}"
+!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
+!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
+!insertmacro MUI_PAGE_STARTMENU ${PRODUCT_NAME} $StartmenuFolder
+
+; Watch the components being installed.
+!insertmacro MUI_PAGE_INSTFILES
+
+!define MUI_FINISHPAGE_TEXT "$(FinishPageMessage)"
+!define MUI_FINISHPAGE_RUN_TEXT "$(FinishPageRun)"
+!define MUI_FINISHPAGE_RUN "${PRODUCT_EXE}"
+!insertmacro MUI_PAGE_FINISH
+
+; The uninstaller.
+!insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+; Languages
+
+!insertmacro MUI_LANGUAGE "English" # first language is the default language
+!insertmacro MUI_LANGUAGE "French"
+!insertmacro MUI_LANGUAGE "German"
+
+!include "lyx_languages\english.nsh"
+!include "lyx_languages\french.nsh"
+!include "lyx_languages\german.nsh"
+
+LicenseData "$(LyXLicenseData)"
+
+;--------------------------------
+; Reserve Files
+
+; These files should be inserted before other files in the data block
+; Keep these lines before any File command
+; Only for solid compression (by default, solid compression
+; is enabled for BZIP2 and LZMA)
+ReserveFile "ioDownload.ini"
+ReserveFile "ioSummary.ini"
+!insertmacro MUI_RESERVEFILE_LANGDLL
+
+;--------------------------------
+
+Section "!${PRODUCT_NAME}" SecCore
+  SectionIn RO
+SectionEnd
+
+Section /o "$(SecAllUsersTitle)" SecAllUsers
+  SetShellVarContext all
+  StrCpy $ProductRootKey "HKLM"
+SectionEnd
+
+Section "$(SecFileAssocTitle)" SecFileAssoc
+  StrCpy $CreateFileAssociations "true"
+SectionEnd
+
+Section "$(SecDesktopTitle)" SecDesktop
+  StrCpy $CreateDesktopIcon "true"
+SectionEnd
+
+; The '-' makes the section invisible.
+; Sections are entered in order, so the settings above are all
+; available to SecInstallation
+Section "-Installation actions" SecInstallation
+  SetOverwrite off
+  SetOutPath "$INSTDIR"
+  File /r "${PRODUCT_SOURCEDIR}\Resources"
+  File /r "${PRODUCT_SOURCEDIR}\bin"
+
+  ${if} "$PathPrefix" != ""
+    lyx_path_prefix::set "$INSTDIR\Resources\lyx\configure" "$PathPrefix"
+    Pop $0
+    ${if} $0 != 0
+      MessageBox MB_OK "$(ModifyingConfigureFailed)"
+    ${endif}
+  ${endif}
+
+  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
+  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
+  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
+  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"
+  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "${PRODUCT_EXE}"
+  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
+  WriteRegStr ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
+
+  CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
+  CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_EXE}"
+  CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}"
+
+  ${if} $CreateDesktopIcon == "true"
+    CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "${PRODUCT_EXE}"
+  ${endif}
+
+  ${if} $CreateFileAssociations == "true"
+    ${CreateApplicationAssociation} \
+      "${PRODUCT_NAME}" \
+      "${PRODUCT_NAME}" \
+      "${PRODUCT_NAME} Document" \
+      "${PRODUCT_EXE},1" \
+      "${PRODUCT_EXE}"
+
+    ${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
+  ${endif}
+
+  WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
+SectionEnd
+
+; Section descriptions
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "$(SecCoreDescription)"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecAllUsers} "$(SecAllUsersDescription)"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecFileAssoc} "$(SecFileAssocDescription)"
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+;--------------------------------
+
+; This hook function is called internally by NSIS on installer startup
+Function .onInit
+  !insertmacro MUI_LANGDLL_DISPLAY
+
+  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioDownload.ini"
+  !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioSummary.ini"
+
+  ; Default settings
+  ; These can be reset to "all" in section SecAllUsers.
+  SetShellVarContext current
+  StrCpy $ProductRootKey "HKCU"
+
+  ; This can be reset to "true" in section SecDesktop.
+  StrCpy $CreateDesktopIcon "false"
+  StrCpy $CreateFileAssociations "false"
+
+  ; If the user does *not* have administrator privileges,
+  ; then make section SecAllUsers readonly.
+  Call IsUserAdmin
+  Pop $0
+  ${if} $0 == "true"
+    !define ENABLE 0x00000001
+    SectionGetFlags ${SecAllUsers} $0
+    IntOp $0 $0 | ${ENABLE}
+    SectionSetFlags ${SecAllUsers} $0
+    !undef ENABLE
+  ${else}
+    !define READ_ONLY 0x00000010
+    SectionGetFlags ${SecAllUsers} $0
+    IntOp $0 $0 | ${READ_ONLY}
+    SectionSetFlags ${SecAllUsers} $0
+    !undef READ_ONLY
+  ${endif}
+
+  ClearErrors
+FunctionEnd
+
+;--------------------------------
+
+Function DownloadMinSYS
+
+  ; Search the registry for the MinSYS uninstaller.
+  ; If successful, put its location in $2.
+  StrCpy $3 "Software\Microsoft\Windows\CurrentVersion\Uninstall"
+  StrCpy $2 ""
+  StrCpy $0 0
+  loop:
+    EnumRegKey $1 HKLM "$3" $0
+    ${if} $1 == ""
+      Goto done
+    ${endif}
+
+    ${StrLoc} $2 "$1" "MSYS-1.0" "<"
+    ${if} $2 > 0
+      StrCpy $2 "$3\$1"
+      Goto done
+    ${else}
+      StrCpy $2 ""
+    ${endif}
+    IntOp $0 $0 + 1
+    Goto loop
+  done:
+
+  ${DownloadEnter} \
+      $MinSYSPath "$2" "Inno Setup: App Path" \
+      "" "\bin" \
+      0 \
+      "$(MinSYSDownloadLabel)" \
+      "$(MinSYSFolderLabel)" \
+      "$(MinSYSHeader)" \
+      "$(MinSYSDescription)"
+FunctionEnd
+
+Function DownloadMinSYS_LeaveFunction
+  ${DownloadLeave} \
+      $0 \
+      $DownloadMinSYS \
+      $MinSYSPath \
+      "http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82721&release_id=158803" \
+      "$(EnterMinSYSFolder)" \
+      "\sh.exe" \
+      "$(InvalidMinSYSFolder)"
+FunctionEnd
+
+;--------------------------------
+
+Function DownloadPython
+  ${DownloadEnter} \
+      $PythonPath "Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe" "" \
+      "\Python.exe" "" \
+      0 \
+      "$(PythonDownloadLabel)" \
+      "$(PythonFolderLabel)" \
+      "$(PythonHeader)" \
+      "$(PythonDescription)"
+FunctionEnd
+
+Function DownloadPython_LeaveFunction
+  ${DownloadLeave} \
+      $0 \
+      $DownloadPython \
+      $PythonPath \
+      "http://www.python.org/download/" \
+      "$(EnterPythonFolder)" \
+      "\Python.exe" \
+      "$(InvalidPythonFolder)"
+FunctionEnd
+
+;--------------------------------
+
+Function DownloadMiKTeX
+  ${DownloadEnter} \
+      $MiKTeXPath "Software\MiK\MiKTeX\CurrentVersion\MiKTeX" "Install Root" \
+      "" "\miktex\bin" \
+      1 \
+      "$(MiKTeXDownloadLabel)" \
+      "$(MiKTeXFolderLabel)" \
+      "$(MiKTeXHeader)" \
+      "$(MiKTeXDescription)"
+FunctionEnd
+
+Function DownloadMiKTeX_LeaveFunction
+  ${DownloadLeave} \
+      $DoNotRequireMiKTeX \
+      $DownloadMiKTeX \
+      $MiKTeXPath \
+      "http://www.miktex.org/setup.html" \
+      "$(EnterMiKTeXFolder)" \
+      "\latex.exe" \
+      "$(InvalidMiKTeXFolder)"
+FunctionEnd
+
+;--------------------------------
+
+Function DownloadPerl
+  ${DownloadEnter} \
+      $PerlPath "Software\Perl" BinDir \
+      "\perl.exe" "" \
+      1 \
+      "$(PerlDownloadLabel)" \
+      "$(PerlFolderLabel)" \
+      "$(PerlHeader)" \
+      "$(PerlDescription)"
+FunctionEnd
+
+Function DownloadPerl_LeaveFunction
+  ${DownloadLeave} \
+      $DoNotRequirePerl \
+      $DownloadPerl \
+      $PerlPath \
+      "http://www.activestate.com/Products/ActivePerl/" \
+      "$(EnterPerlFolder)" \
+      "\perl.exe" \
+      "$(InvalidPerlFolder)"
+FunctionEnd
+
+;--------------------------------
+
+Function DownloadImageMagick
+  ${DownloadEnter} \
+      $ImageMagickPath "Software\ImageMagick\Current" "BinPath" \
+      "" "" \
+      1 \
+      "$(ImageMagickDownloadLabel)" \
+      "$(ImageMagickFolderLabel)" \
+      "$(ImageMagickHeader)" \
+      "$(ImageMagickDescription)"
+FunctionEnd
+
+Function DownloadImageMagick_LeaveFunction
+  ${DownloadLeave} \
+      $DoNotRequireImageMagick \
+      $DownloadImageMagick \
+      $ImageMagickPath \
+      "http://www.imagemagick.org/script/binary-releases.php" \
+      "$(EnterImageMagickFolder)" \
+      "\convert.exe" \
+      "$(InvalidImageMagickFolder)"
+FunctionEnd
+
+;--------------------------------
+
+Function DownloadGhostscript
+
+  ; Find which version of ghostscript, if any, is installed.
+  EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
+  ${if} $1 != ""
+    StrCpy $0 "Software\AFPL Ghostscript\$1"
+  ${else}
+    StrCpy $0 ""
+  ${endif}
+
+  ${DownloadEnter} \
+      $GhostscriptPath "$0" "GS_DLL" \
+      "\gsdll32.dll" "" \
+      1 \
+      "$(GhostscriptDownloadLabel)" \
+      "$(GhostscriptFolderLabel)" \
+      "$(GhostscriptHeader)" \
+      "$(GhostscriptDescription)"
+FunctionEnd
+
+Function DownloadGhostscript_LeaveFunction
+  ${DownloadLeave} \
+      $DoNotRequireGhostscript \
+      $DownloadGhostscript \
+      $GhostscriptPath \
+      "http://www.cs.wisc.edu/~ghost/doc/AFPL/index.htm" \
+      "$(EnterGhostscriptFolder)" \
+      "\gswin32c.exe" \
+      "$(InvalidGhostscriptFolder)"
+FunctionEnd
+
+;--------------------------------
+
+Function SummariseDownloads
+
+  StrCpy $PathPrefix ""
+  ${if} $MinSYSPath != ""
+    StrCpy $PathPrefix "$PathPrefix;$MinSYSPath"
+  ${endif}
+  ${if} $PythonPath != ""
+    StrCpy $PathPrefix "$PathPrefix;$PythonPath"
+  ${endif}
+  ${if} $MiKTeXPath != ""
+    StrCpy $PathPrefix "$PathPrefix;$MiKTeXPath"
+  ${endif}
+  ${if} $PerlPath != ""
+    StrCpy $PathPrefix "$PathPrefix;$PerlPath"
+  ${endif}
+  ${if} $ImageMagickPath != ""
+    StrCpy $PathPrefix "$PathPrefix;$ImageMagickPath"
+  ${endif}
+  ${if} $GhostscriptPath != ""
+    StrCpy $PathPrefix "$PathPrefix;$GhostscriptPath"
+  ${endif}
+  ; Remove the leading ';'
+  StrCpy $PathPrefix "$PathPrefix" "" 1
+
+  IntOp $DoNotInstallLyX $DownloadMinSYS + $DownloadPython
+  IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadMiKTeX
+  IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadPerl
+  IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadImageMagick
+  IntOp $DoNotInstallLyX $DoNotInstallLyX + $DownloadGhostscript
+
+  ${if} "$DoNotInstallLyX" == 1
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" "$(SummaryPleaseInstall)"
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" ""
+  ${else}
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 1" "Text" "$(SummaryPathPrefix)"
+    !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSummary.ini" "Field 2" "Text" "$PathPrefix"
+  ${endif}
+
+  !insertmacro MUI_HEADER_TEXT "$(SummaryTitle)" ""
+  !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioSummary.ini"
+FunctionEnd
+
+Function SummariseDownloads_LeaveFunction
+  ${if} "$DoNotInstallLyX" == 1
+    Quit
+  ${endif}
+FunctionEnd
+
+;--------------------------------
+; The Uninstaller
+
+Function un.onInit
+
+  !insertmacro MUI_UNGETLANGUAGE
+
+  ; Ascertain whether the user has sufficient privileges to uninstall.
+  SetShellVarContext current
+
+  ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
+  ${if} $0 == ""
+    ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "RootKey"
+    ${if} $0 == ""
+      MessageBox MB_OK "$(UnNotInRegistryLabel)"
+    ${endif}
+  ${endif}
+
+  ${if} $0 == "HKLM"
+    Call un.IsUserAdmin
+    Pop $0
+    ${if} $0 == "true"
+      SetShellVarContext all
+    ${else}
+      MessageBox MB_OK "$(UnNotAdminLabel)"
+      Abort
+    ${endif}
+  ${endif}
+
+  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2
+  Abort
+FunctionEnd
+
+
+Function un.onUninstSuccess
+  HideWindow
+  MessageBox MB_ICONINFORMATION|MB_OK "$(UnRemoveSuccessLabel)"
+FunctionEnd
+
+
+Section Uninstall
+  RMDir /r $INSTDIR
+
+  ReadRegStr $0 ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu"
+  RMDir /r "$0"
+
+  Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
+
+  DeleteRegKey ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
+  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
+
+  ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
+
+  SetAutoClose true
+SectionEnd
+
+; eof
diff --git a/development/Win32/packaging/installer/lyx_languages/english.nsh b/development/Win32/packaging/installer/lyx_languages/english.nsh
new file mode 100644 (file)
index 0000000..75ee952
--- /dev/null
@@ -0,0 +1,80 @@
+!ifndef _LYX_LANGUAGES_ENGLISH_NSH_
+!define _LYX_LANGUAGES_ENGLISH_NSH_
+
+!ifdef LYX_LANG
+  !undef LYX_LANG
+!endif
+!define LYX_LANG ${LANG_ENGLISH}
+
+LicenseLangString LyXLicenseData ${LYX_LANG} "${PRODUCT_LICENSE_FILE}"
+
+LangString SecAllUsersTitle "${LYX_LANG}" "Install for all users?"
+LangString SecFileAssocTitle "${LYX_LANG}" "File associations"
+LangString SecDesktopTitle "${LYX_LANG}" "Desktop icon"
+
+LangString SecCoreDescription "${LYX_LANG}" "The ${PRODUCT_NAME} files."
+LangString SecAllUsersDescription "${LYX_LANG}" "Install for all users or just the current user. (Requires Administrator privileges.)"
+LangString SecFileAssocDescription "${LYX_LANG}" "Create associations between the executable and the .lyx extension."
+LangString SecDesktopDescription "${LYX_LANG}" "A ${PRODUCT_NAME} icon on the desktop."
+
+LangString ModifyingConfigureFailed "${LYX_LANG}" "Failed attempting to set 'path_prefix' in the configure script"
+
+LangString FinishPageMessage "${LYX_LANG}" "Congratulations! LyX has been installed successfully."
+LangString FinishPageRun "${LYX_LANG}" "Launch LyX"
+
+LangString DownloadPageField2 "${LYX_LANG}" "&Do not install"
+
+LangString MinSYSHeader "${LYX_LANG}" "MinSYS"
+LangString MinSYSDescription "${LYX_LANG}" "MinSYS is a minimal unix scripting environment (www.mingw.org/msys.shtml) which ${PRODUCT_NAME} needs to run a number of scripts."
+LangString EnterMinSYSFolder "${LYX_LANG}" "Please input the path to the folder containing MinSYS.exe"
+LangString InvalidMinSYSFolder "${LYX_LANG}" "Unable to find MinSYS.exe"
+LangString MinSYSDownloadLabel "${LYX_LANG}" "&Download MinSYS"
+LangString MinSYSFolderLabel "${LYX_LANG}" "&Folder containing sh.exe"
+
+LangString PythonHeader "${LYX_LANG}" "Python"
+LangString PythonDescription "${LYX_LANG}" "The Python scripting language (www.python.org) must be installed or ${PRODUCT_NAME} will be unable to run a number of scripts."
+LangString EnterPythonFolder "${LYX_LANG}" "Please input the path to the folder containing Python.exe"
+LangString InvalidPythonFolder "${LYX_LANG}" "Unable to find Python.exe"
+LangString PythonDownloadLabel "${LYX_LANG}" "&Download Python"
+LangString PythonFolderLabel "${LYX_LANG}" "&Folder containing Python.exe"
+
+LangString MiKTeXHeader "${LYX_LANG}" "MiKTeX"
+LangString MiKTeXDescription "${LYX_LANG}" "MiKTeX (www.miktex.org) is an up-to-date TeX implementation for Windows."
+LangString EnterMiKTeXFolder "${LYX_LANG}" "Please input the path to the folder containing latex.exe"
+LangString InvalidMiKTeXFolder "${LYX_LANG}" "Unable to find latex.exe"
+LangString MiKTeXDownloadLabel "${LYX_LANG}" "&Download MiKTeX"
+LangString MiKTeXFolderLabel "${LYX_LANG}" "&Folder containing latex.exe"
+
+LangString PerlHeader "${LYX_LANG}" "Perl"
+LangString PerlDescription "${LYX_LANG}" "If you plan on using reLyX to convert LaTeX documents to LyX ones, then you should install Perl (www.perl.com)."
+LangString EnterPerlFolder "${LYX_LANG}" "Please input the path to the folder containing Perl.exe"
+LangString InvalidPerlFolder "${LYX_LANG}" "Unable to find Perl.exe"
+LangString PerlDownloadLabel "${LYX_LANG}" "&Download Perl"
+LangString PerlFolderLabel "${LYX_LANG}" "&Folder containing perl.exe"
+
+LangString ImageMagickHeader "${LYX_LANG}" "ImageMagick"
+LangString ImageMagickDescription "${LYX_LANG}" "The ImageMagick tools (www.imagemagick.org/script/index.php) can be used to convert graphics files to whatever output format is needed."
+LangString EnterImageMagickFolder "${LYX_LANG}" "Please input the path to the folder containing convert.exe"
+LangString InvalidImageMagickFolder "${LYX_LANG}" "Unable to find convert.exe"
+LangString ImageMagickDownloadLabel "${LYX_LANG}" "&Download ImageMagick"
+LangString ImageMagickFolderLabel "${LYX_LANG}" "&Folder containing convert.exe"
+
+LangString GhostscriptHeader "${LYX_LANG}" "Ghostscript"
+LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) is used to convert images to/from PostScript."
+LangString EnterGhostscriptFolder "${LYX_LANG}" "Please input the path to the folder containing gswin32c.exe"
+LangString InvalidGhostscriptFolder "${LYX_LANG}" "Unable to find gswin32c.exe"
+LangString GhostscriptDownloadLabel "${LYX_LANG}" "&Download Ghostscript"
+LangString GhostscriptFolderLabel "${LYX_LANG}" "&Folder containing gswin32c.exe"
+
+LangString SummaryTitle "${LYX_LANG}" "Software summary"
+LangString SummaryPleaseInstall "${LYX_LANG}" "Please install your downloaded files and then run LyX's installer once again."
+LangString SummaryPathPrefix "${LYX_LANG}" "I shall add a 'path_prefix' string to 'lyxrc.defaults' containing:$\r$\n$PathPrefix"
+
+LangString UnNotInRegistryLabel "${LYX_LANG}" "Unable to find $(^Name) in the registry$\r$\nShortcuts on the desktop and in the Start Menu will not be removed."
+LangString UnNotAdminLabel "${LYX_LANG}" "Sorry! You must have administrator privileges$\r$\nto uninstall $(^Name)."
+LangString UnReallyRemoveLabel "${LYX_LANG}" "Are you sure you want to completely remove $(^Name) and all of its components?"
+LangString UnRemoveSuccessLabel "${LYX_LANG}" "$(^Name) was successfully removed from your computer."
+
+!undef LYX_LANG
+
+!endif ; _LYX_LANGUAGES_ENGLISH_NSH_
diff --git a/development/Win32/packaging/installer/lyx_languages/french.nsh b/development/Win32/packaging/installer/lyx_languages/french.nsh
new file mode 100644 (file)
index 0000000..a98deb9
--- /dev/null
@@ -0,0 +1,80 @@
+!ifndef _LYX_LANGUAGES_FRENCH_NSH_
+!define _LYX_LANGUAGES_FRENCH_NSH_
+
+!ifdef LYX_LANG
+  !undef LYX_LANG
+!endif
+!define LYX_LANG ${LANG_FRENCH}
+
+LicenseLangString LyXLicenseData ${LYX_LANG} "${PRODUCT_LICENSE_FILE}"
+
+LangString SecAllUsersTitle "${LYX_LANG}" "Install for all users?"
+LangString SecFileAssocTitle "${LYX_LANG}" "File associations"
+LangString SecDesktopTitle "${LYX_LANG}" "Desktop icon"
+
+LangString SecCoreDescription "${LYX_LANG}" "The ${PRODUCT_NAME} files."
+LangString SecAllUsersDescription "${LYX_LANG}" "Install for all users or just the current user. (Requires Administrator privileges.)"
+LangString SecFileAssocDescription "${LYX_LANG}" "Create associations between the executable and the .lyx extension."
+LangString SecDesktopDescription "${LYX_LANG}" "A ${PRODUCT_NAME} icon on the desktop."
+
+LangString ModifyingConfigureFailed "${LYX_LANG}" "Failed attempting to set 'path_prefix' in the configure script"
+
+LangString FinishPageMessage "${LYX_LANG}" "Congratulations! LyX has been installed successfully."
+LangString FinishPageRun "${LYX_LANG}" "Launch LyX"
+
+LangString DownloadPageField2 "${LYX_LANG}" "&Do not install"
+
+LangString MinSYSHeader "${LYX_LANG}" "MinSYS"
+LangString MinSYSDescription "${LYX_LANG}" "MinSYS is a minimal unix scripting environment (www.mingw.org/msys.shtml) which ${PRODUCT_NAME} needs to run a number of scripts."
+LangString EnterMinSYSFolder "${LYX_LANG}" "Please input the path to the folder containing MinSYS.exe"
+LangString InvalidMinSYSFolder "${LYX_LANG}" "Unable to find MinSYS.exe"
+LangString MinSYSDownloadLabel "${LYX_LANG}" "&Download MinSYS"
+LangString MinSYSFolderLabel "${LYX_LANG}" "&Folder containing sh.exe"
+
+LangString PythonHeader "${LYX_LANG}" "Python"
+LangString PythonDescription "${LYX_LANG}" "The Python scripting language (www.python.org) must be installed or ${PRODUCT_NAME} will be unable to run a number of scripts."
+LangString EnterPythonFolder "${LYX_LANG}" "Please input the path to the folder containing Python.exe"
+LangString InvalidPythonFolder "${LYX_LANG}" "Unable to find Python.exe"
+LangString PythonDownloadLabel "${LYX_LANG}" "&Download Python"
+LangString PythonFolderLabel "${LYX_LANG}" "&Folder containing Python.exe"
+
+LangString MiKTeXHeader "${LYX_LANG}" "MiKTeX"
+LangString MiKTeXDescription "${LYX_LANG}" "MiKTeX (www.miktex.org) is an up-to-date TeX implementation for Windows."
+LangString EnterMiKTeXFolder "${LYX_LANG}" "Please input the path to the folder containing latex.exe"
+LangString InvalidMiKTeXFolder "${LYX_LANG}" "Unable to find latex.exe"
+LangString MiKTeXDownloadLabel "${LYX_LANG}" "&Download MiKTeX"
+LangString MiKTeXFolderLabel "${LYX_LANG}" "&Folder containing latex.exe"
+
+LangString PerlHeader "${LYX_LANG}" "Perl"
+LangString PerlDescription "${LYX_LANG}" "If you plan on using reLyX to convert LaTeX documents to LyX ones, then you should install Perl (www.perl.com)."
+LangString EnterPerlFolder "${LYX_LANG}" "Please input the path to the folder containing Perl.exe"
+LangString InvalidPerlFolder "${LYX_LANG}" "Unable to find Perl.exe"
+LangString PerlDownloadLabel "${LYX_LANG}" "&Download Perl"
+LangString PerlFolderLabel "${LYX_LANG}" "&Folder containing perl.exe"
+
+LangString ImageMagickHeader "${LYX_LANG}" "ImageMagick"
+LangString ImageMagickDescription "${LYX_LANG}" "The ImageMagick tools (www.imagemagick.org/script/index.php) can be used to convert graphics files to whatever output format is needed."
+LangString EnterImageMagickFolder "${LYX_LANG}" "Please input the path to the folder containing convert.exe"
+LangString InvalidImageMagickFolder "${LYX_LANG}" "Unable to find convert.exe"
+LangString ImageMagickDownloadLabel "${LYX_LANG}" "&Download ImageMagick"
+LangString ImageMagickFolderLabel "${LYX_LANG}" "&Folder containing convert.exe"
+
+LangString GhostscriptHeader "${LYX_LANG}" "Ghostscript"
+LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) is used to convert images to/from PostScript."
+LangString EnterGhostscriptFolder "${LYX_LANG}" "Please input the path to the folder containing gswin32c.exe"
+LangString InvalidGhostscriptFolder "${LYX_LANG}" "Unable to find gswin32c.exe"
+LangString GhostscriptDownloadLabel "${LYX_LANG}" "&Download Ghostscript"
+LangString GhostscriptFolderLabel "${LYX_LANG}" "&Folder containing gswin32c.exe"
+
+LangString SummaryTitle "${LYX_LANG}" "Software summary"
+LangString SummaryPleaseInstall "${LYX_LANG}" "Please install your downloaded files and then run LyX's installer once again."
+LangString SummaryPathPrefix "${LYX_LANG}" "I shall add a 'path_prefix' string to 'lyxrc.defaults' containing:$\r$\n$PathPrefix"
+
+LangString UnNotInRegistryLabel "${LYX_LANG}" "Unable to find $(^Name) in the registry$\r$\nShortcuts on the desktop and in the Start Menu will not be removed."
+LangString UnNotAdminLabel "${LYX_LANG}" "Sorry! You must have administrator privileges$\r$\nto uninstall $(^Name)."
+LangString UnReallyRemoveLabel "${LYX_LANG}" "Are you sure you want to completely remove $(^Name) and all of its components?"
+LangString UnRemoveSuccessLabel "${LYX_LANG}" "$(^Name) was successfully removed from your computer."
+
+!undef LYX_LANG
+
+!endif ; _LYX_LANGUAGES_FRENCH_NSH_
diff --git a/development/Win32/packaging/installer/lyx_languages/german.nsh b/development/Win32/packaging/installer/lyx_languages/german.nsh
new file mode 100644 (file)
index 0000000..0cb4d8c
--- /dev/null
@@ -0,0 +1,80 @@
+!ifndef _LYX_LANGUAGES_GERMAN_NSH_
+!define _LYX_LANGUAGES_GERMAN_NSH_
+
+!ifdef LYX_LANG
+  !undef LYX_LANG
+!endif
+!define LYX_LANG ${LANG_GERMAN}
+
+LicenseLangString LyXLicenseData ${LYX_LANG} "${PRODUCT_LICENSE_FILE}"
+
+LangString SecAllUsersTitle "${LYX_LANG}" "Install for all users?"
+LangString SecFileAssocTitle "${LYX_LANG}" "File associations"
+LangString SecDesktopTitle "${LYX_LANG}" "Desktop icon"
+
+LangString SecCoreDescription "${LYX_LANG}" "The ${PRODUCT_NAME} files."
+LangString SecAllUsersDescription "${LYX_LANG}" "Install for all users or just the current user. (Requires Administrator privileges.)"
+LangString SecFileAssocDescription "${LYX_LANG}" "Create associations between the executable and the .lyx extension."
+LangString SecDesktopDescription "${LYX_LANG}" "A ${PRODUCT_NAME} icon on the desktop."
+
+LangString ModifyingConfigureFailed "${LYX_LANG}" "Failed attempting to set 'path_prefix' in the configure script"
+
+LangString FinishPageMessage "${LYX_LANG}" "Congratulations! LyX has been installed successfully."
+LangString FinishPageRun "${LYX_LANG}" "Launch LyX"
+
+LangString DownloadPageField2 "${LYX_LANG}" "&Do not install"
+
+LangString MinSYSHeader "${LYX_LANG}" "MinSYS"
+LangString MinSYSDescription "${LYX_LANG}" "MinSYS is a minimal unix scripting environment (www.mingw.org/msys.shtml) which ${PRODUCT_NAME} needs to run a number of scripts."
+LangString EnterMinSYSFolder "${LYX_LANG}" "Please input the path to the folder containing MinSYS.exe"
+LangString InvalidMinSYSFolder "${LYX_LANG}" "Unable to find MinSYS.exe"
+LangString MinSYSDownloadLabel "${LYX_LANG}" "&Download MinSYS"
+LangString MinSYSFolderLabel "${LYX_LANG}" "&Folder containing sh.exe"
+
+LangString PythonHeader "${LYX_LANG}" "Python"
+LangString PythonDescription "${LYX_LANG}" "The Python scripting language (www.python.org) must be installed or ${PRODUCT_NAME} will be unable to run a number of scripts."
+LangString EnterPythonFolder "${LYX_LANG}" "Please input the path to the folder containing Python.exe"
+LangString InvalidPythonFolder "${LYX_LANG}" "Unable to find Python.exe"
+LangString PythonDownloadLabel "${LYX_LANG}" "&Download Python"
+LangString PythonFolderLabel "${LYX_LANG}" "&Folder containing Python.exe"
+
+LangString MiKTeXHeader "${LYX_LANG}" "MiKTeX"
+LangString MiKTeXDescription "${LYX_LANG}" "MiKTeX (www.miktex.org) is an up-to-date TeX implementation for Windows."
+LangString EnterMiKTeXFolder "${LYX_LANG}" "Please input the path to the folder containing latex.exe"
+LangString InvalidMiKTeXFolder "${LYX_LANG}" "Unable to find latex.exe"
+LangString MiKTeXDownloadLabel "${LYX_LANG}" "&Download MiKTeX"
+LangString MiKTeXFolderLabel "${LYX_LANG}" "&Folder containing latex.exe"
+
+LangString PerlHeader "${LYX_LANG}" "Perl"
+LangString PerlDescription "${LYX_LANG}" "If you plan on using reLyX to convert LaTeX documents to LyX ones, then you should install Perl (www.perl.com)."
+LangString EnterPerlFolder "${LYX_LANG}" "Please input the path to the folder containing Perl.exe"
+LangString InvalidPerlFolder "${LYX_LANG}" "Unable to find Perl.exe"
+LangString PerlDownloadLabel "${LYX_LANG}" "&Download Perl"
+LangString PerlFolderLabel "${LYX_LANG}" "&Folder containing perl.exe"
+
+LangString ImageMagickHeader "${LYX_LANG}" "ImageMagick"
+LangString ImageMagickDescription "${LYX_LANG}" "The ImageMagick tools (www.imagemagick.org/script/index.php) can be used to convert graphics files to whatever output format is needed."
+LangString EnterImageMagickFolder "${LYX_LANG}" "Please input the path to the folder containing convert.exe"
+LangString InvalidImageMagickFolder "${LYX_LANG}" "Unable to find convert.exe"
+LangString ImageMagickDownloadLabel "${LYX_LANG}" "&Download ImageMagick"
+LangString ImageMagickFolderLabel "${LYX_LANG}" "&Folder containing convert.exe"
+
+LangString GhostscriptHeader "${LYX_LANG}" "Ghostscript"
+LangString GhostscriptDescription "${LYX_LANG}" "Ghostscript (http://www.cs.wisc.edu/~ghost/) is used to convert images to/from PostScript."
+LangString EnterGhostscriptFolder "${LYX_LANG}" "Please input the path to the folder containing gswin32c.exe"
+LangString InvalidGhostscriptFolder "${LYX_LANG}" "Unable to find gswin32c.exe"
+LangString GhostscriptDownloadLabel "${LYX_LANG}" "&Download Ghostscript"
+LangString GhostscriptFolderLabel "${LYX_LANG}" "&Folder containing gswin32c.exe"
+
+LangString SummaryTitle "${LYX_LANG}" "Software summary"
+LangString SummaryPleaseInstall "${LYX_LANG}" "Please install your downloaded files and then run LyX's installer once again."
+LangString SummaryPathPrefix "${LYX_LANG}" "I shall add a 'path_prefix' string to 'lyxrc.defaults' containing:$\r$\n$PathPrefix"
+
+LangString UnNotInRegistryLabel "${LYX_LANG}" "Unable to find $(^Name) in the registry$\r$\nShortcuts on the desktop and in the Start Menu will not be removed."
+LangString UnNotAdminLabel "${LYX_LANG}" "Sorry! You must have administrator privileges$\r$\nto uninstall $(^Name)."
+LangString UnReallyRemoveLabel "${LYX_LANG}" "Are you sure you want to completely remove $(^Name) and all of its components?"
+LangString UnRemoveSuccessLabel "${LYX_LANG}" "$(^Name) was successfully removed from your computer."
+
+!undef LYX_LANG
+
+!endif ; _LYX_LANGUAGES_GERMAN_NSH_
diff --git a/development/Win32/packaging/installer/lyx_path_prefix.C b/development/Win32/packaging/installer/lyx_path_prefix.C
new file mode 100644 (file)
index 0000000..305d32a
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * \file lyx_path_prefix.C
+ * This file is part of LyX, the document processor.
+ * http://www.lyx.org/
+ * Licence details can be found in the file COPYING or copy at
+ * http://www.lyx.org/about/license.php3
+
+ * \author Angus Leeming
+ * Full author contact details are available in file CREDITS or copy at
+ * http://www.lyx.org/about/credits.php
+ *
+ * This little piece of code is used to insert some code into LyX's
+ * Resources/lyx/configure script so that it will cause lyxrc.defaults to
+ * contain
+ *
+ * \path_prefix "<path to sh.exe>;<path to python.exe>;..."
+ *
+ * Compile the code with
+ *
+ * g++ -I/c/Program\ Files/NSIS/Contrib -Wall -shared \
+ *    lyx_path_prefix.c -o lyx_path_prefix.dll
+ *
+ * Move resulting .dll to /c/Program\ Files/NSIS/Plugins
+ */
+
+#include <windows.h>
+#include "ExDLL/exdll.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <fstream>
+#include <iostream>
+#include <string>
+
+namespace {
+
+std::string const subst(std::string const & a,
+                       std::string const & oldstr,
+                       std::string const & newstr)
+{
+       std::string lstr = a;
+       std::string::size_type i = 0;
+       std::string::size_type const olen = oldstr.length();
+       while ((i = lstr.find(oldstr, i)) != std::string::npos) {
+               lstr.replace(i, olen, newstr);
+               i += newstr.length(); // We need to be sure that we dont
+               // use the same i over and over again.
+       }
+       return lstr;
+}
+
+} // namespace anon
+
+
+BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved)
+{
+       return TRUE;
+}
+
+
+extern "C"
+void __declspec(dllexport) set(HWND hwndParent, int string_size, char *variables, stack_t **stacktop)
+{
+       char configure_file[MAX_PATH];
+       char path_prefix[MAX_PATH];
+
+       EXDLL_INIT();
+
+       popstring(configure_file);
+       popstring(path_prefix);
+
+       std::fstream fs(configure_file);
+       if (!fs) {
+               pushstring("-1");
+               return;
+       }
+
+       std::istreambuf_iterator<char> const begin(fs);
+       std::istreambuf_iterator<char> const end;
+
+       std::string configure_data(begin, end);
+       std::string::size_type const xfonts_pos = configure_data.find("X FONTS");
+       if (xfonts_pos == std::string::npos) {
+               pushstring("-1");
+               return;
+       }
+
+       std::string::size_type const xfonts_start =
+               configure_data.find_last_of('\n', xfonts_pos);
+       if (xfonts_start == std::string::npos) {
+               pushstring("-1");
+               return;
+       }
+
+       fs.seekg(0);
+       fs << configure_data.substr(0, xfonts_start)
+          << "\n"
+             "cat >>$outfile <<EOF\n"
+             "\n"
+             "\\\\path_prefix \"" << subst(path_prefix, "\\", "\\\\") << "\"\n"
+             "EOF\n"
+          << configure_data.substr(xfonts_start);
+
+       // Now we've rebuilt configure, run it to generate things like
+       // lyxrc.defaults.
+       std::string configure_dir(configure_file);
+       std::string::size_type const final_slash = configure_dir.find_last_of('\\');
+       if (final_slash == std::string::npos) {
+               pushstring("-1");
+               return;
+       }
+       configure_dir = configure_dir.substr(0, final_slash);
+       if (SetCurrentDirectory(configure_dir.c_str()) == 0) {
+               pushstring("-1");
+               return;
+       }
+
+       char path[MAX_PATH];
+       if (GetEnvironmentVariable("PATH", path, MAX_PATH) == 0) {
+               pushstring("-1");
+               return;
+       }
+
+       std::string const path_str = std::string(path_prefix) + ';' + path;
+       if (SetEnvironmentVariable("PATH", path_str.c_str()) == 0) {
+               pushstring("-1");
+               return;
+       }
+
+       if (system("start /min sh.exe configure") != 0) {
+               pushstring("-1");
+               return;
+       }
+
+       pushstring("0");
+}
diff --git a/development/Win32/packaging/installer/lyxfunc.nsh b/development/Win32/packaging/installer/lyxfunc.nsh
new file mode 100644 (file)
index 0000000..2f5fadb
--- /dev/null
@@ -0,0 +1,14 @@
+!ifndef _LYX_FUNC_NSH_
+!define _LYX_FUNC_NSH_
+
+!macro LYX_DEFFUNC Name
+  !define `${Name}` `!insertmacro LYX_FUNCTION_${Name}`
+!macroend
+
+!macro LYX_FUNC ShortName
+  !undef `${ShortName}`
+  !define `${ShortName}` `!insertmacro LYX_FUNCTION_${ShortName}_Call`
+  Function `${ShortName}`
+!macroend
+
+!endif ; _LYX_FUNC_NSH_
diff --git a/development/Win32/packaging/installer/strtrim.nsh b/development/Win32/packaging/installer/strtrim.nsh
new file mode 100644 (file)
index 0000000..a585739
--- /dev/null
@@ -0,0 +1,53 @@
+!ifndef _STRTRIM_NSH_
+!define _STRTRIM_NSH_
+
+!include "lyxfunc.nsh"
+
+!insertmacro LYX_DEFFUNC `StrTrim`
+
+!macro LYX_FUNCTION_StrTrim
+  !insertmacro LYX_FUNC `StrTrim`
+
+    ; After this point:
+    ; $0 = String (input)
+    ; $1 = Temp (temp)
+
+    ; Get input from user
+    Exch $0
+    Push $1
+
+Loop:
+    StrCpy $1 "$0" 1
+    StrCmp "$1" " " TrimLeft
+    StrCmp "$1" "$\r" TrimLeft
+    StrCmp "$1" "$\n" TrimLeft
+    StrCmp "$1" "      " TrimLeft ; this is a tab.
+    GoTo Loop2
+TrimLeft:
+    StrCpy $0 "$0" "" 1
+    Goto Loop
+
+Loop2:
+    StrCpy $1 "$0" 1 -1
+    StrCmp "$1" " " TrimRight
+    StrCmp "$1" "$\r" TrimRight
+    StrCmp "$1" "$\n" TrimRight
+    StrCmp "$1" "      " TrimRight ; this is a tab
+    GoTo Done
+TrimRight:
+    StrCpy $0 "$0" -1
+    Goto Loop2
+
+Done:
+    Pop $1
+    Exch $0
+  FunctionEnd
+!macroend
+
+!macro LYX_FUNCTION_StrTrim_Call String
+  Push `${String}`
+  Call StrTrim
+  Pop `${String}`
+!macroend
+
+!endif ; _STRTRIM_NSH_
diff --git a/development/Win32/packaging/package_lyxwin.sh b/development/Win32/packaging/package_lyxwin.sh
new file mode 100644 (file)
index 0000000..f43e7b8
--- /dev/null
@@ -0,0 +1,111 @@
+#! /bin/sh
+
+# This script aims to do averything necessary to automate the packaging
+# of LyX/Win ready for an Windows Installer to be built.
+
+# It copies these files into the appropriate places in the LyX tree.
+#   qt-mt3.dll
+#   libiconv-2.dll
+#   mingw10.dll
+#   clean_dvi.py
+#   dv2dt.exe
+#   dt2dv.exe
+
+# It strips the executables.
+
+# It adds formats and converters to the Resources/lyx/configure script to
+# ensure that the generated .dvi file is usable.
+
+# It removes all stuff generated by running configure:
+#   xfonts/
+#   doc/LaTeXConfig.lyx
+#   lyxrc.defaults
+#   packages.lst
+#   textclass.lst
+
+# The installee should regenerate them by running configure on his machine.
+
+QT_DLL="$HOME/qt3/bin/qt-mt3.dll"
+LIBICONV_DLL="/j/MinGW/bin/libiconv-2.dll"
+MINGW_DLL="/j/MinGW/bin/mingwm10.dll"
+CLEAN_DVI_PY="clean_dvi.py"
+DTL_DIR=dtl
+DT2DV="$DTL_DIR/dt2dv.exe"
+DV2DT="$DTL_DIR/dv2dt.exe"
+
+LYX_INSTALL_DIR="/j/Programs/LyX"
+
+# Change this to 'mv -f' when you are confident that
+# the various sed scripts are working correctly.
+MV='mv -f'
+
+windows_packaging()
+{
+    # Install the necessary .dlls and clean_dvi stuff.
+    for file in "${QT_DLL}" "${LIBICONV_DLL}" "${MINGW_DLL}" "${DT2DV}" "${DV2DT}"
+    do
+      cp "${file}" "$LYX_INSTALL_DIR"/bin/. || {
+         echo "Failed to copy ${file} to the LyX package" >&2
+         exit 1
+      }
+    done
+
+    cp "${CLEAN_DVI_PY}" "$LYX_INSTALL_DIR"/Resources/lyx/scripts/. || {
+       echo "Failed to copy ${CLEAN_DVI_PY} to the LyX package" >&2
+       exit 1
+    }
+
+    # Strip the executables
+    (
+       cd "${LYX_INSTALL_DIR}/bin"
+       for file in *.exe
+       do
+         strip $file
+       done
+    )
+
+    # Modify the configure script,
+    # * add a dvi2 format
+    # * change the latex->dvi converter to latex->dvi2
+    # * add a dvi2->dvi converter
+    # * fix the generated chkconfig.sed so that it works with versions of
+    #   sed that get confused by sed scripts with DOS line endings.
+    TMP=tmp.$$
+    CONFIGURE="${LYX_INSTALL_DIR}"/Resources/lyx/configure
+    # Do this to make it easy to compare the before and after files.
+    dos2unix "${CONFIGURE}"
+    sed '
+# (Note that this sed script contains TAB characters.)
+# Append the dvi2 format after the dvi format.
+/^ *\\\\Format[         ]\{1,\}dvi[     ]\{1,\}/a\
+\\\\Format dvi2          dvi   DirtyDVI        ""
+
+# Change the latex->dvi converter to latex->dvi2
+# and append the dvi2->dvi converter
+/^ *\\\\converter[      ]\{1,\}latex[   ]\{1,\}dvi[     ]\{1,\}/{
+s/dvi/dvi2/
+a\
+\\\\converter dvi2 dvi "python \\\$\\\$s/scripts/clean_dvi.py \\\$\\\$i \\\$\\\$o" ""
+}
+' "${CONFIGURE}" > "${TMP}"
+    cmp -s "${CONFIGURE}" "${TMP}" || {
+       diff -u "${CONFIGURE}" "${TMP}"
+       ${MV} "${TMP}" "${CONFIGURE}"
+    }
+    rm -f "${TMP}"
+
+    # Strip the executables
+    (
+       cd "${LYX_INSTALL_DIR}/Resources/lyx"
+       rm -rf xfonts
+       for file in doc/LaTeXConfig.lyx lyxrc.defaults packages.lst textclass.lst
+       do
+         rm -f $file
+       done
+    )
+}
+
+
+windows_packaging || exit 1
+
+# The end