home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume10 / xdvi / patch10.01 next >
Encoding:
Internet Message Format  |  1990-10-18  |  49.2 KB

  1. Path: uunet!lll-winken!sun-barr!newstop!sun!math.Berkeley.EDU
  2. From: vojta@math.Berkeley.EDU (Paul Vojta)
  3. Newsgroups: comp.sources.x
  4. Subject: v10i009: xdvi, Patch10, Part01/02
  5. Message-ID: <143915@sun.Eng.Sun.COM>
  6. Date: 18 Oct 90 22:35:18 GMT
  7. References: <csx-10i009:xdvi@uunet.UU.NET>
  8. Sender: news@sun.Eng.Sun.COM
  9. Lines: 1505
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: vojta@math.Berkeley.EDU (Paul Vojta)
  13. Posting-number: Volume 10, Issue 9
  14. Archive-name: xdvi/patch10.01
  15. Patch-To: xdvi: Volume 3, Issues 37-39
  16. Patch-To: xdvi: Volume 4, Issue 44 (xdvi, Patch4)
  17. Patch-To: xdvi: Volume 4, Issue 96 (xdvi, dvi previewer, Patch5)
  18. Patch-To: xdvi: Volume 5, Issue 35 (xdvi, dvi previewer, patch 6, part 1/2)
  19. Patch-To: xdvi: Volume 5, Issue 36 (xdvi, dvi previewer, patch 6, part 2/2)
  20. Patch-To: xdvi: Volume 6, Issue  5 (xdvi, Patch7)
  21. Patch-To: xdvi: Volume 6, Issue 49 (xdvi, dvi previewer, patch 8)
  22. Patch-To: xdvi: Volume 7, Issue 52 (xdvi, dvi previewer, patch 9, part 1/2)
  23. Patch-To: xdvi: Volume 7, Issue 53 (xdvi, dvi previewer, patch 9, part 2/2)
  24.  
  25. This is patch 10 for xdvi.  In addition to the usual bug fixes, it implements:
  26.   1.  Uses the cursor keys as synonyms for 'u', 'd', etc.
  27.   2.  Expert mode (-DBUTTONS only):  hides the buttons.
  28.   3.  +sw option to inhibit warning about specials being ignored.
  29.   4.  -xoffset and -yoffset options to override the 1 inch default margins
  30.   5.  Improvements in font searching:  search for the actual size first,
  31.       and use the magic number in the font file to determine the format.
  32.  
  33. -- cut here --
  34. diff -cr xdvi_old/Imakefile xdvi_new/Imakefile
  35. *** xdvi_old/Imakefile    Mon Sep 17 17:34:43 1990
  36. --- xdvi_new/Imakefile    Wed Oct 10 13:20:15 1990
  37. ***************
  38. *** 1,9 ****
  39.   DEFAULT_FONT_PATH=/usr/local/tex/fonts
  40.   DEFAULT_FONT_SIZES=300:328.6:360:432:518.4:622:746.4
  41. ! DEFINES=-DMSBITFIRST \
  42. !   -DBMSHORT
  43. ! FONTDEFINES=-DDEFAULT_FONT_PATH=\"$(DEFAULT_FONT_PATH)\" \
  44. !   -DDEFAULT_FONT_SIZES=\"$(DEFAULT_FONT_SIZES)\"
  45.   FONTFORMATS_C=gf.c pk.c pxl.c
  46.   FONTFORMATS_O=gf.o pk.o pxl.o
  47.   
  48. --- 1,6 ----
  49.   DEFAULT_FONT_PATH=/usr/local/tex/fonts
  50.   DEFAULT_FONT_SIZES=300:328.6:360:432:518.4:622:746.4
  51. ! DEFS=-DMSBITFIRST -DBMSHORT -DBUTTONS
  52.   FONTFORMATS_C=gf.c pk.c pxl.c
  53.   FONTFORMATS_O=gf.o pk.o pxl.o
  54.   
  55. ***************
  56. *** 11,32 ****
  57.   LOCAL_LIBRARIES=XawClientLibs
  58.   MATHLIB=-lm
  59.   SYS_LIBRARIES=$(MATHLIB)
  60.   SRCS=xdvi.c dvi_init.c dvi_draw.c $(FONTFORMATS_C) pxl_open.c tpic.c
  61.   OBJS=xdvi.o dvi_init.o dvi_draw.o $(FONTFORMATS_O) pxl_open.o tpic.o
  62.   
  63.   ComplexProgramTarget(xdvi)
  64.   
  65. - pxl_open.o:
  66. -     $(CC) -c $(CFLAGS) $(FONTDEFINES) pxl_open.c
  67.   xdvi.man: xdvi_man.sed
  68.       chmod u+x mksedscript
  69. !     mksedscript $(DEFAULT_FONT_PATH) $(DEFAULT_FONT_SIZES) $(DEFINES) \
  70.           > sedscript
  71.       sed -f sedscript < xdvi_man.sed > xdvi.man
  72.   
  73.   clean::
  74. !     $(RM) sedscript xdvi.man xdvi10.man.s
  75. ! lint::
  76. !     $(LINT) $(INCLUDES) $(DEFINES) $(FONTDEFINES) $(SRCS)
  77. --- 8,26 ----
  78.   LOCAL_LIBRARIES=XawClientLibs
  79.   MATHLIB=-lm
  80.   SYS_LIBRARIES=$(MATHLIB)
  81. + LINTLIBS=$(LINTXAW) $(LINTXMU) $(LINTXTOOL) $(LINTEXTENSIONLIB) $(LINTXLIB) -lm
  82.   SRCS=xdvi.c dvi_init.c dvi_draw.c $(FONTFORMATS_C) pxl_open.c tpic.c
  83.   OBJS=xdvi.o dvi_init.o dvi_draw.o $(FONTFORMATS_O) pxl_open.o tpic.o
  84. + DEFINES=$(DEFS) -DDEFAULT_FONT_PATH=\"$(DEFAULT_FONT_PATH)\" \
  85. +   -DDEFAULT_FONT_SIZES=\"$(DEFAULT_FONT_SIZES)\"
  86.   
  87.   ComplexProgramTarget(xdvi)
  88.   
  89.   xdvi.man: xdvi_man.sed
  90.       chmod u+x mksedscript
  91. !     ./mksedscript $(DEFAULT_FONT_PATH) $(DEFAULT_FONT_SIZES) $(DEFS) \
  92.           > sedscript
  93.       sed -f sedscript < xdvi_man.sed > xdvi.man
  94.   
  95.   clean::
  96. !     $(RM) sedscript xdvi.man
  97. diff -cr xdvi_old/MAKE_VMS.COM xdvi_new/MAKE_VMS.COM
  98. *** xdvi_old/MAKE_VMS.COM    Mon Sep 17 17:34:45 1990
  99. --- xdvi_new/MAKE_VMS.COM    Sun Aug 12 14:29:23 1990
  100. ***************
  101. *** 6,12 ****
  102.   $ CC /DEFINE = (BMLONG, NOTOOL) PK
  103.   $ CC /DEFINE = (BMLONG, NOTOOL) PXL
  104.   $ CC /DEFINE = (BMLONG, NOTOOL, -
  105. !      "DEFAULT_FONT_PATH=""TEX$FONTS""", -
  106.        "DEFAULT_FONT_SIZES=""300/328.6/360/432/518.4/622/746.4""") PXL_OPEN
  107.   $ CC /DEFINE = (BMLONG, NOTOOL) TPIC
  108.   $ CC /DEFINE = (BMLONG, NOTOOL) XDVI
  109. --- 6,12 ----
  110.   $ CC /DEFINE = (BMLONG, NOTOOL) PK
  111.   $ CC /DEFINE = (BMLONG, NOTOOL) PXL
  112.   $ CC /DEFINE = (BMLONG, NOTOOL, -
  113. !      "DEFAULT_FONT_PATH=""TEX_FONTS""", -
  114.        "DEFAULT_FONT_SIZES=""300/328.6/360/432/518.4/622/746.4""") PXL_OPEN
  115.   $ CC /DEFINE = (BMLONG, NOTOOL) TPIC
  116.   $ CC /DEFINE = (BMLONG, NOTOOL) XDVI
  117. diff -cr xdvi_old/Makefile xdvi_new/Makefile
  118. *** xdvi_old/Makefile    Mon Sep 17 17:34:48 1990
  119. --- xdvi_new/Makefile    Wed Oct 10 13:42:41 1990
  120. ***************
  121. *** 6,13 ****
  122.   #
  123.   DEFAULT_FONT_PATH=/usr/local/tex/fonts
  124.   DEFAULT_FONT_SIZES=300:328.6:360:432:518.4:622:746.4
  125. ! DEFINES=-DMSBITFIRST \
  126. !   -DBMSHORT -DBUTTONS
  127.   FONTDEFINES=-DDEFAULT_FONT_PATH=\"$(DEFAULT_FONT_PATH)\" \
  128.     -DDEFAULT_FONT_SIZES=\"$(DEFAULT_FONT_SIZES)\"
  129.   FONTFORMATS_C=gf.c pk.c pxl.c
  130. --- 6,12 ----
  131.   #
  132.   DEFAULT_FONT_PATH=/usr/local/tex/fonts
  133.   DEFAULT_FONT_SIZES=300:328.6:360:432:518.4:622:746.4
  134. ! DEFS=-DMSBITFIRST -DBMSHORT -DBUTTONS
  135.   FONTDEFINES=-DDEFAULT_FONT_PATH=\"$(DEFAULT_FONT_PATH)\" \
  136.     -DDEFAULT_FONT_SIZES=\"$(DEFAULT_FONT_SIZES)\"
  137.   FONTFORMATS_C=gf.c pk.c pxl.c
  138. ***************
  139. *** 14,29 ****
  140.   FONTFORMATS_O=gf.o pk.o pxl.o
  141.   LIBDIR=/usr/custom/x11/lib
  142.   #LIBDIR=/tuna_a/x11r4/lib
  143. ! INCDIR=/usr/include
  144.   #INCDIR=/tuna_a/x11r4/include
  145. ! XMULIB=
  146. ! #XMULIB=-lXmu
  147.   EXTENSIONLIB=-lXext
  148.   DESTDIR=/usr/local/x11
  149.   BINDIR=$(DESTDIR)/bin
  150.   MANDIR=$(DESTDIR)/man
  151.   INCLUDES=-I$(INCDIR)
  152. ! CFLAGS=-O $(INCLUDES) $(DEFINES)
  153.   LIBS=-L$(LIBDIR) -lXaw $(XMULIB) -lXt $(EXTENSIONLIB) -lX11 -lm
  154.   SRCS=xdvi.c dvi_init.c dvi_draw.c $(FONTFORMATS_C) pxl_open.c tpic.c
  155.   OBJS=xdvi.o dvi_init.o dvi_draw.o $(FONTFORMATS_O) pxl_open.o tpic.o
  156. --- 13,27 ----
  157.   FONTFORMATS_O=gf.o pk.o pxl.o
  158.   LIBDIR=/usr/custom/x11/lib
  159.   #LIBDIR=/tuna_a/x11r4/lib
  160. ! INCDIR=
  161.   #INCDIR=/tuna_a/x11r4/include
  162. ! XMULIB=-lXmu
  163.   EXTENSIONLIB=-lXext
  164.   DESTDIR=/usr/local/x11
  165.   BINDIR=$(DESTDIR)/bin
  166.   MANDIR=$(DESTDIR)/man
  167.   INCLUDES=-I$(INCDIR)
  168. ! CFLAGS=-O $(INCLUDES) $(DEFS)
  169.   LIBS=-L$(LIBDIR) -lXaw $(XMULIB) -lXt $(EXTENSIONLIB) -lX11 -lm
  170.   SRCS=xdvi.c dvi_init.c dvi_draw.c $(FONTFORMATS_C) pxl_open.c tpic.c
  171.   OBJS=xdvi.o dvi_init.o dvi_draw.o $(FONTFORMATS_O) pxl_open.o tpic.o
  172. ***************
  173. *** 46,57 ****
  174.   pk.o:    xdvi.h
  175.   pxl.o:    xdvi.h
  176.   
  177. ! pxl_open.o:
  178.       $(CC) -c $(CFLAGS) $(FONTDEFINES) pxl_open.c
  179.   
  180.   xdvi.man: xdvi_man.sed
  181.       chmod u+x mksedscript
  182. !     mksedscript $(DEFAULT_FONT_PATH) $(DEFAULT_FONT_SIZES) $(DEFINES) \
  183.           > sedscript
  184.       sed -f sedscript < xdvi_man.sed > xdvi.man
  185.   
  186. --- 44,55 ----
  187.   pk.o:    xdvi.h
  188.   pxl.o:    xdvi.h
  189.   
  190. ! pxl_open.o:    xdvi.h
  191.       $(CC) -c $(CFLAGS) $(FONTDEFINES) pxl_open.c
  192.   
  193.   xdvi.man: xdvi_man.sed
  194.       chmod u+x mksedscript
  195. !     ./mksedscript $(DEFAULT_FONT_PATH) $(DEFAULT_FONT_SIZES) $(DEFS) \
  196.           > sedscript
  197.       sed -f sedscript < xdvi_man.sed > xdvi.man
  198.   
  199. ***************
  200. *** 61,67 ****
  201.   
  202.   clean:
  203.       $(RM) *.o *.BAK *.CKP sedscript xdvi.man xdvi a.out core errs *~
  204. -     $(RM) xdvi10.man.s
  205.   
  206.   lint:
  207. !     lint $(INCLUDES) $(DEFINES) $(FONTDEFINES) $(SRCS)
  208. --- 59,64 ----
  209.   
  210.   clean:
  211.       $(RM) *.o *.BAK *.CKP sedscript xdvi.man xdvi a.out core errs *~
  212.   
  213.   lint:
  214. !     lint $(INCLUDES) $(DEFS) $(FONTDEFINES) $(SRCS) -lm
  215. diff -cr xdvi_old/Makefile_10 xdvi_new/Makefile_10
  216. *** xdvi_old/Makefile_10    Mon Sep 17 17:34:50 1990
  217. --- xdvi_new/Makefile_10    Thu Oct 11 15:31:59 1990
  218. ***************
  219. *** 6,12 ****
  220.   #
  221.   DEFAULT_FONT_PATH=/usr/local/tex/fonts
  222.   DEFAULT_FONT_SIZES=300:328.6:360:432:518.4:622:746.4
  223. ! DEFINES=-DX10
  224.   FONTDEFINES=-DDEFAULT_FONT_PATH=\"$(DEFAULT_FONT_PATH)\" \
  225.     -DDEFAULT_FONT_SIZES=\"$(DEFAULT_FONT_SIZES)\"
  226.   FONTFORMATS_C=gf.c pk.c pxl.c
  227. --- 6,12 ----
  228.   #
  229.   DEFAULT_FONT_PATH=/usr/local/tex/fonts
  230.   DEFAULT_FONT_SIZES=300:328.6:360:432:518.4:622:746.4
  231. ! DEFS=-DX10
  232.   FONTDEFINES=-DDEFAULT_FONT_PATH=\"$(DEFAULT_FONT_PATH)\" \
  233.     -DDEFAULT_FONT_SIZES=\"$(DEFAULT_FONT_SIZES)\"
  234.   FONTFORMATS_C=gf.c pk.c pxl.c
  235. ***************
  236. *** 15,22 ****
  237.   BINDIR=$(DESTDIR)/bin
  238.   MANDIR=$(DESTDIR)/man
  239.   #INCLUDES=-I/usr/include/X
  240. ! CFLAGS=-O $(INCLUDES) $(DEFINES)
  241. ! LIBS=-lX -lm
  242.   SRCS=xdvi.c dvi_init.c dvi_draw.c $(FONTFORMATS_C) pxl_open.c tpic.c
  243.   OBJS=xdvi.o dvi_init.o dvi_draw.o $(FONTFORMATS_O) pxl_open.o tpic.o
  244.   CC=/tuna_a/gnu/bin/gcc
  245. --- 15,22 ----
  246.   BINDIR=$(DESTDIR)/bin
  247.   MANDIR=$(DESTDIR)/man
  248.   #INCLUDES=-I/usr/include/X
  249. ! CFLAGS=-O $(INCLUDES) $(DEFS)
  250. ! LIBS=-L/products/ccs/X10/lib -lX -lm
  251.   SRCS=xdvi.c dvi_init.c dvi_draw.c $(FONTFORMATS_C) pxl_open.c tpic.c
  252.   OBJS=xdvi.o dvi_init.o dvi_draw.o $(FONTFORMATS_O) pxl_open.o tpic.o
  253.   CC=/tuna_a/gnu/bin/gcc
  254. ***************
  255. *** 38,49 ****
  256.   pk.o:    xdvi.h
  257.   pxl.o:    xdvi.h
  258.   
  259. ! pxl_open.o:
  260.       $(CC) -c $(CFLAGS) $(FONTDEFINES) pxl_open.c
  261.   
  262.   xdvi.man: xdvi_man.sed
  263.       chmod u+x mksedscript
  264. !     mksedscript $(DEFAULT_FONT_PATH) $(DEFAULT_FONT_SIZES) $(DEFINES) \
  265.           > sedscript
  266.       sed -f sedscript < xdvi_man.sed > xdvi.man
  267.   
  268. --- 38,49 ----
  269.   pk.o:    xdvi.h
  270.   pxl.o:    xdvi.h
  271.   
  272. ! pxl_open.o:    xdvi.h
  273.       $(CC) -c $(CFLAGS) $(FONTDEFINES) pxl_open.c
  274.   
  275.   xdvi.man: xdvi_man.sed
  276.       chmod u+x mksedscript
  277. !     ./mksedscript $(DEFAULT_FONT_PATH) $(DEFAULT_FONT_SIZES) $(DEFS) \
  278.           > sedscript
  279.       sed -f sedscript < xdvi_man.sed > xdvi.man
  280.   
  281. ***************
  282. *** 53,59 ****
  283.   
  284.   clean:
  285.       $(RM) *.o *.BAK *.CKP sedscript xdvi.man xdvi a.out core errs *~
  286. -     $(RM) xdvi10.man.s
  287.   
  288.   lint:
  289. !     lint $(INCLUDES) $(DEFINES) $(FONTDEFINES) $(SRCS)
  290. --- 53,58 ----
  291.   
  292.   clean:
  293.       $(RM) *.o *.BAK *.CKP sedscript xdvi.man xdvi a.out core errs *~
  294.   
  295.   lint:
  296. !     lint $(INCLUDES) $(DEFS) $(FONTDEFINES) $(SRCS) -lm
  297. diff -cr xdvi_old/README xdvi_new/README
  298. *** xdvi_old/README    Mon Sep 17 17:34:54 1990
  299. --- xdvi_new/README    Wed Oct 10 13:34:24 1990
  300. ***************
  301. *** 1,7 ****
  302.   INSTALLATION INSTRUCTIONS
  303.   
  304.   To install, do the following:
  305. !     1.    Read the ENVIRONMENTS section of xdvi.man.sed to determine the correct
  306.       default values for the XDVIFONTS and XDVISIZES environment variables.
  307.       Edit the Imakefile or Makefile and change the values of the make
  308.       variables DEFAULT_FONT_PATH and DEFAULT_FONT_SIZES to these values.
  309. --- 1,7 ----
  310.   INSTALLATION INSTRUCTIONS
  311.   
  312.   To install, do the following:
  313. !     1.    Read the ENVIRONMENT section of xdvi_man.sed to determine the correct
  314.       default values for the XDVIFONTS and XDVISIZES environment variables.
  315.       Edit the Imakefile or Makefile and change the values of the make
  316.       variables DEFAULT_FONT_PATH and DEFAULT_FONT_SIZES to these values.
  317. ***************
  318. *** 28,41 ****
  319.       to reflect which font formats are actually used at your site.
  320.   
  321.   Other compilation flags are:
  322. !     FONT_PATH    (xdvi.c)  Name of the environment variable to use when
  323. !             searching for the font path
  324. !     DEFAULT_FONT_PATH  (xdvi.c)  Name of the default font path to use when
  325. !             the above environment variable is not set.  See the
  326. !             ENVIRONMENT section of the man page for details on
  327. !             how to get xdvi to recognize the directory structure
  328. !             you use for storing fonts.
  329. !     SYSV        (dvi_init pxl_open xdvi.c)  Set for System V
  330.               compilation.
  331.       VMS        Set for VMS compilation.
  332.       MSBITFIRST    (X11 only; xdvi.c dvi_draw.c gf.c pk.c pxl.c)  Store
  333. --- 28,34 ----
  334.       to reflect which font formats are actually used at your site.
  335.   
  336.   Other compilation flags are:
  337. !     SYSV        (dvi_init.c pxl_open.c xdvi.c)  Set for System V
  338.               compilation.
  339.       VMS        Set for VMS compilation.
  340.       MSBITFIRST    (X11 only; xdvi.c dvi_draw.c gf.c pk.c pxl.c)  Store
  341. ***************
  342. *** 63,70 ****
  343.               window for commonly used commands.
  344.       A4        (xdvi.c)  Use European size paper by default.
  345.   
  346. ! All flags should be set in the appropriate Makefile via the variable
  347. ! ``DEFINES''.
  348.   
  349.   ================================================================
  350.   
  351. --- 56,62 ----
  352.               window for commonly used commands.
  353.       A4        (xdvi.c)  Use European size paper by default.
  354.   
  355. ! All flags should be set in the appropriate Makefile via the variable ``DEFS''.
  356.   
  357.   ================================================================
  358.   
  359. ***************
  360. *** 180,184 ****
  361. --- 172,179 ----
  362.   --  Patchlevel 9:  --
  363.      23.    Removed obsolete '#' and '=' options from the X11 version:  they
  364.       interfere with emacs.
  365. + --  Patchlevel 10: --
  366. +    24.    Implemented arrow keys, expert mode, searching for the font's actual
  367. +     size first, the -[xy]offset and -sw options, and numerous bug fixes.
  368.   
  369.   Paul Vojta, vojta@math.berkeley.edu
  370. diff -cr xdvi_old/README.VMS xdvi_new/README.VMS
  371. *** xdvi_old/README.VMS    Mon Sep 17 17:35:05 1990
  372. --- xdvi_new/README.VMS    Mon Oct 15 12:41:40 1990
  373. ***************
  374. *** 6,14 ****
  375.   SYNOPSIS
  376.   --------
  377.   
  378. !    XDVI [+[page]] [-s shrink] [-density density] [-p pixels] [-l] [-rv]
  379.           [-bw width] [-fg color] [-bg color] [-hl color] [-bd color] [-cr color]
  380. !         [-margins inches] [-sidemargin inches] [-topmargin inches]
  381.           [-paper papertype] [-mgs[n] size] [-altfont font] [-thorough] [-copy]
  382.           [-geometry geometry] [-icongeometry geometry] [-iconic]
  383.           [-display display] dvi_file
  384. --- 6,15 ----
  385.   SYNOPSIS
  386.   --------
  387.   
  388. !    XDVI [+[page]] [-s shrink] [-density density] [-p pixels] [-l] [-rv] [-sw]
  389.           [-bw width] [-fg color] [-bg color] [-hl color] [-bd color] [-cr color]
  390. !         [-margins dimen] [-sidemargin dimen] [-topmargin dimen]
  391. !         [-offsets dimen] [-xoffset dimen] [-yoffset dimen]
  392.           [-paper papertype] [-mgs[n] size] [-altfont font] [-thorough] [-copy]
  393.           [-geometry geometry] [-icongeometry geometry] [-iconic]
  394.           [-display display] dvi_file
  395. ***************
  396. *** 60,65 ****
  397. --- 61,70 ----
  398.                            white characters on a black background, instead of vice
  399.                            versa.
  400.   
  401. +    -sw                   (.specialWarn)  Causes XDVI to warn the user when it
  402. +                          encounters a \special string which it cannot process.
  403. +                          This option is on by default; to turn it off, use +sw.
  404.      -bw <width>           (.borderWidth)  Specifies the width of the border of
  405.                            the window.
  406.   
  407. ***************
  408. *** 85,109 ****
  409.      -cr <color>           (.cursorColor)  Determines the color of the cursor.
  410.                            The default is the color of the page border.
  411.   
  412. !    -margins <inches>     (.margins)  Specifies the size of both the top and side
  413. !                          margins.  This can be a decimal number, e.g., 1.5.
  414. !                          XDVI determines the "home" position of the page within
  415. !                          the window as follows.  If the entire page fits in the
  416. !                          window, then the margin settings are ignored.  If, even
  417. !                          after removing the margins from the left, right, top,
  418. !                          and bottom, the page still cannot fit in the window,
  419. !                          then the page is put in the window such that the top
  420. !                          and left margins are hidden, and presumably the upper
  421.                            left-hand corner of the text on the page will be in the
  422.                            upper left-hand corner of the window.  Otherwise, the
  423.                            text is centered in the window.  See also `M' under the
  424.                            KEYSTROKES section.
  425.   
  426. !    -sidemargin <inches>  (.sideMargin)  Specifies the side margin (see above).
  427.   
  428. !    -topmargin <inches>   (.topMargin)  Specifies the top and bottom margins (see
  429.                            above).
  430.   
  431.      -paper <papertype>    (.paper)  Specifies the size of the printed page.  This
  432.                            may be of the form WxH (or WxHcm), where W is the width
  433.                            in inches (or cm) and H is the height in inches (or
  434. --- 90,132 ----
  435.      -cr <color>           (.cursorColor)  Determines the color of the cursor.
  436.                            The default is the color of the page border.
  437.   
  438. !    -margins <dimen>      (.Margin)  Specifies the size of both the top and side
  439. !                          margins.  This should be a decimal number optionally
  440. !                          followed by "cm", e.g., 1.5 or 3cm, giving a
  441. !                          measurement in inches or centimeters.  XDVI determines
  442. !                          the "home" position of the page within the window as
  443. !                          follows.  If the entire page fits in the window, then
  444. !                          the margin settings are ignored.  If, even after
  445. !                          removing the margins from the left, right, top, and
  446. !                          bottom, the page still cannot fit in the window, then
  447. !                          the page is put in the window such that the top and
  448. !                          left margins are hidden, and presumably the upper
  449.                            left-hand corner of the text on the page will be in the
  450.                            upper left-hand corner of the window.  Otherwise, the
  451.                            text is centered in the window.  See also `M' under the
  452.                            KEYSTROKES section.
  453.   
  454. !    -sidemargin <dimen>   (.sideMargin)  Specifies the side margin (see above).
  455.   
  456. !    -topmargin <dimen>    (.topMargin)  Specifies the top and bottom margins (see
  457.                            above).
  458.   
  459. +    -offsets <dimen>      (.Offset)  Specifies the size of both the horizontal
  460. +                          and vertical offsets of the output on the page.  This
  461. +                          should be a decimal number optionally followed by "cm",
  462. +                          e.g., 1.5 or 3cm, giving a measurement in inches or
  463. +                          centimeters.  By decree of the Stanford TeX Project,
  464. +                          the default TeX page origin is always 1 inch over and
  465. +                          down from the top-left page corner, even when
  466. +                          non-American paper sizes are used.  Therefore, the
  467. +                          default offsets are 1.0 inch.
  468. +    -xoffset <dimen>      (.xOffset)  Specifies the size of the horizontal
  469. +                          offset of the output on the page (see above).
  470. +    -yoffset <dimen>      (.yOffset)  Specifies the size of the vertical offset
  471. +                          of the output on the page (see above).
  472.      -paper <papertype>    (.paper)  Specifies the size of the printed page.  This
  473.                            may be of the form WxH (or WxHcm), where W is the width
  474.                            in inches (or cm) and H is the height in inches (or
  475. ***************
  476. *** 168,177 ****
  477.      q    Quits the program.  Control-C and control-D will do this, too.
  478.   
  479.      n    Moves to the next page (or to the nth next page if a number is given).
  480. !         Synonyms are `f', Space, Return, and Line Feed.
  481.   
  482.      p    Moves to the previous page (or back n pages).  Synonyms are `b',
  483. !         control-H, and Delete.
  484.   
  485.      g    Moves to the page with the given number.  Initially, the first page is
  486.           assumed to be page number 1, but this can be changed with the `P'
  487. --- 191,200 ----
  488.      q    Quits the program.  Control-C and control-D will do this, too.
  489.   
  490.      n    Moves to the next page (or to the nth next page if a number is given).
  491. !         Synonyms are `f', Space, Return, Line Feed, and <Next Screen>.
  492.   
  493.      p    Moves to the previous page (or back n pages).  Synonyms are `b',
  494. !         control-H, Delete, and <Prev Screen>.
  495.   
  496.      g    Moves to the page with the given number.  Initially, the first page is
  497.           assumed to be page number 1, but this can be changed with the `P'
  498. ***************
  499. *** 187,199 ****
  500.           left-hand corner of the page, depending on the margins as described in
  501.           the -margins option, above.
  502.   
  503. !    u    Moves up two thirds of a window-full.
  504.   
  505. !    d    Moves down two thirds of a window-full.
  506.   
  507. !    l    Moves left two thirds of a window-full.
  508.   
  509. !    r    Moves right two thirds of a window-full.
  510.   
  511.      c    Moves the page so that the point currently beneath the cursor is moved
  512.           to the middle of the window.  It also (gasp!) warps the cursor to the
  513. --- 210,226 ----
  514.           left-hand corner of the page, depending on the margins as described in
  515.           the -margins option, above.
  516.   
  517. !    u    Moves up two thirds of a window-full.  The <Up Arrow> key is a synonym
  518. !         for this keystroke.
  519.   
  520. !    d    Moves down two thirds of a window-full.  The <Down Arrow> key is a
  521. !         synonym for this keystroke.
  522.   
  523. !    l    Moves left two thirds of a window-full.  The <Left Arrow> key is a
  524. !         synonym for this keystroke.
  525.   
  526. !    r    Moves right two thirds of a window-full.  The <Right Arrow> key is a
  527. !         sysnonym for this keystroke.
  528.   
  529.      c    Moves the page so that the point currently beneath the cursor is moved
  530.           to the middle of the window.  It also (gasp!) warps the cursor to the
  531. ***************
  532. *** 251,265 ****
  533.      the font name; "%d" is changed to the magnification; and "%p" is changed to
  534.      the font family ("gf", "pk", or "pxl").  If no "%f" appears in the string,
  535.      then the string ":%f.%d%p" is added on the end.  For example, if the string
  536. !    is "TEX$DISK:[TEX.FONTS.%d]%f.%p" and the font is cmr10 at 300 dpi, then XDVI
  537. !    looks for TEX$DISK:[TEX.FONTS.300]CMR10.GF, TEX$DISK:[TEX.FONTS.300]CMR10.PK,
  538. !    and TEX$DISK:[TEX.FONTS.1500]CMR10.PXL, in that order.  If the first
  539. !    character of the "XDVIFONTS" logical name is a slash, then the system default
  540. !    directories are tried first.  If the font is not found in the desired size,
  541. !    then XDVI will try to find the nearest size.  If the font cannot be found at
  542. !    all, then XDVI will try to vary the point size of the font (within a certain
  543. !    range), and if this fails, then it will use the font specified as the
  544. !    alternate font (cf. -altfont).
  545.   
  546.      The logical name "XDVISIZES" must be set to indicate which sizes of fonts are
  547.      available.  It should consists of a list of numbers separated by slashes.  If
  548. --- 278,292 ----
  549.      the font name; "%d" is changed to the magnification; and "%p" is changed to
  550.      the font family ("gf", "pk", or "pxl").  If no "%f" appears in the string,
  551.      then the string ":%f.%d%p" is added on the end.  For example, if the string
  552. !    is "TEX_DISK:[TEX.FONTS.%d]%f.%p" and the font is cmr10 at 300 dpi, then XDVI
  553. !    looks for TEX_DISK:[TEX.FONTS.300]CMR10.GF, TEX_DISK:[TEX.FONTS.300]CMR10.PK,
  554. !    and TEX_DISK:[TEX.FONTS.1500]CMR10.PXL, in that order.  An extra slash
  555. !    anywhere in the "XDVIFONTS" logical name causes the system default
  556. !    directories to be tried at that point.  If the font is not found in the
  557. !    desired size, then XDVI will try to find the nearest size.  If the font
  558. !    cannot be found at all, then XDVI will try to vary the point size of the font
  559. !    (within a certain range), and if this fails, then it will use the font
  560. !    specified as the alternate font (cf. -altfont).
  561.   
  562.      The logical name "XDVISIZES" must be set to indicate which sizes of fonts are
  563.      available.  It should consists of a list of numbers separated by slashes.  If
  564. ***************
  565. *** 267,278 ****
  566.      Sizes are expressed in dots per inch; decimals may be used for "pxl" files:
  567.      for example, a 300 dots per inch file magnified by half a step comes out to
  568.      1643 dots per five inches, which should be encoded as 328.6.  The current
  569. !    default set of sizes is 300/328.6/360/432/518.4/622/746.4.
  570.   
  571.   FILES
  572.   -----
  573.   
  574. !    TEX$FONTS   System default directory for font pixel files.
  575.   
  576.   RESOURCE NAMES
  577.   --------------
  578. --- 294,306 ----
  579.      Sizes are expressed in dots per inch; decimals may be used for "pxl" files:
  580.      for example, a 300 dots per inch file magnified by half a step comes out to
  581.      1643 dots per five inches, which should be encoded as 328.6.  The current
  582. !    default set of sizes is 300/328.6/360/432/518.4/622/746.4.  XDVI will also
  583. !    try the actual size of the font before trying any of the given sizes.
  584.   
  585.   FILES
  586.   -----
  587.   
  588. !    TEX_FONTS   System default directory for font pixel files.
  589.   
  590.   RESOURCE NAMES
  591.   --------------
  592. ***************
  593. *** 287,293 ****
  594.         XDvi.copy: off
  595.         XDvi.thorough: on
  596.         XDvi.shrinkFactor: 2
  597. !       XDvi.margins: 0.95
  598.         XDvi*geometry: 1015x750+3+25
  599.   
  600.      When XDVI is invoked, it would behave as if it had been invoked with the
  601. --- 315,321 ----
  602.         XDvi.copy: off
  603.         XDvi.thorough: on
  604.         XDvi.shrinkFactor: 2
  605. !       XDvi.Margin: 0.95
  606.         XDvi*geometry: 1015x750+3+25
  607.   
  608.      When XDVI is invoked, it would behave as if it had been invoked with the
  609. ***************
  610. *** 334,351 ****
  611.         $!
  612.         $! Define the virtual disk devices.
  613.         $!
  614.         $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) PIXELS$    'PIXELS'
  615.         $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) LPIXELS$   'LPIXELS'
  616.         $!
  617.         $! Define the directories for TeX and its related TeXware.
  618.         $!
  619. !       $ DEFINE TEX$          TEX$DISK:[LOCAL.PROGRAMS]
  620. !       $ DEFINE TEX$PIXELS    PIXELS$, LPIXELS$
  621.         $!
  622.         $! Define the information necessary to run XDVI.
  623.         $!
  624. !       $ XDVI :== "$TEX$:XDVI"
  625. !       $ DEFINE XDVIFONTS "TEX$PIXELS:[DPI%d]%f.%p"
  626.         $ DEFINE XDVISIZES -
  627.                 "300/328.6/360/432/518.4/600/622/746.4/895.8/1075/1200/1290/1548"
  628.         $ EXIT
  629. --- 362,380 ----
  630.         $!
  631.         $! Define the virtual disk devices.
  632.         $!
  633. +       $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) TEX_DISK   'TEXDISK'
  634.         $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) PIXELS$    'PIXELS'
  635.         $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) LPIXELS$   'LPIXELS'
  636.         $!
  637.         $! Define the directories for TeX and its related TeXware.
  638.         $!
  639. !       $ DEFINE TEX_EXE       TEX_DISK:[LOCAL.PROGRAMS]
  640. !       $ DEFINE TEX_PIXELS    PIXELS$, LPIXELS$
  641.         $!
  642.         $! Define the information necessary to run XDVI.
  643.         $!
  644. !       $ XDVI :== "$TEX_EXE:XDVI"
  645. !       $ DEFINE XDVIFONTS "TEX_PIXELS:[DPI%d]%f.%p"
  646.         $ DEFINE XDVISIZES -
  647.                 "300/328.6/360/432/518.4/600/622/746.4/895.8/1075/1200/1290/1548"
  648.         $ EXIT
  649. diff -cr xdvi_old/XDVI.RNH xdvi_new/XDVI.RNH
  650. *** xdvi_old/XDVI.RNH    Mon Sep 17 17:35:18 1990
  651. --- xdvi_new/XDVI.RNH    Mon Oct 15 12:41:41 1990
  652. ***************
  653. *** 7,12 ****
  654. --- 7,13 ----
  655.   .! please let me know.  Pete Siemsen,  siemsen@usc.edu
  656.   .!
  657.   .! Merged with patchlevel 8.001 help file for VMS by Scott Allendorf.
  658. + .! Added new switches for patchlevel 10.  Scott Allendorf.
  659.   .!
  660.   .NO PAGING
  661.   .NO FLAGS ALL
  662. ***************
  663. *** 206,211 ****
  664. --- 207,226 ----
  665.   .SKIP
  666.   The resource name is ".pixelsPerInch".
  667.   .INDENT -1
  668. + 3 -offsets
  669. + .BREAK
  670. + -offsets <dimen>
  671. + .SKIP
  672. + Specifies the size of both the horizontal and vertical offsets of the
  673. + output on the page.  This should be a decimal number optionally followed by
  674. + "cm", e.g., 1.5 or 3cm, giving a measurement in inches or centimeters.
  675. + By decree
  676. + of the Stanford TeX Project, the default TeX page origin is always 1 inch
  677. + over and down from the top-left page corner, even when non-American paper
  678. + sizes are used.  Therefore, the default offsets are 1.0 inch.
  679. + .SKIP
  680. + The resource name is ".Offset".
  681. + .INDENT -1
  682.   3 -paper
  683.   .BREAK
  684.   -paper <papertype>
  685. ***************
  686. *** 221,230 ****
  687.   .INDENT -1
  688.   3 -margins
  689.   .BREAK
  690. ! -margins <inches>
  691.   .SKIP
  692. ! Specifies the size of both the top and side margins.  This can
  693. ! be a decimal number, e.g., 1.5.  XDVI determines the "home" position of
  694.   the page within the window as follows.  If the entire page fits in the
  695.   window, then the margin settings are ignored.  If, even after removing
  696.   the margins from the left, right, top, and bottom, the page still
  697. --- 236,247 ----
  698.   .INDENT -1
  699.   3 -margins
  700.   .BREAK
  701. ! -margins <dimen>
  702.   .SKIP
  703. ! Specifies the size of both the top and side margins.  This should be a
  704. ! decimal number optionally followed by "cm", e.g., 1.5 or 3cm, giving a
  705. ! measurement in inches or centimeters.
  706. ! XDVI determines the "home" position of
  707.   the page within the window as follows.  If the entire page fits in the
  708.   window, then the margin settings are ignored.  If, even after removing
  709.   the margins from the left, right, top, and bottom, the page still
  710. ***************
  711. *** 234,240 ****
  712.   left-hand corner of the window.  Otherwise, the text is centered in
  713.   the window.  See also `M' under the Keystrokes help entry.
  714.   .SKIP
  715. ! The resource name is ".margins".
  716.   .INDENT -1
  717.   3 -mgs[n]
  718.   .BREAK
  719. --- 251,257 ----
  720.   left-hand corner of the window.  Otherwise, the text is centered in
  721.   the window.  See also `M' under the Keystrokes help entry.
  722.   .SKIP
  723. ! The resource name is ".Margin".
  724.   .INDENT -1
  725.   3 -mgs[n]
  726.   .BREAK
  727. ***************
  728. *** 269,280 ****
  729.   .INDENT -1
  730.   3 -sidemargin
  731.   .BREAK
  732. ! -sidemargin <inches>
  733.   .SKIP
  734.   Specifies the side margin (see -margins).
  735.   .SKIP
  736.   The resource name is ".sideMargin".
  737.   .INDENT -1
  738.   3 -thorough
  739.   .BREAK
  740.   XDVI will usually try to ensure that overstrike characters (e.g.,
  741. --- 286,304 ----
  742.   .INDENT -1
  743.   3 -sidemargin
  744.   .BREAK
  745. ! -sidemargin <dimen>
  746.   .SKIP
  747.   Specifies the side margin (see -margins).
  748.   .SKIP
  749.   The resource name is ".sideMargin".
  750.   .INDENT -1
  751. + 3 -sw
  752. + .BREAK
  753. + Causes XDVI to warn the user when it encounters a \special string which it
  754. + cannot process.  This option is on by default; to turn it off, use  +sw.
  755. + .SKIP
  756. + The resource name is ".specialWarn".
  757. + .INDENT -1
  758.   3 -thorough
  759.   .BREAK
  760.   XDVI will usually try to ensure that overstrike characters (e.g.,
  761. ***************
  762. *** 290,300 ****
  763.   .INDENT -1
  764.   3 -topmargin
  765.   .BREAK
  766. ! -topmargin <inches>
  767.   .SKIP
  768.   Specifies the top and bottom margins (see -margins).
  769.   .SKIP
  770.   The resource name is ".topMargin".
  771.   
  772.   .INDENT -1
  773.   2 Keystrokes
  774. --- 314,342 ----
  775.   .INDENT -1
  776.   3 -topmargin
  777.   .BREAK
  778. ! -topmargin <dimen>
  779.   .SKIP
  780.   Specifies the top and bottom margins (see -margins).
  781.   .SKIP
  782.   The resource name is ".topMargin".
  783. + .INDENT -1
  784. + 3 -xoffset
  785. + .BREAK
  786. + -xoffset <dimen>
  787. + .SKIP
  788. + Specifies the size of the horizontal offset of the output on the page (see
  789. + -offsets).
  790. + .SKIP
  791. + The resource name is ".xOffset".
  792. + .INDENT -1
  793. + 3 -yoffset
  794. + .BREAK
  795. + -yoffset <dimen>
  796. + .SKIP
  797. + Specifies the size of the vertical offset of the output on the page (see
  798. + -offsets).
  799. + .SKIP
  800. + The resource name is ".yOffset".
  801.   
  802.   .INDENT -1
  803.   2 Keystrokes
  804. ***************
  805. *** 311,322 ****
  806.   3 n
  807.   .BREAK
  808.   Moves to the next page (or to the nth next page if a number is given).
  809. ! Synonyms are `f', Space, Return, and Line Feed.
  810.   .INDENT -1
  811.   3 p
  812.   .BREAK
  813.   Moves to the previous page (or back n pages).  Synonyms are
  814. ! `b', control-H, and Delete.
  815.   .INDENT -1
  816.   3 g
  817.   .BREAK
  818. --- 353,364 ----
  819.   3 n
  820.   .BREAK
  821.   Moves to the next page (or to the nth next page if a number is given).
  822. ! Synonyms are `f', Space, Return, Line Feed, and <Next Screen>.
  823.   .INDENT -1
  824.   3 p
  825.   .BREAK
  826.   Moves to the previous page (or back n pages).  Synonyms are
  827. ! `b', control-H, Delete, and <Prev Screen>.
  828.   .INDENT -1
  829.   3 g
  830.   .BREAK
  831. ***************
  832. *** 341,359 ****
  833.   .INDENT -1
  834.   3 u
  835.   .BREAK
  836. ! Moves up two thirds of a window-full.
  837.   .INDENT -1
  838.   3 d
  839.   .BREAK
  840. ! Moves down two thirds of a window-full.
  841.   .INDENT -1
  842.   3 l
  843.   .BREAK
  844. ! Moves left two thirds of a window-full.
  845.   .INDENT -1
  846.   3 r
  847.   .BREAK
  848. ! Moves right two thirds of a window-full.
  849.   .INDENT -1
  850.   3 c
  851.   .BREAK
  852. --- 383,405 ----
  853.   .INDENT -1
  854.   3 u
  855.   .BREAK
  856. ! Moves up two thirds of a window-full.  The <Up Arrow> key is a synonym for this
  857. ! keystroke.
  858.   .INDENT -1
  859.   3 d
  860.   .BREAK
  861. ! Moves down two thirds of a window-full.  The <Down Arrow> key is a synonym for
  862. ! this keystroke.
  863.   .INDENT -1
  864.   3 l
  865.   .BREAK
  866. ! Moves left two thirds of a window-full.  The <Left Arrow> key is a synonym for
  867. ! this keystroke.
  868.   .INDENT -1
  869.   3 r
  870.   .BREAK
  871. ! Moves right two thirds of a window-full.  The <Right Arrow> key is a synonym for
  872. ! this keystroke.
  873.   .INDENT -1
  874.   3 c
  875.   .BREAK
  876. ***************
  877. *** 432,445 ****
  878.   "%p" is changed to the font family ("gf", "pk", or "pxl").  If no "%f"
  879.   appears in the string, then the string ":%f.%d%p" is added on the end.
  880.   .SKIP
  881. ! For example, if the string is "TEX$DISK:[TEX.FONTS.%d]%f.%p" and the font is
  882. ! cmr10 at 300dpi, then XDVI looks for TEX$DISK:[TEX.FONTS.300]CMR10.GF,
  883. ! TEX$DISK:[TEX.FONTS.300]CMR10.PK, and TEX$DISK:[TEX.FONTS.1500]CMR10.PXL,
  884.   in that order.
  885.   .SKIP
  886. ! If the first character of the "XDVIFONTS" logical name is a slash, then
  887. ! the system default directories are tried first.  If the font is not found in
  888. ! the desired size, then XDVI will try to find the nearest size.  If the
  889.   font cannot be found at all, then XDVI will try to vary the point size
  890.   of the font (within a certain range), and if this fails, then it will
  891.   use the font specified as the alternate font (cf. -altfont).
  892. --- 478,491 ----
  893.   "%p" is changed to the font family ("gf", "pk", or "pxl").  If no "%f"
  894.   appears in the string, then the string ":%f.%d%p" is added on the end.
  895.   .SKIP
  896. ! For example, if the string is "TEX_DISK:[TEX.FONTS.%d]%f.%p" and the font is
  897. ! cmr10 at 300dpi, then XDVI looks for TEX_DISK:[TEX.FONTS.300]CMR10.GF,
  898. ! TEX_DISK:[TEX.FONTS.300]CMR10.PK, and TEX_DISK:[TEX.FONTS.1500]CMR10.PXL,
  899.   in that order.
  900.   .SKIP
  901. ! An extra slash anywhere in the the "XDVIFONTS" logical name causes the
  902. ! system default directories to be tried at that point.  If the font is not
  903. ! found in the desired size, then XDVI will try to find the nearest size.  If the
  904.   font cannot be found at all, then XDVI will try to vary the point size
  905.   of the font (within a certain range), and if this fails, then it will
  906.   use the font specified as the alternate font (cf. -altfont).
  907. ***************
  908. *** 453,459 ****
  909.   inch; decimals may be used for "pxl" files: for example, a 300 dots
  910.   per inch file magnified by half a step comes out to 1643 dots per five
  911.   inches, which should be encoded as 328.6.  The current default set of
  912. ! sizes is 300/328.6/360/432/518.4/622/746.4.
  913.   
  914.   .INDENT -1
  915.   2 Resource_Names
  916. --- 499,506 ----
  917.   inch; decimals may be used for "pxl" files: for example, a 300 dots
  918.   per inch file magnified by half a step comes out to 1643 dots per five
  919.   inches, which should be encoded as 328.6.  The current default set of
  920. ! sizes is 300/328.6/360/432/518.4/622/746.4.  XDVI will also try the actual
  921. ! size of the font before trying any of the given sizes.
  922.   
  923.   .INDENT -1
  924.   2 Resource_Names
  925. ***************
  926. *** 469,475 ****
  927.      XDvi.copy: off
  928.      XDvi.thorough: on
  929.      XDvi.shrinkFactor: 2
  930. !    XDvi.margins: 0.95
  931.      XDvi*geometry: 1015x750+3+25
  932.   .END LITERAL
  933.   .SKIP
  934. --- 516,522 ----
  935.      XDvi.copy: off
  936.      XDvi.thorough: on
  937.      XDvi.shrinkFactor: 2
  938. !    XDvi.Margin: 0.95
  939.      XDvi*geometry: 1015x750+3+25
  940.   .END LITERAL
  941.   .SKIP
  942. diff -cr xdvi_old/dvi_draw.c xdvi_new/dvi_draw.c
  943. *** xdvi_old/dvi_draw.c    Mon Sep 17 17:35:29 1990
  944. --- xdvi_new/dvi_draw.c    Fri Sep  7 12:57:55 1990
  945. ***************
  946. *** 34,44 ****
  947.   
  948.   /*
  949.    *    Explanation of the following constant:
  950. !  *    pixels_per_inch << 16:    one inch margin
  951.    *    shrink_factor << 16:    one pixel page border
  952.    *    shrink_factor << 15:    rounding for pixel_conv
  953.    */
  954. ! #define PAGE_OFFSET    (pixels_per_inch << 16) + (shrink_factor * 3 << 15)
  955.   
  956.   struct frame    *stack;
  957.   struct frame    *stackp;
  958. --- 34,45 ----
  959.   
  960.   /*
  961.    *    Explanation of the following constant:
  962. !  *    offset_[xy]   << 16:    margin (defaults to one inch)
  963.    *    shrink_factor << 16:    one pixel page border
  964.    *    shrink_factor << 15:    rounding for pixel_conv
  965.    */
  966. ! #define OFFSET_X    (offset_x << 16) + (shrink_factor * 3 << 15)
  967. ! #define OFFSET_Y    (offset_y << 16) + (shrink_factor * 3 << 15)
  968.   
  969.   struct frame    *stack;
  970.   struct frame    *stackp;
  971. ***************
  972. *** 74,79 ****
  973. --- 75,81 ----
  974.   #endif    /* BMLONG */
  975.   
  976.   char    *malloc();
  977. + void    exit();
  978.   Boolean    check_dvi_file();
  979.   void    applicationDoSpecial();
  980.   
  981. ***************
  982. *** 94,103 ****
  983.   #else
  984.           for (i = BITS_PER_BMUNIT - 1; i >= 0; --i)
  985.   #endif
  986. !             putchar((*ptr & (1 << i)) ? '@' : ' ');
  987.           ++ptr;
  988.           }
  989. !         putchar('\n');
  990.       }
  991.   }
  992.   
  993. --- 96,105 ----
  994.   #else
  995.           for (i = BITS_PER_BMUNIT - 1; i >= 0; --i)
  996.   #endif
  997. !             Putchar((*ptr & (1 << i)) ? '@' : ' ');
  998.           ++ptr;
  999.           }
  1000. !         Putchar('\n');
  1001.       }
  1002.   }
  1003.   
  1004. ***************
  1005. *** 109,115 ****
  1006.       Printf("char %d", ch);
  1007.       if (isprint(ch))
  1008.           Printf(" (%c)", ch);
  1009. !     putchar('\n');
  1010.       Printf("x = %d, y = %d, dvi = %d\n",
  1011.           g->x, g->y, g->dvi_adv);
  1012.       print_bitmap(&g->bitmap);
  1013. --- 111,117 ----
  1014.       Printf("char %d", ch);
  1015.       if (isprint(ch))
  1016.           Printf(" (%c)", ch);
  1017. !     Putchar('\n');
  1018.       Printf("x = %d, y = %d, dvi = %d\n",
  1019.           g->x, g->y, g->dvi_adv);
  1020.       print_bitmap(&g->bitmap);
  1021. ***************
  1022. *** 139,145 ****
  1023.           Printf("SETCHAR%-3d", ch - SETCHAR0);
  1024.           if (isprint(ch))
  1025.               Printf(" (%c)", ch);
  1026. !         putchar('\n');
  1027.           return;
  1028.       }
  1029.       else if (ch < FNTNUM0) s = dvi_table1[ch - 128];
  1030. --- 141,147 ----
  1031.           Printf("SETCHAR%-3d", ch - SETCHAR0);
  1032.           if (isprint(ch))
  1033.               Printf(" (%c)", ch);
  1034. !         Putchar('\n');
  1035.           return;
  1036.       }
  1037.       else if (ch < FNTNUM0) s = dvi_table1[ch - 128];
  1038. ***************
  1039. *** 468,475 ****
  1040.                   case BOP:
  1041.                   Fseek(dvi_file, (long) 11*4, 1);
  1042.                   stackp = stack;
  1043. !                 DVI_H = DVI_V = PAGE_OFFSET;
  1044. !                 PXL_V = pixel_conv(PAGE_OFFSET);
  1045.                   WW = XX = YY = ZZ = 0;
  1046.                   break;
  1047.   
  1048. --- 470,478 ----
  1049.                   case BOP:
  1050.                   Fseek(dvi_file, (long) 11*4, 1);
  1051.                   stackp = stack;
  1052. !                 DVI_H = OFFSET_X;
  1053. !                 DVI_V = OFFSET_Y;
  1054. !                 PXL_V = pixel_conv(DVI_V);
  1055.                   WW = XX = YY = ZZ = 0;
  1056.                   break;
  1057.   
  1058. ***************
  1059. *** 633,638 ****
  1060.   {
  1061.       Fprintf(stderr, "%s: ", prog);
  1062.       Fprintf(stderr, message, a, b, c, d, e, f);
  1063. !     putc('\n', stderr);
  1064.       exit(1);
  1065.   }
  1066. --- 636,641 ----
  1067.   {
  1068.       Fprintf(stderr, "%s: ", prog);
  1069.       Fprintf(stderr, message, a, b, c, d, e, f);
  1070. !     Putc('\n', stderr);
  1071.       exit(1);
  1072.   }
  1073. diff -cr xdvi_old/dvi_init.c xdvi_new/dvi_init.c
  1074. *** xdvi_old/dvi_init.c    Mon Sep 17 17:35:35 1990
  1075. --- xdvi_new/dvi_init.c    Wed Sep 26 12:37:09 1990
  1076. ***************
  1077. *** 27,32 ****
  1078. --- 27,41 ----
  1079.    *    A4    use European size paper
  1080.    */
  1081.   
  1082. + #define    GF_PRE        247
  1083. + #define    GF_ID_BYTE    131
  1084. + #define    GF_MAGIC    (GF_PRE << 8) + GF_ID_BYTE
  1085. + #define    PK_PRE        247
  1086. + #define    PK_ID        89
  1087. + #define    PK_MAGIC    (PK_PRE << 8) + PK_ID
  1088. + #define    PXL_MAGIC1    0
  1089. + #define    PXL_MAGIC2    1001
  1090.   #include <stdio.h>
  1091.   #include <ctype.h>
  1092.   #include "xdvi.h"
  1093. ***************
  1094. *** 36,41 ****
  1095. --- 45,52 ----
  1096.   #define    dvi_oops(str)    longjmp(dvi_env, (int) str);
  1097.   #define XtOffset(type, field)    ((unsigned int)&(((type)NULL)->field))
  1098.   
  1099. + read_font_index_proc read_GF_index, read_PK_index, read_PXL_index;
  1100.   static    struct stat fstatbuf;        /* mechanism to see if file was */
  1101.   time_t    dvi_time;            /* modified since last usage */
  1102.   
  1103. ***************
  1104. *** 48,59 ****
  1105.   int    n_fonts_left    = 32767;    /* for LRU management of fonts */
  1106.   
  1107.   char    *realloc();
  1108.   
  1109.   /*
  1110.    * DVI preamble and postamble information.
  1111.    */
  1112.   int    current_page;
  1113. ! Boolean    spec_warn;
  1114.   int    total_pages;
  1115.   double    fraction;
  1116.   int    maxstack;
  1117. --- 59,71 ----
  1118.   int    n_fonts_left    = 32767;    /* for LRU management of fonts */
  1119.   
  1120.   char    *realloc();
  1121. + void    exit();
  1122.   
  1123.   /*
  1124.    * DVI preamble and postamble information.
  1125.    */
  1126.   int    current_page;
  1127. ! Boolean    spec_warn_now;
  1128.   int    total_pages;
  1129.   double    fraction;
  1130.   int    maxstack;
  1131. ***************
  1132. *** 90,95 ****
  1133. --- 102,108 ----
  1134.           register struct font *fontp;
  1135.       struct font **fontpp = old_fonts;
  1136.       struct font *fontp1;
  1137. +     float    fsize;
  1138.       int len;
  1139.       int design;
  1140.       int size;
  1141. ***************
  1142. *** 108,115 ****
  1143.       if(debug & DBG_PK)
  1144.         Printf("Define font \"%s\" scale=%d design=%d\n",
  1145.           fontp->fontname, fontp->scale, design);
  1146. !     fontp->size = size = ((double) fontp->scale / design * magnification
  1147. !         * pixels_per_inch * 0.005) + 0.5;
  1148.       fontp->scale = fontp->scale * fraction;
  1149.       /*
  1150.        * reuse font if possible
  1151. --- 121,129 ----
  1152.       if(debug & DBG_PK)
  1153.         Printf("Define font \"%s\" scale=%d design=%d\n",
  1154.           fontp->fontname, fontp->scale, design);
  1155. !     fsize = (float) fontp->scale / design * magnification
  1156. !         * pixels_per_inch * 0.005;
  1157. !     fontp->size = size = fsize + 0.5;
  1158.       fontp->scale = fontp->scale * fraction;
  1159.       /*
  1160.        * reuse font if possible
  1161. ***************
  1162. *** 121,132 ****
  1163.           char    *font_found;
  1164.           int    size_found;
  1165.           int    dpi = (size + 2) / 5;
  1166.   
  1167.           if (n_fonts_left == 0)
  1168.               close_a_file();
  1169.           fontp->file = pxl_open(fontp->fontname, &font_found,
  1170. !             size, &size_found, &fontp->factor, &fontp->filename,
  1171. !             &read_font_index);
  1172.           if (fontp->file == NULL) {
  1173.               Fprintf(stderr, "Can't find font %s.\n", fontp->fontname);
  1174.               font_not_found = True;
  1175. --- 135,146 ----
  1176.           char    *font_found;
  1177.           int    size_found;
  1178.           int    dpi = (size + 2) / 5;
  1179. +         int    magic;
  1180.   
  1181.           if (n_fonts_left == 0)
  1182.               close_a_file();
  1183.           fontp->file = pxl_open(fontp->fontname, &font_found,
  1184. !             fsize, &size_found, &fontp->factor, &fontp->filename);
  1185.           if (fontp->file == NULL) {
  1186.               Fprintf(stderr, "Can't find font %s.\n", fontp->fontname);
  1187.               font_not_found = True;
  1188. ***************
  1189. *** 140,152 ****
  1190.               free(fontp->fontname);
  1191.               fontp->fontname = font_found;
  1192.           }
  1193. !         else if (25 * size_found > 26 * size ||
  1194. !             25 * size > 26 * size_found)
  1195.               Fprintf(stderr,
  1196.               "Can't find font %s at %d dpi; using %d dpi instead.\n",
  1197.               fontp->fontname, dpi, (size_found + 2) / 5);
  1198. !         fontp->factor = fontp->factor * size / size_found;
  1199.           maxchar = 255;
  1200.           (*read_font_index)(fontp);
  1201.           while (maxchar > 0 && fontp->glyph[maxchar].addr == 0)
  1202.               --maxchar;
  1203. --- 154,175 ----
  1204.               free(fontp->fontname);
  1205.               fontp->fontname = font_found;
  1206.           }
  1207. !         else if (size_found > (int) (1.002 * fsize + 0.5) ||
  1208. !             size_found < (int) (0.998 * fsize + 0.5))
  1209.               Fprintf(stderr,
  1210.               "Can't find font %s at %d dpi; using %d dpi instead.\n",
  1211.               fontp->fontname, dpi, (size_found + 2) / 5);
  1212. !         fontp->factor = fontp->factor * fsize / size_found;
  1213.           maxchar = 255;
  1214. +         magic = two(fontp->file);
  1215. +         if (magic == GF_MAGIC) read_font_index = read_GF_index;
  1216. +         else if (magic == PK_MAGIC) read_font_index = read_PK_index;
  1217. +         else if (magic == PXL_MAGIC1 && two(fontp->file) == PXL_MAGIC2)
  1218. +             read_font_index = read_PXL_index;
  1219. +         else oops("Cannot recognize format for font file %s",
  1220. +             fontp->filename);
  1221. +         if (read_font_index == NULL)
  1222. +             oops("%s: unsupported font format.", fontp->filename);
  1223.           (*read_font_index)(fontp);
  1224.           while (maxchar > 0 && fontp->glyph[maxchar].addr == 0)
  1225.               --maxchar;
  1226. ***************
  1227. *** 162,169 ****
  1228.           free(fontp->fontname);
  1229.           free((char *) fontp);
  1230.           fontp = fontp1;
  1231. !         if (list_fonts)
  1232. !             fputs("(reusing) ",stdout);
  1233.           break;
  1234.           }
  1235.           fontpp = &fontp1->next;
  1236. --- 185,191 ----
  1237.           free(fontp->fontname);
  1238.           free((char *) fontp);
  1239.           fontp = fontp1;
  1240. !         if (list_fonts) Fputs("(reusing) ", stdout);
  1241.           break;
  1242.           }
  1243.           fontpp = &fontp1->next;
  1244. ***************
  1245. *** 204,227 ****
  1246.    *      find_postamble locates the beginning of the postamble
  1247.    *    and leaves the file ready to start reading at that location.
  1248.    */
  1249.   static
  1250.   find_postamble()
  1251.   {
  1252. !     ubyte byte;
  1253.   
  1254. !     Fseek(dvi_file, (long) -4, 2);
  1255. !     while (four(dvi_file) !=
  1256. !         ((long) TRAILER << 24 | TRAILER << 16 | TRAILER << 8 | TRAILER))
  1257. !         Fseek(dvi_file, (long) -5, 1);
  1258. !     Fseek(dvi_file, (long) -5, 1);
  1259.       for (;;) {
  1260. !         byte = one(dvi_file);
  1261. !         if (byte != TRAILER) break;
  1262. !         Fseek(dvi_file, (long) -2, 1);
  1263.       }
  1264.       if (byte != 2)
  1265. !         dvi_oops("Wrong version of DVI output for this program");
  1266. !     Fseek(dvi_file, (long) -5, 1);
  1267.       Fseek(dvi_file, sfour(dvi_file), 0);
  1268.   }
  1269.   
  1270. --- 226,263 ----
  1271.    *      find_postamble locates the beginning of the postamble
  1272.    *    and leaves the file ready to start reading at that location.
  1273.    */
  1274. + #define    TMPSIZ    516    /* 4 trailer bytes + 512 junk bytes allowed */
  1275.   static
  1276.   find_postamble()
  1277.   {
  1278. !     long    pos;
  1279. !     ubyte    temp[TMPSIZ];
  1280. !     ubyte    *p;
  1281. !     ubyte    *p1;
  1282. !     ubyte    byte;
  1283.   
  1284. !     Fseek(dvi_file, (long) 0, 2);
  1285. !     pos = ftell(dvi_file) - TMPSIZ;
  1286. !     if (pos < 0) pos = 0;
  1287. !     Fseek(dvi_file, pos, 0);
  1288. !     p = temp + fread((char *) temp, sizeof(char), TMPSIZ, dvi_file);
  1289.       for (;;) {
  1290. !         p1 = p;
  1291. !         while (p1 > temp && *(--p1) != TRAILER) ;
  1292. !         p = p1;
  1293. !         while (p > temp && *(--p) == TRAILER) ;
  1294. !         if (p <= p1 - 4) break;    /* found 4 TRAILER bytes */
  1295. !         if (p <= temp) dvi_oops("DVI file corrupted");
  1296.       }
  1297. +     pos += p - temp;
  1298. +     byte = *p;
  1299. +     while (byte == TRAILER) {
  1300. +         Fseek(dvi_file, --pos, 0);
  1301. +         byte = one(dvi_file);
  1302. +     }
  1303.       if (byte != 2)
  1304. !         dvi_oops("Wrong version of DVI output for this program");
  1305. !     Fseek(dvi_file, pos - 4, 0);
  1306.       Fseek(dvi_file, sfour(dvi_file), 0);
  1307.   }
  1308.   
  1309. ***************
  1310. *** 244,253 ****
  1311.             ||  magnification != four(dvi_file))
  1312.           dvi_oops("Postamble doesn't match preamble");
  1313.           /* read largest box height and width */
  1314. !     unshrunk_page_h = (spellfour(dvi_file) >> 16) + pixels_per_inch;
  1315.       if (unshrunk_page_h < unshrunk_paper_h)
  1316.           unshrunk_page_h = unshrunk_paper_h;
  1317. !     unshrunk_page_w = (spellfour(dvi_file) >> 16) + pixels_per_inch;
  1318.       if (unshrunk_page_w < unshrunk_paper_w)
  1319.           unshrunk_page_w = unshrunk_paper_w;
  1320.       maxstack = two(dvi_file);
  1321. --- 280,289 ----
  1322.             ||  magnification != four(dvi_file))
  1323.           dvi_oops("Postamble doesn't match preamble");
  1324.           /* read largest box height and width */
  1325. !     unshrunk_page_h = (spellfour(dvi_file) >> 16) + offset_y;
  1326.       if (unshrunk_page_h < unshrunk_paper_h)
  1327.           unshrunk_page_h = unshrunk_paper_h;
  1328. !     unshrunk_page_w = (spellfour(dvi_file) >> 16) + offset_x;
  1329.       if (unshrunk_page_w < unshrunk_paper_w)
  1330.           unshrunk_page_w = unshrunk_paper_w;
  1331.       maxstack = two(dvi_file);
  1332. ***************
  1333. *** 344,350 ****
  1334.       prepare_pages();
  1335.       init_page();
  1336.       if (current_page >= total_pages) current_page = total_pages - 1;
  1337. !     spec_warn = True;
  1338.   }
  1339.   
  1340.   /**
  1341. --- 380,386 ----
  1342.       prepare_pages();
  1343.       init_page();
  1344.       if (current_page >= total_pages) current_page = total_pages - 1;
  1345. !     spec_warn_now = spec_warn;
  1346.   }
  1347.   
  1348.   /**
  1349. ***************
  1350. *** 408,414 ****
  1351.           dvi_file = fopen(dvi_name, OPEN_MODE);
  1352.           if (dvi_file == NULL)
  1353.               dvi_oops("Cannot reopen dvi file.");
  1354. !         if (list_fonts) putchar('\n');
  1355.           init_dvi_file();
  1356.           redraw_page();
  1357.           return False;
  1358. --- 444,450 ----
  1359.           dvi_file = fopen(dvi_name, OPEN_MODE);
  1360.           if (dvi_file == NULL)
  1361.               dvi_oops("Cannot reopen dvi file.");
  1362. !         if (list_fonts) Putchar('\n');
  1363.           init_dvi_file();
  1364.           redraw_page();
  1365.           return False;
  1366. diff -cr xdvi_old/gf.c xdvi_new/gf.c
  1367. *** xdvi_old/gf.c    Mon Sep 17 17:35:40 1990
  1368. --- xdvi_new/gf.c    Mon Sep 17 12:23:33 1990
  1369. ***************
  1370. *** 71,83 ****
  1371.   
  1372.       fontp->read_char = read_char;
  1373.       GF_file = fontp->file;
  1374. - /*
  1375. -  *    Read the preamble.
  1376. -  */
  1377.       if (debug & DBG_PK)
  1378. !         Printf("Reading header for GF pixel file %s\n", fontp->filename);
  1379. !     expect(PRE);
  1380. !     expect(GF_ID_BYTE);
  1381.   /*
  1382.    *    Find postamble.
  1383.    */
  1384. --- 71,78 ----
  1385.   
  1386.       fontp->read_char = read_char;
  1387.       GF_file = fontp->file;
  1388.       if (debug & DBG_PK)
  1389. !         Printf("Reading GF pixel file %s\n", fontp->filename);
  1390.   /*
  1391.    *    Find postamble.
  1392.    */
  1393. diff -cr xdvi_old/patchlevel.h xdvi_new/patchlevel.h
  1394. *** xdvi_old/patchlevel.h    Mon Sep 17 17:35:43 1990
  1395. --- xdvi_new/patchlevel.h    Wed Sep 26 13:09:55 1990
  1396. ***************
  1397. *** 1 ****
  1398. ! #define PATCHLEVEL 9
  1399. --- 1 ----
  1400. ! #define PATCHLEVEL 10
  1401. diff -cr xdvi_old/pk.c xdvi_new/pk.c
  1402. *** xdvi_old/pk.c    Mon Sep 17 17:35:49 1990
  1403. --- xdvi_new/pk.c    Mon Sep 17 12:25:49 1990
  1404. ***************
  1405. *** 123,141 ****
  1406.   register struct font *fontp;
  1407.   {
  1408.     int hppp, vppp;
  1409. !   /*
  1410. !    * Read the header of a packed pixel file.
  1411. !    */
  1412.     fontp->read_char = read_char;
  1413.     if (debug & DBG_PK)
  1414. !     Printf("Reading header for PK pixel file %s\n", fontp->filename);
  1415.   
  1416. -   if (one(fontp->file) != PK_PRE)
  1417. -     oops("File %s lacks preamble command", fontp->fontname);
  1418. -   if (one(fontp->file) != PK_ID)
  1419. -     oops("File %s has wrong PK id", fontp->fontname);
  1420.     Fseek(fontp->file, (long) one(fontp->file), 1);    /* skip comment */
  1421.   
  1422.     (void) four(fontp->file);        /* skip design size */
  1423. --- 123,133 ----
  1424.   register struct font *fontp;
  1425.   {
  1426.     int hppp, vppp;
  1427.     fontp->read_char = read_char;
  1428.     if (debug & DBG_PK)
  1429. !     Printf("Reading PK pixel file %s\n", fontp->filename);
  1430.   
  1431.     Fseek(fontp->file, (long) one(fontp->file), 1);    /* skip comment */
  1432.   
  1433.     (void) four(fontp->file);        /* skip design size */
  1434. ***************
  1435. *** 143,149 ****
  1436.     hppp = sfour(fontp->file);
  1437.     vppp = sfour(fontp->file);
  1438.     if( debug && hppp != vppp )
  1439. !     oops("Warning: aspect ratio not 1:1 for font %s", fontp->fontname);
  1440.     /*fontp->f_scale = (int)((((float) hppp * 72.27) / (float) 65536) + 0.5);*/
  1441.   
  1442.     /*if (fontp->f_scale == 0) fontp->f_scale = 1000;*/
  1443. --- 135,142 ----
  1444.     hppp = sfour(fontp->file);
  1445.     vppp = sfour(fontp->file);
  1446.     if( debug && hppp != vppp )
  1447. !     Fprintf(stderr, "Warning: aspect ratio not 1:1 for font %s\n",
  1448. !       fontp->fontname);
  1449.     /*fontp->f_scale = (int)((((float) hppp * 72.27) / (float) 65536) + 0.5);*/
  1450.   
  1451.     /*if (fontp->f_scale == 0) fontp->f_scale = 1000;*/
  1452. ***************
  1453. *** 237,243 ****
  1454.       if (g->bitmap.w != 0)
  1455.           Printf(", size=%dx%d, dvi_adv=%d", g->bitmap.w, g->bitmap.h,
  1456.           g->dvi_adv);
  1457. !     putchar('\n');
  1458.       }
  1459.   
  1460.       alloc_bitmap(&g->bitmap, fontp->fontname, ch);
  1461. --- 230,236 ----
  1462.       if (g->bitmap.w != 0)
  1463.           Printf(", size=%dx%d, dvi_adv=%d", g->bitmap.w, g->bitmap.h,
  1464.           g->dvi_adv);
  1465. !     Putchar('\n');
  1466.       }
  1467.   
  1468.       alloc_bitmap(&g->bitmap, fontp->fontname, ch);
  1469. diff -cr xdvi_old/pxl.c xdvi_new/pxl.c
  1470. *** xdvi_old/pxl.c    Mon Sep 17 17:35:52 1990
  1471. --- xdvi_new/pxl.c    Mon Sep 17 17:37:22 1990
  1472. ***************
  1473. *** 52,65 ****
  1474.       register struct font *fontp;
  1475.   {
  1476.       register struct glyph *g;
  1477. !     register FILE *fp;
  1478.       long font_dir_ptr;
  1479.   
  1480.       if (debug & DBG_PK)
  1481. !         Printf("Reading header for PXL file %s\n", fontp->filename);
  1482.       fontp->read_char = read_char;
  1483. -     if (four(fp = fontp->file) != 1001)
  1484. -         oops("File %s has wrong PXL magic number.", fontp->filename);
  1485.       /* seek to trailer info */
  1486.       Fseek(fp, (long) -4, 2);
  1487.       while (four(fp) != 1001)
  1488. --- 52,63 ----
  1489.       register struct font *fontp;
  1490.   {
  1491.       register struct glyph *g;
  1492. !     register FILE *fp    = fontp->file;
  1493.       long font_dir_ptr;
  1494.   
  1495.       if (debug & DBG_PK)
  1496. !         Printf("Reading PXL file %s\n", fontp->filename);
  1497.       fontp->read_char = read_char;
  1498.       /* seek to trailer info */
  1499.       Fseek(fp, (long) -4, 2);
  1500.       while (four(fp) != 1001)
  1501.  
  1502. dan
  1503. ----------------------------------------------------
  1504. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1505. Opinions expressed reflect those of the author only.
  1506.