home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume5 / xdvi / patch7 < prev    next >
Encoding:
Internet Message Format  |  1993-04-28  |  32.9 KB

  1. From: kent@ssbell.IMD.Sterling.COM (Kent Landfield)
  2. Newsgroups: comp.sources.x
  3. Subject: v05i071: xdvi:  dvi previewer, Patch7
  4. Message-ID: <653@ssbell.IMD.Sterling.COM>
  5. Date: 5 Feb 90 05:00:58 GMT
  6. Approved: kent@ssbell.IMD.Sterling.COM (Kent Landfield)
  7.  
  8. Submitted-by: vojta@guinness.ias.edu (Paul A Vojta)
  9. Posting-number: Volume 5, Issue 71
  10. Archive-name: xdvi/patch7
  11. Patch-To: xdvi: Volume 3, Issue 37-39,46,57
  12. Patch-To: xdvi: Volume 4, Issue 44,96
  13. Patch-To: xdvi: Volume 5, Issue 35-36
  14.  
  15.  
  16. This is patch 7 for xdvi.  It replaces the -pagewidth and -pageheight
  17. options with a -paper option which is more convenient to use.
  18.  
  19. Thanks to iis!prl, bingle@cs.purdue.edu, boaz@neutron.lcs.mit.edu, and
  20. others for fixes and bug reports.
  21.  
  22. --Paul Vojta, vojta@guinness.ias.edu
  23.  
  24. -- cut here --
  25. diff -cr old/README new/README
  26. *** old/README    Sun Feb  4 13:09:22 1990
  27. --- new/README    Sun Feb  4 12:50:09 1990
  28. ***************
  29. *** 42,48 ****
  30.               the left.  For performance reasons, it would be best
  31.               to set this to coincide with what your server uses.
  32.               Use the keystroke '^P' to find information in this
  33. !             regard.
  34.       BMSHORT        (X11 only; xdvi.c dvi_draw.c gf.c pk.c pxl.c)  Store
  35.               bitmaps in short integers instead of bytes.  See
  36.               MSBITFIRST for other relevant comments.  To check
  37. --- 42,52 ----
  38.               the left.  For performance reasons, it would be best
  39.               to set this to coincide with what your server uses.
  40.               Use the keystroke '^P' to find information in this
  41. !             regard.  Generally, you should use MSBITFIRST if and
  42. !             only if '^P' reports bitord = 1, and BMSHORT/BMLONG
  43. !             (below) should be set to match whatever '^P' reports
  44. !             under "Unit =".  But, if bitord = byteord, then the
  45. !             latter setting should not matter much.
  46.       BMSHORT        (X11 only; xdvi.c dvi_draw.c gf.c pk.c pxl.c)  Store
  47.               bitmaps in short integers instead of bytes.  See
  48.               MSBITFIRST for other relevant comments.  To check
  49. ***************
  50. *** 50,58 ****
  51.                   time xdvi -d 8 file.dvi
  52.       BMLONG        (X11 only; xdvi.c dvi_draw.c gf.c pk.c pxl.c)  Store
  53.               bitmaps in long integers instead of bytes.
  54. !     ALTFONT        Default font to use if the font named in the dvi file
  55. !             cannot be found.  Can be set to NULL.  By default, it
  56. !             is "cmr10".
  57.       NOTOOL        (X11 only; xdvi.c)  Compile using raw X calls.
  58.       BUTTONS        (xdvi.c)  Put radio buttons on the right side of the
  59.               window for commonly used commands.
  60. --- 54,62 ----
  61.                   time xdvi -d 8 file.dvi
  62.       BMLONG        (X11 only; xdvi.c dvi_draw.c gf.c pk.c pxl.c)  Store
  63.               bitmaps in long integers instead of bytes.
  64. !     ALTFONT        (xdvi.c)  Default font to use if the font named in the
  65. !             dvi file cannot be found.  Can be set to NULL.  By
  66. !             default, it is "cmr10".
  67.       NOTOOL        (X11 only; xdvi.c)  Compile using raw X calls.
  68.       BUTTONS        (xdvi.c)  Put radio buttons on the right side of the
  69.               window for commonly used commands.
  70. ***************
  71. *** 168,172 ****
  72. --- 172,178 ----
  73.      19.  Added -pagewidth and -pageheight command line options and A4
  74.       compilation option.
  75.      20.  Added a yet more robust font finding algorithm.
  76. + --  Patchlevel 7:  --
  77. +    21.  Replaced -pagewidth and -pageheight options with -paper.
  78.   
  79.   Paul Vojta, vojta@math.berkeley.edu
  80. diff -cr old/dvi_draw.c new/dvi_draw.c
  81. *** old/dvi_draw.c    Sun Feb  4 13:09:25 1990
  82. --- new/dvi_draw.c    Mon Jan 29 22:48:24 1990
  83. ***************
  84. *** 303,309 ****
  85.       if (ch > maxchar ||
  86.           (g = ¤t_font->glyph[ch])->bitmap.bits == NULL) {
  87.           if (ch > maxchar || g->addr == 0)
  88. !         oops("Character %d not defined in font %s\n", ch,
  89.               current_font->fontname);
  90.           open_pxl_file(current_font);
  91.           Fseek(current_font->file, g->addr, 0);
  92. --- 303,309 ----
  93.       if (ch > maxchar ||
  94.           (g = ¤t_font->glyph[ch])->bitmap.bits == NULL) {
  95.           if (ch > maxchar || g->addr == 0)
  96. !         oops("Character %d not defined in font %s", ch,
  97.               current_font->fontname);
  98.           open_pxl_file(current_font);
  99.           Fseek(current_font->file, g->addr, 0);
  100. ***************
  101. *** 361,367 ****
  102.           close_a_file();
  103.           fontp->file = fopen(fontp->filename, OPEN_MODE);
  104.           if (fontp->file == NULL)
  105. !         oops("Font file disappeared:  %s\n", fontp->filename);
  106.           --n_fonts_left;
  107.       }
  108.   }
  109. --- 361,367 ----
  110.           close_a_file();
  111.           fontp->file = fopen(fontp->filename, OPEN_MODE);
  112.           if (fontp->file == NULL)
  113. !         oops("Font file disappeared:  %s", fontp->filename);
  114.           --n_fonts_left;
  115.       }
  116.   }
  117. diff -cr old/dvi_init.c new/dvi_init.c
  118. *** old/dvi_init.c    Sun Feb  4 13:09:27 1990
  119. --- new/dvi_init.c    Sun Dec 10 20:50:19 1989
  120. ***************
  121. *** 69,78 ****
  122.    */
  123.   static    long    last_page_offset;
  124.   
  125. ! #ifndef    ANSI_LIB
  126.   char    *sprintf();
  127. ! #endif
  128. ! char    *malloc(), *strcpy();
  129.   FILE    *pxl_open();
  130.   
  131.   /*
  132. --- 69,79 ----
  133.    */
  134.   static    long    last_page_offset;
  135.   
  136. ! #ifdef    sun
  137.   char    *sprintf();
  138. ! #endif    sun
  139. ! char    *malloc();
  140.   FILE    *pxl_open();
  141.   
  142.   /*
  143. diff -cr old/mksedscript new/mksedscript
  144. *** old/mksedscript    Sun Feb  4 13:09:30 1990
  145. --- new/mksedscript    Sun Feb  4 13:01:47 1990
  146. ***************
  147. *** 1,4 ****
  148. ! #! /bin/csh
  149.   unset    x10 buttons a4
  150.   set    noglob
  151.   foreach x ($argv[3-])
  152. --- 1,4 ----
  153. ! #! /bin/csh -f
  154.   unset    x10 buttons a4
  155.   set    noglob
  156.   foreach x ($argv[3-])
  157. ***************
  158. *** 16,22 ****
  159.   if (! $?buttons)    echo /^\#ifbuttons/,/^\#/d
  160.   echo    /^\#/d
  161.   if ($?a4) then
  162. !     echo    s/%%defaultpagesize%%/8.3 x 11.7 inches (A4 size)/
  163.   else
  164.       echo    s/%%defaultpagesize%%/8.5 x 11 inches/
  165.   endif
  166. --- 16,22 ----
  167.   if (! $?buttons)    echo /^\#ifbuttons/,/^\#/d
  168.   echo    /^\#/d
  169.   if ($?a4) then
  170. !     echo    's/%%defaultpagesize%%/21 x 29.7 cm (A4 size)/'
  171.   else
  172.       echo    s/%%defaultpagesize%%/8.5 x 11 inches/
  173.   endif
  174. diff -cr old/patchlevel.h new/patchlevel.h
  175. *** old/patchlevel.h    Sun Feb  4 13:09:31 1990
  176. --- new/patchlevel.h    Sun Dec 10 21:52:09 1989
  177. ***************
  178. *** 1 ****
  179. ! #define PATCHLEVEL 6
  180. --- 1 ----
  181. ! #define PATCHLEVEL 7
  182. diff -cr old/pk.c new/pk.c
  183. *** old/pk.c    Sun Feb  4 13:09:33 1990
  184. --- new/pk.c    Mon Jan 29 22:49:58 1990
  185. ***************
  186. *** 105,111 ****
  187.           case PK_NOOP :
  188.             break;
  189.           default :
  190. !           oops("Unexpected %d in PK file %s\n", PK_flag_byte,
  191.           fontp->fontname);
  192.             break;
  193.           }
  194. --- 105,111 ----
  195.           case PK_NOOP :
  196.             break;
  197.           default :
  198. !           oops("Unexpected %d in PK file %s", PK_flag_byte,
  199.           fontp->fontname);
  200.             break;
  201.           }
  202. ***************
  203. *** 131,140 ****
  204.       Printf("Reading header for PK pixel file %s\n", fontp->filename);
  205.   
  206.     if (one(fontp->file) != PK_PRE)
  207. !     oops("File %s lacks preamble command\n", fontp->fontname);
  208.   
  209.     if (one(fontp->file) != PK_ID)
  210. !     oops("File %s has wrong PK id\n", fontp->fontname);
  211.   
  212.     Fseek(fontp->file, (long) one(fontp->file), 1);    /* skip comment */
  213.   
  214. --- 131,140 ----
  215.       Printf("Reading header for PK pixel file %s\n", fontp->filename);
  216.   
  217.     if (one(fontp->file) != PK_PRE)
  218. !     oops("File %s lacks preamble command", fontp->fontname);
  219.   
  220.     if (one(fontp->file) != PK_ID)
  221. !     oops("File %s has wrong PK id", fontp->fontname);
  222.   
  223.     Fseek(fontp->file, (long) one(fontp->file), 1);    /* skip comment */
  224.   
  225. ***************
  226. *** 143,149 ****
  227.     hppp = sfour(fontp->file);
  228.     vppp = sfour(fontp->file);
  229.     if( debug && hppp != vppp )
  230. !     oops("Warning: aspect ratio not 1:1 for font %s\n", fontp->fontname);
  231.     /*fontp->f_scale = (int)((((float) hppp * 72.27) / (float) 65536) + 0.5);*/
  232.   
  233.     /*if (fontp->f_scale == 0) fontp->f_scale = 1000;*/
  234. --- 143,149 ----
  235.     hppp = sfour(fontp->file);
  236.     vppp = sfour(fontp->file);
  237.     if( debug && hppp != vppp )
  238. !     oops("Warning: aspect ratio not 1:1 for font %s", fontp->fontname);
  239.     /*fontp->f_scale = (int)((((float) hppp * 72.27) / (float) 65536) + 0.5);*/
  240.   
  241.     /*if (fontp->f_scale == 0) fontp->f_scale = 1000;*/
  242. ***************
  243. *** 224,230 ****
  244.       w = num(fp, n);
  245.       h = num(fp, n);
  246.       if (w > 0x7fff || h > 0x7fff)
  247. !         oops("Too large character (%d) in file %s\n", ch, fontp->fontname);
  248.       g->bitmap.w = w;
  249.       g->bitmap.h = h;
  250.       }
  251. --- 224,230 ----
  252.       w = num(fp, n);
  253.       h = num(fp, n);
  254.       if (w > 0x7fff || h > 0x7fff)
  255. !         oops("Too large character (%d) in file %s", ch, fontp->fontname);
  256.       g->bitmap.w = w;
  257.       g->bitmap.h = h;
  258.       }
  259. ***************
  260. *** 354,362 ****
  261.             paint_switch = 1 - paint_switch;
  262.           }
  263.         if (cp != ((BMUNIT *) (g->bitmap.bits + bytes_wide * g->bitmap.h)))
  264. !         oops("Wrong number of bits stored:  char. %d, font %s\n", ch,
  265.           fontp->fontname);
  266.         if (rows_left != 0 || h_bit != g->bitmap.w)
  267. !         oops("Bad pk file (%s), too many bits\n", fontp->fontname);
  268.       }
  269.   }
  270. --- 354,362 ----
  271.             paint_switch = 1 - paint_switch;
  272.           }
  273.         if (cp != ((BMUNIT *) (g->bitmap.bits + bytes_wide * g->bitmap.h)))
  274. !         oops("Wrong number of bits stored:  char. %d, font %s", ch,
  275.           fontp->fontname);
  276.         if (rows_left != 0 || h_bit != g->bitmap.w)
  277. !         oops("Bad pk file (%s), too many bits", fontp->fontname);
  278.       }
  279.   }
  280. diff -cr old/pxl.c new/pxl.c
  281. *** old/pxl.c    Sun Feb  4 13:09:34 1990
  282. --- new/pxl.c    Mon Jan 29 22:50:14 1990
  283. ***************
  284. *** 63,69 ****
  285.           Printf("Reading header for PXL file %s\n", fontp->filename);
  286.       fontp->read_char = read_char;
  287.       if (four(fp = fontp->file) != 1001)
  288. !         oops("File %s has wrong PXL magic number.\n", fontp->filename);
  289.       /* seek to trailer info */
  290.       Fseek(fp, (long) -5 * 4, 2);
  291.       (void) four(fp);    /* checksum */
  292. --- 63,69 ----
  293.           Printf("Reading header for PXL file %s\n", fontp->filename);
  294.       fontp->read_char = read_char;
  295.       if (four(fp = fontp->file) != 1001)
  296. !         oops("File %s has wrong PXL magic number.", fontp->filename);
  297.       /* seek to trailer info */
  298.       Fseek(fp, (long) -5 * 4, 2);
  299.       (void) four(fp);    /* checksum */
  300. diff -cr old/pxl_open.c new/pxl_open.c
  301. *** old/pxl_open.c    Sun Feb  4 13:09:36 1990
  302. --- new/pxl_open.c    Sun Dec 10 20:50:59 1989
  303. ***************
  304. *** 33,40 ****
  305. --- 33,53 ----
  306.    */
  307.   
  308.   #include <stdio.h>
  309. + #ifndef X10
  310. + #include <X11/Xos.h>    /* same as below */
  311. + #else X10
  312. + #ifdef    SYSV
  313.   #include <string.h>
  314. + #define index strchr
  315. + #define rindex strrchr
  316. + #else /* SYSV */
  317. + #include <strings.h>
  318. + #endif /* SYSV */
  319. + #endif X10
  320.   #include <errno.h>
  321. + extern    int    errno;
  322.   
  323.   #define    PATH_SEP    ':'
  324.   #define    DEFAULT_TAIL    "/%f.%d%p"
  325. ***************
  326. *** 57,67 ****
  327.   
  328.   read_font_index_proc read_GF_index, read_PK_index, read_PXL_index;
  329.   
  330. ! #ifndef    ANSI_LIB
  331.   char    *sprintf();
  332. ! #endif
  333. ! char    *malloc(), *index(), *getenv();
  334.   
  335.   double    atof();
  336.   
  337.   #define    Strcpy    (void) strcpy
  338. --- 70,80 ----
  339.   
  340.   read_font_index_proc read_GF_index, read_PK_index, read_PXL_index;
  341.   
  342. ! #ifdef    sun
  343.   char    *sprintf();
  344. ! #endif    sun
  345.   
  346. + char    *malloc(), *getenv();
  347.   double    atof();
  348.   
  349.   #define    Strcpy    (void) strcpy
  350. diff -cr old/xdvi.c new/xdvi.c
  351. *** old/xdvi.c    Sun Feb  4 13:09:45 1990
  352. --- new/xdvi.c    Sat Feb  3 18:51:25 1990
  353. ***************
  354. *** 39,49 ****
  355.   #endif    ALTFONT
  356.   
  357.   #ifndef    A4
  358. ! #define    DEFAULT_PAGE_WIDTH    "8.5"
  359. ! #define    DEFAULT_PAGE_HEIGHT    "11"
  360.   #else    A4
  361. ! #define    DEFAULT_PAGE_WIDTH    "8.3"
  362. ! #define    DEFAULT_PAGE_HEIGHT    "11.7"
  363.   #endif    A4
  364.   
  365.   #if    !defined(X10) && !defined(NOTOOL)
  366. --- 39,47 ----
  367.   #endif    ALTFONT
  368.   
  369.   #ifndef    A4
  370. ! #define    DEFAULT_PAPER        "us"
  371.   #else    A4
  372. ! #define    DEFAULT_PAPER        "a4"
  373.   #endif    A4
  374.   
  375.   #if    !defined(X10) && !defined(NOTOOL)
  376. ***************
  377. *** 143,150 ****
  378.   int    density = 40;
  379.   int    pixels_per_inch = 300;
  380.   int    unshrunk_page_w, unshrunk_page_h;
  381. ! static    char    *arg_page_w    = DEFAULT_PAGE_WIDTH;
  382. ! static    char    *arg_page_h    = DEFAULT_PAGE_HEIGHT;
  383.   static    char    *margins, *sidemargin, *topmargin;
  384.   static    Boolean    reverse;
  385.   static    Dimension    bwidth    = 2;
  386. --- 141,147 ----
  387.   int    density = 40;
  388.   int    pixels_per_inch = 300;
  389.   int    unshrunk_page_w, unshrunk_page_h;
  390. ! static    char    *paper        = DEFAULT_PAPER;
  391.   static    char    *margins, *sidemargin, *topmargin;
  392.   static    Boolean    reverse;
  393.   static    Dimension    bwidth    = 2;
  394. ***************
  395. *** 187,193 ****
  396.   #endif X10
  397.   
  398.   int    page_w, page_h;
  399. - static    int    screen_w, screen_h;
  400.   #define    clip_w    mane.width
  401.   #define    clip_h    mane.height
  402.   static    Dimension    window_w, window_h;
  403. --- 184,189 ----
  404. ***************
  405. *** 229,235 ****
  406.       {XtNbottom,    (XtArgVal) XtChainBottom},
  407.       {XtNleft,    (XtArgVal) XtChainLeft},
  408.       {XtNright,    (XtArgVal) XtChainRight},
  409. -     {XtNresizable,    (XtArgVal) True},
  410.   #endif    BUTTONS
  411.       {XtNallowHoriz,    (XtArgVal) True},
  412.       {XtNallowVert,    (XtArgVal) True},
  413. --- 225,230 ----
  414. ***************
  415. *** 262,271 ****
  416.       }
  417.       command_table[] = {
  418.           {"Quit",    "quit",        'q',        50},
  419. !         {"X1 Mag",    "sh1",        1 << 8 | 's',    150},
  420. !         {"X2 Mag",    "sh2",        2 << 8 | 's',    200},
  421. !         {"X3 Mag",    "sh3",        3 << 8 | 's',    250},
  422. !         {"X4 Mag",    "sh4",        4 << 8 | 's',    300},
  423.           {"Next",    "next",        'n',        400},
  424.           {"Page+5",    "next5",    5 << 8 | 'n',    450},
  425.           {"Page+10",    "next10",    10 << 8 | 'n',    500},
  426. --- 257,266 ----
  427.       }
  428.       command_table[] = {
  429.           {"Quit",    "quit",        'q',        50},
  430. !         {"Shrink1",    "sh1",        1 << 8 | 's',    150},
  431. !         {"Shrink2",    "sh2",        2 << 8 | 's',    200},
  432. !         {"Shrink3",    "sh3",        3 << 8 | 's',    250},
  433. !         {"Shrink4",    "sh4",        4 << 8 | 's',    300},
  434.           {"Next",    "next",        'n',        400},
  435.           {"Page+5",    "next5",    5 << 8 | 'n',    450},
  436.           {"Page+10",    "next10",    10 << 8 | 'n',    500},
  437. ***************
  438. *** 287,294 ****
  439.       {XtNlabel,    NULL},
  440.       {XtNvertDistance, (XtArgVal) 0},
  441.       {XtNfromHoriz,    (XtArgVal) NULL},
  442. !     {XtNhorizDistance, (XtArgVal) 9},
  443. !     {XtNwidth,    (XtArgVal) 60},
  444.       {XtNheight,    (XtArgVal) 30},
  445.       {XtNtop,    (XtArgVal) XtChainTop},
  446.       {XtNbottom,    (XtArgVal) XtChainTop},
  447. --- 282,289 ----
  448.       {XtNlabel,    NULL},
  449.       {XtNvertDistance, (XtArgVal) 0},
  450.       {XtNfromHoriz,    (XtArgVal) NULL},
  451. !     {XtNhorizDistance, (XtArgVal) 7},
  452. !     {XtNwidth,    (XtArgVal) 64},
  453.       {XtNheight,    (XtArgVal) 30},
  454.       {XtNtop,    (XtArgVal) XtChainTop},
  455.       {XtNbottom,    (XtArgVal) XtChainTop},
  456. ***************
  457. *** 307,318 ****
  458.       {XtNbottom,    (XtArgVal) XtChainBottom},
  459.       {XtNleft,    (XtArgVal) XtChainRight},
  460.       {XtNright,    (XtArgVal) XtChainRight},
  461. -     {XtNresizable,    (XtArgVal) True},
  462.   };
  463.   
  464.   static    Arg    strut_args[] = {
  465.       {XtNfromHoriz,    (XtArgVal) NULL},
  466.       {XtNwidth,    (XtArgVal) 78},
  467.       {XtNmappedWhenManaged, (XtArgVal) False},
  468.       {XtNborderWidth, (XtArgVal) 0},
  469.       {XtNtop,    (XtArgVal) XtChainTop},
  470. --- 302,313 ----
  471.       {XtNbottom,    (XtArgVal) XtChainBottom},
  472.       {XtNleft,    (XtArgVal) XtChainRight},
  473.       {XtNright,    (XtArgVal) XtChainRight},
  474.   };
  475.   
  476.   static    Arg    strut_args[] = {
  477.       {XtNfromHoriz,    (XtArgVal) NULL},
  478.       {XtNwidth,    (XtArgVal) 78},
  479. +     {XtNheight,    (XtArgVal) 2},
  480.       {XtNmappedWhenManaged, (XtArgVal) False},
  481.       {XtNborderWidth, (XtArgVal) 0},
  482.       {XtNtop,    (XtArgVal) XtChainTop},
  483. ***************
  484. *** 373,383 ****
  485.   #endif    X10
  486.   #endif    lint
  487.   
  488. ! #ifndef    ANSI_LIB
  489.   char    *sprintf();
  490. ! #endif
  491. ! char    *malloc(), *index(), *rindex(), *strcpy(), *strcat();
  492.   
  493.   double    atof();
  494.   
  495.   /********************************
  496. --- 368,378 ----
  497.   #endif    X10
  498.   #endif    lint
  499.   
  500. ! #ifdef    sun
  501.   char    *sprintf();
  502. ! #endif    sun
  503.   
  504. + char    *malloc();
  505.   double    atof();
  506.   
  507.   /********************************
  508. ***************
  509. *** 733,745 ****
  510.           DarkenArea(x_bar, new_x_bgn, 1, new_x_end - new_x_bgn, BAR_WID);
  511.       }
  512.       else {        /* this stuff avoids flicker */
  513. !         if (x_bgn <= new_x_bgn)
  514.           ClearArea(x_bar, x_bgn, 1, new_x_bgn - x_bgn, BAR_WID);
  515. !         else
  516.           DarkenArea(x_bar, new_x_bgn, 1, x_bgn - new_x_bgn, BAR_WID);
  517. !         if (new_x_end <= x_end)
  518.           ClearArea(x_bar, new_x_end, 1, x_end - new_x_end, BAR_WID);
  519. !         else
  520.           DarkenArea(x_bar, x_end, 1, new_x_end - x_end, BAR_WID);
  521.       }
  522.       x_bgn = new_x_bgn;
  523. --- 728,740 ----
  524.           DarkenArea(x_bar, new_x_bgn, 1, new_x_end - new_x_bgn, BAR_WID);
  525.       }
  526.       else {        /* this stuff avoids flicker */
  527. !         if (x_bgn < new_x_bgn)
  528.           ClearArea(x_bar, x_bgn, 1, new_x_bgn - x_bgn, BAR_WID);
  529. !         else if (x_bgn > new_x_bgn)
  530.           DarkenArea(x_bar, new_x_bgn, 1, x_bgn - new_x_bgn, BAR_WID);
  531. !         if (new_x_end < x_end)
  532.           ClearArea(x_bar, new_x_end, 1, x_end - new_x_end, BAR_WID);
  533. !         else if (new_x_end > x_end)
  534.           DarkenArea(x_bar, x_end, 1, new_x_end - x_end, BAR_WID);
  535.       }
  536.       x_bgn = new_x_bgn;
  537. ***************
  538. *** 757,769 ****
  539.           DarkenArea(y_bar, 1, new_y_bgn, BAR_WID, new_y_end - new_y_bgn);
  540.       }
  541.       else {        /* this stuff avoids flicker */
  542. !         if (y_bgn <= new_y_bgn)
  543.           ClearArea(y_bar, 1, y_bgn, BAR_WID, new_y_bgn - y_bgn);
  544. !         else
  545.           DarkenArea(y_bar, 1, new_y_bgn, BAR_WID, y_bgn - new_y_bgn);
  546. !         if (new_y_end <= y_end)
  547.           ClearArea(y_bar, 1, new_y_end, BAR_WID, y_end - new_y_end);
  548. !         else
  549.           DarkenArea(y_bar, 1, y_end, BAR_WID, new_y_end - y_end);
  550.       }
  551.       y_bgn = new_y_bgn;
  552. --- 752,764 ----
  553.           DarkenArea(y_bar, 1, new_y_bgn, BAR_WID, new_y_end - new_y_bgn);
  554.       }
  555.       else {        /* this stuff avoids flicker */
  556. !         if (y_bgn < new_y_bgn)
  557.           ClearArea(y_bar, 1, y_bgn, BAR_WID, new_y_bgn - y_bgn);
  558. !         else if (y_bgn > new_y_bgn)
  559.           DarkenArea(y_bar, 1, new_y_bgn, BAR_WID, y_bgn - new_y_bgn);
  560. !         if (new_y_end < y_end)
  561.           ClearArea(y_bar, 1, new_y_end, BAR_WID, y_end - new_y_end);
  562. !         else if (new_y_end > y_end)
  563.           DarkenArea(y_bar, 1, y_end, BAR_WID, new_y_end - y_end);
  564.       }
  565.       y_bgn = new_y_bgn;
  566. ***************
  567. *** 1140,1146 ****
  568.           case '\b':
  569.           case '\177':    /* Del */
  570.           /* scroll backward */
  571. !         next_page = current_page - 1;
  572.           break;
  573.           case 'g':
  574.           /* go to absolute page */
  575. --- 1135,1141 ----
  576.           case '\b':
  577.           case '\177':    /* Del */
  578.           /* scroll backward */
  579. !         next_page = current_page - (arg0 ? number0 : 1);
  580.           break;
  581.           case 'g':
  582.           /* go to absolute page */
  583. ***************
  584. *** 1259,1270 ****
  585.           get_geom();
  586.           home(False);
  587.           XMapWindow(DISP, (Window) mane.win);
  588. !         return;
  589.   #else    TOOLKIT
  590.           reconfig();
  591.           home(False);
  592. -         break;
  593.   #endif    TOOLKIT
  594.           case 'S':
  595.           if (!arg0) goto bad;
  596.           if (number0 < 0) goto bad;
  597. --- 1254,1270 ----
  598.           get_geom();
  599.           home(False);
  600.           XMapWindow(DISP, (Window) mane.win);
  601. !         /* Wait for next event; this will likely be an expose event,
  602. !            so we don't redraw the window twice. */
  603. !         {
  604. !             XEvent event;
  605. !             XPeekEvent(DISP, &event);
  606. !         }
  607.   #else    TOOLKIT
  608.           reconfig();
  609.           home(False);
  610.   #endif    TOOLKIT
  611. +         break;
  612.           case 'S':
  613.           if (!arg0) goto bad;
  614.           if (number0 < 0) goto bad;
  615. ***************
  616. *** 1459,1473 ****
  617.               if (XANY(event).window == top_level &&
  618.               (XCONFIG(event).width != window_w ||
  619.               XCONFIG(event).height != window_h)) {
  620. !                 register Dimension old_window_w = window_w;
  621.   
  622.                   window_w = XCONFIG(event).width;
  623.                   window_h = XCONFIG(event).height;
  624.                   reconfig();
  625. !                 if (old_window_w == 0) home(False);
  626.               }
  627.               break;
  628.   
  629.           case KeyPress:
  630.   #ifndef X10
  631.               string = trbuf;
  632. --- 1459,1482 ----
  633.               if (XANY(event).window == top_level &&
  634.               (XCONFIG(event).width != window_w ||
  635.               XCONFIG(event).height != window_h)) {
  636. !                 register caddr_t old_mane_win = mane.win;
  637.   
  638.                   window_w = XCONFIG(event).width;
  639.                   window_h = XCONFIG(event).height;
  640.                   reconfig();
  641. !                 if (old_mane_win == NULL) home(False);
  642.               }
  643.               break;
  644.   
  645. + #ifndef X10
  646. +         case MapNotify:        /* if running w/o WM */
  647. +             if (mane.win == NULL) {
  648. +             reconfig();
  649. +             home(False);
  650. +             }
  651. +             break;
  652. + #endif X10
  653.           case KeyPress:
  654.   #ifndef X10
  655.               string = trbuf;
  656. ***************
  657. *** 1657,1665 ****
  658.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  659.   [-cr <color>]\n\
  660.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  661. !     [-pagewidth <inches>] [-pageheight <inches>] [-mgs[n] <size>]\n\
  662. !     [-altfont <font>] [#<geometry>] [-geometry <geometry>]\n\
  663. !     [-display <host:display>] [-copy] [-thorough] dvi_file\n", stderr);
  664.   #else X10
  665.       fputs("\
  666.   Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l] [-rv]\n\
  667. --- 1666,1674 ----
  668.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  669.   [-cr <color>]\n\
  670.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  671. !     [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
  672. !     [#<geometry>] [-geometry <geometry>] [-display <host:display>]\n\
  673. !     [-copy] [-thorough] dvi_file\n", stderr);
  674.   #else X10
  675.       fputs("\
  676.   Usage: xdvi [+[<page>]] [-s <shrink>] [-S <density>] [-p <pixels>] [-l] [-rv]\n\
  677. ***************
  678. *** 1666,1673 ****
  679.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  680.   [-cr <color>]\n\
  681.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  682. !     [-pagewidth <inches>] [-pageheight <inches>] [-mgs[n] <size>]\n\
  683. !     [-altfont <font>] [-geometry <geometry> | =<geometry>]\n\
  684.       [-display <host:display> | <host:display>] dvi_file\n", stderr);
  685.   #endif X10
  686.       exit(1);
  687. --- 1675,1682 ----
  688.       [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] \
  689.   [-cr <color>]\n\
  690.       [-margins <inches>] [-sidemargin <inches>] [-topmargin <inches>]\n\
  691. !     [-paper <papertype>] [-mgs[n] <size>] [-altfont <font>]\n\
  692. !     [-geometry <geometry> | =<geometry>]\n\
  693.       [-display <host:display> | <host:display>] dvi_file\n", stderr);
  694.   #endif X10
  695.       exit(1);
  696. ***************
  697. *** 1735,1744 ****
  698.     (Cardinal) &sidemargin, XtRString, NULL},
  699.   {"topMargin", "Margin", XtRString, sizeof(char *),
  700.     (Cardinal) &topmargin, XtRString, NULL},
  701. ! {"pageWidth", "PageWidth", XtRString, sizeof(char *),
  702. !   (Cardinal) &arg_page_w, XtRString, (caddr_t) DEFAULT_PAGE_WIDTH},
  703. ! {"pageHeight", "PageHeight", XtRString, sizeof(char *),
  704. !   (Cardinal) &arg_page_h, XtRString, (caddr_t) DEFAULT_PAGE_HEIGHT},
  705.   {"altFont", "AltFont", XtRString, sizeof(char *),
  706.     (Cardinal) &alt_font, XtRString, (caddr_t) ALTFONT},
  707.   {"listFonts", "ListFonts", XtRBoolean, sizeof(Boolean),
  708. --- 1744,1751 ----
  709.     (Cardinal) &sidemargin, XtRString, NULL},
  710.   {"topMargin", "Margin", XtRString, sizeof(char *),
  711.     (Cardinal) &topmargin, XtRString, NULL},
  712. ! {"paper", "Paper", XtRString, sizeof(char *),
  713. !   (Cardinal) &paper, XtRString, (caddr_t) DEFAULT_PAPER},
  714.   {"altFont", "AltFont", XtRString, sizeof(char *),
  715.     (Cardinal) &alt_font, XtRString, (caddr_t) ALTFONT},
  716.   {"listFonts", "ListFonts", XtRBoolean, sizeof(Boolean),
  717. ***************
  718. *** 1855,1862 ****
  719.   {"-sidemargin",    "sideMargin",    SepArg,    StringArg,    (caddr_t) &sidemargin},
  720.   {"-topmargin",    "topMargin",    SepArg,    StringArg,    (caddr_t) &topmargin},
  721.   {"-altfont",    "altFont",    SepArg,    StringArg,    (caddr_t) &alt_font},
  722. ! {"-pagewidth",    "pageWidth",    SepArg,    StringArg,    (caddr_t) &arg_page_w},
  723. ! {"-pageheight",    "pageHeight",    SepArg,    StringArg,    (caddr_t) &arg_page_h},
  724.   {"-l",        "listFonts",    TrueArg, BooleanArg,    (caddr_t) &list_fonts},
  725.   {"+l",        NULL,        FalseArg, BooleanArg,    (caddr_t) &list_fonts},
  726.   {"-rv",        "reverseVideo",    TrueArg, BooleanArg,    (caddr_t) &reverse},
  727. --- 1862,1868 ----
  728.   {"-sidemargin",    "sideMargin",    SepArg,    StringArg,    (caddr_t) &sidemargin},
  729.   {"-topmargin",    "topMargin",    SepArg,    StringArg,    (caddr_t) &topmargin},
  730.   {"-altfont",    "altFont",    SepArg,    StringArg,    (caddr_t) &alt_font},
  731. ! {"-paper",    "paper",    SepArg,    StringArg,    (caddr_t) &paper},
  732.   {"-l",        "listFonts",    TrueArg, BooleanArg,    (caddr_t) &list_fonts},
  733.   {"+l",        NULL,        FalseArg, BooleanArg,    (caddr_t) &list_fonts},
  734.   {"-rv",        "reverseVideo",    TrueArg, BooleanArg,    (caddr_t) &reverse},
  735. ***************
  736. *** 1968,1978 ****
  737.   
  738.   #ifndef X10
  739.       if ((DISP = XOpenDisplay(display)) == NULL)
  740. !         oops("Can't open display\n");
  741.       SCRN = DefaultScreenOfDisplay(DISP);
  742.   #else X10
  743.       if (XOpenDisplay(display) == NULL)
  744. !         oops("Can't open display\n");
  745.   #endif X10
  746.       for (opt = options; opt < options + XtNumber(options); ++opt)
  747.           if (opt->resource &&
  748. --- 1974,1984 ----
  749.   
  750.   #ifndef X10
  751.       if ((DISP = XOpenDisplay(display)) == NULL)
  752. !         oops("Can't open display");
  753.       SCRN = DefaultScreenOfDisplay(DISP);
  754.   #else X10
  755.       if (XOpenDisplay(display) == NULL)
  756. !         oops("Can't open display");
  757.   #endif X10
  758.       for (opt = options; opt < options + XtNumber(options); ++opt)
  759.           if (opt->resource &&
  760. ***************
  761. *** 1997,2002 ****
  762. --- 2003,2106 ----
  763.   
  764.   #endif    TOOLKIT
  765.   
  766. + static    char    *paper_types[] = {
  767. +     "us",        "8.5x11",
  768. +     "usr",        "11x8.5",
  769. +     "legal",    "8.5x14",
  770. +     "foolscap",    "13.5x17.0",    /* ??? */
  771. +     /* ISO `A' formats, Portrait */
  772. +     "a1",        "59.4x84.0cm",
  773. +     "a2",        "42.0x59.4cm",
  774. +     "a3",        "29.7x42.0cm",
  775. +     "a4",        "21.0x29.7cm",
  776. +     "a5",        "14.85x21.0cm",
  777. +     "a6",        "10.5x14.85cm",
  778. +     "a7",        "7.42x10.5cm",
  779. +     /* ISO `A' formats, Landscape */
  780. +     "a1r",        "84.0x59.4cm",
  781. +     "a2r",        "59.4x42.0cm",
  782. +     "a3r",        "42.0x29.7cm",
  783. +     "a4r",        "29.7x21.0cm",
  784. +     "a5r",        "21.0x14.85cm",
  785. +     "a6r",        "14.85x10.5cm",
  786. +     "a7r",        "10.5x7.42cm",
  787. +     /* ISO `B' formats, Portrait */
  788. +     "b1",        "70.6x100.0cm",
  789. +     "b2",        "50.0x70.6cm",
  790. +     "b3",        "35.3x50.0cm",
  791. +     "b4",        "25.0x35.3cm",
  792. +     "b5",        "17.6x25.0cm",
  793. +     "b6",        "13.5x17.6cm",
  794. +     "b7",        "8.8x13.5cm",
  795. +     /* ISO `B' formats, Landscape */
  796. +     "b1r",        "100.0x70.6cm",
  797. +     "b2r",        "70.6x50.0cm",
  798. +     "b3r",        "50.0x35.3cm",
  799. +     "b4r",        "35.3x25.0cm",
  800. +     "b5r",        "25.0x17.6cm",
  801. +     "b6r",        "17.6x13.5cm",
  802. +     "b7r",        "13.5x8.8cm",
  803. +     /* ISO `C' formats, Portrait */
  804. +     "c1",        "64.8x91.6cm",
  805. +     "c2",        "45.8x64.8cm",
  806. +     "c3",        "32.4x45.8cm",
  807. +     "c4",        "22.9x32.4cm",
  808. +     "c5",        "16.2x22.9cm",
  809. +     "c6",        "11.46x16.2cm",
  810. +     "c7",        "8.1x11.46cm",
  811. +     /* ISO `C' formats, Landscape */
  812. +     "c1r",        "91.6x64.8cm",
  813. +     "c2r",        "64.8x45.8cm",
  814. +     "c3r",        "45.8x32.4cm",
  815. +     "c4r",        "32.4x22.9cm",
  816. +     "c5r",        "22.9x16.2cm",
  817. +     "c6r",        "16.2x11.46cm",
  818. +     "c7r",        "11.46x8.1cm",
  819. + };
  820. + static    Boolean
  821. + set_paper_type() {
  822. +     char    temp[21];
  823. +     int    i;
  824. +     double    factor    = 1.0;
  825. +     char    c;
  826. +     char    **p;
  827. +     char    *q;
  828. +     if (strlen(paper) > 20) return False;
  829. +     i = 0;
  830. +     for (;;) {    /* convert to lower case */
  831. +         c = paper[i];
  832. +         if (c >= 'A' && c <= 'Z') c ^= ('a' ^ 'A');
  833. +         temp[i] = c;
  834. +         if (c == '\0') break;
  835. +         ++i;
  836. +     }
  837. +     /* perform substitutions */
  838. +     for (p = paper_types; p < paper_types + XtNumber(paper_types); p += 2)
  839. +         if (strcmp(temp, *p) == 0) {
  840. +         (void) strcpy(temp, p[1]);
  841. +         break;
  842. +         }
  843. +     if (i > 2 && strcmp(temp + i - 2, "cm") == 0) {
  844. +         factor = 1.0 / 2.54;
  845. +         temp[i - 2] = '\0';
  846. +     }
  847. +     q = index(temp, 'x');
  848. +     if (q == NULL) return False;
  849. +     *q = '\0';
  850. +     factor *= pixels_per_inch;
  851. +     unshrunk_page_w = atof(temp) * factor + 0.5;
  852. +     unshrunk_page_h = atof(q + 1) * factor + 0.5;
  853. +     return (unshrunk_page_w != 0 && unshrunk_page_h != 0);
  854. + }
  855.   /*
  856.    *    main program
  857.    */
  858. ***************
  859. *** 2015,2022 ****
  860. --- 2119,2128 ----
  861.       char    def[32];
  862.       int    mouspix;
  863.       Color    cdef;
  864. +     int    x_thick, y_thick;
  865.   #endif X10
  866.   #endif    TOOLKIT
  867. +     int    screen_w, screen_h;
  868.   
  869.       prog = rindex(*argv, '/');
  870.       if (prog != NULL) ++prog; else prog = *argv;
  871. ***************
  872. *** 2055,2062 ****
  873.       if (margins) home_x = home_y = atof(margins) * pixels_per_inch;
  874.       if (sidemargin) home_x = atof(sidemargin) * pixels_per_inch;
  875.       if (topmargin) home_y = atof(topmargin) * pixels_per_inch;
  876. !     unshrunk_page_w = atof(arg_page_w) * pixels_per_inch + 0.5;
  877. !     unshrunk_page_h = atof(arg_page_h) * pixels_per_inch + 0.5;
  878.   
  879.       init_pxl_open();
  880.       open_dvi_file();
  881. --- 2161,2167 ----
  882.       if (margins) home_x = home_y = atof(margins) * pixels_per_inch;
  883.       if (sidemargin) home_x = atof(sidemargin) * pixels_per_inch;
  884.       if (topmargin) home_y = atof(topmargin) * pixels_per_inch;
  885. !     if (!set_paper_type()) oops("Don't recognize paper type %s", paper);
  886.   
  887.       init_pxl_open();
  888.       open_dvi_file();
  889. ***************
  890. *** 2228,2250 ****
  891.       size_hints.x = size_hints.y = 0;
  892.       if (geometry != NULL) {
  893.           int flag = XParseGeometry(geometry, &size_hints.x, &size_hints.y,
  894. !         &size_hints.width, &size_hints.height);
  895.   
  896.           if (flag & (XValue | YValue))
  897. !         size_hints.flags |= USSize | USPosition;
  898.           if (flag & (WidthValue | HeightValue))
  899.           size_hints.flags |= USSize;
  900. !         if (flag & XNegative) size_hints.x += screen_w - size_hints.width;
  901. !         if (flag & YNegative) size_hints.y += screen_h - size_hints.height;
  902.       }
  903.       if (!(size_hints.flags & USSize)) {
  904.           size_hints.flags |= PSize;
  905. -         size_hints.width = page_w < screen_w ? page_w : screen_w;
  906. -         size_hints.height = page_h < screen_h ? page_h : screen_h;
  907.       }
  908.       top_level = XCreateSimpleWindow(DISP, RootWindowOfScreen(SCRN),
  909. !         size_hints.x, size_hints.y, size_hints.width, size_hints.height,
  910. !         bwidth, fore_Pixel, back_Pixel);
  911.       XSetStandardProperties(DISP, top_level, dvi_name, prog, NULL,
  912.           argv, argc, &size_hints);
  913.   
  914. --- 2333,2366 ----
  915.       size_hints.x = size_hints.y = 0;
  916.       if (geometry != NULL) {
  917.           int flag = XParseGeometry(geometry, &size_hints.x, &size_hints.y,
  918. !         &window_w, &window_h);
  919.   
  920.           if (flag & (XValue | YValue))
  921. !         size_hints.flags |= USPosition;
  922.           if (flag & (WidthValue | HeightValue))
  923.           size_hints.flags |= USSize;
  924. !         if (flag & XNegative) size_hints.x += screen_w - window_w;
  925. !         if (flag & YNegative) size_hints.y += screen_h - window_h;
  926.       }
  927.       if (!(size_hints.flags & USSize)) {
  928. +         int x_thick = 0;
  929. +         int y_thick = 0;
  930. +         if (screen_w < page_w) x_thick = BAR_THICK;
  931. +         if (screen_h < page_h + x_thick) y_thick = BAR_THICK;
  932. +         window_w = page_w + y_thick;
  933. +         if (window_w > screen_w) {
  934. +         x_thick = BAR_THICK;
  935. +         window_w = screen_w;
  936. +         }
  937. +         window_h = page_h + x_thick;
  938. +         if (window_h > screen_h) window_h = screen_h;
  939.           size_hints.flags |= PSize;
  940.       }
  941. +     size_hints.width = window_w;
  942. +     size_hints.height = window_h;
  943.       top_level = XCreateSimpleWindow(DISP, RootWindowOfScreen(SCRN),
  944. !         size_hints.x, size_hints.y, window_w, window_h, bwidth,
  945. !         fore_Pixel, back_Pixel);
  946.       XSetStandardProperties(DISP, top_level, dvi_name, prog, NULL,
  947.           argv, argc, &size_hints);
  948.   
  949. ***************
  950. *** 2331,2338 ****
  951.       frame.bdrwidth = bwidth;
  952.       screen_w = DisplayWidth() - 2*bwidth;
  953.       screen_h = DisplayHeight() - 2*bwidth;
  954. !     frame.width = (page_w < screen_w ? page_w : screen_w);
  955. !     frame.height = (page_h < screen_h ? page_h : screen_h);
  956.       frame.border = bdrmap;
  957.       frame.background = backmap;
  958.       frame.x = 0;
  959. --- 2447,2462 ----
  960.       frame.bdrwidth = bwidth;
  961.       screen_w = DisplayWidth() - 2*bwidth;
  962.       screen_h = DisplayHeight() - 2*bwidth;
  963. !     x_thick = y_thick = 0;
  964. !     if (screen_w < page_w) x_thick = BAR_THICK;
  965. !     if (screen_h < page_h + x_thick) y_thick = BAR_THICK;
  966. !     frame.width = page_w + y_thick;
  967. !     if (frame.width > screen_w) {
  968. !         x_thick = BAR_THICK;
  969. !         frame.width = screen_w;
  970. !     }
  971. !     frame.height = page_h + x_thick;
  972. !     if (frame.height > screen_h) frame.height = screen_h;
  973.       frame.border = bdrmap;
  974.       frame.background = backmap;
  975.       frame.x = 0;
  976. diff -cr old/xdvi.h new/xdvi.h
  977. *** old/xdvi.h    Sun Feb  4 13:09:47 1990
  978. --- new/xdvi.h    Sun Dec 10 20:29:55 1989
  979. ***************
  980. *** 7,13 ****
  981. --- 7,23 ----
  982.   #include <X11/Xos.h>    /* same as below */
  983.   #else X10
  984.   #include <sys/types.h>    /* for sites without X11 */
  985. + #ifdef    SYSV
  986. + #include <string.h>
  987. + #define index strchr
  988. + #define rindex strrchr
  989. + #include <fcntl.h>
  990. + #else /* SYSV */
  991. + #include <strings.h>
  992. + #endif /* SYSV */
  993. + #include <sys/file.h>
  994.   #endif X10
  995.   #include <setjmp.h>
  996.   
  997.   #define    OPEN_MODE    "r"
  998. diff -cr old/xdvi.man.sed new/xdvi.man.sed
  999. *** old/xdvi.man.sed    Sun Feb  4 13:09:50 1990
  1000. --- new/xdvi.man.sed    Sun Feb  4 13:28:33 1990
  1001. ***************
  1002. *** 12,19 ****
  1003.   [\-l] [\-rv] [\-fg \fIcolor\fP] [\-bg \fIcolor\fP]
  1004.   [\-hl \fIcolor\fP] [\-bd \fIcolor\fP] [\-cr \fIcolor\fP]
  1005.   [\-margins \fIinches\fP] [\-sidemargin \fIinches\fP] [\-topmargin \fIinches\fP]
  1006. ! [\-pagewidth \fIinches\fP] [\-pageheight \fIinches\fP]
  1007. ! [\-mgs[\fIn\fP] \fIsize\fP] [\-altfont \fIfont\fP]
  1008.   #ifx11
  1009.   [#\fIgeometry\fP] [\-geometry \fIgeometry\fP] [\-display \fIdisplay\fP]
  1010.   [-copy] [-thorough]
  1011. --- 12,18 ----
  1012.   [\-l] [\-rv] [\-fg \fIcolor\fP] [\-bg \fIcolor\fP]
  1013.   [\-hl \fIcolor\fP] [\-bd \fIcolor\fP] [\-cr \fIcolor\fP]
  1014.   [\-margins \fIinches\fP] [\-sidemargin \fIinches\fP] [\-topmargin \fIinches\fP]
  1015. ! [\-paper \fIpapertype\fP] [\-mgs[\fIn\fP] \fIsize\fP] [\-altfont \fIfont\fP]
  1016.   #ifx11
  1017.   [#\fIgeometry\fP] [\-geometry \fIgeometry\fP] [\-display \fIdisplay\fP]
  1018.   [-copy] [-thorough]
  1019. ***************
  1020. *** 156,162 ****
  1021.   still cannot fit in the window, then the page is put in the window such that
  1022.   the top and left margins are hidden, and presumably the upper left-hand corner
  1023.   of the text on the page will be in the upper left-hand corner of the window.
  1024. ! Otherwise, the text is centered in the window.  See also `\fBH\fR' under
  1025.   the KEY\%STROKES section.
  1026.   .TP
  1027.   .BI \-sidemargin " inches"
  1028. --- 155,161 ----
  1029.   still cannot fit in the window, then the page is put in the window such that
  1030.   the top and left margins are hidden, and presumably the upper left-hand corner
  1031.   of the text on the page will be in the upper left-hand corner of the window.
  1032. ! Otherwise, the text is centered in the window.  See also `\fBM\fR' under
  1033.   the KEY\%STROKES section.
  1034.   .TP
  1035.   .BI \-sidemargin " inches"
  1036. ***************
  1037. *** 167,180 ****
  1038.   (%%dot%%topMargin)
  1039.   Specifies the top and bottom margins (see above).
  1040.   .TP
  1041. ! .BI \-pagewidth " inches"
  1042. ! (%%dot%%pageWidth)
  1043. ! Specifies the width of the printed page.
  1044. ! .TP
  1045. ! .BI \-pageheight " inches"
  1046. ! (%%dot%%pageHeight)
  1047. ! Specifies the height of the printed page.  By default, the page size
  1048. ! is %%defaultpagesize%%.
  1049.   .TP
  1050.   #ifx11
  1051.   .BI "\-mgs[n]" " size"
  1052. --- 166,180 ----
  1053.   (%%dot%%topMargin)
  1054.   Specifies the top and bottom margins (see above).
  1055.   .TP
  1056. ! .BI \-paper " papertype"
  1057. ! (%%dot%%paper)
  1058. ! Specifies the size of the printed page.  This may be of the form
  1059. ! \fIw\fRx\fIh\fR (or \fIw\fRx\fIh\fRcm), where \fIw\fR is the width in
  1060. ! inches (or cm) and \fIh\fR is the height in inches (or cm), respectively.
  1061. ! There are also synonyms which may be used:  us (8.5x11), usr (11x8.5),
  1062. ! legal (8.5x14), foolscap (13.5x17), as well as the ISO sizes a1-a7,
  1063. ! b1-b7, c1-c7, a1r-a7r (a1-a7 rotated), etc.  The default size is
  1064. ! %%defaultpagesize%%.
  1065.   .TP
  1066.   #ifx11
  1067.   .BI "\-mgs[n]" " size"
  1068.  
  1069.