home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume27 / psroff-3.0 / patch17 next >
Text File  |  1994-03-29  |  19KB  |  620 lines

  1. Newsgroups: comp.sources.unix
  2. From: clewis@ferret.ocunix.on.ca (Chris Lewis)
  3. Subject: v27i210: psroff 3.0, Patch17
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: clewis@ferret.ocunix.on.ca (Chris Lewis)
  8. Posting-Number: Volume 27, Issue 210
  9. Archive-Name: psroff-3.0/patch17
  10.  
  11.     This is official patch 17 for Psroff 3.0.
  12.     Please apply it by:
  13.  
  14.     cd <psroff source directory>
  15.     patch -N -p < <this file>
  16.     
  17.     The base release of psroff3.0 was in comp.sources.unix volume 24.
  18.     Patches 1 through ../t2r2/Patch.16 are in volume 24 and subsequent
  19.     issues.
  20.  
  21.     A set of shars containing psroff patched to patch level 17
  22.     can be retrieved by anonymous FTP from ftp.uunet.ca under
  23.     distrib/chris_lewis/psroff3.0pl17.
  24.  
  25.     Hp2pbm and its patches can also be retrieved from ftp.uunet.ca under
  26.     distrib/chris_lewis/hp2pbm.
  27.  
  28. A bug fix release.  No new features, except for "ljprev" - if you
  29. have X windows, you can preview HP Laserjet II output.  Note that
  30. you also need hp2pbm patch level 3.  Note new "ljp" entry in
  31. psrofflib.S to use this functionality.
  32.  
  33. Summary of changes:
  34.     - psroff -n (copies) option changed to -C to avoid groff
  35.       argument clash.
  36.     - psrofflib.S greatly rearranged to aid configuration.
  37.       This will probably cause many rejects if you've previously
  38.       configured psrofflib.  Ignore them, though you may want
  39.       to consider ensuring that you have the optimizer (-Z)
  40.       on in the entries you're using.
  41.     - lj3draw.c would core dump on out of range fill arguments.
  42.     - ljdraw.c would core dump on out of range raster bit diddling.
  43.       Lines out of vertical or horizontal by one pixel (usually
  44.       round off during a polygon) snapped to vertical or
  45.       horizontal.
  46.     - fix to installdit to make groff postprocessors work.
  47.  
  48. ./man/psroff.1.S
  49. ./lib/psrofflib.S
  50. ./widths/installdit.S
  51. ./utils/ljprev.S
  52. ./defs.h
  53. ./psroff.S
  54. ./ljdraw.c
  55. ./lj3draw.c
  56.  
  57. Patchwrapped: 930624225013
  58.  
  59. Index: ./man/psroff.1.S
  60. *** /tmp/PATCHold/./man/psroff.1.S    Thu Jun 24 22:48:13 1993
  61. --- ./man/psroff.1.S    Thu Jun 24 22:48:15 1993
  62. ***************
  63. *** 1,4 ****
  64. ! .\"Copyright 1988 by Chris Lewis 2.11 93/01/10
  65.   .TH PSROFF %%MANEXT%% "Psroff %%T2VERSION%%"
  66.   .SH NAME
  67.   psroff,ljroff,xxroff,catconv \- troff to PostScript or other printers
  68. --- 1,4 ----
  69. ! .\"Copyright 1988 by Chris Lewis 2.12 93/04/19
  70.   .TH PSROFF %%MANEXT%% "Psroff %%T2VERSION%%"
  71.   .SH NAME
  72.   psroff,ljroff,xxroff,catconv \- troff to PostScript or other printers
  73. ***************
  74. *** 5,10 ****
  75. --- 5,11 ----
  76.   .SH SYNOPSIS
  77.   .IB xx roff
  78.   .BI "[\-T" xx "]"
  79. + .BI "[\-C" nn "]"
  80.   .BI "[\-d" ptr "]"
  81.   .BI "[\-rL" length "]"
  82.   .BI "[\-P" prologs "]"
  83. ***************
  84. *** 157,162 ****
  85. --- 158,165 ----
  86.   With
  87.   .B lp
  88.   you may have to consult the printer interface file under /usr/spool/lp/interface.
  89. + .PP
  90. + The ``\-C'' option allows you to set the number of copies you want.
  91.   .PP
  92.   .I Psroff
  93.   can be made to generate several different printer output formats.
  94. Index: ./lib/psrofflib.S
  95. *** /tmp/PATCHold/./lib/psrofflib.S    Thu Jun 24 22:48:27 1993
  96. --- ./lib/psrofflib.S    Thu Jun 24 22:48:29 1993
  97. ***************
  98. *** 1,4 ****
  99. ! #    2.29 92/12/02
  100.   #    This file controls psroff, you can insert additional printer
  101.   #    types here.  These are eval'd *late* in processing, so that
  102.   #    you can insert $copies etc.
  103. --- 1,4 ----
  104. ! #    2.31 93/06/24
  105.   #    This file controls psroff, you can insert additional printer
  106.   #    types here.  These are eval'd *late* in processing, so that
  107.   #    you can insert $copies etc.
  108. ***************
  109. *** 12,17 ****
  110. --- 12,33 ----
  111.   #    with an english description of the configuration.  Find the one[s]
  112.   #    closest to what you want, and modify as necessary.
  113.   #
  114. + #    The entries are divided into groups depending on which troff
  115. + #    you have.  If you have CAT troff, use the entries under
  116. + #    "CAT TROFF SECTION", if you have ditroff, use the entries
  117. + #    under "DITROFF SECTION", and if you have GROFF, use the
  118. + #    entries under "GROFF SECTION".
  119. + #
  120. + #    If you have DITROFF or GROFF, but you can't find a entry close
  121. + #    to what you need, consult the CAT TROFF section, and copy/rename
  122. + #    one.  Note that you have to add -N/-G options etc.
  123. + #
  124. + #    Near the end of the CAT TROFF section, there is an example
  125. + #    of using psroff to drive Epson 24 pin printers via hp2pbm and
  126. + #    pbm2e24.  This should be used as a model for generating output
  127. + #    for any printer that can be "reached" via PBM.  Ie: TIFF, GIF,
  128. + #    formats etc.
  129. + #
  130.   #    Syntax:
  131.   #
  132.   # troff=<path to troff>
  133. ***************
  134. *** 123,128 ****
  135. --- 139,146 ----
  136.   #    the width parameter, -N and -W (if present) options must be
  137.   #    on the same line.
  138.   
  139. + #    ********************** CAT TROFF SECTION
  140.   troff=''
  141.   trofftype='-T$width'
  142.   #    Uncomment the following if you're a Sun or Ultrix -F troff.
  143. ***************
  144. *** 169,181 ****
  145.   #    Laserjet III (built-in fonts, using supplied widths, Univers base)
  146.   lj3u    width=lj3u t2arg='-Tlj3 -plj3u -W%%FONTDIR%%/lj3u'
  147.   lj3u    lparg='| lp -d$ptr -og -n$copies' ptr=laser
  148. - #    Ditroff:
  149. - dlj3    width=lj3 t2arg='-Tlj3 -plj3 -N -W%%FONTDIR%%/lj3'
  150. - dlj3    lparg='| lp -d$ptr -og -n$copies' ptr=laser
  151. - #    Ditroff:
  152. - dlj3u    width=lj3u t2arg='-Tlj3 -plj3u -N -W%%FONTDIR%%/lj3u'
  153. - dlj3u    lparg='| lp -d$ptr -og -n$copies' ptr=laser
  154.   
  155.   #    Deskjet: Only difference is troff2ps library inclusions for deskjet.
  156.   #    (dt.lib has a slightly different prolog)
  157. --- 187,192 ----
  158. ***************
  159. *** 187,194 ****
  160.   
  161.   dt    width=ps t2arg='-Tdt -ddjet' lparg="| cat"
  162.   
  163. - #    Ditroff configurations:
  164.   #    Tpscript output (ditroff drivers, PS widths, dt libraries)
  165.   
  166.   tp    width=ps t2arg='-Tdt -R720 -dalw'
  167. --- 198,203 ----
  168. ***************
  169. *** 239,251 ****
  170.   
  171.   troff=otroff
  172.   xp    width=ps t2arg='-Tdt -dpsc' lparg='| xproof'
  173. ! #
  174.   
  175.   troff=''
  176.   trofftype='-T$width'
  177.   
  178.   #    Ditroff input driving postscript
  179. ! dtps    width=alw t2arg='-O0 -Tps -N -W%%FONTDIR%%/ps' ptr='gate!AppleLaser'
  180.   dtps    lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies'
  181.   
  182.   #    Ditroff input driving display postscript (ie: IBM RS/6000)
  183. --- 248,287 ----
  184.   
  185.   troff=otroff
  186.   xp    width=ps t2arg='-Tdt -dpsc' lparg='| xproof'
  187. ! #    Display postscript (the troff assignment probably needs adjustment)
  188. ! #    See MISC file about modifying dpsexec.
  189. ! troff=/usr/local/bin/otroff
  190. ! cdps    v=1 width=ps t2arg='-Tps -S -Z'
  191. ! cdps    lparg="> /tmp/dps$$; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
  192. ! #    Driving a Epson 24 pin printer with hp2pbm/pbm2e24/CAT troff
  193. ! #    The quoting in lparg is very picky.
  194. ! #    Requires that hp2e24 and pbm2e24 are installed in your path.
  195. ! troff=troff
  196. ! trofftype='-T$width'
  197. ! e24    width=lj t2arg='-Tlj -Z -W%%FONTDIR%%/lj'
  198. ! e24    lparg='| hp2e24 -r"| pbm2e24" | lp -d$ptr -og -n$copies' ptr=laser
  199.   
  200. + #    X windows preview - needs hp2pbm/pbm2Xd (both in hp2pbm package)
  201. + #    and xwud (X utility) in your path.
  202. + ljp    width=lj t2arg='-Tlj -Z -W%%FONTDIR%%/lj' lparg='| %%LIBDIR%%/ljprev'
  203.   troff=''
  204.   trofftype='-T$width'
  205.   
  206. + #    ********************** DITROFF SECTION
  207. + #    Ditroff driving HP Laserjet III/IV:
  208. + dlj3    width=lj3 t2arg='-Tlj3 -plj3 -N -W%%FONTDIR%%/lj3 -Z'
  209. + dlj3    lparg='| lp -d$ptr -og -n$copies' ptr=laser
  210. + #    Ditroff driving HP Laserjet III/IV Univers fonts:
  211. + dlj3u    width=lj3u t2arg='-Tlj3 -plj3u -N -W%%FONTDIR%%/lj3u -Z'
  212. + dlj3u    lparg='| lp -d$ptr -og -n$copies' ptr=laser
  213.   #    Ditroff input driving postscript
  214. ! dtps    width=alw t2arg='-O0 -Tps -N -Z -W%%FONTDIR%%/ps' ptr='gate!AppleLaser'
  215.   dtps    lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies'
  216.   
  217.   #    Ditroff input driving display postscript (ie: IBM RS/6000)
  218. ***************
  219. *** 254,265 ****
  220.   #    is in the MISC file.
  221.   dps    width=psc t2arg='-O0 -Tps -N -W%%FONTDIR%%/ps -S -Z'
  222.   dps    lparg='> /tmp/dps$$ ; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
  223.   #    LJ3 widths generating postscript
  224.   dpslj3    width=lj3 t2arg='-O0 -Tps -N -W%%FONTDIR%%/lj3 -S -Z'
  225.   
  226. ! troff=/usr/local/bin/otroff
  227. ! cdps    v=1 width=ps t2arg='-Tps -S -Z'
  228. ! cdps    lparg="> /tmp/dps$$; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
  229.   
  230.   #    Using groff (gtroff actually) and driving LJ3:
  231.   #    "make installwidths" installs the width tables and driver
  232. --- 290,300 ----
  233.   #    is in the MISC file.
  234.   dps    width=psc t2arg='-O0 -Tps -N -W%%FONTDIR%%/ps -S -Z'
  235.   dps    lparg='> /tmp/dps$$ ; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
  236.   #    LJ3 widths generating postscript
  237.   dpslj3    width=lj3 t2arg='-O0 -Tps -N -W%%FONTDIR%%/lj3 -S -Z'
  238.   
  239. ! #    ********************** GROFF SECTION
  240.   
  241.   #    Using groff (gtroff actually) and driving LJ3:
  242.   #    "make installwidths" installs the width tables and driver
  243. ***************
  244. *** 266,286 ****
  245.   #    entries so that groff -T{lj3,lj3u,lj} will work as well as
  246.   #    psroff -Tg{lj3,lj3u,lj}
  247.   #
  248. ! #    Assumes "standard" install location
  249.   troff=/usr/local/bin/gtroff
  250.   trofftype='-T$width'
  251.   glj3    width=lj3 t2arg='-Tlj3 -plj3 -N -Z -O0 -W%%FONTDIR%%/lj3 -G1'
  252.   glj3    lparg='| lp -og -d$ptr -n$copies' ptr=laser
  253.   #    Univers base:
  254.   glj3u    width=lj3u t2arg='-Tlj3 -plj3u -N -Z -O0 -W%%FONTDIR%%/lj3u -G1'
  255.   glj3u    lparg='| lp -og -d$ptr -n$copies' ptr=laser
  256. ! #    Groff driving HP Laserjet PCL4
  257.   glj    width=lj t2arg='-Tlj -N -Z -O0 -W%%FONTDIR%%/lj -G1'
  258.   glj    lparg='| lp -og -d$ptr -n$copies' ptr=laser
  259. ! #
  260. ! #    Driving a Epson 24 pin printer with hp2pbm/pbm2e24/CAT troff
  261. ! #    The quoting in lparg is very picky.
  262. ! #    Requires that hp2e24 and pbm2e24 are installed in your path.
  263. ! troff=troff
  264. ! trofftype='-T$width'
  265. ! e24    width=lj t2arg=-Tlj lparg='| hp2e24 -r"| pbm2e24" | lp -d$ptr -og -n$copies' ptr=laser
  266. --- 301,325 ----
  267.   #    entries so that groff -T{lj3,lj3u,lj} will work as well as
  268.   #    psroff -Tg{lj3,lj3u,lj}
  269.   #
  270. ! #    Assumes "standard" groff install locations
  271.   troff=/usr/local/bin/gtroff
  272.   trofftype='-T$width'
  273. + #    Roman base:
  274.   glj3    width=lj3 t2arg='-Tlj3 -plj3 -N -Z -O0 -W%%FONTDIR%%/lj3 -G1'
  275.   glj3    lparg='| lp -og -d$ptr -n$copies' ptr=laser
  276.   #    Univers base:
  277.   glj3u    width=lj3u t2arg='-Tlj3 -plj3u -N -Z -O0 -W%%FONTDIR%%/lj3u -G1'
  278.   glj3u    lparg='| lp -og -d$ptr -n$copies' ptr=laser
  279. ! #    Groff driving HP Laserjet PCL4 (HPLJ IIs)
  280.   glj    width=lj t2arg='-Tlj -N -Z -O0 -W%%FONTDIR%%/lj -G1'
  281.   glj    lparg='| lp -og -d$ptr -n$copies' ptr=laser
  282. ! #    Groff driving PostScript (this is really only for testing
  283. ! #    purposes.  If you have groff, you have grops, which you should
  284. ! #    use instead.)
  285. ! gps    width=alw t2arg='-Tps -N -Z -O0 -W%%FONTDIR%%/ps -G1'
  286. ! gps    lparg='| lp -d$ptr -n$copies' ptr=laser
  287. Index: ./widths/installdit.S
  288. *** /tmp/PATCHold/./widths/installdit.S    Thu Jun 24 22:48:42 1993
  289. --- ./widths/installdit.S    Thu Jun 24 22:48:43 1993
  290. ***************
  291. *** 5,11 ****
  292.   #    See the LICENSE file for a full description of the restrictions
  293.   #    under which this software is provided.
  294.   #
  295. ! #1.10 92/11/26
  296.   MAKEDEV=%%MAKEDEV%%
  297.   LIBDIR=%%LIBDIR%%
  298.   if [ "$1" = "-i" ]
  299. --- 5,11 ----
  300.   #    See the LICENSE file for a full description of the restrictions
  301.   #    under which this software is provided.
  302.   #
  303. ! #1.11 93/03/14
  304.   MAKEDEV=%%MAKEDEV%%
  305.   LIBDIR=%%LIBDIR%%
  306.   if [ "$1" = "-i" ]
  307. ***************
  308. *** 123,129 ****
  309.           chmod 644 $destdir/DESC
  310.           echo "   installing groff postprocessor in $LIBDIR"
  311.           rm -f $groffpostpro
  312. !         echo "$LIBDIR/troff2ps $t2arg" > $groffpostpro
  313.           chmod 755 $groffpostpro
  314.           fi
  315.       fi
  316. --- 123,129 ----
  317.           chmod 644 $destdir/DESC
  318.           echo "   installing groff postprocessor in $LIBDIR"
  319.           rm -f $groffpostpro
  320. !         echo "$LIBDIR/troff2ps $t2arg \$@" > $groffpostpro
  321.           chmod 755 $groffpostpro
  322.           fi
  323.       fi
  324. Index: ./utils/ljprev.S
  325. *** /tmp/PATCHold/./utils/ljprev.S    Thu Jun 24 22:48:51 1993
  326. --- ./utils/ljprev.S    Thu Jun 24 22:48:53 1993
  327. ***************
  328. *** 0 ****
  329. --- 1,27 ----
  330. + %%STARTSHELL%%
  331. + #    Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991 Chris Lewis
  332. + #        All Rights Reserved
  333. + #
  334. + #    See the LICENSE file for a full description of the restrictions
  335. + #    under which this software is provided.
  336. + #
  337. + #    Function: laserjet to X previewer - just run HPLJ PCL4 into
  338. + #    standard input.  Needs hp2pbm, pbm2Xd and xwud in your path.
  339. + #@(#)ljprev 1.1 93/06/24
  340. + if [ -n "$1" ]
  341. + then
  342. +         file=$1
  343. + else
  344. +         cat - > /tmp/$$
  345. +         file=/tmp/$$
  346. +         delete=$file
  347. + fi
  348. + hp2pbm -r/tmp/$$ -d100 < $file
  349. + for i in /tmp/$$.[0-9]*
  350. + do
  351. +     pbm2Xd < $i > /tmp/$$.R
  352. +     rm $i
  353. +     xwud -in /tmp/$$.R
  354. + done
  355. + rm /tmp/$$.* $delete
  356. Index: ./defs.h
  357. *** /tmp/PATCHold/./defs.h    Thu Jun 24 22:49:02 1993
  358. --- ./defs.h    Thu Jun 24 22:49:04 1993
  359. ***************
  360. *** 9,15 ****
  361.    */
  362.   
  363.   /*    Official Release and Patch level:    */
  364. ! #define    T2VERSION    "@(#)PSROFF Copyright 93/02/21 Chris Lewis - R3 PL16"
  365.   
  366.   /*    Configuration parameters:
  367.    */
  368. --- 9,15 ----
  369.    */
  370.   
  371.   /*    Official Release and Patch level:    */
  372. ! #define    T2VERSION    "@(#)PSROFF Copyright 93/06/18 Chris Lewis - R3 PL17"
  373.   
  374.   /*    Configuration parameters:
  375.    */
  376. Index: ./psroff.S
  377. *** /tmp/PATCHold/./psroff.S    Thu Jun 24 22:49:34 1993
  378. --- ./psroff.S    Thu Jun 24 22:49:35 1993
  379. ***************
  380. *** 7,13 ****
  381.   #
  382.   #    Specs:        troff2ps driver
  383.   #
  384. ! #ident  "@(#)psroff.sh: 2.29 Copyright 93/03/08 19:42:10 Chris Lewis"
  385.   
  386.   LIBDIR="%%LIBDIR%%"
  387.   FONTDIR="%%FONTDIR%%"
  388. --- 7,13 ----
  389.   #
  390.   #    Specs:        troff2ps driver
  391.   #
  392. ! #ident  "@(#)psroff.sh: 2.30 Copyright 93/04/19 08:55:29 Chris Lewis"
  393.   
  394.   LIBDIR="%%LIBDIR%%"
  395.   FONTDIR="%%FONTDIR%%"
  396. ***************
  397. *** 53,59 ****
  398.       -d*)
  399.           sptr=`echo $i | sed -e 's/-d//'`
  400.           ;;
  401. !     -n*)
  402.           copies=`echo $i | sed -e 's/-n//'`
  403.           ;;
  404.       -D* | -M | -R* | -O* | -P* | -Z | -Y* )
  405. --- 53,59 ----
  406.       -d*)
  407.           sptr=`echo $i | sed -e 's/-d//'`
  408.           ;;
  409. !     -C*)
  410.           copies=`echo $i | sed -e 's/-n//'`
  411.           ;;
  412.       -D* | -M | -R* | -O* | -P* | -Z | -Y* )
  413. Index: ./ljdraw.c
  414. *** /tmp/PATCHold/./ljdraw.c    Thu Jun 24 22:49:45 1993
  415. --- ./ljdraw.c    Thu Jun 24 22:49:47 1993
  416. ***************
  417. *** 32,38 ****
  418.   
  419.   #ifndef    lint
  420.   static char SCCSid[] =
  421. !     "@(#)ljdraw.c: 1.7 Copyright 93/01/17 22:36:34 Chris Lewis";
  422.   #endif
  423.   
  424.   static int ljLine(), ljPos(), lineseg();
  425. --- 32,38 ----
  426.   
  427.   #ifndef    lint
  428.   static char SCCSid[] =
  429. !     "@(#)ljdraw.c: 1.10 Copyright 93/06/24 22:26:51 Chris Lewis";
  430.   #endif
  431.   
  432.   static int ljLine(), ljPos(), lineseg();
  433. ***************
  434. *** 99,105 ****
  435.           ctindex = 1;
  436.           if (!require(1, ctindex, "set thick", saves)) {
  437.           curthick = numbers[0] / 2;
  438. !         if (curthick < 1)
  439.               curthick = 1;
  440.           DBP((D_PIC, "THICK: %d\n", curthick));
  441.           }
  442. --- 99,105 ----
  443.           ctindex = 1;
  444.           if (!require(1, ctindex, "set thick", saves)) {
  445.           curthick = numbers[0] / 2;
  446. !         if (curthick < 0)
  447.               curthick = 1;
  448.           DBP((D_PIC, "THICK: %d\n", curthick));
  449.           }
  450. ***************
  451. *** 180,185 ****
  452. --- 180,186 ----
  453.   int curx, cury, ctindex;
  454.   short *numbers; {
  455.       int i;
  456. +     int origx = curx, origy = cury;
  457.   
  458.       DBP((D_PIC, "ljPoly\n"));
  459.   
  460. ***************
  461. *** 188,193 ****
  462. --- 189,196 ----
  463.       curx += numbers[i];
  464.       cury += numbers[i+1];
  465.       }
  466. +     if (origx != curx || origy != cury)
  467. +     ljLine(curx, cury, origx, origy);
  468.   
  469.   }
  470.   
  471. ***************
  472. *** 288,300 ****
  473.       ljCircle (x1, y0, curthick, drawDot, 0);
  474.   }
  475.   
  476.   static
  477.   ljLine(x0, y0, x1, y1)
  478.   register int x0, y0, x1, y1; {
  479. !     DBP((D_PIC, "ljLine: (%d,%d)..(%d,%d), curthick: %d\n", x0, y0, x1, y1, curthick));
  480. !     if (y0 == y1)
  481.       ljHorLine(x0, y0, x1);
  482. !     else if (x0 == x1)
  483.       ljVerLine(x0, y0, y1);
  484.       else
  485.       ljHLine(x0, y0, x1, y1);
  486. --- 291,313 ----
  487.       ljCircle (x1, y0, curthick, drawDot, 0);
  488.   }
  489.   
  490. + /*    if the X or Y delta of the line is less
  491. +     than JAGGYFUDGE (300ths), draw true horizontal
  492. +     or vertical lines.  This is both a space saver,
  493. +     and a eyesweetness improvement on almost vertical
  494. +     or horizontal lines.  Any larger than 1, you'll
  495. +     start seeing gouges in curves.
  496. +  */
  497. + #define JAGGYFUDGE    1
  498.   static
  499.   ljLine(x0, y0, x1, y1)
  500.   register int x0, y0, x1, y1; {
  501. !     DBP((D_PIC, "ljLine: (%d,%d)..(%d,%d), curthick: %d\n",
  502. !     x0, y0, x1, y1, curthick));
  503. !     if (y0 >= y1 - JAGGYFUDGE && y0 <= y1 + JAGGYFUDGE)
  504.       ljHorLine(x0, y0, x1);
  505. !     else if (x0 >= x1 - JAGGYFUDGE && x0 <= x1 + JAGGYFUDGE)
  506.       ljVerLine(x0, y0, y1);
  507.       else
  508.       ljHLine(x0, y0, x1, y1);
  509. ***************
  510. *** 781,786 ****
  511. --- 794,801 ----
  512.   
  513.   setbit(x, y)
  514.   register int x, y; {
  515. +     if (y < 0 || y >= numy || x < 0 || x >= numx)
  516. +     return;
  517.       if (!ljraster[y])
  518.       return;
  519.       ljraster[y][x >> 3] |= (0x80 >> (x & 0x7));
  520. ***************
  521. *** 788,793 ****
  522. --- 803,810 ----
  523.   
  524.   clearbit(x, y)
  525.   register int x, y; {
  526. +     if (y < 0 || y >= numy || x < 0 || x >= numx)
  527. +     return;
  528.       if (!ljraster[y])
  529.       return;
  530.       ljraster[y][x >> 3] &= ~(0x80 >> (x & 0x7));
  531. Index: ./lj3draw.c
  532. *** /tmp/PATCHold/./lj3draw.c    Thu Jun 24 22:50:00 1993
  533. --- ./lj3draw.c    Thu Jun 24 22:50:01 1993
  534. ***************
  535. *** 29,35 ****
  536.   
  537.   #ifndef    lint
  538.   static char SCCSid[] =
  539. !     "@(#)lj3draw.c: 1.5 Copyright 92/12/22 02:16:58 Chris Lewis";
  540.   #endif
  541.   
  542.   #define to_deg(a)    ((180.0/M_PI) * (a))
  543. --- 29,35 ----
  544.   
  545.   #ifndef    lint
  546.   static char SCCSid[] =
  547. !     "@(#)lj3draw.c: 1.6 Copyright 93/06/18 21:56:10 Chris Lewis";
  548.   #endif
  549.   
  550.   #define to_deg(a)    ((180.0/M_PI) * (a))
  551. ***************
  552. *** 99,112 ****
  553.           if (!require(1, ctindex, "set fill", s)) {
  554.               DBP((D_PIC, "lj3Draw: fill: %d\n", numbers[0]));
  555.   
  556. !         if ((numbers[0] < 0) || (numbers[0] > 1000))
  557. !             fprintf(stderr, "%s: fill %d out of range [0,1000]\n",
  558. !             numbers[0]);
  559. !         else {
  560. !             ENTER_HPGL2;
  561. !                 printf("FT10,%d;",(100-(numbers[0]/10)));
  562. !             EXIT_HPGL2;
  563. !         }
  564.           }
  565.           return;
  566.       case 't':
  567. --- 99,115 ----
  568.           if (!require(1, ctindex, "set fill", s)) {
  569.               DBP((D_PIC, "lj3Draw: fill: %d\n", numbers[0]));
  570.   
  571. !                 if ((numbers[0] < 0) || (numbers[0] > 1000)) {
  572. !                     fprintf(stderr, "%s: fill %d out of range [0,1000]\n",
  573. !                         progname, numbers[0]);
  574. !                     if (numbers[0] < 0)
  575. !                         numbers[0] = 0;
  576. !                     else
  577. !                         numbers[0] = 1000;
  578. !                 }
  579. !                 ENTER_HPGL2;
  580. !                 printf("FT10,%d;",(100-(numbers[0]/10)));
  581. !                 EXIT_HPGL2;
  582.           }
  583.           return;
  584.       case 't':
  585. ***************
  586. *** 113,119 ****
  587.           if (ctindex == 2)
  588.           ctindex = 1;
  589.           if (!require(1, ctindex, "set thick", s)) {
  590. !             DBP((D_PIC, "lj3Draw: thich: %d\n", numbers[0]));
  591.           ENTER_HPGL2;
  592.           /* width 1 = 1mm */
  593.               printf("\033%%1BPW%.2f;\033%%0A\n", 
  594. --- 116,123 ----
  595.           if (ctindex == 2)
  596.           ctindex = 1;
  597.           if (!require(1, ctindex, "set thick", s)) {
  598. !         if (numbers[0] < 0) numbers[0] = 1;
  599. !             DBP((D_PIC, "lj3Draw: thick: %d\n", numbers[0]));
  600.           ENTER_HPGL2;
  601.           /* width 1 = 1mm */
  602.               printf("\033%%1BPW%.2f;\033%%0A\n", 
  603.