home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume27
/
psroff-3.0
/
patch17
next >
Wrap
Text File
|
1994-03-29
|
19KB
|
620 lines
Newsgroups: comp.sources.unix
From: clewis@ferret.ocunix.on.ca (Chris Lewis)
Subject: v27i210: psroff 3.0, Patch17
Sender: unix-sources-moderator@gw.home.vix.com
Approved: vixie@gw.home.vix.com
Submitted-By: clewis@ferret.ocunix.on.ca (Chris Lewis)
Posting-Number: Volume 27, Issue 210
Archive-Name: psroff-3.0/patch17
This is official patch 17 for Psroff 3.0.
Please apply it by:
cd <psroff source directory>
patch -N -p < <this file>
The base release of psroff3.0 was in comp.sources.unix volume 24.
Patches 1 through ../t2r2/Patch.16 are in volume 24 and subsequent
issues.
A set of shars containing psroff patched to patch level 17
can be retrieved by anonymous FTP from ftp.uunet.ca under
distrib/chris_lewis/psroff3.0pl17.
Hp2pbm and its patches can also be retrieved from ftp.uunet.ca under
distrib/chris_lewis/hp2pbm.
A bug fix release. No new features, except for "ljprev" - if you
have X windows, you can preview HP Laserjet II output. Note that
you also need hp2pbm patch level 3. Note new "ljp" entry in
psrofflib.S to use this functionality.
Summary of changes:
- psroff -n (copies) option changed to -C to avoid groff
argument clash.
- psrofflib.S greatly rearranged to aid configuration.
This will probably cause many rejects if you've previously
configured psrofflib. Ignore them, though you may want
to consider ensuring that you have the optimizer (-Z)
on in the entries you're using.
- lj3draw.c would core dump on out of range fill arguments.
- ljdraw.c would core dump on out of range raster bit diddling.
Lines out of vertical or horizontal by one pixel (usually
round off during a polygon) snapped to vertical or
horizontal.
- fix to installdit to make groff postprocessors work.
./man/psroff.1.S
./lib/psrofflib.S
./widths/installdit.S
./utils/ljprev.S
./defs.h
./psroff.S
./ljdraw.c
./lj3draw.c
Patchwrapped: 930624225013
Index: ./man/psroff.1.S
*** /tmp/PATCHold/./man/psroff.1.S Thu Jun 24 22:48:13 1993
--- ./man/psroff.1.S Thu Jun 24 22:48:15 1993
***************
*** 1,4 ****
! .\"Copyright 1988 by Chris Lewis 2.11 93/01/10
.TH PSROFF %%MANEXT%% "Psroff %%T2VERSION%%"
.SH NAME
psroff,ljroff,xxroff,catconv \- troff to PostScript or other printers
--- 1,4 ----
! .\"Copyright 1988 by Chris Lewis 2.12 93/04/19
.TH PSROFF %%MANEXT%% "Psroff %%T2VERSION%%"
.SH NAME
psroff,ljroff,xxroff,catconv \- troff to PostScript or other printers
***************
*** 5,10 ****
--- 5,11 ----
.SH SYNOPSIS
.IB xx roff
.BI "[\-T" xx "]"
+ .BI "[\-C" nn "]"
.BI "[\-d" ptr "]"
.BI "[\-rL" length "]"
.BI "[\-P" prologs "]"
***************
*** 157,162 ****
--- 158,165 ----
With
.B lp
you may have to consult the printer interface file under /usr/spool/lp/interface.
+ .PP
+ The ``\-C'' option allows you to set the number of copies you want.
.PP
.I Psroff
can be made to generate several different printer output formats.
Index: ./lib/psrofflib.S
*** /tmp/PATCHold/./lib/psrofflib.S Thu Jun 24 22:48:27 1993
--- ./lib/psrofflib.S Thu Jun 24 22:48:29 1993
***************
*** 1,4 ****
! # 2.29 92/12/02
# This file controls psroff, you can insert additional printer
# types here. These are eval'd *late* in processing, so that
# you can insert $copies etc.
--- 1,4 ----
! # 2.31 93/06/24
# This file controls psroff, you can insert additional printer
# types here. These are eval'd *late* in processing, so that
# you can insert $copies etc.
***************
*** 12,17 ****
--- 12,33 ----
# with an english description of the configuration. Find the one[s]
# closest to what you want, and modify as necessary.
#
+ # The entries are divided into groups depending on which troff
+ # you have. If you have CAT troff, use the entries under
+ # "CAT TROFF SECTION", if you have ditroff, use the entries
+ # under "DITROFF SECTION", and if you have GROFF, use the
+ # entries under "GROFF SECTION".
+ #
+ # If you have DITROFF or GROFF, but you can't find a entry close
+ # to what you need, consult the CAT TROFF section, and copy/rename
+ # one. Note that you have to add -N/-G options etc.
+ #
+ # Near the end of the CAT TROFF section, there is an example
+ # of using psroff to drive Epson 24 pin printers via hp2pbm and
+ # pbm2e24. This should be used as a model for generating output
+ # for any printer that can be "reached" via PBM. Ie: TIFF, GIF,
+ # formats etc.
+ #
# Syntax:
#
# troff=<path to troff>
***************
*** 123,128 ****
--- 139,146 ----
# the width parameter, -N and -W (if present) options must be
# on the same line.
+ # ********************** CAT TROFF SECTION
+
troff=''
trofftype='-T$width'
# Uncomment the following if you're a Sun or Ultrix -F troff.
***************
*** 169,181 ****
# Laserjet III (built-in fonts, using supplied widths, Univers base)
lj3u width=lj3u t2arg='-Tlj3 -plj3u -W%%FONTDIR%%/lj3u'
lj3u lparg='| lp -d$ptr -og -n$copies' ptr=laser
- # Ditroff:
- dlj3 width=lj3 t2arg='-Tlj3 -plj3 -N -W%%FONTDIR%%/lj3'
- dlj3 lparg='| lp -d$ptr -og -n$copies' ptr=laser
- # Ditroff:
- dlj3u width=lj3u t2arg='-Tlj3 -plj3u -N -W%%FONTDIR%%/lj3u'
- dlj3u lparg='| lp -d$ptr -og -n$copies' ptr=laser
-
# Deskjet: Only difference is troff2ps library inclusions for deskjet.
# (dt.lib has a slightly different prolog)
--- 187,192 ----
***************
*** 187,194 ****
dt width=ps t2arg='-Tdt -ddjet' lparg="| cat"
- # Ditroff configurations:
-
# Tpscript output (ditroff drivers, PS widths, dt libraries)
tp width=ps t2arg='-Tdt -R720 -dalw'
--- 198,203 ----
***************
*** 239,251 ****
troff=otroff
xp width=ps t2arg='-Tdt -dpsc' lparg='| xproof'
! #
troff=''
trofftype='-T$width'
# Ditroff input driving postscript
! dtps width=alw t2arg='-O0 -Tps -N -W%%FONTDIR%%/ps' ptr='gate!AppleLaser'
dtps lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies'
# Ditroff input driving display postscript (ie: IBM RS/6000)
--- 248,287 ----
troff=otroff
xp width=ps t2arg='-Tdt -dpsc' lparg='| xproof'
!
! # Display postscript (the troff assignment probably needs adjustment)
! # See MISC file about modifying dpsexec.
! troff=/usr/local/bin/otroff
! cdps v=1 width=ps t2arg='-Tps -S -Z'
! cdps lparg="> /tmp/dps$$; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
!
! # Driving a Epson 24 pin printer with hp2pbm/pbm2e24/CAT troff
! # The quoting in lparg is very picky.
! # Requires that hp2e24 and pbm2e24 are installed in your path.
! troff=troff
! trofftype='-T$width'
! e24 width=lj t2arg='-Tlj -Z -W%%FONTDIR%%/lj'
! e24 lparg='| hp2e24 -r"| pbm2e24" | lp -d$ptr -og -n$copies' ptr=laser
+ # X windows preview - needs hp2pbm/pbm2Xd (both in hp2pbm package)
+ # and xwud (X utility) in your path.
+ ljp width=lj t2arg='-Tlj -Z -W%%FONTDIR%%/lj' lparg='| %%LIBDIR%%/ljprev'
+
troff=''
trofftype='-T$width'
+ # ********************** DITROFF SECTION
+
+ # Ditroff driving HP Laserjet III/IV:
+ dlj3 width=lj3 t2arg='-Tlj3 -plj3 -N -W%%FONTDIR%%/lj3 -Z'
+ dlj3 lparg='| lp -d$ptr -og -n$copies' ptr=laser
+
+ # Ditroff driving HP Laserjet III/IV Univers fonts:
+ dlj3u width=lj3u t2arg='-Tlj3 -plj3u -N -W%%FONTDIR%%/lj3u -Z'
+ dlj3u lparg='| lp -d$ptr -og -n$copies' ptr=laser
+
# Ditroff input driving postscript
! dtps width=alw t2arg='-O0 -Tps -N -Z -W%%FONTDIR%%/ps' ptr='gate!AppleLaser'
dtps lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies'
# Ditroff input driving display postscript (ie: IBM RS/6000)
***************
*** 254,265 ****
# is in the MISC file.
dps width=psc t2arg='-O0 -Tps -N -W%%FONTDIR%%/ps -S -Z'
dps lparg='> /tmp/dps$$ ; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
# LJ3 widths generating postscript
dpslj3 width=lj3 t2arg='-O0 -Tps -N -W%%FONTDIR%%/lj3 -S -Z'
! troff=/usr/local/bin/otroff
! cdps v=1 width=ps t2arg='-Tps -S -Z'
! cdps lparg="> /tmp/dps$$; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
# Using groff (gtroff actually) and driving LJ3:
# "make installwidths" installs the width tables and driver
--- 290,300 ----
# is in the MISC file.
dps width=psc t2arg='-O0 -Tps -N -W%%FONTDIR%%/ps -S -Z'
dps lparg='> /tmp/dps$$ ; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
+
# LJ3 widths generating postscript
dpslj3 width=lj3 t2arg='-O0 -Tps -N -W%%FONTDIR%%/lj3 -S -Z'
! # ********************** GROFF SECTION
# Using groff (gtroff actually) and driving LJ3:
# "make installwidths" installs the width tables and driver
***************
*** 266,286 ****
# entries so that groff -T{lj3,lj3u,lj} will work as well as
# psroff -Tg{lj3,lj3u,lj}
#
! # Assumes "standard" install location
troff=/usr/local/bin/gtroff
trofftype='-T$width'
glj3 width=lj3 t2arg='-Tlj3 -plj3 -N -Z -O0 -W%%FONTDIR%%/lj3 -G1'
glj3 lparg='| lp -og -d$ptr -n$copies' ptr=laser
# Univers base:
glj3u width=lj3u t2arg='-Tlj3 -plj3u -N -Z -O0 -W%%FONTDIR%%/lj3u -G1'
glj3u lparg='| lp -og -d$ptr -n$copies' ptr=laser
! # Groff driving HP Laserjet PCL4
glj width=lj t2arg='-Tlj -N -Z -O0 -W%%FONTDIR%%/lj -G1'
glj lparg='| lp -og -d$ptr -n$copies' ptr=laser
! #
! # Driving a Epson 24 pin printer with hp2pbm/pbm2e24/CAT troff
! # The quoting in lparg is very picky.
! # Requires that hp2e24 and pbm2e24 are installed in your path.
! troff=troff
! trofftype='-T$width'
! e24 width=lj t2arg=-Tlj lparg='| hp2e24 -r"| pbm2e24" | lp -d$ptr -og -n$copies' ptr=laser
--- 301,325 ----
# entries so that groff -T{lj3,lj3u,lj} will work as well as
# psroff -Tg{lj3,lj3u,lj}
#
! # Assumes "standard" groff install locations
troff=/usr/local/bin/gtroff
trofftype='-T$width'
+
+ # Roman base:
glj3 width=lj3 t2arg='-Tlj3 -plj3 -N -Z -O0 -W%%FONTDIR%%/lj3 -G1'
glj3 lparg='| lp -og -d$ptr -n$copies' ptr=laser
+
# Univers base:
glj3u width=lj3u t2arg='-Tlj3 -plj3u -N -Z -O0 -W%%FONTDIR%%/lj3u -G1'
glj3u lparg='| lp -og -d$ptr -n$copies' ptr=laser
!
! # Groff driving HP Laserjet PCL4 (HPLJ IIs)
glj width=lj t2arg='-Tlj -N -Z -O0 -W%%FONTDIR%%/lj -G1'
glj lparg='| lp -og -d$ptr -n$copies' ptr=laser
!
! # Groff driving PostScript (this is really only for testing
! # purposes. If you have groff, you have grops, which you should
! # use instead.)
! gps width=alw t2arg='-Tps -N -Z -O0 -W%%FONTDIR%%/ps -G1'
! gps lparg='| lp -d$ptr -n$copies' ptr=laser
!
Index: ./widths/installdit.S
*** /tmp/PATCHold/./widths/installdit.S Thu Jun 24 22:48:42 1993
--- ./widths/installdit.S Thu Jun 24 22:48:43 1993
***************
*** 5,11 ****
# See the LICENSE file for a full description of the restrictions
# under which this software is provided.
#
! #1.10 92/11/26
MAKEDEV=%%MAKEDEV%%
LIBDIR=%%LIBDIR%%
if [ "$1" = "-i" ]
--- 5,11 ----
# See the LICENSE file for a full description of the restrictions
# under which this software is provided.
#
! #1.11 93/03/14
MAKEDEV=%%MAKEDEV%%
LIBDIR=%%LIBDIR%%
if [ "$1" = "-i" ]
***************
*** 123,129 ****
chmod 644 $destdir/DESC
echo " installing groff postprocessor in $LIBDIR"
rm -f $groffpostpro
! echo "$LIBDIR/troff2ps $t2arg" > $groffpostpro
chmod 755 $groffpostpro
fi
fi
--- 123,129 ----
chmod 644 $destdir/DESC
echo " installing groff postprocessor in $LIBDIR"
rm -f $groffpostpro
! echo "$LIBDIR/troff2ps $t2arg \$@" > $groffpostpro
chmod 755 $groffpostpro
fi
fi
Index: ./utils/ljprev.S
*** /tmp/PATCHold/./utils/ljprev.S Thu Jun 24 22:48:51 1993
--- ./utils/ljprev.S Thu Jun 24 22:48:53 1993
***************
*** 0 ****
--- 1,27 ----
+ %%STARTSHELL%%
+ # Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991 Chris Lewis
+ # All Rights Reserved
+ #
+ # See the LICENSE file for a full description of the restrictions
+ # under which this software is provided.
+ #
+ # Function: laserjet to X previewer - just run HPLJ PCL4 into
+ # standard input. Needs hp2pbm, pbm2Xd and xwud in your path.
+ #@(#)ljprev 1.1 93/06/24
+ if [ -n "$1" ]
+ then
+ file=$1
+ else
+ cat - > /tmp/$$
+ file=/tmp/$$
+ delete=$file
+ fi
+ hp2pbm -r/tmp/$$ -d100 < $file
+ for i in /tmp/$$.[0-9]*
+ do
+ pbm2Xd < $i > /tmp/$$.R
+ rm $i
+ xwud -in /tmp/$$.R
+ done
+ rm /tmp/$$.* $delete
+
Index: ./defs.h
*** /tmp/PATCHold/./defs.h Thu Jun 24 22:49:02 1993
--- ./defs.h Thu Jun 24 22:49:04 1993
***************
*** 9,15 ****
*/
/* Official Release and Patch level: */
! #define T2VERSION "@(#)PSROFF Copyright 93/02/21 Chris Lewis - R3 PL16"
/* Configuration parameters:
*/
--- 9,15 ----
*/
/* Official Release and Patch level: */
! #define T2VERSION "@(#)PSROFF Copyright 93/06/18 Chris Lewis - R3 PL17"
/* Configuration parameters:
*/
Index: ./psroff.S
*** /tmp/PATCHold/./psroff.S Thu Jun 24 22:49:34 1993
--- ./psroff.S Thu Jun 24 22:49:35 1993
***************
*** 7,13 ****
#
# Specs: troff2ps driver
#
! #ident "@(#)psroff.sh: 2.29 Copyright 93/03/08 19:42:10 Chris Lewis"
LIBDIR="%%LIBDIR%%"
FONTDIR="%%FONTDIR%%"
--- 7,13 ----
#
# Specs: troff2ps driver
#
! #ident "@(#)psroff.sh: 2.30 Copyright 93/04/19 08:55:29 Chris Lewis"
LIBDIR="%%LIBDIR%%"
FONTDIR="%%FONTDIR%%"
***************
*** 53,59 ****
-d*)
sptr=`echo $i | sed -e 's/-d//'`
;;
! -n*)
copies=`echo $i | sed -e 's/-n//'`
;;
-D* | -M | -R* | -O* | -P* | -Z | -Y* )
--- 53,59 ----
-d*)
sptr=`echo $i | sed -e 's/-d//'`
;;
! -C*)
copies=`echo $i | sed -e 's/-n//'`
;;
-D* | -M | -R* | -O* | -P* | -Z | -Y* )
Index: ./ljdraw.c
*** /tmp/PATCHold/./ljdraw.c Thu Jun 24 22:49:45 1993
--- ./ljdraw.c Thu Jun 24 22:49:47 1993
***************
*** 32,38 ****
#ifndef lint
static char SCCSid[] =
! "@(#)ljdraw.c: 1.7 Copyright 93/01/17 22:36:34 Chris Lewis";
#endif
static int ljLine(), ljPos(), lineseg();
--- 32,38 ----
#ifndef lint
static char SCCSid[] =
! "@(#)ljdraw.c: 1.10 Copyright 93/06/24 22:26:51 Chris Lewis";
#endif
static int ljLine(), ljPos(), lineseg();
***************
*** 99,105 ****
ctindex = 1;
if (!require(1, ctindex, "set thick", saves)) {
curthick = numbers[0] / 2;
! if (curthick < 1)
curthick = 1;
DBP((D_PIC, "THICK: %d\n", curthick));
}
--- 99,105 ----
ctindex = 1;
if (!require(1, ctindex, "set thick", saves)) {
curthick = numbers[0] / 2;
! if (curthick < 0)
curthick = 1;
DBP((D_PIC, "THICK: %d\n", curthick));
}
***************
*** 180,185 ****
--- 180,186 ----
int curx, cury, ctindex;
short *numbers; {
int i;
+ int origx = curx, origy = cury;
DBP((D_PIC, "ljPoly\n"));
***************
*** 188,193 ****
--- 189,196 ----
curx += numbers[i];
cury += numbers[i+1];
}
+ if (origx != curx || origy != cury)
+ ljLine(curx, cury, origx, origy);
}
***************
*** 288,300 ****
ljCircle (x1, y0, curthick, drawDot, 0);
}
static
ljLine(x0, y0, x1, y1)
register int x0, y0, x1, y1; {
! DBP((D_PIC, "ljLine: (%d,%d)..(%d,%d), curthick: %d\n", x0, y0, x1, y1, curthick));
! if (y0 == y1)
ljHorLine(x0, y0, x1);
! else if (x0 == x1)
ljVerLine(x0, y0, y1);
else
ljHLine(x0, y0, x1, y1);
--- 291,313 ----
ljCircle (x1, y0, curthick, drawDot, 0);
}
+ /* if the X or Y delta of the line is less
+ than JAGGYFUDGE (300ths), draw true horizontal
+ or vertical lines. This is both a space saver,
+ and a eyesweetness improvement on almost vertical
+ or horizontal lines. Any larger than 1, you'll
+ start seeing gouges in curves.
+ */
+ #define JAGGYFUDGE 1
+
static
ljLine(x0, y0, x1, y1)
register int x0, y0, x1, y1; {
! DBP((D_PIC, "ljLine: (%d,%d)..(%d,%d), curthick: %d\n",
! x0, y0, x1, y1, curthick));
! if (y0 >= y1 - JAGGYFUDGE && y0 <= y1 + JAGGYFUDGE)
ljHorLine(x0, y0, x1);
! else if (x0 >= x1 - JAGGYFUDGE && x0 <= x1 + JAGGYFUDGE)
ljVerLine(x0, y0, y1);
else
ljHLine(x0, y0, x1, y1);
***************
*** 781,786 ****
--- 794,801 ----
setbit(x, y)
register int x, y; {
+ if (y < 0 || y >= numy || x < 0 || x >= numx)
+ return;
if (!ljraster[y])
return;
ljraster[y][x >> 3] |= (0x80 >> (x & 0x7));
***************
*** 788,793 ****
--- 803,810 ----
clearbit(x, y)
register int x, y; {
+ if (y < 0 || y >= numy || x < 0 || x >= numx)
+ return;
if (!ljraster[y])
return;
ljraster[y][x >> 3] &= ~(0x80 >> (x & 0x7));
Index: ./lj3draw.c
*** /tmp/PATCHold/./lj3draw.c Thu Jun 24 22:50:00 1993
--- ./lj3draw.c Thu Jun 24 22:50:01 1993
***************
*** 29,35 ****
#ifndef lint
static char SCCSid[] =
! "@(#)lj3draw.c: 1.5 Copyright 92/12/22 02:16:58 Chris Lewis";
#endif
#define to_deg(a) ((180.0/M_PI) * (a))
--- 29,35 ----
#ifndef lint
static char SCCSid[] =
! "@(#)lj3draw.c: 1.6 Copyright 93/06/18 21:56:10 Chris Lewis";
#endif
#define to_deg(a) ((180.0/M_PI) * (a))
***************
*** 99,112 ****
if (!require(1, ctindex, "set fill", s)) {
DBP((D_PIC, "lj3Draw: fill: %d\n", numbers[0]));
! if ((numbers[0] < 0) || (numbers[0] > 1000))
! fprintf(stderr, "%s: fill %d out of range [0,1000]\n",
! numbers[0]);
! else {
! ENTER_HPGL2;
! printf("FT10,%d;",(100-(numbers[0]/10)));
! EXIT_HPGL2;
! }
}
return;
case 't':
--- 99,115 ----
if (!require(1, ctindex, "set fill", s)) {
DBP((D_PIC, "lj3Draw: fill: %d\n", numbers[0]));
! if ((numbers[0] < 0) || (numbers[0] > 1000)) {
! fprintf(stderr, "%s: fill %d out of range [0,1000]\n",
! progname, numbers[0]);
! if (numbers[0] < 0)
! numbers[0] = 0;
! else
! numbers[0] = 1000;
! }
! ENTER_HPGL2;
! printf("FT10,%d;",(100-(numbers[0]/10)));
! EXIT_HPGL2;
}
return;
case 't':
***************
*** 113,119 ****
if (ctindex == 2)
ctindex = 1;
if (!require(1, ctindex, "set thick", s)) {
! DBP((D_PIC, "lj3Draw: thich: %d\n", numbers[0]));
ENTER_HPGL2;
/* width 1 = 1mm */
printf("\033%%1BPW%.2f;\033%%0A\n",
--- 116,123 ----
if (ctindex == 2)
ctindex = 1;
if (!require(1, ctindex, "set thick", s)) {
! if (numbers[0] < 0) numbers[0] = 1;
! DBP((D_PIC, "lj3Draw: thick: %d\n", numbers[0]));
ENTER_HPGL2;
/* width 1 = 1mm */
printf("\033%%1BPW%.2f;\033%%0A\n",