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

  1. Newsgroups: comp.sources.x
  2. From: vojta@math.berkeley.edu (Paul Vojta)
  3. Subject: v20i054:  xdvi - dvi previewer, Patch16b/2
  4. Message-ID: <1993Jun28.143135.7442@sparky.imd.sterling.com>
  5. X-Md4-Signature: 6f20859709c805548387e297a51bfa2b
  6. Sender: chris@sparky.imd.sterling.com (Chris Olson)
  7. Organization: Sterling Software
  8. Date: Mon, 28 Jun 1993 14:31:35 GMT
  9. Approved: chris@sparky.imd.sterling.com
  10.  
  11. Submitted-by: vojta@math.berkeley.edu (Paul Vojta)
  12. Posting-number: Volume 20, Issue 54
  13. Archive-name: xdvi/patch16b
  14. Environment: X10, X11
  15. Patch-To: xdvi: Volume 17, Issue 23-25,27,40-41,53,106-107
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  xdvi.p16.1
  22. # Wrapped by chris@sparky on Mon Jun 28 08:49:45 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 2 (of 2)."'
  26. if test -f 'xdvi.p16.1' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'xdvi.p16.1'\"
  28. else
  29.   echo shar: Extracting \"'xdvi.p16.1'\" \(44861 characters\)
  30.   sed "s/^X//" >'xdvi.p16.1' <<'END_OF_FILE'
  31. XPrereq: 15
  32. Xdiff -cr xdvi_old/patchlevel.h xdvi_new/patchlevel.h
  33. X*** xdvi_old/patchlevel.h    Tue Jun 16 11:37:36 1992
  34. X--- xdvi_new/patchlevel.h    Tue Aug 25 12:22:44 1992
  35. X***************
  36. X*** 1 ****
  37. X! #define PATCHLEVEL 15
  38. X--- 1 ----
  39. X! #define PATCHLEVEL 16
  40. Xdiff -cr xdvi_old/README xdvi_new/README
  41. X*** xdvi_old/README    Fri Jun 19 13:18:24 1992
  42. X--- xdvi_new/README    Wed Sep 16 17:34:48 1992
  43. X***************
  44. X*** 79,84 ****
  45. X--- 79,85 ----
  46. X              definition of drawingWidgetClass.
  47. X      TEXXET        (everything)  Enables op-codes 250 and 251 (used for
  48. X              right-to-left languages).
  49. X+     BDPI        (xdvi.c) Default number of pixels per inch to use.
  50. X      GREY        (everything)  Use greyscale anti-aliasing for
  51. X              displaying shrunken bitmaps.
  52. X      MAKEPK        (font_open.c)  If a font is not found, then try to
  53. X***************
  54. X*** 87,93 ****
  55. X              correctly for your site, and be sure that the
  56. X              destination directory for MakeTeXPK appears in your
  57. X              DEFAULT_FONT_PATH variable.
  58. X!     MAKEPKCMD=/usr/local/tex/bin/MakeTeXPK (font_open.c)  Same as the
  59. X              above, but this variant explicitly declares which
  60. X              command to use to create the font.
  61. X  
  62. X--- 88,94 ----
  63. X              correctly for your site, and be sure that the
  64. X              destination directory for MakeTeXPK appears in your
  65. X              DEFAULT_FONT_PATH variable.
  66. X!     MAKEPKCMD=\"/usr/local/tex/bin/MakeTeXPK\" (font_open.c)  Same as the
  67. X              above, but this variant explicitly declares which
  68. X              command to use to create the font.
  69. X  
  70. X***************
  71. X*** 259,263 ****
  72. X--- 260,268 ----
  73. X     32.  Added support for greyscale anti-aliasing.
  74. X  --  Patchlevel 15: --
  75. X     33.  Added support for MakeTeXPK, as in dvips.
  76. X+ --  Patchlevel 16: --
  77. X+    34.    In the code for greyscale anti-aliasing, try to allocate a colormap
  78. X+     so that GXor operations can be used for drawing.  Also interpolate
  79. X+     between foreground and background colors.
  80. X  
  81. X  Paul Vojta, vojta@math.berkeley.edu
  82. Xdiff -cr xdvi_old/README.VMS xdvi_new/README.VMS
  83. X*** xdvi_old/README.VMS    Sun Jun  7 22:47:16 1992
  84. X--- xdvi_new/README.VMS    Wed Sep 16 17:19:08 1992
  85. X***************
  86. X*** 10,17 ****
  87. X          [-bw width] [-fg color] [-bg color] [-hl color] [-bd color] [-cr color]
  88. X          [-margins dimen] [-sidemargin dimen] [-topmargin dimen] [-version]
  89. X          [-offsets dimen] [-xoffset dimen] [-yoffset dimen] [-keep] [-nogrey]
  90. X!         [-hushspecials] [-hushchars] [-hush] [-paper papertype] [-mgs[n] size]
  91. X!         [-altfont font] [-thorough] [-copy] [-geometry geometry]
  92. X          [-icongeometry geometry] [-iconic] [-display display] dvi_file
  93. X  
  94. X  DESCRIPTION
  95. X--- 10,17 ----
  96. X          [-bw width] [-fg color] [-bg color] [-hl color] [-bd color] [-cr color]
  97. X          [-margins dimen] [-sidemargin dimen] [-topmargin dimen] [-version]
  98. X          [-offsets dimen] [-xoffset dimen] [-yoffset dimen] [-keep] [-nogrey]
  99. X!         [-gamma g] [-hushspecials] [-hushchars] [-hush] [-paper papertype]
  100. X!         [-mgs[n] size] [-altfont font] [-thorough] [-copy] [-geometry geometry]
  101. X          [-icongeometry geometry] [-iconic] [-display display] dvi_file
  102. X  
  103. X  DESCRIPTION
  104. X***************
  105. X*** 129,140 ****
  106. X                           should not move to the home position when moving to a
  107. X                           new page.  See also the `k' keystroke.
  108. X  
  109. X!    -nogrey               (.grey)  Turns off the use greyscale anti-aliasing
  110. X                           when printing shrunken bitmaps.  In this case, the
  111. X!                          logic of the corresponding resource is the reverse;
  112. X                           -nogrey corresponds to grey:off; +nogrey to grey:on.
  113. X                           See also the 'G' keystroke.
  114. X  
  115. X     -hushspecials         (.hushSpecials)  Causes XDVI to suppress warnings about
  116. X                           \special strings which it cannot process.
  117. X  
  118. X--- 129,148 ----
  119. X                           should not move to the home position when moving to a
  120. X                           new page.  See also the `k' keystroke.
  121. X  
  122. X!    -nogrey               (.grey)  Turns off the use of greyscale anti-aliasing
  123. X                           when printing shrunken bitmaps.  In this case, the
  124. X!                          logic of the corresponding resource is the reverse:
  125. X                           -nogrey corresponds to grey:off; +nogrey to grey:on.
  126. X                           See also the 'G' keystroke.
  127. X  
  128. X+    -gamma <gamma>        (.gamma)  Controls the interpolation of colors in the
  129. X+                          greyscale anti-aliasing color palette.  The default
  130. X+                          value is 1.0.  For 0 < gamma < 1, the fonts will be
  131. X+                          lighter (more like the background), and for gamma > 1,
  132. X+                          the fonts will be darker (more like the foreground).
  133. X+                          Negative values behave the same way, but use a slightly
  134. X+                          different algorithm.
  135. X+ 
  136. X     -hushspecials         (.hushSpecials)  Causes XDVI to suppress warnings about
  137. X                           \special strings which it cannot process.
  138. X  
  139. X***************
  140. X*** 142,148 ****
  141. X                           about references to characters which are not defined in
  142. X                           the font.
  143. X  
  144. X!    -hush                 (.Hush)  Causes XDVI to suppress all suppressable
  145. X                           warnings.
  146. X  
  147. X     -paper <papertype>    (.paper)  Specifies the size of the printed page.  This
  148. X--- 150,156 ----
  149. X                           about references to characters which are not defined in
  150. X                           the font.
  151. X  
  152. X!    -hush                 (.Hush)  Causes XDVI to suppress all suppressible
  153. X                           warnings.
  154. X  
  155. X     -paper <papertype>    (.paper)  Specifies the size of the printed page.  This
  156. X***************
  157. X*** 180,186 ****
  158. X     -copy                 (.copy)  Always use the copy operation when writing
  159. X                           characters to the display.  This option may be
  160. X                           necessary for correct operation on a color display, but
  161. X!                          overstrike characters will be incorrect.
  162. X  
  163. X     -geometry <geometry>  (*geometry)  Specifies the initial geometry of the
  164. X                           window.
  165. X--- 188,197 ----
  166. X     -copy                 (.copy)  Always use the copy operation when writing
  167. X                           characters to the display.  This option may be
  168. X                           necessary for correct operation on a color display, but
  169. X!                          overstrike characters will be incorrect.  If greyscale
  170. X!                          anti-aliasing is in use, the copy operation will
  171. X!                          disable the use of colorplanes and make overstrikes
  172. X!                          come out incorrectly.
  173. X  
  174. X     -geometry <geometry>  (*geometry)  Specifies the initial geometry of the
  175. X                           window.
  176. X***************
  177. X*** 239,245 ****
  178. X          synonym for this keystroke.
  179. X  
  180. X     r    Moves right two thirds of a window-full.  The <Right Arrow> key is a
  181. X!         sysnonym for this keystroke.
  182. X  
  183. X     c    Moves the page so that the point currently beneath the cursor is moved
  184. X          to the middle of the window.  It also (gasp!) warps the cursor to the
  185. X--- 250,256 ----
  186. X          synonym for this keystroke.
  187. X  
  188. X     r    Moves right two thirds of a window-full.  The <Right Arrow> key is a
  189. X!         synonym for this keystroke.
  190. X  
  191. X     c    Moves the page so that the point currently beneath the cursor is moved
  192. X          to the middle of the window.  It also (gasp!) warps the cursor to the
  193. X***************
  194. X*** 311,322 ****
  195. X     (within a certain range), and if this fails, then it will use the font
  196. X     specified as the alternate font (cf. -altfont).
  197. X  
  198. X!    For compatibilty with some versions of TeX, you may also use the logical name
  199. X!    "TEXFONTS" in place of "XDVIFONTS", although in that case the string should
  200. X!    not include any "%" specifiers.  The reason for recognizing "TEXFONTS" is
  201. X!    that certain version of TeX also support the convention regarding an extra
  202. X!    slash in the font path; therefore, users who create their own fonts can put
  203. X!    both their .TFM and raster files in the same directory and do
  204. X  
  205. X          $ DEFINE TEXFONTS "/MFDIR"
  206. X  
  207. X--- 322,333 ----
  208. X     (within a certain range), and if this fails, then it will use the font
  209. X     specified as the alternate font (cf. -altfont).
  210. X  
  211. X!    For compatibility with some versions of TeX, you may also use the logical
  212. X!    name "TEXFONTS" in place of "XDVIFONTS", although in that case the string
  213. X!    should not include any "%" specifiers.  The reason for recognizing "TEXFONTS"
  214. X!    is that certain versions of TeX also support the convention regarding an
  215. X!    extra slash in the font path; therefore, users who create their own fonts can
  216. X!    put both their .TFM and raster files in the same directory and do
  217. X  
  218. X          $ DEFINE TEXFONTS "/MFDIR"
  219. X  
  220. X***************
  221. X*** 330,335 ****
  222. X--- 341,349 ----
  223. X     explicitly, and therefore this feature is not useful, the "XDVIFONTS" logical
  224. X     name be set to an empty string to cause XDVI to ignore "TEXFONTS".
  225. X  
  226. X+    XDVI also recognizes the "PKFONTS" logical name, which is checked after
  227. X+    "XDVIFONTS" but before "TEXFONTS".
  228. X+ 
  229. X     The logical name "XDVISIZES" must be set to indicate which sizes of fonts are
  230. X     available.  It should consist of a list of numbers separated by slashes.  If
  231. X     the list begins with a slash, the system default sizes are used, as well.
  232. X***************
  233. X*** 342,349 ****
  234. X     Virtual fonts are also supported, although XDVI does not have any built-in
  235. X     fonts to which they can refer.  The search path for .VF files can be
  236. X     specified with the "XDVIVFS" logical name in a similar manner to that for the
  237. X!    "XDVIFONTS" logical name.  Virtual fonts are searched for immediately after
  238. X!    looking for the font as a normal font in the exact size specified.
  239. X  
  240. X  FILES
  241. X  -----
  242. X--- 356,365 ----
  243. X     Virtual fonts are also supported, although XDVI does not have any built-in
  244. X     fonts to which they can refer.  The search path for .VF files can be
  245. X     specified with the "XDVIVFS" logical name in a similar manner to that for the
  246. X!    "XDVIFONTS" logical name.  XDVI will also check the "VFFONTS" logical name if
  247. X!    the "XDVIFONTS" logical name is not defined.  Virtual fonts are searched for
  248. X!    immediately after looking for the font as a normal font in the exact size
  249. X!    specified.
  250. X  
  251. X  FILES
  252. X  -----
  253. Xdiff -cr xdvi_old/XDVI.RNH xdvi_new/XDVI.RNH
  254. X*** xdvi_old/XDVI.RNH    Sun Jun  7 22:47:17 1992
  255. X--- xdvi_new/XDVI.RNH    Wed Sep 16 17:19:10 1992
  256. X***************
  257. X*** 10,15 ****
  258. X--- 10,16 ----
  259. X  .! Added new switches for patchlevel 10.  Scott Allendorf.
  260. X  .! Added new switches for patchlevel 11.  Scott Allendorf.
  261. X  .! Added new switches for patchlevel 14.  Scott Allendorf.
  262. X+ .! Added new switches for patchlevel 16.  Scott Allendorf.
  263. X  .!
  264. X  .NO PAGING
  265. X  .NO FLAGS ALL
  266. X***************
  267. X*** 116,122 ****
  268. X  .BREAK
  269. X  Always use the copy operation when writing characters to the display.
  270. X  This option may be necessary for correct operation on a color display,
  271. X! but overstrike characters will be incorrect.
  272. X  .SKIP
  273. X  The resource name is ".copy".
  274. X  .INDENT -1
  275. X--- 117,125 ----
  276. X  .BREAK
  277. X  Always use the copy operation when writing characters to the display.
  278. X  This option may be necessary for correct operation on a color display,
  279. X! but overstrike characters will be incorrect.  If greyscale anti-aliasing
  280. X! is in use, the copy operation will disable the use of colorplanes and make
  281. X! overstrikes come out incorrectly.
  282. X  .SKIP
  283. X  The resource name is ".copy".
  284. X  .INDENT -1
  285. X***************
  286. X*** 161,166 ****
  287. X--- 164,181 ----
  288. X  .SKIP
  289. X  Same as -fg.
  290. X  .INDENT -1
  291. X+ 3 -gamma
  292. X+ .BREAK
  293. X+ -gamma <gamma>
  294. X+ .SKIP
  295. X+ Controls the interpolation of colors in the greyscale anti-aliasing color
  296. X+ palette.  The default value is 1.0.  For 0 < gamma < 1, the fonts will be
  297. X+ lighter (more like the background), and for gamma > 1, the fonts will be darker
  298. X+ (more like the foreground).  Negative values behave the same way, but use a
  299. X+ slightly different algorithm.
  300. X+ .SKIP
  301. X+ The resource name is ".gamma".
  302. X+ .INDENT -1
  303. X  3 -geometry
  304. X  .BREAK
  305. X  -geometry <geometry>
  306. X***************
  307. X*** 179,185 ****
  308. X  .INDENT -1
  309. X  3 -hush
  310. X  .BREAK
  311. X! Causes XDVI to suppress all suppressable warnings.
  312. X  .SKIP
  313. X  The resource name is ".Hush".
  314. X  .INDENT -1
  315. X--- 194,200 ----
  316. X  .INDENT -1
  317. X  3 -hush
  318. X  .BREAK
  319. X! Causes XDVI to suppress all suppressible warnings.
  320. X  .SKIP
  321. X  The resource name is ".Hush".
  322. X  .INDENT -1
  323. X***************
  324. X*** 228,239 ****
  325. X  .SKIP
  326. X  The resource name is ".listFonts".
  327. X  .INDENT -1
  328. X  3 -nogrey
  329. X  .BREAK
  330. X  -nogrey
  331. X  .SKIP
  332. X  Turns off the use of greyscale anti-aliasing when printing shrunken bitmaps.
  333. X! (In this case, the logic of the corresponding resource is the reverse;
  334. X  -nogrey corresponds to grey:off; +nogrey to grey:on).
  335. X  See also 'G' under the Keystrokes help entry.
  336. X  .SKIP
  337. X--- 243,289 ----
  338. X  .SKIP
  339. X  The resource name is ".listFonts".
  340. X  .INDENT -1
  341. X+ 3 -margins
  342. X+ .BREAK
  343. X+ -margins <dimen>
  344. X+ .SKIP
  345. X+ Specifies the size of both the top and side margins.  This should be a
  346. X+ decimal number optionally followed by "cm", e.g., 1.5 or 3cm, giving a
  347. X+ measurement in inches or centimeters.
  348. X+ XDVI determines the "home" position of
  349. X+ the page within the window as follows.  If the entire page fits in the
  350. X+ window, then the margin settings are ignored.  If, even after removing
  351. X+ the margins from the left, right, top, and bottom, the page still
  352. X+ cannot fit in the window, then the page is put in the window such that
  353. X+ the top and left margins are hidden, and presumably the upper
  354. X+ left-hand corner of the text on the page will be in the upper
  355. X+ left-hand corner of the window.  Otherwise, the text is centered in
  356. X+ the window.  See also `M' under the Keystrokes help entry.
  357. X+ .SKIP
  358. X+ The resource name is ".Margin".
  359. X+ .INDENT -1
  360. X+ 3 -mgs[n]
  361. X+ .BREAK
  362. X+ -mgs[n] <size>
  363. X+ .SKIP
  364. X+ Specifies the size of the window to be used for the "magnifying glass"
  365. X+ for Button n.  See the MOUSE ACTIONS section.
  366. X+ Defaults are 200, 350, 600, 900, and 1200.
  367. X+ .SKIP
  368. X+ The resource name is ".magnifierSize[n]".
  369. X+ .INDENT -1
  370. X+ 3 -mgs
  371. X+ .BREAK
  372. X+ -mgs <size>
  373. X+ .SKIP
  374. X+ Same as -mgs1.
  375. X+ .INDENT -1
  376. X  3 -nogrey
  377. X  .BREAK
  378. X  -nogrey
  379. X  .SKIP
  380. X  Turns off the use of greyscale anti-aliasing when printing shrunken bitmaps.
  381. X! (In this case, the logic of the corresponding resource is the reverse:
  382. X  -nogrey corresponds to grey:off; +nogrey to grey:on).
  383. X  See also 'G' under the Keystrokes help entry.
  384. X  .SKIP
  385. X***************
  386. X*** 275,315 ****
  387. X  .SKIP
  388. X  The resource name is ".paper".
  389. X  .INDENT -1
  390. X- 3 -margins
  391. X- .BREAK
  392. X- -margins <dimen>
  393. X- .SKIP
  394. X- Specifies the size of both the top and side margins.  This should be a
  395. X- decimal number optionally followed by "cm", e.g., 1.5 or 3cm, giving a
  396. X- measurement in inches or centimeters.
  397. X- XDVI determines the "home" position of
  398. X- the page within the window as follows.  If the entire page fits in the
  399. X- window, then the margin settings are ignored.  If, even after removing
  400. X- the margins from the left, right, top, and bottom, the page still
  401. X- cannot fit in the window, then the page is put in the window such that
  402. X- the top and left margins are hidden, and presumably the upper
  403. X- left-hand corner of the text on the page will be in the upper
  404. X- left-hand corner of the window.  Otherwise, the text is centered in
  405. X- the window.  See also `M' under the Keystrokes help entry.
  406. X- .SKIP
  407. X- The resource name is ".Margin".
  408. X- .INDENT -1
  409. X- 3 -mgs[n]
  410. X- .BREAK
  411. X- -mgs[n] <size>
  412. X- .SKIP
  413. X- Specifies the size of the window to be used for the "magnifying glass"
  414. X- for Button n.  See the MOUSE ACTIONS section.
  415. X- Defaults are 200, 350, 600, 900, and 1200.
  416. X- .SKIP
  417. X- The resource name is ".magnifierSize[n]".
  418. X- .INDENT -1
  419. X- 3 -mgs
  420. X- .BREAK
  421. X- -mgs <size>
  422. X- .SKIP
  423. X- Same as -mgs1.
  424. X- .INDENT -1
  425. X  3 -rv
  426. X  .BREAK
  427. X  Causes the page to be displayed with white characters on a black
  428. X--- 325,330 ----
  429. X***************
  430. X*** 478,484 ****
  431. X  .INDENT -1
  432. X  3 G
  433. X  .BREAK
  434. X! The key toggles the use of greyscale anti-aliasing for displaying shrunken 
  435. X  bitmaps.  In addition, the key sequences `0G' and `1G' clear and set this flag,
  436. X  respectively.  See also the -nogrey option.
  437. X  
  438. X--- 493,499 ----
  439. X  .INDENT -1
  440. X  3 G
  441. X  .BREAK
  442. X! The key toggles the use of greyscale anti-aliasing for displaying shrunken
  443. X  bitmaps.  In addition, the key sequences `0G' and `1G' clear and set this flag,
  444. X  respectively.  See also the -nogrey option.
  445. X  
  446. X***************
  447. X*** 536,545 ****
  448. X  of the font (within a certain range), and if this fails, then it will
  449. X  use the font specified as the alternate font (cf. -altfont).
  450. X  .SKIP
  451. X! For compatibilty with some versions of TeX, you may also use the logical name
  452. X  "TEXFONTS" in place of "XDVIFONTS", although in that case the string should
  453. X! not include any "%" specifiers.
  454. X  
  455. X  .INDENT -1
  456. X  3 XDVISIZES
  457. X  .BREAK
  458. X--- 551,580 ----
  459. X  of the font (within a certain range), and if this fails, then it will
  460. X  use the font specified as the alternate font (cf. -altfont).
  461. X  .SKIP
  462. X! For compatibility with some versions of TeX, you may also use the logical name
  463. X  "TEXFONTS" in place of "XDVIFONTS", although in that case the string should
  464. X! not include any "%" specifiers.  The reason for recognizing "TEXFONTS" is
  465. X! that certain versions of TeX also support the convention regarding an extra
  466. X! slash in the font path; therefore, users who create their own fonts can put
  467. X! both their .TFM and raster file in the same directory and do
  468. X! .SKIP
  469. X! .LITERAL
  470. X!         $ DEFINE TEXFONTS "/MFDIR"
  471. X  
  472. X+ or
  473. X+ 
  474. X+         $ DEFINE TEXFONTS "MFDIR/"
  475. X+ .END LITERAL
  476. X+ .SKIP
  477. X+ in order to get TeX and XDVI to search their directory in addition to the
  478. X+ system standard directories.  The "XDVIFONTS" logical name overrides the
  479. X+ "TEXFONTS" logical name, so that on those sites where "TEXFONTS" must be set
  480. X+ explicitly, and therefore this feature is not useful, the "XDVIFONTS" logical
  481. X+ name be set to an empty string to cause XDVI to ignore "TEXFONTS".
  482. X+ .SKIP
  483. X+ XDVI also recognizes the "PKFONTS" logical name, which is checked after
  484. X+ "XDVIFONTS" but before "TEXFONTS".
  485. X+ 
  486. X  .INDENT -1
  487. X  3 XDVISIZES
  488. X  .BREAK
  489. X***************
  490. X*** 559,566 ****
  491. X  Virtual fonts are supported, although XDVI does not have any built-in fonts to
  492. X  which they can refer.  The search path for .VF files can be specified with the
  493. X  "XDVIVFS" logical name in a similar manner to that for the "XDVIFONTS" logical
  494. X! name.  Virtual fonts are searched for immediately after looking for the font
  495. X! as a normal font in the exact size specified.
  496. X  
  497. X  .INDENT -1
  498. X  2 Resource_Names
  499. X--- 594,602 ----
  500. X  Virtual fonts are supported, although XDVI does not have any built-in fonts to
  501. X  which they can refer.  The search path for .VF files can be specified with the
  502. X  "XDVIVFS" logical name in a similar manner to that for the "XDVIFONTS" logical
  503. X! name.  XDVI will also check the "VFFONTS" logical name if the "XDVIFONTS"
  504. X! logical name is not defined.  Virtual fonts are searched for immediately after
  505. X! looking for the font as a normal font in the exact size specified.
  506. X  
  507. X  .INDENT -1
  508. X  2 Resource_Names
  509. Xdiff -cr xdvi_old/dvi_draw.c xdvi_new/dvi_draw.c
  510. X*** xdvi_old/dvi_draw.c    Fri Jun 19 12:25:05 1992
  511. X--- xdvi_new/dvi_draw.c    Mon Aug 24 18:44:34 1992
  512. X***************
  513. X*** 6,20 ****
  514. X   * Code derived from dvi-imagen.c.
  515. X   *
  516. X   * Modification history:
  517. X!  * 1/1986    Modified for X.10 by Bob Scheifler, MIT LCS.
  518. X!  * 7/1988    Modified for X.11 by Mark Eichin, MIT
  519. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  520. X!  *            --Paul Vojta, UC Berkeley.
  521. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  522. X!  * 4/1989    Modified for System V by Donald Richardson, Clarkson Univ.
  523. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  524. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  525. X   * 1/1992    Added greyscale code    --Till Brychcy, Techn. Univ. Muenchen
  526. X   *
  527. X   *    Compilation options:
  528. X   *    SYSV    compile for System V
  529. X--- 6,21 ----
  530. X   * Code derived from dvi-imagen.c.
  531. X   *
  532. X   * Modification history:
  533. X!  * 1/1986    Modified for X.10    --Bob Scheifler, MIT LCS.
  534. X!  * 7/1988    Modified for X.11    --Mark Eichin, MIT
  535. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  536. X!  *                    --Paul Vojta, UC Berkeley.
  537. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  538. X!  * 4/1989    Modified for System V    --Donald Richardson, Clarkson Univ.
  539. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  540. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  541. X   * 1/1992    Added greyscale code    --Till Brychcy, Techn. Univ. Muenchen
  542. X+  *                      and Lee Hetherington, MIT
  543. X   *
  544. X   *    Compilation options:
  545. X   *    SYSV    compile for System V
  546. X***************
  547. X*** 180,190 ****
  548. X  }
  549. X  
  550. X  #if    NeedVarargsPrototypes
  551. X! static    volatile void
  552. X  tell_oops(_Xconst char *message, ...)
  553. X  #else
  554. X  /* VARARGS */
  555. X! static    volatile void
  556. X  tell_oops(va_alist)
  557. X      va_dcl
  558. X  #endif
  559. X--- 181,191 ----
  560. X  }
  561. X  
  562. X  #if    NeedVarargsPrototypes
  563. X! static    NORETURN void
  564. X  tell_oops(_Xconst char *message, ...)
  565. X  #else
  566. X  /* VARARGS */
  567. X! static    NORETURN void
  568. X  tell_oops(va_alist)
  569. X      va_dcl
  570. X  #endif
  571. X***************
  572. X*** 206,212 ****
  573. X      if (currinf.virtual)
  574. X          Fprintf(stderr, " in virtual font %s\n", currinf.virtual->fontname);
  575. X      else
  576. X!         Fprintf(stderr, ", offset %d\n", xtell(currinf.pos - 1));
  577. X      exit(1);
  578. X  }
  579. X  
  580. X--- 207,213 ----
  581. X      if (currinf.virtual)
  582. X          Fprintf(stderr, " in virtual font %s\n", currinf.virtual->fontname);
  583. X      else
  584. X!         Fprintf(stderr, ", offset %ld\n", xtell(currinf.pos - 1));
  585. X      exit(1);
  586. X  }
  587. X  
  588. X***************
  589. X*** 248,254 ****
  590. X      if (isprint(ch))
  591. X          Printf(" (%c)", ch);
  592. X      Putchar('\n');
  593. X!     Printf("x = %d, y = %d, dvi = %d\n", g->x, g->y, g->dvi_adv);
  594. X      print_bitmap(&g->bitmap);
  595. X  }
  596. X  
  597. X--- 249,255 ----
  598. X      if (isprint(ch))
  599. X          Printf(" (%c)", ch);
  600. X      Putchar('\n');
  601. X!     Printf("x = %d, y = %d, dvi = %ld\n", g->x, g->y, g->dvi_adv);
  602. X      print_bitmap(&g->bitmap);
  603. X  }
  604. X  
  605. X***************
  606. X*** 285,291 ****
  607. X          return;
  608. X      }
  609. X      else s = dvi_table2[ch - (FNTNUM0 + 64)];
  610. X!     if (s) puts(s);
  611. X      else
  612. X          tell_oops("unknown op-code %d", ch);
  613. X  }
  614. X--- 286,292 ----
  615. X          return;
  616. X      }
  617. X      else s = dvi_table2[ch - (FNTNUM0 + 64)];
  618. X!     if (s) Puts(s);
  619. X      else
  620. X          tell_oops("unknown op-code %d", ch);
  621. X  }
  622. X***************
  623. X*** 351,364 ****
  624. X  shrink_glyph_grey(g)
  625. X      register struct glyph *g;
  626. X  {
  627. X-     int    shrunk_bytes_wide, shrunk_height;
  628. X      int    rows_left, rows, init_cols, cols_left;
  629. X      register int    cols;
  630. X      int    x, y;
  631. X      long    thesample;
  632. X!     BMUNIT    *old_ptr, *new_ptr;
  633. X!     register BMUNIT    m, *cp;
  634. X!     int    min_sample = shrink_factor * shrink_factor * density / 100;
  635. X  
  636. X      /* These machinations ensure that the character is shrunk according to
  637. X         its hot point, rather than its upper left-hand corner. */
  638. X--- 352,362 ----
  639. X  shrink_glyph_grey(g)
  640. X      register struct glyph *g;
  641. X  {
  642. X      int    rows_left, rows, init_cols, cols_left;
  643. X      register int    cols;
  644. X      int    x, y;
  645. X      long    thesample;
  646. X!     BMUNIT    *old_ptr;
  647. X  
  648. X      /* These machinations ensure that the character is shrunk according to
  649. X         its hot point, rather than its upper left-hand corner. */
  650. X***************
  651. X*** 375,447 ****
  652. X          rows += shrink_factor;
  653. X          --g->y2;
  654. X      }
  655. X!     g->bitmap2.h = shrunk_height = g->y2 +
  656. X!         ROUNDUP(g->bitmap.h - cols, shrink_factor) + 1;
  657. X!     if (g->bitmap2.bits) free(g->bitmap2.bits);
  658. X!     alloc_bitmap(&g->bitmap2);
  659. X  
  660. X!     if (g->pixmap2)
  661. X!         XDestroyImage(g->image2);
  662. X! 
  663. X!     g->pixmap2 = xmalloc((unsigned) (g->bitmap2.bytes_wide * g->bitmap2.h *
  664. X!                    DefaultDepthOfScreen(SCRN)), "character pixmap");
  665. X!     g->image2 = XCreateImage(DISP,DefaultVisualOfScreen(SCRN),
  666. X                   DefaultDepthOfScreen(SCRN),
  667. X!                  ZPixmap, 0, g->pixmap2,
  668. X                   g->bitmap2.w, g->bitmap2.h,
  669. X                   BITS_PER_BMUNIT, 0);
  670. X  
  671. X      old_ptr = (BMUNIT *) g->bitmap.bits;
  672. X-     new_ptr = (BMUNIT *) g->bitmap2.bits;
  673. X-     shrunk_bytes_wide = g->bitmap2.bytes_wide;
  674. X      rows_left = g->bitmap.h;
  675. X-     bzero((char *) new_ptr, shrunk_bytes_wide * shrunk_height);
  676. X      y = 0;
  677. X      while (rows_left) {
  678. X          x = 0;
  679. X          if (rows > rows_left) rows = rows_left;
  680. X          cols_left = g->bitmap.w;
  681. X- #ifndef    MSBITFIRST
  682. X-         m = (1 << 0);
  683. X- #else
  684. X-         m = (1 << (BITS_PER_BMUNIT-1));
  685. X- #endif
  686. X-         cp = new_ptr;
  687. X          cols = init_cols;
  688. X          while (cols_left) {
  689. X          if (cols > cols_left) cols = cols_left;
  690. X-         if ((thesample = sample(old_ptr, g->bitmap.bytes_wide,
  691. X-             g->bitmap.w - cols_left, cols, rows)) >= min_sample)
  692. X-             *cp |= m;
  693. X- #ifndef    MSBITFIRST
  694. X-         if (m == (BMUNIT)(1 << (BITS_PER_BMUNIT-1))) {
  695. X-             m = (1 << 0);
  696. X-             ++cp;
  697. X-         }
  698. X-         else m <<= 1;
  699. X- #else
  700. X-         if (m == (1 << 0)) {
  701. X-             m = (1 << (BITS_PER_BMUNIT-1));
  702. X-             ++cp;
  703. X-         }
  704. X-         else m >>= 1;
  705. X- #endif
  706. X-         cols_left -= cols;
  707. X-         cols = shrink_factor;
  708. X  
  709. X!         if (shrink_factor == 2)
  710. X!             XPutPixel(g->image2, x, y, pixel2[thesample]);
  711. X!         else if (shrink_factor == 3)
  712. X!             XPutPixel(g->image2, x, y, pixel3[thesample]);
  713. X!         else if (shrink_factor == 4)
  714. X!             XPutPixel(g->image2, x, y, pixel4[thesample]);
  715. X!         else
  716. X!             XPutPixel(g->image2, x, y,
  717. X!             pixel4[thesample * 16 / shrink_factor / shrink_factor]);
  718. X  
  719. X          x++;
  720. X          }
  721. X-         *((char **) &new_ptr) += shrunk_bytes_wide;
  722. X          *((char **) &old_ptr) += rows * g->bitmap.bytes_wide;
  723. X          rows_left -= rows;
  724. X          rows = shrink_factor;
  725. X--- 373,408 ----
  726. X          rows += shrink_factor;
  727. X          --g->y2;
  728. X      }
  729. X!     g->bitmap2.h = g->y2 + ROUNDUP(g->bitmap.h - cols, shrink_factor) + 1;
  730. X  
  731. X!     g->image2 = XCreateImage(DISP, DefaultVisualOfScreen(SCRN),
  732. X                   DefaultDepthOfScreen(SCRN),
  733. X!                  ZPixmap, 0, (char *) NULL,
  734. X                   g->bitmap2.w, g->bitmap2.h,
  735. X                   BITS_PER_BMUNIT, 0);
  736. X+     g->pixmap2 = g->image2->data = xmalloc((unsigned)
  737. X+             g->image2->bytes_per_line * g->bitmap2.h,
  738. X+             "character pixmap");
  739. X  
  740. X      old_ptr = (BMUNIT *) g->bitmap.bits;
  741. X      rows_left = g->bitmap.h;
  742. X      y = 0;
  743. X      while (rows_left) {
  744. X          x = 0;
  745. X          if (rows > rows_left) rows = rows_left;
  746. X          cols_left = g->bitmap.w;
  747. X          cols = init_cols;
  748. X          while (cols_left) {
  749. X          if (cols > cols_left) cols = cols_left;
  750. X  
  751. X!         thesample = sample(old_ptr, g->bitmap.bytes_wide,
  752. X!             g->bitmap.w - cols_left, cols, rows);
  753. X!         XPutPixel(g->image2, x, y, pixeltbl[thesample]);
  754. X  
  755. X+         cols_left -= cols;
  756. X+         cols = shrink_factor;
  757. X          x++;
  758. X          }
  759. X          *((char **) &old_ptr) += rows * g->bitmap.bytes_wide;
  760. X          rows_left -= rows;
  761. X          rows = shrink_factor;
  762. X***************
  763. X*** 450,462 ****
  764. X  
  765. X      while (y < g->bitmap2.h) {
  766. X          for (x = 0; x < g->bitmap2.w; x++)
  767. X!         XPutPixel(g->image2, x, y, pixel2[0]);
  768. X          y++;
  769. X      }
  770. X  
  771. X      g->y2 = g->y / shrink_factor;
  772. X-     if (debug & DBG_BITMAP)
  773. X-         print_bitmap(&g->bitmap2);
  774. X  }
  775. X  #endif    /* GREY */
  776. X  
  777. X--- 411,421 ----
  778. X  
  779. X      while (y < g->bitmap2.h) {
  780. X          for (x = 0; x < g->bitmap2.w; x++)
  781. X!         XPutPixel(g->image2, x, y, *pixeltbl);
  782. X          y++;
  783. X      }
  784. X  
  785. X      g->y2 = g->y / shrink_factor;
  786. X  }
  787. X  #endif    /* GREY */
  788. X  
  789. X***************
  790. X*** 488,494 ****
  791. X      }
  792. X      g->bitmap2.h = shrunk_height = g->y2 +
  793. X          ROUNDUP(g->bitmap.h - cols, shrink_factor) + 1;
  794. X-     if (g->bitmap2.bits) free(g->bitmap2.bits);
  795. X      alloc_bitmap(&g->bitmap2);
  796. X      old_ptr = (BMUNIT *) g->bitmap.bits;
  797. X      new_ptr = (BMUNIT *) g->bitmap2.bits;
  798. X--- 447,452 ----
  799. X***************
  800. X*** 601,607 ****
  801. X      long    dvi_h_sav;
  802. X  #endif
  803. X  
  804. X!     if (ch > maxchar) realloc_font(currinf.fontp, ch);
  805. X      if ((g = &currinf.fontp->glyph[ch])->bitmap.bits == NULL) {
  806. X          if (g->addr == 0) {
  807. X          if (!hush_chars)
  808. X--- 559,565 ----
  809. X      long    dvi_h_sav;
  810. X  #endif
  811. X  
  812. X!     if (ch > maxchar) realloc_font(currinf.fontp, WIDEARG(,(int)) ch);
  813. X      if ((g = &currinf.fontp->glyph[ch])->bitmap.bits == NULL) {
  814. X          if (g->addr == 0) {
  815. X          if (!hush_chars)
  816. X***************
  817. X*** 615,621 ****
  818. X          open_font_file(currinf.fontp);
  819. X          Fseek(currinf.fontp->file, g->addr, 0);
  820. X          (*currinf.fontp->read_char)(currinf.fontp, ch);
  821. X!         if (debug & DBG_BITMAP) print_char(ch, g);
  822. X          currinf.fontp->timestamp = ++current_timestamp;
  823. X      }
  824. X  
  825. X--- 573,579 ----
  826. X          open_font_file(currinf.fontp);
  827. X          Fseek(currinf.fontp->file, g->addr, 0);
  828. X          (*currinf.fontp->read_char)(currinf.fontp, ch);
  829. X!         if (debug & DBG_BITMAP) print_char((ubyte) ch, g);
  830. X          currinf.fontp->timestamp = ++current_timestamp;
  831. X      }
  832. X  
  833. X***************
  834. X*** 714,723 ****
  835. X  
  836. X  
  837. X  #ifndef    TEXXET
  838. X! long
  839. X  set_no_char(ch)
  840. X  #else
  841. X! void
  842. X  set_no_char(cmd, ch)
  843. X      ubyte    cmd;
  844. X  #endif
  845. X--- 672,681 ----
  846. X  
  847. X  
  848. X  #ifndef    TEXXET
  849. X! static    long
  850. X  set_no_char(ch)
  851. X  #else
  852. X! static    void
  853. X  set_no_char(cmd, ch)
  854. X      ubyte    cmd;
  855. X  #endif
  856. Xdiff -cr xdvi_old/dvi_init.c xdvi_new/dvi_init.c
  857. X*** xdvi_old/dvi_init.c    Wed Jun 10 18:46:09 1992
  858. X--- xdvi_new/dvi_init.c    Mon Aug 24 18:44:44 1992
  859. X***************
  860. X*** 6,20 ****
  861. X   * Code derived from dvi-imagen.c.
  862. X   *
  863. X   * Modification history:
  864. X!  * 1/1986    Modified for X.10 by Bob Scheifler, MIT LCS.
  865. X!  * 7/1988    Modified for X.11 by Mark Eichin, MIT
  866. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  867. X!  *            --Paul Vojta, UC Berkeley.
  868. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  869. X!  * 4/1989    Modified for System V by Donald Richardson, Clarkson Univ.
  870. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  871. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  872. X   * 1/1992    Added greyscale code    --Till Brychcy, Techn. Univ. Muenchen
  873. X   *
  874. X   *    Compilation options:
  875. X   *    SYSV    compile for System V
  876. X--- 6,21 ----
  877. X   * Code derived from dvi-imagen.c.
  878. X   *
  879. X   * Modification history:
  880. X!  * 1/1986    Modified for X.10    --Bob Scheifler, MIT LCS.
  881. X!  * 7/1988    Modified for X.11    --Mark Eichin, MIT
  882. X   * 12/1988    Added 'R' option, toolkit, magnifying glass
  883. X!  *                    --Paul Vojta, UC Berkeley.
  884. X   * 2/1989    Added tpic support    --Jeffrey Lee, U of Toronto
  885. X!  * 4/1989    Modified for System V    --Donald Richardson, Clarkson Univ.
  886. X   * 3/1990    Added VMS support    --Scott Allendorf, U of Iowa
  887. X   * 7/1990    Added reflection mode    --Michael Pak, Hebrew U of Jerusalem
  888. X   * 1/1992    Added greyscale code    --Till Brychcy, Techn. Univ. Muenchen
  889. X+  *                      and Lee Hetherington, MIT
  890. X   *
  891. X   *    Compilation options:
  892. X   *    SYSV    compile for System V
  893. X***************
  894. X*** 180,186 ****
  895. X  
  896. X      fontp->flags |= FONT_LOADED;
  897. X      fontp->file = font_open(fontp->fontname, &font_found,
  898. X!         (WIDEARG(float, double)) fsize, &size_found, &fontp->filename);
  899. X      if (fontp->file == NULL) {
  900. X          Fprintf(stderr, "Can't find font %s.\n", fontp->fontname);
  901. X          font_not_found = True;
  902. X--- 181,188 ----
  903. X  
  904. X      fontp->flags |= FONT_LOADED;
  905. X      fontp->file = font_open(fontp->fontname, &font_found,
  906. X!         (WIDEARG(float, double)) fsize, &size_found, fontp->magstepval,
  907. X!         &fontp->filename);
  908. X      if (fontp->file == NULL) {
  909. X          Fprintf(stderr, "Can't find font %s.\n", fontp->fontname);
  910. X          font_not_found = True;
  911. X***************
  912. X*** 223,238 ****
  913. X  
  914. X      if (fontp->flags & FONT_VIRTUAL) {
  915. X          while (maxchar > 0 && fontp->macro[maxchar].pos == NULL) --maxchar;
  916. X!         if (maxchar < 255) realloc_virtual_font(fontp, maxchar);
  917. X      }
  918. X      else {
  919. X          while (maxchar > 0 && fontp->glyph[maxchar].addr == 0) --maxchar;
  920. X!         if (maxchar < 255) realloc_font(fontp, maxchar);
  921. X      }
  922. X  }
  923. X  
  924. X  
  925. X  /*
  926. X   *    reuse_font recursively sets the flags for font structures being reused.
  927. X   */
  928. X  
  929. X--- 225,284 ----
  930. X  
  931. X      if (fontp->flags & FONT_VIRTUAL) {
  932. X          while (maxchar > 0 && fontp->macro[maxchar].pos == NULL) --maxchar;
  933. X!         if (maxchar < 255)
  934. X!         realloc_virtual_font(fontp, WIDEARG(,(int)) maxchar);
  935. X      }
  936. X      else {
  937. X          while (maxchar > 0 && fontp->glyph[maxchar].addr == 0) --maxchar;
  938. X!         if (maxchar < 255)
  939. X!         realloc_font(fontp, WIDEARG(,(int)) maxchar);
  940. X      }
  941. X  }
  942. X  
  943. X  
  944. X  /*
  945. X+  *    MAGSTEPVALUE - If the given magnification is close to a \magstep
  946. X+  *    or a \magstephalf, then return twice the number of \magsteps.
  947. X+  *    Otherwise return NOMAGSTP.
  948. X+  */
  949. X+ 
  950. X+ #define    NOMAGSTP (-29999)
  951. X+ #define    NOBUILD    29999
  952. X+ 
  953. X+ static    int
  954. X+ magstepvalue(mag)
  955. X+     float    *mag;
  956. X+ {
  957. X+     int    m    = 0;
  958. X+     double    fmag    = *mag;
  959. X+     double    xmag    = pixels_per_inch;
  960. X+     float    margin    = fmag * 0.002;
  961. X+ 
  962. X+     if (fmag < pixels_per_inch)
  963. X+         for (;;) {
  964. X+         if (xmag - fmag < margin && -(xmag - fmag) < margin) {
  965. X+             *mag = xmag;
  966. X+             return m;
  967. X+         }
  968. X+         if (xmag < fmag) break;
  969. X+         xmag *= 0.9128709292;
  970. X+         --m;
  971. X+         }
  972. X+     else
  973. X+         for (;;) {
  974. X+         if (xmag - fmag < margin && -(xmag - fmag) < margin) {
  975. X+             *mag = xmag;
  976. X+             return m;
  977. X+         }
  978. X+         if (xmag > fmag) break;
  979. X+         xmag *= 1.095445115;
  980. X+         ++m;
  981. X+         }
  982. X+     return NOMAGSTP;
  983. X+ }
  984. X+ 
  985. X+ 
  986. X+ /*
  987. X   *    reuse_font recursively sets the flags for font structures being reused.
  988. X   */
  989. X  
  990. X***************
  991. X*** 262,268 ****
  992. X  void
  993. X  define_font(file, cmnd, vfparent, tn_headpp)
  994. X      FILE        *file;
  995. X!     WIDEARG(ubyte,unsigned int) cmnd;
  996. X      struct font    *vfparent;    /* vf parent of this font, or NULL */
  997. X      struct tn    **tn_headpp;    /* addr of head of list of TeXnumbers */
  998. X  {
  999. X--- 308,314 ----
  1000. X  void
  1001. X  define_font(file, cmnd, vfparent, tn_headpp)
  1002. X      FILE        *file;
  1003. X!     WIDEARG(ubyte, unsigned int) cmnd;
  1004. X      struct font    *vfparent;    /* vf parent of this font, or NULL */
  1005. X      struct tn    **tn_headpp;    /* addr of head of list of TeXnumbers */
  1006. X  {
  1007. X***************
  1008. X*** 272,277 ****
  1009. X--- 318,324 ----
  1010. X      double    scale_dimconv;
  1011. X      int scale;
  1012. X      int design;
  1013. X+     int magstepval;
  1014. X      int len;
  1015. X      char *fontname;
  1016. X      int size;
  1017. X***************
  1018. X*** 280,286 ****
  1019. X          "TeXnumber structure");
  1020. X      tnp->next = *tn_headpp;
  1021. X      *tn_headpp = tnp;
  1022. X!     tnp->TeXnumber = num(file, (ubyte) cmnd - FNTDEF1 + 1);
  1023. X      (void) four(file);    /* checksum */
  1024. X      scale = four(file);
  1025. X      design = four(file);
  1026. X--- 327,333 ----
  1027. X          "TeXnumber structure");
  1028. X      tnp->next = *tn_headpp;
  1029. X      *tn_headpp = tnp;
  1030. X!     tnp->TeXnumber = num(file, (int) cmnd - FNTDEF1 + 1);
  1031. X      (void) four(file);    /* checksum */
  1032. X      scale = four(file);
  1033. X      design = four(file);
  1034. X***************
  1035. X*** 307,312 ****
  1036. X--- 354,360 ----
  1037. X          fsize = (72.27 * (1<<4)) * vfparent->dimconv * scale / design;
  1038. X          scale_dimconv = vfparent->dimconv;
  1039. X      }
  1040. X+     magstepval = magstepvalue(&fsize);
  1041. X      size = 5 * fsize + 0.5;
  1042. X      /*
  1043. X       * reuse font if possible
  1044. X***************
  1045. X*** 317,329 ****
  1046. X              Printf("%s at %d dpi\n", fontname, (int) (fsize + 0.5));
  1047. X          fontp = (struct font *) xmalloc((unsigned) sizeof(struct font),
  1048. X              "font structure");
  1049. X-         fontp->next = font_head;
  1050. X-         font_head = fontp;
  1051. X          fontp->dimconv = scale * scale_dimconv / (1<<20);
  1052. X          fontp->fontname = fontname;
  1053. X          fontp->fsize = fsize;
  1054. X          fontp->flags = FONT_IN_USE;
  1055. X          if (vfparent == NULL) load_font(fontp);
  1056. X          break;
  1057. X          }
  1058. X          if (strcmp(fontname, fontp->fontname) == 0
  1059. X--- 365,378 ----
  1060. X              Printf("%s at %d dpi\n", fontname, (int) (fsize + 0.5));
  1061. X          fontp = (struct font *) xmalloc((unsigned) sizeof(struct font),
  1062. X              "font structure");
  1063. X          fontp->dimconv = scale * scale_dimconv / (1<<20);
  1064. X          fontp->fontname = fontname;
  1065. X          fontp->fsize = fsize;
  1066. X+         fontp->magstepval = magstepval;
  1067. X          fontp->flags = FONT_IN_USE;
  1068. X          if (vfparent == NULL) load_font(fontp);
  1069. X+         fontp->next = font_head;
  1070. X+         font_head = fontp;
  1071. X          break;
  1072. X          }
  1073. X          if (strcmp(fontname, fontp->fontname) == 0
  1074. Xdiff -cr xdvi_old/font_open.c xdvi_new/font_open.c
  1075. X*** xdvi_old/font_open.c    Mon Jun 15 12:49:37 1992
  1076. X--- xdvi_new/font_open.c    Fri Jul 24 14:28:54 1992
  1077. X***************
  1078. X*** 1,5 ****
  1079. X  /*
  1080. X!  *    font_open.c(font, font_ret, mag, mag_ret, name)
  1081. X   *    Find and open gf, pk, or pxl files in the given path, having the given
  1082. X   *    name and magnification.  It tries gf files first, followed by pk and pxl
  1083. X   *    files.  The path variable should be of the form path1:path2:...:pathn,
  1084. X--- 1,5 ----
  1085. X  /*
  1086. X!  *    font_open.c(font, font_ret, mag, mag_ret, magstepval, name)
  1087. X   *    Find and open gf, pk, or pxl files in the given path, having the given
  1088. X   *    name and magnification.  It tries gf files first, followed by pk and pxl
  1089. X   *    files.  The path variable should be of the form path1:path2:...:pathn,
  1090. X***************
  1091. X*** 40,47 ****
  1092. X  #include <errno.h>
  1093. X  
  1094. X  #ifndef    X_NOT_STDC_ENV
  1095. X! #include <stdlib.h>
  1096. X  #endif
  1097. X  
  1098. X  /*
  1099. X   *    If you think you have to change DEFAULT_TAIL, then you haven't read the
  1100. X--- 40,53 ----
  1101. X  #include <errno.h>
  1102. X  
  1103. X  #ifndef    X_NOT_STDC_ENV
  1104. X! #include <stdlib.h>    /* has getenv() */
  1105. X! #include <math.h>    /* has atof() */
  1106. X! #else
  1107. X! extern    char    *getenv();
  1108. X! #ifndef    atof
  1109. X! double    atof();
  1110. X  #endif
  1111. X+ #endif
  1112. X  
  1113. X  /*
  1114. X   *    If you think you have to change DEFAULT_TAIL, then you haven't read the
  1115. X***************
  1116. X*** 67,84 ****
  1117. X  static    int    *sizes, *sizend;
  1118. X  static    char    default_size_list[]    = DEFAULT_FONT_SIZES;
  1119. X  
  1120. X  #define    FILENAMESIZE 512
  1121. X  
  1122. X  #ifdef    sun
  1123. X  char    *sprintf();
  1124. X  #endif
  1125. X  
  1126. X- char    *getenv();
  1127. X- 
  1128. X- #ifndef    atof
  1129. X- double    atof();
  1130. X- #endif
  1131. X- 
  1132. X  #ifdef    SEARCH_SUBDIRECTORIES
  1133. X  /* We will need some system include files to deal with directories.  */
  1134. X  /* <sys/types.h> was included by xdvi.h.  */
  1135. X--- 73,93 ----
  1136. X  static    int    *sizes, *sizend;
  1137. X  static    char    default_size_list[]    = DEFAULT_FONT_SIZES;
  1138. X  
  1139. X+ #ifdef    _POSIX_SOURCE
  1140. X+ #include <limits.h>
  1141. X+ #ifdef    PATH_MAX
  1142. X+ #define    FILENAMESIZE    PATH_MAX
  1143. X+ #endif
  1144. X+ #endif
  1145. X+ 
  1146. X+ #ifndef    FILENAMESIZE
  1147. X  #define    FILENAMESIZE 512
  1148. X+ #endif
  1149. X  
  1150. X  #ifdef    sun
  1151. X  char    *sprintf();
  1152. X  #endif
  1153. X  
  1154. X  #ifdef    SEARCH_SUBDIRECTORIES
  1155. X  /* We will need some system include files to deal with directories.  */
  1156. X  /* <sys/types.h> was included by xdvi.h.  */
  1157. X***************
  1158. X*** 99,111 ****
  1159. X  
  1160. X  #ifdef    HAVE_GETWD
  1161. X  extern    char    *getwd ();
  1162. X! #define    getcwd(b, len)    ((b) ? getwd (b) : getwd (xmalloc (len, "getwd")))
  1163. X  #else
  1164. X! #ifdef    ANSI
  1165. X  extern    char    *getcwd (char *, int);
  1166. X  #else
  1167. X  extern    char    *getcwd ();
  1168. X! #endif    /* not ANSI */
  1169. X  #endif    /* not HAVE_GETWD */
  1170. X  
  1171. X  static    char    *cwd;
  1172. X--- 108,130 ----
  1173. X  
  1174. X  #ifdef    HAVE_GETWD
  1175. X  extern    char    *getwd ();
  1176. X! #define    GETCWD(b, len)    ((b) ? getwd (b) : getwd (xmalloc (len, "getwd")))
  1177. X  #else
  1178. X! /* POSIX says getcwd result is undefined if the pointer is NULL; at least
  1179. X!    on a Convex, the result is a coredump.  Hence the GETCWD macro
  1180. X!    below is defined, as it works regardless of what getcwd() does
  1181. X!    with a NULL pointer  */
  1182. X! #define    GETCWD(b, len)    ((b) ? getcwd (b,len) \
  1183. X!             : getcwd (xmalloc (len, "getcwd"),len))
  1184. X! #ifdef    _POSIX_SOURCE
  1185. X! #include <unistd.h>    /* getcwd prototype */
  1186. X! #else
  1187. X! #if    NeedFunctionPrototypes
  1188. X  extern    char    *getcwd (char *, int);
  1189. X  #else
  1190. X  extern    char    *getcwd ();
  1191. X! #endif    /* not NeedFunctionPrototypes */
  1192. X! #endif    /* not _POSIX_SOURCE */
  1193. X  #endif    /* not HAVE_GETWD */
  1194. X  
  1195. X  static    char    *cwd;
  1196. X***************
  1197. X*** 204,210 ****
  1198. X  
  1199. X  static    struct subdir_entry *
  1200. X  make_subdir_entry(index, name)
  1201. X!     char    *index, *name;
  1202. X  {
  1203. X      struct subdir_entry        *new_entry;
  1204. X      static    struct subdir_entry    **subdir_tail = &subdir_head;
  1205. X--- 223,230 ----
  1206. X  
  1207. X  static    struct subdir_entry *
  1208. X  make_subdir_entry(index, name)
  1209. X!     _Xconst char    *index;
  1210. X!     char        *name;
  1211. X  {
  1212. X      struct subdir_entry        *new_entry;
  1213. X      static    struct subdir_entry    **subdir_tail = &subdir_head;
  1214. X***************
  1215. X*** 225,231 ****
  1216. X  
  1217. X  static    void
  1218. X  add_subdirs(str, len, recurs)
  1219. X!     char    *str;
  1220. X      int    len;
  1221. X      Boolean    recurs;
  1222. X  {
  1223. X--- 245,251 ----
  1224. X  
  1225. X  static    void
  1226. X  add_subdirs(str, len, recurs)
  1227. X!     _Xconst char    *str;
  1228. X      int    len;
  1229. X      Boolean    recurs;
  1230. X  {
  1231. X***************
  1232. X*** 278,287 ****
  1233. X  
  1234. X  static    void
  1235. X  compute_subdir_paths(fp, fp_default)
  1236. X!     char    *fp, *fp_default;
  1237. X  {
  1238. X!     char    *star_loc = NULL;
  1239. X!     char    *endp;
  1240. X  
  1241. X      do {
  1242. X          if (star_loc == NULL) {
  1243. X--- 298,308 ----
  1244. X  
  1245. X  static    void
  1246. X  compute_subdir_paths(fp, fp_default)
  1247. X!     _Xconst char    *fp;
  1248. X!     _Xconst char    *fp_default;
  1249. X  {
  1250. X!     _Xconst char    *star_loc = NULL;
  1251. X!     _Xconst char    *endp;
  1252. X  
  1253. X      do {
  1254. X          if (star_loc == NULL) {
  1255. X***************
  1256. X*** 358,364 ****
  1257. X         is not necessarily the same directory the user expects to be
  1258. X         in.  So, we must always call getcwd(3) or getwd(3), even though
  1259. X         they are slow and prone to hang in networked installations.  */
  1260. X!     cwd = getcwd ((char *) NULL, FILENAMESIZE + 2);
  1261. X      if (cwd == NULL) {
  1262. X          perror ("getcwd");
  1263. X          exit (errno);
  1264. X--- 379,385 ----
  1265. X         is not necessarily the same directory the user expects to be
  1266. X         in.  So, we must always call getcwd(3) or getwd(3), even though
  1267. X         they are slow and prone to hang in networked installations.  */
  1268. X!     cwd = GETCWD ((char *) NULL, FILENAMESIZE + 2);
  1269. X      if (cwd == NULL) {
  1270. X          perror ("getcwd");
  1271. X          exit (errno);
  1272. X***************
  1273. X*** 580,638 ****
  1274. X  }
  1275. X  
  1276. X  #ifdef    MAKEPKCMD
  1277. X  #define    MAKEPK
  1278. X  #endif
  1279. X  
  1280. X  #ifdef    MAKEPK
  1281. X- 
  1282. X  #ifndef    MAKEPKCMD
  1283. X  #define    MAKEPKCMD    "MakeTeXPK"
  1284. X  #endif
  1285. X  
  1286. X! /*
  1287. X!  *    Create the string for magstep() values.
  1288. X!  */
  1289. X  
  1290. X- static    char *
  1291. X- magstring(mdpi)
  1292. X-     int    mdpi;
  1293. X- {
  1294. X-     int    m;
  1295. X-     double    fdpi;
  1296. X-     int    tdpi;
  1297. X-     static    char    str[24];
  1298. X- 
  1299. X-     if (mdpi != 0) {
  1300. X-         fdpi = pixels_per_inch;
  1301. X-         m = 0;
  1302. X-         if (mdpi >= pixels_per_inch) {
  1303. X-         while ((tdpi = fdpi + 0.5) < mdpi) {
  1304. X-             fdpi *= 1.095445115;
  1305. X-             ++m;
  1306. X-         }
  1307. X-         if (tdpi == mdpi) {
  1308. X-             Sprintf(str, "magstep\\(%d%s\\)", m / 2, m % 2 ? ".5" : "");
  1309. X-             return str;
  1310. X-         }
  1311. X-         }
  1312. X-         else {
  1313. X-         do {
  1314. X-             fdpi *= 0.9128709292;
  1315. X-             ++m;
  1316. X-         }
  1317. X-         while ((tdpi = fdpi + 0.5) > mdpi);
  1318. X-         if (tdpi == mdpi) {
  1319. X-             Sprintf(str, "magstep\\(-%d%s\\)", m / 2, m % 2 ? ".5" :"");
  1320. X-             return str;
  1321. X-         }
  1322. X-         }
  1323. X-     }
  1324. X-     Sprintf(str, "%d+%d/%d", mdpi / pixels_per_inch, mdpi % pixels_per_inch,
  1325. X-         pixels_per_inch);
  1326. X-     return str;
  1327. X- }
  1328. X- #endif    /* MAKEPK */
  1329. X- 
  1330. X  /*
  1331. X   *    Try a given font name
  1332. X   */
  1333. X--- 601,618 ----
  1334. X  }
  1335. X  
  1336. X  #ifdef    MAKEPKCMD
  1337. X+ #undef    MAKEPK
  1338. X  #define    MAKEPK
  1339. X  #endif
  1340. X  
  1341. X  #ifdef    MAKEPK
  1342. X  #ifndef    MAKEPKCMD
  1343. X  #define    MAKEPKCMD    "MakeTeXPK"
  1344. X  #endif
  1345. X  
  1346. X! #define    NOBUILD    29999
  1347. X! #endif
  1348. X  
  1349. X  /*
  1350. X   *    Try a given font name
  1351. X   */
  1352. X***************
  1353. X*** 645,657 ****
  1354. X  #endif
  1355. X  
  1356. X  static    FILE *
  1357. X! PRE_FONT_OPEN(font, fmag, mag_ret, name, try_make)
  1358. X      _Xconst char    *font;
  1359. X      float    fmag;
  1360. X      int    *mag_ret;
  1361. X      char    **name;
  1362. X  #ifdef    MAKEPK
  1363. X!     Boolean    try_make;
  1364. X  #endif
  1365. X  {
  1366. X      FILE    *f;
  1367. X--- 625,637 ----
  1368. X  #endif
  1369. X  
  1370. X  static    FILE *
  1371. X! PRE_FONT_OPEN(font, fmag, mag_ret, name, magstepval)
  1372. X      _Xconst char    *font;
  1373. X      float    fmag;
  1374. X      int    *mag_ret;
  1375. X      char    **name;
  1376. X  #ifdef    MAKEPK
  1377. X!     int    magstepval;
  1378. X  #endif
  1379. X  {
  1380. X      FILE    *f;
  1381. X***************
  1382. X*** 708,716 ****
  1383. X  
  1384. X  #ifdef    MAKEPK
  1385. X      /* Try to create the font. */
  1386. X!         if (try_make) {
  1387. X!         Sprintf(mkpk, "%s %s %d %d %s", MAKEPKCMD, font, mag / 5,
  1388. X!         pixels_per_inch, magstring(mag / 5));
  1389. X          Printf("- %s\n", mkpk);
  1390. X          if (system(mkpk) == 0
  1391. X          && (f = try_size(font, mag, name, path_to_use,
  1392. X--- 688,709 ----
  1393. X  
  1394. X  #ifdef    MAKEPK
  1395. X      /* Try to create the font. */
  1396. X!     if (magstepval != NOBUILD) {
  1397. X!         char str[24];
  1398. X!         int    dpi    = (mag + 2) / 5;
  1399. X! 
  1400. X!         if (magstepval == NOMAGSTP)
  1401. X!         Sprintf(str, "%d+%d/%d", dpi / pixels_per_inch,
  1402. X!             dpi % pixels_per_inch, pixels_per_inch);
  1403. X!         else if (magstepval < 0)
  1404. X!         Sprintf(str, "magstep\\(-%d%s\\)", (-magstepval) / 2,
  1405. X!             magstepval % 2 ? ".5" :"");
  1406. X!         else
  1407. X!         Sprintf(str, "magstep\\(%d%s\\)", magstepval / 2,
  1408. X!             magstepval % 2 ? ".5" :"");
  1409. X! 
  1410. X!         Sprintf(mkpk, "%s %s %d %d %s", MAKEPKCMD, font, dpi,
  1411. X!         pixels_per_inch, str);
  1412. X          Printf("- %s\n", mkpk);
  1413. X          if (system(mkpk) == 0
  1414. X          && (f = try_size(font, mag, name, path_to_use,
  1415. X***************
  1416. X*** 737,748 ****
  1417. X      }
  1418. X  }
  1419. X  
  1420. X  FILE *
  1421. X! font_open(font, font_ret, mag, mag_ret, name)
  1422. X      _Xconst char    *font;
  1423. X      char    **font_ret;
  1424. X!     WIDEARG(float,double) mag;
  1425. X      int    *mag_ret;
  1426. X      char    **name;
  1427. X  {
  1428. X      FILE    *f;
  1429. X--- 730,743 ----
  1430. X      }
  1431. X  }
  1432. X  
  1433. X+ /* ARGSUSED */
  1434. X  FILE *
  1435. X! font_open(font, font_ret, mag, mag_ret, magstepval, name)
  1436. X      _Xconst char    *font;
  1437. X      char    **font_ret;
  1438. X!     WIDEARG(float, double) mag;
  1439. X      int    *mag_ret;
  1440. X+     int    magstepval;
  1441. X      char    **name;
  1442. X  {
  1443. X      FILE    *f;
  1444. X***************
  1445. X*** 749,755 ****
  1446. X      int    actual_pt, low_pt, high_pt, trial_pt;
  1447. X      char    fn[50], *fnend;
  1448. X  
  1449. X!     f = PRE_FONT_OPEN(font, mag, mag_ret, name, True);
  1450. X      if (f != NULL) {
  1451. X          *font_ret = NULL;
  1452. X          return f;
  1453. X--- 744,750 ----
  1454. X      int    actual_pt, low_pt, high_pt, trial_pt;
  1455. X      char    fn[50], *fnend;
  1456. X  
  1457. X!     f = PRE_FONT_OPEN(font, mag, mag_ret, name, magstepval);
  1458. X      if (f != NULL) {
  1459. X          *font_ret = NULL;
  1460. X          return f;
  1461. X***************
  1462. X*** 770,776 ****
  1463. X          else trial_pt = high_pt++;
  1464. X          Sprintf(fnend, "%d", trial_pt);
  1465. X          f = PRE_FONT_OPEN(fn, mag * actual_pt / trial_pt, mag_ret,
  1466. X!             name, False);
  1467. X          if (f != NULL) {
  1468. X              *font_ret = strcpy(xmalloc((unsigned) strlen(fn) + 1,
  1469. X              "name of font used"), fn);
  1470. X--- 765,771 ----
  1471. X          else trial_pt = high_pt++;
  1472. X          Sprintf(fnend, "%d", trial_pt);
  1473. X          f = PRE_FONT_OPEN(fn, mag * actual_pt / trial_pt, mag_ret,
  1474. X!             name, NOBUILD);
  1475. X          if (f != NULL) {
  1476. X              *font_ret = strcpy(xmalloc((unsigned) strlen(fn) + 1,
  1477. X              "name of font used"), fn);
  1478. X***************
  1479. X*** 779,785 ****
  1480. X          }
  1481. X      }
  1482. X      if (alt_font != NULL) {
  1483. X!         f = PRE_FONT_OPEN(alt_font, mag, mag_ret, name, False);
  1484. X          if (f != NULL)
  1485. X          *font_ret = strcpy(xmalloc((unsigned) strlen(alt_font) + 1,
  1486. X              "name of font used"), alt_font);
  1487. X--- 774,780 ----
  1488. X          }
  1489. X      }
  1490. X      if (alt_font != NULL) {
  1491. X!         f = PRE_FONT_OPEN(alt_font, mag, mag_ret, name, NOBUILD);
  1492. X          if (f != NULL)
  1493. X          *font_ret = strcpy(xmalloc((unsigned) strlen(alt_font) + 1,
  1494. X              "name of font used"), alt_font);
  1495. X
  1496. X
  1497. END_OF_FILE
  1498.   if test 44861 -ne `wc -c <'xdvi.p16.1'`; then
  1499.     echo shar: \"'xdvi.p16.1'\" unpacked with wrong size!
  1500.   fi
  1501.   # end of 'xdvi.p16.1'
  1502. fi
  1503. echo shar: End of archive 2 \(of 2\).
  1504. cp /dev/null ark2isdone
  1505. MISSING=""
  1506. for I in 1 2 ; do
  1507.     if test ! -f ark${I}isdone ; then
  1508.     MISSING="${MISSING} ${I}"
  1509.     fi
  1510. done
  1511. if test "${MISSING}" = "" ; then
  1512.     echo You have unpacked both archives.
  1513.     rm -f ark[1-9]isdone
  1514. else
  1515.     echo You still must unpack the following archives:
  1516.     echo "        " ${MISSING}
  1517. fi
  1518. exit 0
  1519. exit 0 # Just in case...
  1520. -- 
  1521.   // chris@IMD.Sterling.COM       | Send comp.sources.x submissions to:
  1522. \X/  Amiga - The only way to fly! |    sources-x@imd.sterling.com
  1523.  "It's intuitively obvious to the |
  1524.   most casual observer..."        | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
  1525.