home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume20 / xdvi / patch17 < prev    next >
Encoding:
Text File  |  1993-06-27  |  43.1 KB  |  1,533 lines

  1. Newsgroups: comp.sources.x
  2. From: vojta@math.berkeley.edu (Paul Vojta)
  3. Subject: v20i055:  xdvi - dvi previewer, Patch17
  4. Message-ID: <1993Jun28.145004.7783@sparky.imd.sterling.com>
  5. X-Md4-Signature: c7f8813b55f21558451304b8298a7a85
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Mon, 28 Jun 1993 14:50:04 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: vojta@math.berkeley.edu (Paul Vojta)
  12. Posting-number: Volume 20, Issue 55
  13. Archive-name: xdvi/patch17
  14. Environment: X10, X11
  15. Patch-To: xdvi: Volume 17, Issue 23-25,27,40-41,53,106-107, Volume 18 Issue 53-54
  16.  
  17. This patch:
  18.   o  Fixes some bugs in the greyscaling code.
  19.   o  Allows you to specify the script for making pk fonts, and have some
  20.      control over its arguments.
  21.   o  Rewrites mksedscript in /bin/sh instead of /bin/csh (not all sites have
  22.      csh, it seems).
  23.  
  24. It is also likely to be the last version of xdvi to support X10 (which has
  25. been untested for quite some time anyway), and the last to support .pxl
  26. files.
  27.  
  28. --Paul Vojta, vojta@math.berkeley.edu
  29.  
  30. #! /bin/sh
  31. # This is a shell archive.  Remove anything before this line, then feed it
  32. # into a shell via "sh file" or similar.  To overwrite existing files,
  33. # type "sh file -c".
  34. # Contents:  xdvi.p17
  35. # Wrapped by chris@sparky on Mon Jun 28 09:26:50 1993
  36. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  37. echo If this archive is complete, you will see the following message:
  38. echo '          "shar: End of archive 1 (of 1)."'
  39. if test -f 'xdvi.p17' -a "${1}" != "-c" ; then 
  40.   echo shar: Will not clobber existing file \"'xdvi.p17'\"
  41. else
  42.   echo shar: Extracting \"'xdvi.p17'\" \(40142 characters\)
  43.   sed "s/^X//" >'xdvi.p17' <<'END_OF_FILE'
  44. XPrereq: 16
  45. Xdiff -cr xdvi_old/patchlevel.h xdvi_new/patchlevel.h
  46. X*** xdvi_old/patchlevel.h    Tue Aug 25 12:22:44 1992
  47. X--- xdvi_new/patchlevel.h    Fri May  7 19:46:10 1993
  48. X***************
  49. X*** 1 ****
  50. X! #define PATCHLEVEL 16
  51. X--- 1 ----
  52. X! #define PATCHLEVEL 17
  53. Xdiff -cr xdvi_old/MakeTeXPK xdvi_new/MakeTeXPK
  54. X*** xdvi_old/MakeTeXPK    Fri Jun 19 13:32:07 1992
  55. X--- xdvi_new/MakeTeXPK    Sun Dec 20 21:00:27 1992
  56. X***************
  57. X*** 36,42 ****
  58. X  BDPI=$3
  59. X  MAG=$4
  60. X  MODE=$5
  61. X! 
  62. X  umask 0
  63. X  
  64. X  if test "$MODE" = ""
  65. X--- 36,48 ----
  66. X  BDPI=$3
  67. X  MAG=$4
  68. X  MODE=$5
  69. X! #
  70. X! #   Prevent X-windows from displaying.  Except it doesn't always work;
  71. X! #   some sh'ells don't seem to understand unset.  There are also some
  72. X! #   versions of METAFONT that don't work if the DISPLAY isn't set and
  73. X! #   the term type is set to xterm.
  74. X! #
  75. X! # unset DISPLAY
  76. X  umask 0
  77. X  
  78. X  if test "$MODE" = ""
  79. X***************
  80. X*** 56,61 ****
  81. X--- 62,70 ----
  82. X     elif test $BDPI = 100
  83. X     then
  84. X        MODE=nextscreen
  85. X+    elif test $BDPI = 72
  86. X+    then
  87. X+       MODE=seventwo
  88. X     elif test $BDPI = 635
  89. X     then
  90. X        MODE=linolo
  91. X***************
  92. X*** 84,89 ****
  93. X--- 93,99 ----
  94. X  if test ! -d $DESTDIR
  95. X  then
  96. X     mkdir $DESTDIR
  97. X+    chmod 777 $DESTDIR
  98. X  fi
  99. X  
  100. X  if test "$6" != ""
  101. X***************
  102. X*** 92,100 ****
  103. X--- 102,116 ----
  104. X     if test ! -d $DESTDIR
  105. X     then
  106. X        mkdir $DESTDIR
  107. X+       chmod 777 $DESTDIR
  108. X     fi
  109. X  fi
  110. X  
  111. X+ # added by gwb, to allow searching in current dir before cd'ing
  112. X+ if test "$MFINPUTS" != ""
  113. X+ then
  114. X+    MFINPUTS=$MFINPUTS:`pwd`; export MFINPUTS
  115. X+ fi
  116. X  mkdir $TEMPDIR
  117. X  cd $TEMPDIR
  118. X  
  119. X***************
  120. X*** 121,126 ****
  121. X--- 137,143 ----
  122. X     fi
  123. X  fi
  124. X  
  125. X+ unset DISPLAY
  126. X  echo "mf \"\\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME\" < /dev/null"
  127. X  mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" < /dev/null
  128. X  if test ! -r $GFNAME
  129. X***************
  130. X*** 137,141 ****
  131. X--- 154,159 ----
  132. X  mv $PKNAME $DESTDIR/pktmp.$$
  133. X  cd $DESTDIR
  134. X  mv pktmp.$$ $PKNAME
  135. X+ chmod a+r $PKNAME
  136. X  
  137. X  exit 0
  138. Xdiff -cr xdvi_old/README xdvi_new/README
  139. X*** xdvi_old/README    Wed Sep 16 17:34:48 1992
  140. X--- xdvi_new/README    Tue May 11 16:20:58 1993
  141. X***************
  142. X*** 8,14 ****
  143. X--- 8,22 ----
  144. X      If your site uses virtual fonts, do the same thing with the
  145. X      DEFAULT_VF_PATH variable.  Note that support of virtual fonts in xdvi
  146. X      does not include support of built-in Postscript<tm> fonts.
  147. X+     Usually you will want to use the same font files as your printer;
  148. X+     given a choice, however, it has been suggested that write-white
  149. X+     fonts look better.
  150. X  
  151. X+     (Note:  If you are using both imake and the "/*" or "/**" syntax for
  152. X+         recursive searching of subdirectories, you should enclose
  153. X+         the string in quotes, since /* marks the beginning of a C
  154. X+         comment, and the Imakefile is processed by cpp.)
  155. X+ 
  156. X      (Note:  for X10 compilation, use Makefile_10 instead of Makefile.)
  157. X  
  158. X      You may also wish to change other compilation options; they are
  159. X***************
  160. X*** 72,77 ****
  161. X--- 80,88 ----
  162. X              paragraph in xdvi_man.sed for more details.  This
  163. X              option turns off that paragraph.
  164. X      NOTOOL        (X11 only; xdvi.c)  Compile using raw X calls.
  165. X+             If you use this, you should also change the LIBS=
  166. X+             line in the Makefile or the DEPLIBS and LOCAL_LIBRARIES
  167. X+             line in the Imakefile.
  168. X      BUTTONS        (xdvi.c)  Put radio buttons on the right side of the
  169. X              window for commonly used commands.
  170. X      A4        (xdvi.c)  Use European size paper by default.
  171. X***************
  172. X*** 80,85 ****
  173. X--- 91,98 ----
  174. X      TEXXET        (everything)  Enables op-codes 250 and 251 (used for
  175. X              right-to-left languages).
  176. X      BDPI        (xdvi.c) Default number of pixels per inch to use.
  177. X+             Don't forget to make corresponding changes to
  178. X+             DEFAULT_FONT_SIZES.
  179. X      GREY        (everything)  Use greyscale anti-aliasing for
  180. X              displaying shrunken bitmaps.
  181. X      MAKEPK        (font_open.c)  If a font is not found, then try to
  182. X***************
  183. X*** 264,268 ****
  184. X--- 277,285 ----
  185. X     34.    In the code for greyscale anti-aliasing, try to allocate a colormap
  186. X      so that GXor operations can be used for drawing.  Also interpolate
  187. X      between foreground and background colors.
  188. X+ --  Patchlevel 17: --
  189. X+    35.    Fixed some bugs in the greyscale code.
  190. X+    36.    Implemented an environment variable for the MakeTeXPK script.
  191. X+    37.    Replaced mksedscript with a script using /bin/sh.
  192. X  
  193. X  Paul Vojta, vojta@math.berkeley.edu
  194. Xdiff -cr xdvi_old/README.VMS xdvi_new/README.VMS
  195. X*** xdvi_old/README.VMS    Wed Sep 16 17:19:08 1992
  196. X--- xdvi_new/README.VMS    Mon May 31 15:55:03 1993
  197. X***************
  198. X*** 344,350 ****
  199. X     XDVI also recognizes the "PKFONTS" logical name, which is checked after
  200. X     "XDVIFONTS" but before "TEXFONTS".
  201. X  
  202. X!    The logical name "XDVISIZES" must be set to indicate which sizes of fonts are
  203. X     available.  It should consist of a list of numbers separated by slashes.  If
  204. X     the list begins with a slash, the system default sizes are used, as well.
  205. X     Sizes are expressed in dots per inch; decimals may be used for "pxl" files:
  206. X--- 344,350 ----
  207. X     XDVI also recognizes the "PKFONTS" logical name, which is checked after
  208. X     "XDVIFONTS" but before "TEXFONTS".
  209. X  
  210. X!    The logical name "XDVISIZES" may be set to indicate which sizes of fonts are
  211. X     available.  It should consist of a list of numbers separated by slashes.  If
  212. X     the list begins with a slash, the system default sizes are used, as well.
  213. X     Sizes are expressed in dots per inch; decimals may be used for "pxl" files:
  214. Xdiff -cr xdvi_old/XDVI.RNH xdvi_new/XDVI.RNH
  215. X*** xdvi_old/XDVI.RNH    Wed Sep 16 17:19:10 1992
  216. X--- xdvi_new/XDVI.RNH    Mon May 31 15:55:03 1993
  217. X***************
  218. X*** 11,16 ****
  219. X--- 11,17 ----
  220. X  .! Added new switches for patchlevel 11.  Scott Allendorf.
  221. X  .! Added new switches for patchlevel 14.  Scott Allendorf.
  222. X  .! Added new switches for patchlevel 16.  Scott Allendorf.
  223. X+ .! Updated for patchlevel 17.             Scott Allendorf.
  224. X  .!
  225. X  .NO PAGING
  226. X  .NO FLAGS ALL
  227. X***************
  228. X*** 578,584 ****
  229. X  .INDENT -1
  230. X  3 XDVISIZES
  231. X  .BREAK
  232. X! The logical name "XDVISIZES" must be set to indicate which
  233. X  sizes of fonts are available.  It should consists of a list of numbers
  234. X  separated by slashes.  If the list begins with a slash, the system
  235. X  default sizes are used, as well.  Sizes are expressed in dots per
  236. X--- 579,585 ----
  237. X  .INDENT -1
  238. X  3 XDVISIZES
  239. X  .BREAK
  240. X! The logical name "XDVISIZES" may be set to indicate which
  241. X  sizes of fonts are available.  It should consists of a list of numbers
  242. X  separated by slashes.  If the list begins with a slash, the system
  243. X  default sizes are used, as well.  Sizes are expressed in dots per
  244. Xdiff -cr xdvi_old/dvi_draw.c xdvi_new/dvi_draw.c
  245. X*** xdvi_old/dvi_draw.c    Mon Aug 24 18:44:34 1992
  246. X--- xdvi_new/dvi_draw.c    Mon Feb 22 15:27:43 1993
  247. X***************
  248. X*** 508,515 ****
  249. X      for (tnp = currinf.tn_head; tnp != NULL; tnp = tnp->next)
  250. X          if (tnp->TeXnumber == n) {
  251. X          currinf.fontp = tnp->fontp;
  252. X-         if (!(currinf.fontp->flags & FONT_LOADED))
  253. X-             load_font(currinf.fontp);
  254. X          break;
  255. X          }
  256. X      if (currinf.fontp == NULL) tell_oops("non-existent font #%d", n);
  257. X--- 508,513 ----
  258. X***************
  259. X*** 616,623 ****
  260. X--- 614,670 ----
  261. X  }
  262. X  
  263. X  
  264. X+ /* ARGSUSED */
  265. X  #ifndef    TEXXET
  266. X  long
  267. X+ set_empty_char(ch)
  268. X+ #else
  269. X+ void
  270. X+ set_empty_char(cmd, ch)
  271. X+     WIDEARG(ubyte, int)    cmd;
  272. X+ #endif
  273. X+     WIDEARG(ubyte, int)    ch;
  274. X+ {
  275. X+ #ifndef    TEXXET
  276. X+     return 0;
  277. X+ #else
  278. X+     return;
  279. X+ #endif
  280. X+ }
  281. X+ 
  282. X+ 
  283. X+ #ifndef    TEXXET
  284. X+ long
  285. X+ load_n_set_char(ch)
  286. X+ #else
  287. X+ void
  288. X+ load_n_set_char(cmd, ch)
  289. X+     WIDEARG(ubyte, int)    cmd;
  290. X+ #endif
  291. X+     WIDEARG(ubyte, int)    ch;
  292. X+ {
  293. X+     if (load_font(currinf.fontp)) {    /* if not found */
  294. X+         Fputs("Character(s) will be left blank.\n", stderr);
  295. X+         currinf.set_char_p = currinf.fontp->set_char_p = set_empty_char;
  296. X+ #ifndef    TEXXET
  297. X+         return 0;
  298. X+ #else
  299. X+         return;
  300. X+ #endif
  301. X+     }
  302. X+     maxchar = currinf.fontp->maxchar;
  303. X+     currinf.set_char_p = currinf.fontp->set_char_p;
  304. X+ #ifndef    TEXXET
  305. X+     return (*currinf.set_char_p)(ch);
  306. X+ #else
  307. X+     (*currinf.set_char_p)(cmd, ch);
  308. X+     return;
  309. X+ #endif
  310. X+ }
  311. X+ 
  312. X+ 
  313. X+ #ifndef    TEXXET
  314. X+ long
  315. X  set_vf_char(ch)
  316. X  #else
  317. X  void
  318. X***************
  319. X*** 684,691 ****
  320. X      if (currinf.virtual) {
  321. X          currinf.fontp = currinf.virtual->first_font;
  322. X          if (currinf.fontp != NULL) {
  323. X-         if (!(currinf.fontp->flags & FONT_LOADED))
  324. X-             load_font(currinf.fontp);
  325. X          maxchar = currinf.fontp->maxchar;
  326. X          currinf.set_char_p = currinf.fontp->set_char_p;
  327. X  #ifndef    TEXXET
  328. X--- 731,736 ----
  329. Xdiff -cr xdvi_old/dvi_init.c xdvi_new/dvi_init.c
  330. X*** xdvi_old/dvi_init.c    Mon Aug 24 18:44:44 1992
  331. X--- xdvi_new/dvi_init.c    Sun Feb 28 17:30:13 1993
  332. X***************
  333. X*** 169,175 ****
  334. X   *    plus whatever other preprocessing is done (depending on the format).
  335. X   */
  336. X  
  337. X! void
  338. X  load_font(fontp)
  339. X      struct font *fontp;
  340. X  {
  341. X--- 169,175 ----
  342. X   *    plus whatever other preprocessing is done (depending on the format).
  343. X   */
  344. X  
  345. X! Boolean
  346. X  load_font(fontp)
  347. X      struct font *fontp;
  348. X  {
  349. X***************
  350. X*** 185,192 ****
  351. X          &fontp->filename);
  352. X      if (fontp->file == NULL) {
  353. X          Fprintf(stderr, "Can't find font %s.\n", fontp->fontname);
  354. X!         font_not_found = True;
  355. X!         return;
  356. X      }
  357. X      --n_files_left;
  358. X      if (font_found != NULL) {
  359. X--- 185,191 ----
  360. X          &fontp->filename);
  361. X      if (fontp->file == NULL) {
  362. X          Fprintf(stderr, "Can't find font %s.\n", fontp->fontname);
  363. X!         return True;
  364. X      }
  365. X      --n_files_left;
  366. X      if (font_found != NULL) {
  367. X***************
  368. X*** 233,238 ****
  369. X--- 232,238 ----
  370. X          if (maxchar < 255)
  371. X          realloc_font(fontp, WIDEARG(,(int)) maxchar);
  372. X      }
  373. X+     return False;
  374. X  }
  375. X  
  376. X  
  377. X***************
  378. X*** 331,337 ****
  379. X      (void) four(file);    /* checksum */
  380. X      scale = four(file);
  381. X      design = four(file);
  382. X!     len = one(file) + one(file);
  383. X      fontname = xmalloc((unsigned) len + 1, "font name");
  384. X      Fread(fontname, sizeof(char), len, file);
  385. X      fontname[len] = '\0';
  386. X--- 331,337 ----
  387. X      (void) four(file);    /* checksum */
  388. X      scale = four(file);
  389. X      design = four(file);
  390. X!     len = one(file); len += one(file); /* sequence point in the middle */
  391. X      fontname = xmalloc((unsigned) len + 1, "font name");
  392. X      Fread(fontname, sizeof(char), len, file);
  393. X      fontname[len] = '\0';
  394. X***************
  395. X*** 365,376 ****
  396. X              Printf("%s at %d dpi\n", fontname, (int) (fsize + 0.5));
  397. X          fontp = (struct font *) xmalloc((unsigned) sizeof(struct font),
  398. X              "font structure");
  399. X-         fontp->dimconv = scale * scale_dimconv / (1<<20);
  400. X          fontp->fontname = fontname;
  401. X          fontp->fsize = fsize;
  402. X          fontp->magstepval = magstepval;
  403. X          fontp->flags = FONT_IN_USE;
  404. X!         if (vfparent == NULL) load_font(fontp);
  405. X          fontp->next = font_head;
  406. X          font_head = fontp;
  407. X          break;
  408. X--- 365,377 ----
  409. X              Printf("%s at %d dpi\n", fontname, (int) (fsize + 0.5));
  410. X          fontp = (struct font *) xmalloc((unsigned) sizeof(struct font),
  411. X              "font structure");
  412. X          fontp->fontname = fontname;
  413. X          fontp->fsize = fsize;
  414. X          fontp->magstepval = magstepval;
  415. X          fontp->flags = FONT_IN_USE;
  416. X!         fontp->dimconv = scale * scale_dimconv / (1<<20);
  417. X!         fontp->set_char_p = load_n_set_char;
  418. X!         if (vfparent == NULL) font_not_found |= load_font(fontp);
  419. X          fontp->next = font_head;
  420. X          font_head = fontp;
  421. X          break;
  422. X***************
  423. X*** 562,575 ****
  424. X  }
  425. X  
  426. X  /*
  427. X!  *    init_dvi_file is the main subroutine for reading the startup information
  428. X!  *    from the dvi file.
  429. X   */
  430. X  
  431. X! static    void
  432. X  init_dvi_file()
  433. X  {
  434. X      (void) fstat(fileno(dvi_file), &fstatbuf);
  435. X      dvi_time = fstatbuf.st_mtime;
  436. X      process_preamble();
  437. X      find_postamble();
  438. X--- 563,578 ----
  439. X  }
  440. X  
  441. X  /*
  442. X!  *    init_dvi_file is the main subroutine for reading the startup
  443. X!  *    information from the dvi file.  Returns True on success.
  444. X   */
  445. X  
  446. X! static    Boolean
  447. X  init_dvi_file()
  448. X  {
  449. X      (void) fstat(fileno(dvi_file), &fstatbuf);
  450. X+     if (S_ISDIR(fstatbuf.st_mode))
  451. X+         return False;
  452. X      dvi_time = fstatbuf.st_mtime;
  453. X      process_preamble();
  454. X      find_postamble();
  455. X***************
  456. X*** 578,583 ****
  457. X--- 581,587 ----
  458. X      init_page();
  459. X      if (current_page >= total_pages) current_page = total_pages - 1;
  460. X      hush_spec_now = hush_spec;
  461. X+     return True;
  462. X  }
  463. X  
  464. X  /**
  465. X***************
  466. X*** 588,613 ****
  467. X  void
  468. X  open_dvi_file()
  469. X  {
  470. X!     char *errmsg;
  471. X  
  472. X!     if ((dvi_file = fopen(dvi_name, OPEN_MODE)) == NULL) {
  473. X!         int n = strlen(dvi_name);
  474. X!         char *file = dvi_name;
  475. X  
  476. X!         if (strcmp(dvi_name + n - sizeof(".dvi") + 1, ".dvi") == 0) {
  477. X!         perror(dvi_name);
  478. X!         exit(1);
  479. X!         }
  480. X!         dvi_name = xmalloc((unsigned) n + sizeof(".dvi"), "dvi file name");
  481. X!         Sprintf(dvi_name, "%s.dvi", file);
  482. X!         if ((dvi_file = fopen(dvi_name, OPEN_MODE)) == NULL) {
  483. X!         perror(dvi_name);
  484. X!         exit(1);
  485. X!         }
  486. X!     }
  487. X  
  488. X!     if (errmsg = (char *) setjmp(dvi_env)) oops(errmsg);
  489. X!     init_dvi_file();
  490. X  }
  491. X  
  492. X  /**
  493. X--- 592,620 ----
  494. X  void
  495. X  open_dvi_file()
  496. X  {
  497. X!     char    *errmsg;
  498. X!     int    n;
  499. X!     char    *file;
  500. X  
  501. X!     if ((errmsg = (char *) setjmp(dvi_env)) != NULL) oops(errmsg);
  502. X  
  503. X!     if ((dvi_file = fopen(dvi_name, OPEN_MODE)) != NULL && init_dvi_file())
  504. X!         return;
  505. X  
  506. X!     n = strlen(dvi_name);
  507. X!     file = dvi_name;
  508. X! 
  509. X!     if (strcmp(dvi_name + n - sizeof(".dvi") + 1, ".dvi") == 0) {
  510. X!         perror(dvi_name);
  511. X!         exit(1);
  512. X!     }
  513. X!     dvi_name = xmalloc((unsigned) n + sizeof(".dvi"), "dvi file name");
  514. X!     Sprintf(dvi_name, "%s.dvi", file);
  515. X!     if ((dvi_file = fopen(dvi_name, OPEN_MODE)) == NULL
  516. X!         || !init_dvi_file()) {
  517. X!         perror(dvi_name);
  518. X!         exit(1);
  519. X!     }
  520. X  }
  521. X  
  522. X  /**
  523. X***************
  524. X*** 621,637 ****
  525. X  
  526. X      if (dvi_file == NULL || fstat(fileno(dvi_file), &fstatbuf) != 0
  527. X          || fstatbuf.st_mtime != dvi_time) {
  528. X!         if (dvi_file) Fclose(dvi_file);
  529. X          free((char *) page_offset);
  530. X-         dvi_file = fopen(dvi_name, OPEN_MODE);
  531. X-         if (dvi_file == NULL)
  532. X-             dvi_oops("Cannot reopen dvi file.");
  533. X-         if (list_fonts) Putchar('\n');
  534. X          free_vf_chain(tn_head);
  535. X          tn_head = NULL;
  536. X          for (fontp = font_head; fontp != NULL; fontp = fontp->next)
  537. X              fontp->flags &= ~FONT_IN_USE;
  538. X!         init_dvi_file();
  539. X          redraw_page();
  540. X          return False;
  541. X      }
  542. X--- 628,646 ----
  543. X  
  544. X      if (dvi_file == NULL || fstat(fileno(dvi_file), &fstatbuf) != 0
  545. X          || fstatbuf.st_mtime != dvi_time) {
  546. X!         if (dvi_file) {
  547. X!             Fclose(dvi_file);
  548. X!             if (list_fonts) Putchar('\n');
  549. X!         }
  550. X          free((char *) page_offset);
  551. X          free_vf_chain(tn_head);
  552. X          tn_head = NULL;
  553. X          for (fontp = font_head; fontp != NULL; fontp = fontp->next)
  554. X              fontp->flags &= ~FONT_IN_USE;
  555. X!         if ((dvi_file = fopen(dvi_name, OPEN_MODE)) == NULL
  556. X!             || !init_dvi_file())
  557. X!             dvi_oops("Cannot reopen dvi file.");
  558. X!         reconfig();
  559. X          redraw_page();
  560. X          return False;
  561. X      }
  562. Xdiff -cr xdvi_old/font_open.c xdvi_new/font_open.c
  563. X*** xdvi_old/font_open.c    Fri Jul 24 14:28:54 1992
  564. X--- xdvi_new/font_open.c    Fri May  7 19:50:23 1993
  565. X***************
  566. X*** 63,72 ****
  567. X--- 63,80 ----
  568. X  #define    DEFAULT_VF_TAIL    ":%f.vf"
  569. X  #endif    /* VMS */
  570. X  
  571. X+ #ifdef    MAKEPKCMD
  572. X+ #undef    MAKEPK
  573. X+ #define    MAKEPK
  574. X+ #endif
  575. X+ 
  576. X  static    _Xconst char    *font_path;
  577. X  static    _Xconst char    *default_font_path    = DEFAULT_FONT_PATH;
  578. X  static    _Xconst char    *vf_path;
  579. X  static    _Xconst char    *default_vf_path    = DEFAULT_VF_PATH;
  580. X+ #ifdef    MAKEPK
  581. X+ static    _Xconst    char    *makepkcmd        = NULL;
  582. X+ #endif
  583. X  #ifdef    SEARCH_SUBDIRECTORIES
  584. X  static    char    default_subdir_path[]    = DEFAULT_SUBDIR_PATH;
  585. X  #endif
  586. X***************
  587. X*** 600,618 ****
  588. X      return NULL;
  589. X  }
  590. X  
  591. X- #ifdef    MAKEPKCMD
  592. X- #undef    MAKEPK
  593. X- #define    MAKEPK
  594. X- #endif
  595. X- 
  596. X  #ifdef    MAKEPK
  597. X  #ifndef    MAKEPKCMD
  598. X  #define    MAKEPKCMD    "MakeTeXPK"
  599. X  #endif
  600. X  
  601. X- #define    NOBUILD    29999
  602. X- #endif
  603. X- 
  604. X  /*
  605. X   *    Try a given font name
  606. X   */
  607. X--- 608,621 ----
  608. X      return NULL;
  609. X  }
  610. X  
  611. X  #ifdef    MAKEPK
  612. X  #ifndef    MAKEPKCMD
  613. X  #define    MAKEPKCMD    "MakeTeXPK"
  614. X  #endif
  615. X+ #define    NOBUILD        29999
  616. X+ #define    MKPKSIZE     256
  617. X+ #endif    /* MAKEPK */
  618. X  
  619. X  /*
  620. X   *    Try a given font name
  621. X   */
  622. X***************
  623. X*** 642,650 ****
  624. X      _Xconst char    *path_to_use;
  625. X      _Xconst char    *vf_path_to_use;
  626. X  #endif
  627. X- #ifdef    MAKEPK
  628. X-     char    mkpk[80];
  629. X- #endif
  630. X  
  631. X      /*
  632. X       * Loop over sizes.  Try actual size first, then closest sizes.
  633. X--- 645,650 ----
  634. X***************
  635. X*** 689,709 ****
  636. X  #ifdef    MAKEPK
  637. X      /* Try to create the font. */
  638. X      if (magstepval != NOBUILD) {
  639. X!         char str[24];
  640. X          int    dpi    = (mag + 2) / 5;
  641. X  
  642. X!         if (magstepval == NOMAGSTP)
  643. X!         Sprintf(str, "%d+%d/%d", dpi / pixels_per_inch,
  644. X!             dpi % pixels_per_inch, pixels_per_inch);
  645. X!         else if (magstepval < 0)
  646. X!         Sprintf(str, "magstep\\(-%d%s\\)", (-magstepval) / 2,
  647. X!             magstepval % 2 ? ".5" :"");
  648. X!         else
  649. X!         Sprintf(str, "magstep\\(%d%s\\)", magstepval / 2,
  650. X!             magstepval % 2 ? ".5" :"");
  651. X  
  652. X-         Sprintf(mkpk, "%s %s %d %d %s", MAKEPKCMD, font, dpi,
  653. X-         pixels_per_inch, str);
  654. X          Printf("- %s\n", mkpk);
  655. X          if (system(mkpk) == 0
  656. X          && (f = try_size(font, mag, name, path_to_use,
  657. X--- 689,756 ----
  658. X  #ifdef    MAKEPK
  659. X      /* Try to create the font. */
  660. X      if (magstepval != NOBUILD) {
  661. X!         char mkpk[MKPKSIZE];
  662. X          int    dpi    = (mag + 2) / 5;
  663. X+         Boolean used_fontname = False;
  664. X+         _Xconst char *p;
  665. X+         char *q;
  666. X  
  667. X!         if (makepkcmd == NULL) {
  668. X!         makepkcmd = getenv("XDVIMAKEPK");
  669. X!         if (makepkcmd == NULL) makepkcmd = MAKEPKCMD;
  670. X!         }
  671. X!         p = makepkcmd;
  672. X!         q = mkpk;
  673. X!         for (;;) {
  674. X!         if (*p == '%') {
  675. X!             switch (*++p) {
  676. X!             case 'n':
  677. X!             Strcpy(q, font);
  678. X!             used_fontname = True;
  679. X!             break;
  680. X!             case 'd':
  681. X!             Sprintf(q, "%d", dpi);
  682. X!             break;
  683. X!             case 'b':
  684. X!             Sprintf(q, "%d", pixels_per_inch);
  685. X!             break;
  686. X!             case 'm':
  687. X!             if (magstepval == NOMAGSTP)
  688. X!                 Sprintf(q, "%d+%d/%d", dpi / pixels_per_inch,
  689. X!                 dpi % pixels_per_inch, pixels_per_inch);
  690. X!             else if (magstepval < 0)
  691. X!                 Sprintf(q, "magstep\\(-%d%s\\)", -magstepval / 2,
  692. X!                 magstepval % 2 ? ".5" :"");
  693. X!             else
  694. X!                 Sprintf(q, "magstep\\(%d%s\\)", magstepval / 2,
  695. X!                 magstepval % 2 ? ".5" :"");
  696. X!             break;
  697. X!             case '%':
  698. X!             *q++ = '%';
  699. X!             *q = '\0';
  700. X!             break;
  701. X!             case '\0':
  702. X!             --p;
  703. X!             *q = '\0';
  704. X!             break;
  705. X!             default:
  706. X!             *q++ = '%';
  707. X!             *q++ = *p;
  708. X!             *q = '\0';
  709. X!             break;
  710. X!             }
  711. X!             q += strlen(q);
  712. X!         }
  713. X!         else if (*p == '\0')
  714. X!             if (used_fontname) break;
  715. X!             else {
  716. X!             p = " %n %d %b %m";
  717. X!             continue;
  718. X!             }
  719. X!         else *q++ = *p;
  720. X!         ++p;
  721. X!         }
  722. X  
  723. X          Printf("- %s\n", mkpk);
  724. X          if (system(mkpk) == 0
  725. X          && (f = try_size(font, mag, name, path_to_use,
  726. X***************
  727. X*** 774,780 ****
  728. X          }
  729. X      }
  730. X      if (alt_font != NULL) {
  731. X!         f = PRE_FONT_OPEN(alt_font, mag, mag_ret, name, NOBUILD);
  732. X          if (f != NULL)
  733. X          *font_ret = strcpy(xmalloc((unsigned) strlen(alt_font) + 1,
  734. X              "name of font used"), alt_font);
  735. X--- 821,827 ----
  736. X          }
  737. X      }
  738. X      if (alt_font != NULL) {
  739. X!         f = PRE_FONT_OPEN(alt_font, mag, mag_ret, name, magstepval);
  740. X          if (f != NULL)
  741. X          *font_ret = strcpy(xmalloc((unsigned) strlen(alt_font) + 1,
  742. X              "name of font used"), alt_font);
  743. Xdiff -cr xdvi_old/mksedscript xdvi_new/mksedscript
  744. X*** xdvi_old/mksedscript    Fri Jun 19 13:01:57 1992
  745. X--- xdvi_new/mksedscript    Fri May  7 20:00:20 1993
  746. X***************
  747. X*** 1,44 ****
  748. X! #! /bin/csh -f
  749. X! unset    x10 buttons a4
  750. X! set    noglob
  751. X! foreach x ($argv[4-])
  752. X!     if ($x == -DX10)    set x10
  753. X!     if ($x == -DBUTTONS)    set buttons
  754. X!     if ($x == -DA4)        set a4
  755. X!     if ($x == -DSEARCH_SUBDIRECTORIES) set subdir
  756. X!     if ($x == -DXDVIFONTS_ONLY) set texfonts
  757. X!     if ($x == -DGREY)    set grey
  758. X!     if ($x =~ -DMAKEPK*)    set makepk
  759. X! end
  760. X! if ($?x10) then
  761. X!     echo    /^\#ifx11/,/^\#/d
  762. X!     echo    s/%%dot%%//
  763. X  else
  764. X!     echo    /^\#ifx10/,/^\#/d
  765. X!     echo    s/%%dot%%/./
  766. X! endif
  767. X! if (! $?buttons)    echo /^\#ifbuttons/,/^\#/d
  768. X! if (! $?subdir)        echo /^\#ifsubdir/,/^\#/d
  769. X! if ($?texfonts)        echo /^\#iftexfonts/,/^\#/d
  770. X! if (! $?grey)        echo /^\#ifgrey/,/^\#/d
  771. X! if (! $?makepk)        echo /^\#ifmakepk/,/^\#/d
  772. X! echo    /^\#/d
  773. X! if ($?a4) then
  774. X      echo    's/%%defaultpagesize%%/21 x 29.7 cm (A4 size)/'
  775. X  else
  776. X!     echo    s/%%defaultpagesize%%/8.5 x 11 inches/
  777. X! endif
  778. X! echo    "s@%%DEFAULT_FONT_PATH%%@.TP\\
  779. X! $1@" | sed -e "s@:@\\\\
  780. X! .TP\\\\
  781. X! @g"
  782. X! echo    s/%%DEFAULT_FONT_SIZES%%/$2/ | sed -e "s/:/ :\\\\
  783. X  /g"
  784. X! if ($3 != "") then
  785. X!     echo    "s@%%DEFAULT_VF_PATH%%@.TP\\
  786. X! $3@" | sed -e "s@:@\\\\
  787. X! .TP\\\\
  788. X! @g"
  789. X  else
  790. X!     echo    's@%%DEFAULT_VF_PATH%%.*$@@'
  791. X! endif
  792. X--- 1,81 ----
  793. X! #!/bin/sh
  794. X! FONTPATH=$1
  795. X! FONTSIZES=$2
  796. X! VFPATH=$3
  797. X! shift 3
  798. X! 
  799. X! X10=
  800. X! BUTTONS=
  801. X! A4=
  802. X! SUBDIR=
  803. X! TEXFONTS=
  804. X! GREY=
  805. X! MAKEPK=
  806. X! BDPI=
  807. X! 
  808. X! while test $# -gt 0
  809. X! do
  810. X!     case $1 in
  811. X!     -DX10)            X10=y;;
  812. X!     -DBUTTONS)        BUTTONS=y;;
  813. X!     -DA4)            A4=y;;
  814. X!     -DSEARCH_SUBDIRECTORIES) SUBDIR=y;;
  815. X!     -DXDVIFONTS_ONLY)    TEXFONTS=y;;
  816. X!     -DGREY)            GREY=y;;
  817. X!     -DMAKEPK)        MAKEPK=-DMAKEPKCMD=\\\"MakeTeXPK\\\";;
  818. X!     -DMAKEPKCMD*)        MAKEPK=$1;;
  819. X!     -DBDPI=*)        BDPI=$1;;
  820. X!     esac
  821. X!     shift
  822. X! done
  823. X! 
  824. X! if test -n "$X10"
  825. X! then
  826. X!     echo    '/^#ifx11/,/^#/d'
  827. X!     echo    's/%%dot%%//'
  828. X  else
  829. X!     echo    '/^#ifx10/,/^#/d'
  830. X!     echo    's/%%dot%%/./'
  831. X! fi
  832. X! 
  833. X! if test -z "$BUTTONS";    then    echo    '/^#ifbuttons/,/^#/d';    fi
  834. X! if test -z "$SUBDIR";    then    echo    '/^#ifsubdir/,/^#/d';    fi
  835. X! if test -n "$TEXFONTS";    then    echo    '/^#iftexfonts/,/^#/d';    fi
  836. X! if test -z "$GREY";    then    echo    '/^#ifgrey/,/^#/d';    fi
  837. X! if test -z "$MAKEPK";    then    echo    '/^#ifmakepk/,/^#/d'
  838. X!     else    echo    "s/%%mkpk%%/`echo $MAKEPK | sed s/-DMAKEPKCMD=//`/"
  839. X!     fi
  840. X! echo    '/^#/d'
  841. X! 
  842. X! if test -n "$A4"
  843. X! then
  844. X      echo    's/%%defaultpagesize%%/21 x 29.7 cm (A4 size)/'
  845. X  else
  846. X!     echo    's/%%defaultpagesize%%/8.5 x 11 inches/'
  847. X! fi
  848. X! 
  849. X! if test -n "$BDPI"
  850. X! then
  851. X!     echo    "s/%%bdpi%%/`echo $BDPI | sed s/-DBDPI=//`/"
  852. X! else
  853. X!     echo    's/%%bdpi%%/300/'
  854. X! fi
  855. X! 
  856. X! echo    "s@%%DEFAULT_FONT_PATH%%   @.B $FONTPATH\\
  857. X! @" | sed -e "s@:@\\\\\\
  858. X! .TP\\\\\\
  859. X! .B @g"
  860. X! 
  861. X! echo    "s/%%DEFAULT_FONT_SIZES%%/$FONTSIZES/" | sed -e "s/:/ :\\\\\\
  862. X  /g"
  863. X! 
  864. X! if test -n "$VFPATH"
  865. X! then
  866. X!     echo    "s@%%DEFAULT_VF_PATH%%   @.TP\\
  867. X! .B $VFPATH\\
  868. X! @" | sed -e "s@:@\\\\\\
  869. X! .TP\\\\\\
  870. X! .B @g"
  871. X  else
  872. X!     echo    '/%%DEFAULT_VF_PATH%%/d'
  873. X! fi
  874. Xdiff -cr xdvi_old/tpic.c xdvi_new/tpic.c
  875. X*** xdvi_old/tpic.c    Sat Jul 25 15:39:01 1992
  876. X--- xdvi_new/tpic.c    Mon Dec 14 18:28:48 1992
  877. X***************
  878. X*** 309,314 ****
  879. X--- 309,315 ----
  880. X      int    xp, yp;
  881. X      int    N;
  882. X      int    lastx, lasty;
  883. X+     Boolean    lastvalid = False;
  884. X      int    t1, t2, t3;
  885. X      int    steps;
  886. X      int    j;
  887. X***************
  888. X*** 334,342 ****
  889. X          t3 = w * w / 20;
  890. X          xp = (t1*xx[i+2] + t2*xx[i+1] + t3*xx[i] + 50000) / 100000;
  891. X          yp = (t1*yy[i+2] + t2*yy[i+1] + t3*yy[i] + 50000) / 100000;
  892. X!         if (i != 0 || j != 0) line_btw(lastx, lasty, xp, yp);
  893. X          lastx = xp;
  894. X          lasty = yp;
  895. X          }
  896. X      }
  897. X      path_len = 0;
  898. X--- 335,344 ----
  899. X          t3 = w * w / 20;
  900. X          xp = (t1*xx[i+2] + t2*xx[i+1] + t3*xx[i] + 50000) / 100000;
  901. X          yp = (t1*yy[i+2] + t2*yy[i+1] + t3*yy[i] + 50000) / 100000;
  902. X!         if (lastvalid) line_btw(lastx, lasty, xp, yp);
  903. X          lastx = xp;
  904. X          lasty = yp;
  905. X+         lastvalid = True;
  906. X          }
  907. X      }
  908. X      path_len = 0;
  909. Xdiff -cr xdvi_old/util.c xdvi_new/util.c
  910. X*** xdvi_old/util.c    Mon Aug 24 18:45:15 1992
  911. X--- xdvi_new/util.c    Fri Dec 11 19:12:45 1992
  912. X***************
  913. X*** 33,39 ****
  914. X  
  915. X  #include "xdvi.h"
  916. X  #include <errno.h>
  917. X- int    errno;
  918. X  
  919. X  #ifdef VMS
  920. X  #include <rmsdef.h>
  921. X--- 33,38 ----
  922. Xdiff -cr xdvi_old/xdvi.c xdvi_new/xdvi.c
  923. X*** xdvi_old/xdvi.c    Sat Sep 12 15:25:42 1992
  924. X--- xdvi_new/xdvi.c    Mon Jun  7 12:06:44 1993
  925. X***************
  926. X*** 289,294 ****
  927. X--- 289,295 ----
  928. X  #ifndef X10
  929. X  static    Position    main_x, main_y;
  930. X  static    XImage    *image;
  931. X+ static    int    backing_store;
  932. X  #else    /* X10 */
  933. X  #define    main_x    0
  934. X  #define    main_y    0
  935. X***************
  936. X*** 314,320 ****
  937. X  #ifdef    TOOLKIT
  938. X  static    Widget    top_level, vport_widget, draw_widget, clip_widget;
  939. X  #ifdef    BUTTONS
  940. X! static    Widget    form_widget, line_widget, right_widget;
  941. X  #endif
  942. X  static    Widget    x_bar, y_bar;    /* horizontal and vertical scroll bars */
  943. X  
  944. X--- 315,321 ----
  945. X  #ifdef    TOOLKIT
  946. X  static    Widget    top_level, vport_widget, draw_widget, clip_widget;
  947. X  #ifdef    BUTTONS
  948. X! static    Widget    form_widget, line_widget, panel_widget;
  949. X  #endif
  950. X  static    Widget    x_bar, y_bar;    /* horizontal and vertical scroll bars */
  951. X  
  952. X***************
  953. X*** 335,340 ****
  954. X--- 336,344 ----
  955. X  static    Arg    draw_args[] = {
  956. X      {XtNwidth,    (XtArgVal) 0},
  957. X      {XtNheight,    (XtArgVal) 0},
  958. X+ #ifdef    GREY
  959. X+     {XtNbackground,    (XtArgVal) 0},
  960. X+ #endif
  961. X      {XtNx,        (XtArgVal) 0},
  962. X      {XtNy,        (XtArgVal) 0},
  963. X      {XtNlabel,    (XtArgVal) ""},
  964. X***************
  965. X*** 358,364 ****
  966. X      {XtNright,    (XtArgVal) XtChainRight},
  967. X  };
  968. X  
  969. X! static    Arg    right_args[] = {
  970. X      {XtNfromHoriz,    (XtArgVal) NULL},
  971. X      {XtNwidth,    (XtArgVal) (XTRA_WID - 1)},
  972. X      {XtNheight,    (XtArgVal) 0},
  973. X--- 362,368 ----
  974. X      {XtNright,    (XtArgVal) XtChainRight},
  975. X  };
  976. X  
  977. X! static    Arg    panel_args[] = {
  978. X      {XtNfromHoriz,    (XtArgVal) NULL},
  979. X      {XtNwidth,    (XtArgVal) (XTRA_WID - 1)},
  980. X      {XtNheight,    (XtArgVal) 0},
  981. X***************
  982. X*** 415,424 ****
  983. X      line_args[3].value = (XtArgVal) vport_widget;
  984. X      line_widget = XtCreateManagedWidget("line", widgetClass, form_widget,
  985. X          line_args, XtNumber(line_args));
  986. X!     right_args[0].value = (XtArgVal) line_widget;
  987. X!     right_args[2].value = h;
  988. X!     right_widget = XtCreateManagedWidget("right", compositeWidgetClass,
  989. X!         form_widget, right_args, XtNumber(right_args));
  990. X  
  991. X      command_args[2].value = (XtArgVal) vport_widget;
  992. X      for (i = 0; i < XtNumber(command_table); ++i) {
  993. X--- 419,428 ----
  994. X      line_args[3].value = (XtArgVal) vport_widget;
  995. X      line_widget = XtCreateManagedWidget("line", widgetClass, form_widget,
  996. X          line_args, XtNumber(line_args));
  997. X!     panel_args[0].value = (XtArgVal) line_widget;
  998. X!     panel_args[2].value = h;
  999. X!     panel_widget = XtCreateManagedWidget("panel", compositeWidgetClass,
  1000. X!         form_widget, panel_args, XtNumber(panel_args));
  1001. X  
  1002. X      command_args[2].value = (XtArgVal) vport_widget;
  1003. X      for (i = 0; i < XtNumber(command_table); ++i) {
  1004. X***************
  1005. X*** 426,432 ****
  1006. X          command_args[2].value = (XtArgVal) command_table[i].y_pos;
  1007. X          command_call[0].closure = (caddr_t) command_table[i].closure;
  1008. X          (void) XtCreateManagedWidget(command_table[i].name,
  1009. X!         commandWidgetClass, right_widget,
  1010. X          command_args, XtNumber(command_args));
  1011. X      }
  1012. X  }
  1013. X--- 430,436 ----
  1014. X          command_args[2].value = (XtArgVal) command_table[i].y_pos;
  1015. X          command_call[0].closure = (caddr_t) command_table[i].closure;
  1016. X          (void) XtCreateManagedWidget(command_table[i].name,
  1017. X!         commandWidgetClass, panel_widget,
  1018. X          command_args, XtNumber(command_args));
  1019. X      }
  1020. X  }
  1021. X***************
  1022. X*** 560,566 ****
  1023. X          Pixel pixel;
  1024. X          XColor color, fc, bc;
  1025. X          XGCValues    values;
  1026. X-         int i;
  1027. X  
  1028. X          if (RESOURCE(gamma) == 0.0) RESOURCE(gamma) = 1.0;
  1029. X  
  1030. X--- 564,569 ----
  1031. X***************
  1032. X*** 610,615 ****
  1033. X--- 613,620 ----
  1034. X          /* Make sure fore_ and back_Pixel are a part of the palette */
  1035. X          RESOURCE(fore_Pixel) = palette[15];
  1036. X          RESOURCE(back_Pixel) = palette[0];
  1037. X+         if (WINDOW(mane) != (Window) 0)
  1038. X+         XSetWindowBackground(DISP, WINDOW(mane), palette[0]);
  1039. X  
  1040. X  #define    MakeGC(fcn, fg, bg)    (values.function = fcn, values.foreground=fg,\
  1041. X          values.background=bg,\
  1042. X***************
  1043. X*** 618,623 ****
  1044. X--- 623,629 ----
  1045. X  
  1046. X          foreGC = ruleGC = MakeGC(RESOURCE(copy) ? GXcopy : GXor,
  1047. X          RESOURCE(fore_Pixel), RESOURCE(back_Pixel));
  1048. X+         foreGC2 = NULL;
  1049. X  
  1050. X          colors_allocated = True;
  1051. X          if (RESOURCE(copy) && warn)
  1052. X***************
  1053. X*** 794,805 ****
  1054. X                  0, 0,
  1055. X              x - currwin.base_x, y - currwin.base_y,
  1056. X              img->width, img->height);
  1057. X- 
  1058. X-         if (foreGC2)
  1059. X-         XPutImage(DISP, WINDOW(currwin), foreGC2, img,
  1060. X-             0, 0,
  1061. X-             x - currwin.base_x, y - currwin.base_y,
  1062. X-             img->width, img->height);
  1063. X      }
  1064. X  }
  1065. X  #endif    /* GREY */
  1066. X--- 800,805 ----
  1067. X***************
  1068. X*** 1014,1019 ****
  1069. X--- 1014,1028 ----
  1070. X  }
  1071. X  #endif    /* BUTTONS */
  1072. X  
  1073. X+ void
  1074. X+ reconfig()
  1075. X+ {
  1076. X+     draw_args[0].value = (XtArgVal) page_w;
  1077. X+     draw_args[1].value = (XtArgVal) page_h;
  1078. X+     XtSetValues(draw_widget, draw_args, (Cardinal) 2);
  1079. X+     get_geom();
  1080. X+ }
  1081. X+ 
  1082. X  #else    /* !TOOLKIT */
  1083. X  
  1084. X  /*
  1085. X***************
  1086. X*** 1083,1089 ****
  1087. X      if (old_base_y != mane.base_y && y_bar) paint_y_bar();
  1088. X  }
  1089. X  
  1090. X! static    void
  1091. X  reconfig()
  1092. X  {
  1093. X      int    x_thick = 0;
  1094. X--- 1092,1098 ----
  1095. X      if (old_base_y != mane.base_y && y_bar) paint_y_bar();
  1096. X  }
  1097. X  
  1098. X! void
  1099. X  reconfig()
  1100. X  {
  1101. X      int    x_thick = 0;
  1102. X***************
  1103. X*** 1105,1115 ****
  1104. X          /* process drawing (clip) window */
  1105. X      if (mane.win == NULL) {    /* initial creation */
  1106. X  #ifndef X10
  1107. X          mane.win = XCreateSimpleWindow(DISP, top_level, y_thick, x_thick,
  1108. X              (unsigned int) clip_w, (unsigned int) clip_h, 0,
  1109. X              brdr_Pixel, back_Pixel);
  1110. X!         XSelectInput(DPY WINDOW(mane), ExposureMask |
  1111. X              ButtonPressMask | ButtonMotionMask | ButtonReleaseMask);
  1112. X  #else
  1113. X          mane.win = XCreateWindow(top_level, y_thick, x_thick,
  1114. X              clip_w, clip_h, 0, bdrmap, backmap);
  1115. X--- 1114,1128 ----
  1116. X          /* process drawing (clip) window */
  1117. X      if (mane.win == NULL) {    /* initial creation */
  1118. X  #ifndef X10
  1119. X+         XWindowAttributes attrs;
  1120. X+ 
  1121. X          mane.win = XCreateSimpleWindow(DISP, top_level, y_thick, x_thick,
  1122. X              (unsigned int) clip_w, (unsigned int) clip_h, 0,
  1123. X              brdr_Pixel, back_Pixel);
  1124. X!         XSelectInput(DISP, WINDOW(mane), ExposureMask |
  1125. X              ButtonPressMask | ButtonMotionMask | ButtonReleaseMask);
  1126. X+         XGetWindowAttributes(DISP, WINDOW(mane), &attrs);
  1127. X+         backing_store = attrs.backing_store;
  1128. X  #else
  1129. X          mane.win = XCreateWindow(top_level, y_thick, x_thick,
  1130. X              clip_w, clip_h, 0, bdrmap, backmap);
  1131. X***************
  1132. X*** 1539,1545 ****
  1133. X          else {        /* destroy buttons */
  1134. X              XtResizeWidget(vport_widget, window_w += XTRA_WID, window_h,
  1135. X              0);
  1136. X!             XtDestroyWidget(right_widget);
  1137. X              XtDestroyWidget(line_widget);
  1138. X              resource.expert = True;
  1139. X          }
  1140. X--- 1552,1558 ----
  1141. X          else {        /* destroy buttons */
  1142. X              XtResizeWidget(vport_widget, window_w += XTRA_WID, window_h,
  1143. X              0);
  1144. X!             XtDestroyWidget(panel_widget);
  1145. X              XtDestroyWidget(line_widget);
  1146. X              resource.expert = True;
  1147. X          }
  1148. X***************
  1149. X*** 1607,1622 ****
  1150. X  #endif
  1151. X              reset_fonts();
  1152. X          }
  1153. X- #ifdef    TOOLKIT
  1154. X-         draw_args[0].value = (XtArgVal) page_w;
  1155. X-         draw_args[1].value = (XtArgVal) page_h;
  1156. X-         XtSetValues(draw_widget, draw_args, (Cardinal) 2);
  1157. X-         get_geom();
  1158. X-         home(False);
  1159. X- #else    /* TOOLKIT */
  1160. X          reconfig();
  1161. X          home(False);
  1162. X- #endif    /* TOOLKIT */
  1163. X          break;
  1164. X          case 'S':
  1165. X          if (!arg0) goto bad;
  1166. X--- 1620,1627 ----
  1167. X***************
  1168. X*** 1895,1901 ****
  1169. X          max_y - min_y, min_x, min_y, currwin.base_x, currwin.base_y);
  1170. X      SetCursor(redraw_cursor);
  1171. X      Flush();
  1172. X!     if (errtext = (char *) setjmp(dvi_env)) {
  1173. X          ClearPage(mane);
  1174. X  #ifndef X10
  1175. X          get_xy();
  1176. X--- 1900,1906 ----
  1177. X          max_y - min_y, min_x, min_y, currwin.base_x, currwin.base_y);
  1178. X      SetCursor(redraw_cursor);
  1179. X      Flush();
  1180. X!     if ((errtext = (char *) setjmp(dvi_env)) != NULL) {
  1181. X          ClearPage(mane);
  1182. X  #ifndef X10
  1183. X          get_xy();
  1184. X***************
  1185. X*** 1922,1933 ****
  1186. X  redraw_page()
  1187. X  {
  1188. X      if (debug & DBG_EVENT) Fputs("Redraw page:  ", stdout);
  1189. X-     get_xy();
  1190. X      ClearPage(mane);
  1191. X!     mane.min_x = -window_x;
  1192. X!     mane.max_x = -window_x + clip_w;
  1193. X!     mane.min_y = -window_y;
  1194. X!     mane.max_y = -window_y + clip_h;
  1195. X      redraw(&mane);
  1196. X  }
  1197. X  
  1198. X--- 1927,1949 ----
  1199. X  redraw_page()
  1200. X  {
  1201. X      if (debug & DBG_EVENT) Fputs("Redraw page:  ", stdout);
  1202. X      ClearPage(mane);
  1203. X! #ifndef    X10
  1204. X!     if (backing_store != NotUseful) {
  1205. X!         mane.min_x = mane.min_y = 0;
  1206. X!         mane.max_x = page_w;
  1207. X!         mane.max_y = page_h;
  1208. X!     }
  1209. X!     else {
  1210. X! #endif
  1211. X!         get_xy();
  1212. X!         mane.min_x = -window_x;
  1213. X!         mane.max_x = -window_x + clip_w;
  1214. X!         mane.min_y = -window_y;
  1215. X!         mane.max_y = -window_y + clip_h;
  1216. X! #ifndef    X10
  1217. X!     }
  1218. X! #endif
  1219. X      redraw(&mane);
  1220. X  }
  1221. X  
  1222. X***************
  1223. X*** 1959,1964 ****
  1224. X--- 1975,1981 ----
  1225. X      windowrec->max_x = windowrec->max_y = 0;
  1226. X  }
  1227. X  
  1228. X+ #ifdef    HAS_SIGIO
  1229. X  static    void
  1230. X  handle_intr() {
  1231. X      event_counter = 1;
  1232. X***************
  1233. X*** 1965,1971 ****
  1234. X      event_freq = -1;    /* forget Plan B */
  1235. X  }
  1236. X  
  1237. X- #ifdef    HAS_SIGIO
  1238. X  static    void
  1239. X  enable_intr() {
  1240. X      int    socket    = ConnectionNumber(DISP);
  1241. X--- 1982,1987 ----
  1242. X***************
  1243. X*** 2765,2771 ****
  1244. X  #endif
  1245. X  
  1246. X  #ifdef    TOOLKIT
  1247. X!     if (resource.copy_arg)
  1248. X  #else
  1249. X      if (copy == 2)
  1250. X  #endif
  1251. X--- 2781,2787 ----
  1252. X  #endif
  1253. X  
  1254. X  #ifdef    TOOLKIT
  1255. X!     if (!resource.copy_arg)
  1256. X  #else
  1257. X      if (copy == 2)
  1258. X  #endif
  1259. X***************
  1260. X*** 2896,2901 ****
  1261. X--- 2912,2920 ----
  1262. X      clip_widget = XtNameToWidget(vport_widget, "clip");
  1263. X      draw_args[0].value = (XtArgVal) page_w;
  1264. X      draw_args[1].value = (XtArgVal) page_h;
  1265. X+ #ifdef    GREY
  1266. X+     draw_args[2].value = (XtArgVal) resource.back_Pixel;
  1267. X+ #endif
  1268. X      draw_widget = XtCreateManagedWidget("drawing", drawWidgetClass,
  1269. X          vport_widget, draw_args, XtNumber(draw_args));
  1270. X      {    /* set default window size */
  1271. X***************
  1272. X*** 2967,2972 ****
  1273. X--- 2986,2998 ----
  1274. X      XtRealizeWidget(top_level);
  1275. X  
  1276. X      currwin.win = mane.win = XtWindow(draw_widget);
  1277. X+ 
  1278. X+     {
  1279. X+         XWindowAttributes attrs;
  1280. X+ 
  1281. X+         XGetWindowAttributes(DISP, WINDOW(mane), &attrs);
  1282. X+         backing_store = attrs.backing_store;
  1283. X+     }
  1284. X  
  1285. X  #else    /* !TOOLKIT */
  1286. X  
  1287. Xdiff -cr xdvi_old/xdvi.h xdvi_new/xdvi.h
  1288. X*** xdvi_old/xdvi.h    Mon Jul 27 10:41:53 1992
  1289. X--- xdvi_new/xdvi.h    Mon May 31 15:55:04 1993
  1290. X***************
  1291. X*** 38,43 ****
  1292. X--- 38,44 ----
  1293. X  #define    rindex    strrchr
  1294. X  #define    bzero(a, b)    (void) memset ((void *) (a), 0, (size_t) (b))
  1295. X  #define bcopy(a, b, c)  (void) memmove ((void *) (b), (void *) (a), (size_t) (c))
  1296. X+ #define S_ISDIR(m)      (((m)&S_IFMT) == S_IFDIR)
  1297. X  #endif
  1298. X  
  1299. X  #include <stdio.h>
  1300. X***************
  1301. X*** 419,424 ****
  1302. X--- 420,426 ----
  1303. X  extern    void    put_image(XImage *, int, int);
  1304. X  #endif
  1305. X  extern    void    put_rectangle(int, int, int, int, WIDEARG(Boolean, int));
  1306. X+ extern    void    reconfig(void);
  1307. X  extern    void    redraw_page(void);
  1308. X  #if    NeedVarargsPrototypes
  1309. X  extern    NORETURN void    oops(_Xconst char *, ...);
  1310. X***************
  1311. X*** 433,439 ****
  1312. X  extern    void    reset_fonts(void);
  1313. X  extern    void    realloc_font(struct font *, WIDEARG(ubyte, int));
  1314. X  extern    void    realloc_virtual_font(struct font *, WIDEARG(ubyte, int));
  1315. X! extern    void    load_font(struct font *);
  1316. X  extern    void    define_font(FILE *, WIDEARG(ubyte, unsigned int), struct font *,
  1317. X              struct tn **);
  1318. X  extern    void    init_page(void);
  1319. X--- 435,441 ----
  1320. X  extern    void    reset_fonts(void);
  1321. X  extern    void    realloc_font(struct font *, WIDEARG(ubyte, int));
  1322. X  extern    void    realloc_virtual_font(struct font *, WIDEARG(ubyte, int));
  1323. X! extern    Boolean    load_font(struct font *);
  1324. X  extern    void    define_font(FILE *, WIDEARG(ubyte, unsigned int), struct font *,
  1325. X              struct tn **);
  1326. X  extern    void    init_page(void);
  1327. X***************
  1328. X*** 441,449 ****
  1329. X--- 443,453 ----
  1330. X  extern    Boolean    check_dvi_file(void);
  1331. X  #ifndef    TEXXET
  1332. X  extern    long    set_char(WIDEARG(ubyte, int));
  1333. X+ extern    long    load_n_set_char(WIDEARG(ubyte, int));
  1334. X  extern    long    set_vf_char(WIDEARG(ubyte, int));
  1335. X  #else
  1336. X  extern    void    set_char(WIDEARG(ubyte, int), WIDEARG(ubyte, int));
  1337. X+ extern    void    load_n_set_char(WIDEARG(ubyte, int), WIDEARG(ubyte, int));
  1338. X  extern    void    set_vf_char(WIDEARG(ubyte, int), WIDEARG(ubyte, int));
  1339. X  #endif
  1340. X  extern    void    draw_page(void);
  1341. X***************
  1342. X*** 466,471 ****
  1343. X--- 470,476 ----
  1344. X  extern    void    put_image();
  1345. X  #endif
  1346. X  extern    void    put_rectangle();
  1347. X+ extern    void    reconfig();
  1348. X  extern    void    redraw_page();
  1349. X  extern    NORETURN void    oops();
  1350. X  extern    char    *xmalloc();
  1351. X***************
  1352. X*** 476,482 ****
  1353. X  extern    void    reset_fonts();
  1354. X  extern    void    realloc_font();
  1355. X  extern    void    realloc_virtual_font();
  1356. X! extern    void    load_font();
  1357. X  extern    void    define_font();
  1358. X  extern    void    init_page();
  1359. X  extern    void    open_dvi_file();
  1360. X--- 481,487 ----
  1361. X  extern    void    reset_fonts();
  1362. X  extern    void    realloc_font();
  1363. X  extern    void    realloc_virtual_font();
  1364. X! extern    Boolean    load_font();
  1365. X  extern    void    define_font();
  1366. X  extern    void    init_page();
  1367. X  extern    void    open_dvi_file();
  1368. X***************
  1369. X*** 483,491 ****
  1370. X--- 488,498 ----
  1371. X  extern    Boolean    check_dvi_file();
  1372. X  #ifndef    TEXXET
  1373. X  extern    long    set_char();
  1374. X+ extern    long    load_n_set_char();
  1375. X  extern    long    set_vf_char();
  1376. X  #else
  1377. X  extern    void    set_char();
  1378. X+ extern    void    load_n_set_char();
  1379. X  extern    void    set_vf_char();
  1380. X  #endif
  1381. X  extern    void    draw_page();
  1382. Xdiff -cr xdvi_old/xdvi_man.sed xdvi_new/xdvi_man.sed
  1383. X*** xdvi_old/xdvi_man.sed    Sat Sep 12 15:31:34 1992
  1384. X--- xdvi_new/xdvi_man.sed    Mon Jun  7 12:18:45 1993
  1385. X***************
  1386. X*** 1,7 ****
  1387. X  #ifx11
  1388. X! .TH XDVI 1 "27 March 1990" "X Version 11"
  1389. X  #ifx10
  1390. X! .TH XDVI 1 "27 March 1990" "X Version 10"
  1391. X  #endif
  1392. X  .SH NAME
  1393. X  xdvi \- DVI Previewer for the X Window System
  1394. X--- 1,7 ----
  1395. X  #ifx11
  1396. X! .TH XDVI 1 "7 June 1993" "X Version 11"
  1397. X  #ifx10
  1398. X! .TH XDVI 1 "7 June 1993" "X Version 10"
  1399. X  #endif
  1400. X  .SH NAME
  1401. X  xdvi \- DVI Previewer for the X Window System
  1402. X***************
  1403. X*** 89,95 ****
  1404. X  .BI \-p " pixels"
  1405. X  (%%dot%%pixelsPerInch)
  1406. X  Defines the size of the fonts to use, in pixels per inch.  The
  1407. X! default value is 300.
  1408. X  .TP
  1409. X  .BI \-altfont " font"
  1410. X  (%%dot%%altFont)
  1411. X--- 89,95 ----
  1412. X  .BI \-p " pixels"
  1413. X  (%%dot%%pixelsPerInch)
  1414. X  Defines the size of the fonts to use, in pixels per inch.  The
  1415. X! default value is %%bdpi%%.
  1416. X  .TP
  1417. X  .BI \-altfont " font"
  1418. X  (%%dot%%altFont)
  1419. X***************
  1420. X*** 428,435 ****
  1421. X  fonts in the following manner.  The string consists of one or more strings
  1422. X  separated by colons.  In each such string, the substring ``%f'' is
  1423. X  changed to the font name; ``%d'' is changed to the magnification; and
  1424. X! ``%p'' is changed to the font family (``gf'', ``pk'', or ``pxl'').  If no
  1425. X! ``%f'' appears in the string, then the string ``/%f.%d%p'' is added on
  1426. X  the end.  For example, if the string is ``/usr/local/tex/fonts'' and the font is
  1427. X  cmr10 at 300dpi, then it searches for /usr/local/tex/fonts/cmr10.300gf,
  1428. X  /usr/local/tex/fonts/cmr10.300pk, and /usr/local/tex/fonts/cmr10.1500pxl,
  1429. X--- 428,435 ----
  1430. X  fonts in the following manner.  The string consists of one or more strings
  1431. X  separated by colons.  In each such string, the substring ``%f'' is
  1432. X  changed to the font name; ``%d'' is changed to the magnification; and
  1433. X! ``%p'' is changed to the font file format (``gf'', ``pk'', or ``pxl'').
  1434. X! If no ``%f'' appears in the string, then the string ``/%f.%d%p'' is added on
  1435. X  the end.  For example, if the string is ``/usr/local/tex/fonts'' and the font is
  1436. X  cmr10 at 300dpi, then it searches for /usr/local/tex/fonts/cmr10.300gf,
  1437. X  /usr/local/tex/fonts/cmr10.300pk, and /usr/local/tex/fonts/cmr10.1500pxl,
  1438. X***************
  1439. X*** 462,467 ****
  1440. X--- 462,480 ----
  1441. X  \fIxdvi\fR also recognizes the PKFONTS variable, which is checked after
  1442. X  XDVIFONTS but before TEXFONTS.
  1443. X  #endif
  1444. X+ #ifmakepk
  1445. X+ .PP
  1446. X+ The script used to create fonts may be controlled by the environment
  1447. X+ variable ``XDVIMAKEPK.''  Usually this variable would be set to the name of
  1448. X+ the script.  In that case the script is called with the following options:
  1449. X+ (1) the font name, (2) the requested resolution in dots per inch,
  1450. X+ (3) the base resolution in dots per inch, and (4) a (possibly more accurate)
  1451. X+ indication of the magnification using magsteps (if possible).
  1452. X+ Optionally, the variable may include specifiers ``%n,'' ``%d,'' ``%b,''
  1453. X+ and ``%m'' to indicate each of the above arguments, respectively.
  1454. X+ This is compatible with the font creation mechanism used in dvips.
  1455. X+ By default, XDVIMAKEPK equals %%mkpk%%.
  1456. X+ #endif
  1457. X  #ifsubdir
  1458. X  .PP
  1459. X  You can also enable recursive searching in the font path by using the ``*''
  1460. X***************
  1461. X*** 476,482 ****
  1462. X  in any path component.
  1463. X  #endif
  1464. X  .PP
  1465. X! The ``XDVISIZES'' variable must be set to indicate which sizes of fonts are
  1466. X  available.  It should consist of a list of numbers separated by colons.  If
  1467. X  the list begins with a colon, the system default sizes are used, as well.
  1468. X  Sizes are expressed in dots per inch; decimals may be used for ``pxl'' files:
  1469. X--- 489,495 ----
  1470. X  in any path component.
  1471. X  #endif
  1472. X  .PP
  1473. X! The ``XDVISIZES'' variable may be set to indicate which sizes of fonts are
  1474. X  available.  It should consist of a list of numbers separated by colons.  If
  1475. X  the list begins with a colon, the system default sizes are used, as well.
  1476. X  Sizes are expressed in dots per inch; decimals may be used for ``pxl'' files:
  1477. X***************
  1478. X*** 496,506 ****
  1479. X  Virtual fonts are searched for immediately after looking for the font
  1480. X  as a normal font in the exact size specified.
  1481. X  .SH FILES
  1482. X! .br
  1483. X  %%DEFAULT_FONT_PATH%%   Font pixel files.
  1484. X  %%DEFAULT_VF_PATH%%   Virtual font files.
  1485. X  .SH "SEE ALSO"
  1486. X! X(1).
  1487. X  .SH AUTHORS
  1488. X  Eric Cooper, CMU, did a version for direct output to a QVSS.
  1489. X  Modified for X by
  1490. X--- 509,521 ----
  1491. X  Virtual fonts are searched for immediately after looking for the font
  1492. X  as a normal font in the exact size specified.
  1493. X  .SH FILES
  1494. X! .PD 0
  1495. X! .TP 40
  1496. X  %%DEFAULT_FONT_PATH%%   Font pixel files.
  1497. X  %%DEFAULT_VF_PATH%%   Virtual font files.
  1498. X+ .PD
  1499. X  .SH "SEE ALSO"
  1500. X! .BR X (1).
  1501. X  .SH AUTHORS
  1502. X  Eric Cooper, CMU, did a version for direct output to a QVSS.
  1503. X  Modified for X by
  1504. X
  1505. END_OF_FILE
  1506.   if test 40142 -ne `wc -c <'xdvi.p17'`; then
  1507.     echo shar: \"'xdvi.p17'\" unpacked with wrong size!
  1508.   fi
  1509.   # end of 'xdvi.p17'
  1510. fi
  1511. echo shar: End of archive 1 \(of 1\).
  1512. cp /dev/null ark1isdone
  1513. MISSING=""
  1514. for I in 1 ; do
  1515.     if test ! -f ark${I}isdone ; then
  1516.     MISSING="${MISSING} ${I}"
  1517.     fi
  1518. done
  1519. if test "${MISSING}" = "" ; then
  1520.     echo You have the archive.
  1521.     rm -f ark[1-9]isdone
  1522. else
  1523.     echo You still must unpack the following archives:
  1524.     echo "        " ${MISSING}
  1525. fi
  1526. exit 0
  1527. exit 0 # Just in case...
  1528. -- 
  1529.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  1530. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  1531.  "It's intuitively obvious to the |
  1532.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1533.