Official Patch 7 for psroff. Phew....
Chris Lewis
clewis at eci386.uucp
Sat Jan 13 09:42:36 AEST 1990
This is officially patch 7 for psroff.
I made a rather silly botch in patch 6 (diddling with the offset code),
and decided to undo the diddling ASAP. Further, to reward you
for your indulgence, this now supports SFP downloading to HP laserjets,
and ditroff piping to jetroff. Code is in place to do TeX PK font
downloading to HP laserjets, but there is a small piece of code missing from
the distribution (utility pktype, which converts PK's to SFP's), which I
will ship with patch 8.
Aside from pktype, patch 8 will *only* be bug fixes.
Patch 07 for psroff, please install it.
To install the patch, please:
cd to your psroff source directory
restore the original defs.h and Makefile
unshar this patch
patch -p < Patch07
Please read README for patch 07 and see if any of the
the changes affect your installation.
Reconfigure the new defs.h and Makefile to match your system
make
su root
make install
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 1 (of 1)."
# Contents: ./Intro.07 ./Patch07
# Wrapped by clewis at eci386 on Fri Jan 12 17:35:54 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f './Intro.07' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./Intro.07'\"
else
echo shar: Extracting \"'./Intro.07'\" \(376 characters\)
sed "s/^X//" >'./Intro.07' <<'END_OF_FILE'
X Patch 07 for psroff, please install it.
X
X To install the patch, please:
X
X cd to your psroff source directory
X restore the original defs.h and Makefile
X unshar this patch
X patch -p < Patch07
X Please read README for patch 07 and see if any of the
X the changes affect your installation.
X Reconfigure the new defs.h and Makefile to match your system
X make
X su root
X make install
END_OF_FILE
if test 376 -ne `wc -c <'./Intro.07'`; then
echo shar: \"'./Intro.07'\" unpacked with wrong size!
fi
# end of './Intro.07'
fi
if test -f './Patch07' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'./Patch07'\"
else
echo shar: Extracting \"'./Patch07'\" \(33956 characters\)
sed "s/^X//" >'./Patch07' <<'END_OF_FILE'
X*** /usr4/public/src/t2current/./macros/tmac.an Fri Jan 12 17:34:08 1990
X--- ./macros/tmac.an Fri Jan 12 17:35:12 1990
X***************
X*** 2,8 ****
X .so %%TMACDIR%%/common.pre
X .so %%RTMACDIR%%/tmac.an
X .\"Default offset (my version of the man macros uses it).
X! .nr )O .963i
X .\"See if someone's using the -rO option (ala MM)
X .if \nO .nr )O \nOu
X .po \n()Ou
X--- 2,8 ----
X .so %%TMACDIR%%/common.pre
X .so %%RTMACDIR%%/tmac.an
X .\"Default offset (my version of the man macros uses it).
X! .nr )O .463i
X .\"See if someone's using the -rO option (ala MM)
X .if \nO .nr )O \nOu
X .po \n()Ou
X*** /usr4/public/src/t2current/./macros/tmac.m Fri Jan 12 17:34:09 1990
X--- ./macros/tmac.m Fri Jan 12 17:35:12 1990
X***************
X*** 2,8 ****
X .so %%TMACDIR%%/common.pre
X .\"Default linewidth 6.5 inches & page offset .963 inches.
X .if !\nW .nr W 6.5i
X! .if !\nO .nr O .963i
X .so %%RTMACDIR%%/tmac.m
X .\"Clobber MM cut marks.
X .rm )k
X--- 2,8 ----
X .so %%TMACDIR%%/common.pre
X .\"Default linewidth 6.5 inches & page offset .963 inches.
X .if !\nW .nr W 6.5i
X! .if !\nO .nr O .463i
X .so %%RTMACDIR%%/tmac.m
X .\"Clobber MM cut marks.
X .rm )k
X*** /usr4/public/src/t2current/./macros/tmac.s Fri Jan 12 17:34:09 1990
X--- ./macros/tmac.s Fri Jan 12 17:35:12 1990
X***************
X*** 1,5 ****
X--- 1,9 ----
X .\"@(#)ident tmac.s %I% %E%
X .so %%TMACDIR%%/common.pre
X+ .\"Trick MS into thinking the initial page offset is .25i less than normal.
X+ .\"(because of the .5inch rightshift in troff2ps)
X+ .\"Then, defaulted MS will be exactly centered.
X+ .po .713i
X .so %%RTMACDIR%%/tmac.s
X .\"Clobber cut marks.
X .rm CM
X*** /usr4/public/src/t2current/./gfnttab.sh Fri Jan 12 17:33:44 1990
X--- ./gfnttab.sh Fri Jan 12 17:34:44 1990
X***************
X*** 1,5 ****
X :
X! #@(#)gfnttab.sh 1.8 89/12/13
X # Set this to something non-null if you need a.out.h/COFF
X # headers on your width files, and the COFF/HEADERSIZE
X # defines cause dit2catwid to generate width tables that
X--- 1,5 ----
X :
X! #@(#)gfnttab.sh 1.9 90/01/12
X # Set this to something non-null if you need a.out.h/COFF
X # headers on your width files, and the COFF/HEADERSIZE
X # defines cause dit2catwid to generate width tables that
X***************
X*** 39,44 ****
X--- 39,48 ----
X then
X sed -e '1,/charset/d' S2 >> /tmp/S
X fi
X+ if [ -r ST ]
X+ then
X+ sed -e '1,/charset/d' ST >> /tmp/S
X+ fi
X else
X echo "WARNING: no symbol font!"
X > /tmp/S
X***************
X*** 66,72 ****
X *) continue ;;
X esac
X trc=0
X! if [ "$i" != S2 ]
X then
X Cline=`sed -e '1q' $i | sed -e 's/^#[ ]*//'`
X echo "$i $Cline" >> $ffile
X--- 70,76 ----
X *) continue ;;
X esac
X trc=0
X! if [ "$i" != S2 -a "$i" != ST ]
X then
X Cline=`sed -e '1q' $i | sed -e 's/^#[ ]*//'`
X echo "$i $Cline" >> $ffile
X***************
X*** 75,81 ****
X S)
X args="-s /tmp/S R"
X ;;
X! S2)
X continue
X ;;
X *)
X--- 79,85 ----
X S)
X args="-s /tmp/S R"
X ;;
X! S2 | ST)
X continue
X ;;
X *)
X*** /usr4/public/src/t2current/./lj.c Fri Jan 12 17:34:18 1990
X--- ./lj.c Fri Jan 12 17:34:46 1990
X***************
X*** 52,70 ****
X
X #ifndef SVR3
X #ifndef lint
X! static char SCCSid[] = "@(#)lj.c: 1.11 Copyright 89/12/22 11:02:10 Chris Lewis";
X #endif
X #else
X! #ident "@(#)lj.c: 1.11 Copyright 89/12/22 11:02:10 Chris Lewis" /*(SVR3)*/
X #endif
X
X- #define USED 1
X- #define BUILTIN 2
X struct ljFts {
X char *troffName;
X char *fontSeq;
X char *ascName;
X! int flags;
X } ljFts[MAXFONT+1];
X
X struct ljFts *t2ljf[8];
X--- 52,71 ----
X
X #ifndef SVR3
X #ifndef lint
X! static char SCCSid[] = "@(#)lj.c: 1.14 Copyright 90/01/12 17:28:24 Chris Lewis";
X #endif
X #else
X! #ident "@(#)lj.c: 1.14 Copyright 90/01/12 17:28:24 Chris Lewis" /*(SVR3)*/
X #endif
X
X struct ljFts {
X char *troffName;
X char *fontSeq;
X char *ascName;
X! long loaded; /* is pointsize already there? */
X! long builtin; /* is pointsize builtin? */
X! long sfp; /* is pointsize SFP? */
X! long pk; /* is pointsize a PK? */
X } ljFts[MAXFONT+1];
X
X struct ljFts *t2ljf[8];
X***************
X*** 93,133 ****
X putchar(d);
X }
X
X ljSetFont(font, points)
X int font, points; {
X
X if (lastPoints != points || font != lastFont) {
X register char *p;
X #ifdef DOWNLOAD
X! if (!(ljFts[font].flags&(USED|BUILTIN))) {
X char buf[512];
X FILE *fontfile;
X int count;
X! sprintf(buf, "%s/%s.%s.%d", LIBDIR, be->bename,
X! ljFts[font].troffName, points);
X! if ((fontfile = fopen(buf, "r")) == NULL) {
X! fprintf(stderr, "%s: Cannot open fontfile %s\n", progname,
X buf);
X } else {
X! while(0 > (count = fread(buf, sizeof(char), 512, fontfile)))
X fwrite(buf, sizeof(char), count, stdout);
X! fclose(fontfile);
X }
X }
X #endif
X! ljFts[font].flags |= USED;
X! for (p = ljFts[font].fontSeq; *p; p++) {
X! if (*p == '\\') {
X! putoct(p+1);
X! p+=3;
X! } else
X! putchar(*p);
X }
X- printf("\033(s%dV", points);
X- lastPoints = points;
X- lastFont = font;
X }
X-
X }
X
X ljChar(x, y, font, points, troffChar)
X--- 94,212 ----
X putchar(d);
X }
X
X+ static
X+ long
X+ ptcvt(points)
X+ int points; {
X+ switch (points) {
X+ case 6: return 0; break;
X+ case 7: return 1; break;
X+ case 8: return 2; break;
X+ case 9: return 3; break;
X+ case 10: return 4; break;
X+ case 11: return 5; break;
X+ case 12: return 6; break;
X+ case 14: return 7; break;
X+ case 16: return 8; break;
X+ case 18: return 9; break;
X+ case 20: return 10; break;
X+ case 22: return 11; break;
X+ case 24: return 12; break;
X+ case 28: return 13; break;
X+ case 36: return 14; break;
X+ default: return 15; break;
X+ }
X+ }
X+
X+ static int sizes[] = {6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36};
X+
X+ static
X+ long
X+ ptbit(points)
X+ int points; {
X+ return(1 << ptcvt(points));
X+ }
X+
X ljSetFont(font, points)
X int font, points; {
X+ int pointdef = ptbit(points);
X
X if (lastPoints != points || font != lastFont) {
X register char *p;
X+
X+ lastPoints = points;
X+ lastFont = font;
X+
X+ #ifdef DOWNLOAD
X+ if (ljFts[font].builtin&pointdef) {
X+ #else
X+ {
X+ #endif
X+ /* if builtin font, select it by characteristic */
X+ for (p = ljFts[font].fontSeq; *p; p++) {
X+ if (*p == '\\') {
X+ putoct(p+1);
X+ p+=3;
X+ } else
X+ putchar(*p);
X+ }
X+ printf("\033(s%dV", points);
X+ return;
X+ }
X+
X #ifdef DOWNLOAD
X! if (!(ljFts[font].loaded&pointdef) &&
X! ((ljFts[font].sfp&pointdef) || (ljFts[font].pk&pointdef))) {
X!
X! /* font is not loaded, but is either sfp or pk format */
X!
X! int sfp = ljFts[font].sfp&pointdef;
X!
X char buf[512];
X FILE *fontfile;
X int count;
X!
X! if (sfp) {
X! sprintf(buf, "%s/lj/sfp/%s.%d", LIBDIR,
X! ljFts[font].troffName, points);
X! fontfile = fopen(buf, "r");
X! } else {
X! sprintf(buf, "%s/pktype -sS %s/lj/pk/%s.%d", LIBDIR,
X! LIBDIR, ljFts[font].troffName, points);
X! fontfile = popen(buf, "r");
X! }
X!
X!
X! if (!fontfile) {
X! fprintf(stderr, "%s: Cannot open fontfile via %s\n", progname,
X buf);
X } else {
X! DEBUGPRINTF("Loading font %s.%d via %s\n",
X! ljFts[font].troffName, points, buf);
X! printf("\033*c%dD", (font << 4) + ptcvt(points));
X! printf("\033*c4F");
X! while(0 < (count = fread(buf, sizeof(char), 512, fontfile)))
X fwrite(buf, sizeof(char), count, stdout);
X! if (sfp)
X! fclose(fontfile);
X! else
X! if (pclose(fontfile))
X! fprintf(stderr, "%s: pktype failure: %s\n",
X! progname, buf);
X }
X+ ljFts[font].loaded |= pointdef;
X }
X #endif
X! if (ljFts[font].loaded&pointdef)
X! /* font is already loaded, select it by fontid */
X! printf("\033(%dX", (font << 4) + ptcvt(points));
X! else {
X! fprintf(stderr, "Could not load font %s.%d\n",
X! ljFts[font].troffName, points);
X! /* fake it as builtin so no more complaints */
X! ljFts[font].builtin |= pointdef;
X }
X }
X }
X
X ljChar(x, y, font, points, troffChar)
X***************
X*** 208,221 ****
X FILE *f; {
X struct ljFts *p = ljFts;
X extern char *malloc();
X! int flags;
X char rbuf[512], nbuf[512], ljbuf[512], seqbuf[512];
X while(fgets(rbuf, sizeof(rbuf), f)) {
X if (rbuf[0] == '#')
X continue;
X! switch(sscanf(rbuf, "%s%s%s%d", nbuf, ljbuf, seqbuf, &flags)) {
X default:
X break;
X case 4:
X if (nbuf[0] == '#')
X break;
X--- 287,303 ----
X FILE *f; {
X struct ljFts *p = ljFts;
X extern char *malloc();
X! char flags[20];
X char rbuf[512], nbuf[512], ljbuf[512], seqbuf[512];
X+ int i;
X while(fgets(rbuf, sizeof(rbuf), f)) {
X if (rbuf[0] == '#')
X continue;
X! switch(sscanf(rbuf, "%s%s%s%s", nbuf, ljbuf, seqbuf, flags)) {
X default:
X break;
X+ case 3:
X+ strcpy(flags, "");
X case 4:
X if (nbuf[0] == '#')
X break;
X***************
X*** 230,242 ****
X strcpy(p->ascName, ljbuf);
X p->fontSeq = malloc((unsigned) strlen(seqbuf) + 1);
X strcpy(p->fontSeq, seqbuf);
X! p->flags = flags;
X p++;
X }
X }
X #ifdef DEBUG
X! for (p = ljFts; p->troffName; p++)
X DEBUGPRINTF("%s -> %s, seq: %s\n", p->troffName, p->ascName, p->fontSeq);
X #endif
X }
X
X--- 312,351 ----
X strcpy(p->ascName, ljbuf);
X p->fontSeq = malloc((unsigned) strlen(seqbuf) + 1);
X strcpy(p->fontSeq, seqbuf);
X! for (i = 0; i < 15; i++) {
X! if (i < strlen(flags)) {
X! switch(flags[i]) {
X! case 'b': p->builtin |= (1 << i); break;
X! case 's': p->sfp |= (1 << i); break;
X! case 'p': p->pk |= (1 << i); break;
X! case ' ': break;
X! case 'n': break;
X! default:
X! fprintf(stderr, "Bad font/point specifier in %s\n",
X! flags);
X! break;
X! }
X! }
X! }
X p++;
X }
X }
X #ifdef DEBUG
X! for (p = ljFts; p->troffName; p++) {
X DEBUGPRINTF("%s -> %s, seq: %s\n", p->troffName, p->ascName, p->fontSeq);
X+ for (i = 0; i < 15; i++) {
X+ DEBUGPRINTF(" Size %d (%d points) is: ", i, sizes[i]);
X+ if (p->builtin&(1 << i)) {
X+ DEBUGPRINTF("builtin\n");
X+ } else if (p->sfp&(1 << i)) {
X+ DEBUGPRINTF("an SFP\n");
X+ } else if (p->pk&(1 << i)) {
X+ DEBUGPRINTF("a PK\n");
X+ } else {
X+ DEBUGPRINTF("non existent\n");
X+ }
X+ }
X+ }
X #endif
X }
X
X*** /usr4/public/src/t2current/./dt.h Fri Jan 12 17:34:18 1990
X--- ./dt.h Fri Jan 12 17:34:48 1990
X***************
X*** 14,23 ****
X
X #ifndef SVR3
X #ifndef lint
X! static char dtID[] = "@(#)dt.h: 1.3 Copyright 90/01/08 16:31:05 Chris Lewis";
X #endif
X #else
X! #ident "@(#)dt.h: 1.3 Copyright 90/01/08 16:31:05 Chris Lewis"
X #endif
X
X /* This is actually done in the back-end */
X--- 14,23 ----
X
X #ifndef SVR3
X #ifndef lint
X! static char dtID[] = "@(#)dt.h: 1.3 Copyright 90/01/12 13:58:31 Chris Lewis";
X #endif
X #else
X! #ident "@(#)dt.h: 1.3 Copyright 90/01/12 13:58:31 Chris Lewis"
X #endif
X
X /* This is actually done in the back-end */
X***************
X*** 24,34 ****
X #define DTRESOLUTION 300
X /* Length scaling factor */
X #define DTSCALEFACTOR ((double) dtresolution / TROFFRESOLUTION)
X! #define TROFF2DTX(x) ((x) * DTSCALEFACTOR)
X /* 11" paper length */
X #define TROFF2DTY(y) ((y) * DTSCALEFACTOR)
X
X extern double pagelength;
X
X #define DTLIB "lib"
X #define DTFONTS "fonts"
X--- 24,38 ----
X #define DTRESOLUTION 300
X /* Length scaling factor */
X #define DTSCALEFACTOR ((double) dtresolution / TROFFRESOLUTION)
X! /* Troff assumes 7.5" paper width, most macro packages print in
X! 6.5" area within that. Sooo, we'll center the paperwidth on the
X! physical page - implying .5" inch physical margins.*/
X! #define TROFF2DTX(x) ((x + pageoffset) * DTSCALEFACTOR)
X /* 11" paper length */
X #define TROFF2DTY(y) ((y) * DTSCALEFACTOR)
X
X extern double pagelength;
X+ extern double pageoffset;
X
X #define DTLIB "lib"
X #define DTFONTS "fonts"
X*** /usr4/public/src/t2current/./psroff.sh Fri Jan 12 17:34:20 1990
X--- ./psroff.sh Fri Jan 12 17:34:50 1990
X***************
X*** 11,26 ****
X # Author: Chris Lewis
X # Specs: troff driver
X #
X! #ident "@(#)psroff.sh: 1.24 Copyright 90/01/03 11:48:55 Chris Lewis"
X troff=troff
X #troff=/usr2/clewis/src/spx/tnroff/troff
X term=false
X fail=false
X type=`basename $0 | sed -e 's/^\(..\).*/\1/'`
X copies=1
X for i in $*
X do
X case $i in
X -F)
X fail=true
X ;;
X--- 11,30 ----
X # Author: Chris Lewis
X # Specs: troff driver
X #
X! #ident "@(#)psroff.sh: 1.26 Copyright 90/01/12 16:42:08 Chris Lewis"
X troff=troff
X #troff=/usr2/clewis/src/spx/tnroff/troff
X term=false
X fail=false
X+ pageoffset='.5i'
X type=`basename $0 | sed -e 's/^\(..\).*/\1/'`
X copies=1
X for i in $*
X do
X case $i in
X+ -O*)
X+ pageoffset=`echo $i | sed -e 's/-O//'`
X+ ;;
X -F)
X fail=true
X ;;
X***************
X*** 90,95 ****
X--- 94,101 ----
X esac
X done
X
X+ debug="$debug -O$pageoffset"
X+
X if [ -z "$seenfiles" ]
X then
X files="$files -"
X***************
X*** 103,110 ****
X--- 109,129 ----
X fi
X
X # If you add a driver, you will have to add it here too:
X+ # You can add ditroff output variants by adding
X+ # lines analogous to the "jt" variant.
X+
X+ realtype=$type
X+ trofftype=$type
X+
X case $type in
X lj) OUTPUT="%%LJOUTPUT%%" ;;
X+ tp) OUTPUT="%%TPOUTPUT%%"
X+ realtype=dt
X+ trofftype=ps
X+ ;;
X+ jt) OUTPUT="%%JTOUTPUT%%"
X+ realtype=dt
X+ ;;
X lk) OUTPUT="%%LKOUTPUT%%" ;;
X dj) OUTPUT="%%DJOUTPUT%%" ;;
X ps) OUTPUT="%%PSOUTPUT%%" ;;
X***************
X*** 114,127 ****
X exit 1
X ;;
X esac
X if $fail
X then
X! $troff -t -T$type $args $files > /dev/null
X elif $term
X then
X! ( $troff -t -T$type $args $files 2>&1 ) | $t2 $length -T$type $debug
X exit $?
X else
X! eval "( $troff -t -T$type $args $files 2>&1 ) | $t2 $length -T$type $debug $OUTPUT"
X exit $?
X fi
X--- 133,147 ----
X exit 1
X ;;
X esac
X+
X if $fail
X then
X! $troff -t -T$trofftype $args $files > /dev/null
X elif $term
X then
X! ( $troff -t -T$trofftype $args $files 2>&1 ) | $t2 $length -T$realtype $debug
X exit $?
X else
X! eval "( $troff -t -T$trofftype $args $files 2>&1 ) | $t2 $length -T$realtype $debug $OUTPUT"
X exit $?
X fi
X*** /usr4/public/src/t2current/./ps.h Fri Jan 12 17:34:20 1990
X--- ./ps.h Fri Jan 12 17:34:50 1990
X***************
X*** 13,22 ****
X
X #ifndef SVR3
X #ifndef lint
X! static char psID[] = "@(#)ps.h: 1.17 Copyright 90/01/08 16:31:08 Chris Lewis";
X #endif
X #else
X! #ident "@(#)ps.h: 1.17 Copyright 90/01/08 16:31:08 Chris Lewis"
X #endif
X
X /* Points per inch (default PostScript resolution) */
X--- 13,22 ----
X
X #ifndef SVR3
X #ifndef lint
X! static char psID[] = "@(#)ps.h: 1.18 Copyright 90/01/12 14:00:36 Chris Lewis";
X #endif
X #else
X! #ident "@(#)ps.h: 1.18 Copyright 90/01/12 14:00:36 Chris Lewis"
X #endif
X
X /* Points per inch (default PostScript resolution) */
X***************
X*** 23,33 ****
X #define PSRESOLUTION 72
X /* Length scaling factor */
X #define PSSCALEFACTOR ((double) PSRESOLUTION / TROFFRESOLUTION)
X! #define TROFF2PSX(x) ((x) * PSSCALEFACTOR)
X /* 11" paper length (note the reversed sign!) */
X #define TROFF2PSY(y) ((pagelength - (y)) * PSSCALEFACTOR)
X
X extern double pagelength;
X
X #define LASTPSFONT ('O')
X
X--- 23,37 ----
X #define PSRESOLUTION 72
X /* Length scaling factor */
X #define PSSCALEFACTOR ((double) PSRESOLUTION / TROFFRESOLUTION)
X! /* Troff assumes 7.5" paper width, most macro packages print in
X! 6.5" area within that. Sooo, we'll center the paperwidth on the
X! physical page - implying .5" inch physical margins.*/
X! #define TROFF2PSX(x) ((x + pageoffset) * PSSCALEFACTOR)
X /* 11" paper length (note the reversed sign!) */
X #define TROFF2PSY(y) ((pagelength - (y)) * PSSCALEFACTOR)
X
X extern double pagelength;
X+ extern double pageoffset;
X
X #define LASTPSFONT ('O')
X
X*** /usr4/public/src/t2current/./lj.h Fri Jan 12 17:34:22 1990
X--- ./lj.h Fri Jan 12 17:34:53 1990
X***************
X*** 16,25 ****
X
X #ifndef SVR3
X #ifndef lint
X! static char ljID[] = "@(#)lj.h: 1.8 Copyright 90/01/08 16:31:10 Chris Lewis";
X #endif
X #else
X! #ident "@(#)lj.h: 1.8 Copyright 90/01/08 16:31:10 Chris Lewis"
X #endif
X
X /* We're using decipoints */
X--- 16,25 ----
X
X #ifndef SVR3
X #ifndef lint
X! static char ljID[] = "@(#)lj.h: 1.8 Copyright 90/01/12 13:58:38 Chris Lewis";
X #endif
X #else
X! #ident "@(#)lj.h: 1.8 Copyright 90/01/12 13:58:38 Chris Lewis"
X #endif
X
X /* We're using decipoints */
X***************
X*** 27,39 ****
X /* Length scaling factor */
X #define LJSCALEFACTOR ((double) LJRESOLUTION / TROFFRESOLUTION)
X
X! #define TROFF2LJX(x) ((x) * LJSCALEFACTOR)
X
X /* 11" paper length */
X #define TROFF2LJY(y) ((y) * LJSCALEFACTOR)
X
X /* change the DJ */
X #define TROFF2DJX(x) TROFF2LJX(x)
X /* for length, we want .25 inch */
X /* margins top and bottom, so we'll */
X /* scale the requests and add .25 inch */
X--- 27,50 ----
X /* Length scaling factor */
X #define LJSCALEFACTOR ((double) LJRESOLUTION / TROFFRESOLUTION)
X
X! /* Troff assumes 7.5" paper width, most macro packages print in
X! 6.5" area within that. Sooo, we'll center the paperwidth on the
X! physical page - implying .5" inch physical margins.*/
X! #define TROFF2LJX(x) ((x + pageoffset) * LJSCALEFACTOR)
X
X /* 11" paper length */
X #define TROFF2LJY(y) ((y) * LJSCALEFACTOR)
X
X+ /* These won't work (ron at mlfarm, */
X+ /* 10.22.89) -- the offset of 1/2 inch */
X+ /* spoils it, and the length scaling */
X+ /* won't fit on a page. I'll only */
X /* change the DJ */
X+ #ifdef BROKEN_XENIX
X+ #define TROFF2DJX(x) ((x + pageoffset) * LJSCALEFACTOR)
X+ #else
X #define TROFF2DJX(x) TROFF2LJX(x)
X+ #endif
X /* for length, we want .25 inch */
X /* margins top and bottom, so we'll */
X /* scale the requests and add .25 inch */
X***************
X*** 41,46 ****
X--- 52,58 ----
X
X
X extern double pagelength;
X+ extern double pageoffset;
X
X #define LASTLJFONT ('O')
X
X*** /usr4/public/src/t2current/./troff2.c Fri Jan 12 17:33:51 1990
X--- ./troff2.c Fri Jan 12 17:34:54 1990
X***************
X*** 15,24 ****
X
X #ifndef SVR3
X #ifndef lint
X! static char SCCSid[] = "@(#)troff2.c: 1.23 Copyright 89/12/12 15:50:48 Chris Lewis";
X #endif
X #else
X! #ident "@(#)troff2.c: 1.23 Copyright 89/12/12 15:50:48 Chris Lewis"
X #endif
X
X #define ESC 0x80
X--- 15,24 ----
X
X #ifndef SVR3
X #ifndef lint
X! static char SCCSid[] = "@(#)troff2.c: 1.25 Copyright 90/01/12 16:42:13 Chris Lewis";
X #endif
X #else
X! #ident "@(#)troff2.c: 1.25 Copyright 90/01/12 16:42:13 Chris Lewis"
X #endif
X
X #define ESC 0x80
X***************
X*** 51,56 ****
X--- 51,57 ----
X #define CTOINT(val,sig) ((~c)&sig)
X
X double pagelength = 11 * TROFFRESOLUTION;
X+ double pageoffset = .5;
X
X #define CFONT (((mag == UPPER)<<2)|((rail == UPPER)<<1)|(tilt==DOWN))
X #ifdef FONT4
X***************
X*** 87,93 ****
X else
X driver = "ZZ";
X
X! while((c = getopt(argc, argv, "T:VDd:l:MR:")) != EOF)
X switch (c) {
X case 'T':
X driver = optarg;
X--- 88,94 ----
X else
X driver = "ZZ";
X
X! while((c = getopt(argc, argv, "O:T:VDd:l:MR:")) != EOF)
X switch (c) {
X case 'T':
X driver = optarg;
X***************
X*** 125,130 ****
X--- 126,134 ----
X break;
X case 'd':
X driver = optarg;
X+ break;
X+ case 'O':
X+ pageoffset = calc(optarg);
X break;
X case 'l':
X pagelength = calc(optarg);
X*** /usr4/public/src/t2current/./defs.h Fri Jan 12 17:34:24 1990
X--- ./defs.h Fri Jan 12 17:34:56 1990
X***************
X*** 17,23 ****
X #define LIBDIR "/usr/lib/troff2"
X #endif
X
X! #define T2VERSION "Release 1 Patchlevel 6 89/12/29"
X
X /* Configuration parameters:
X */
X--- 17,23 ----
X #define LIBDIR "/usr/lib/troff2"
X #endif
X
X! #define T2VERSION "Release 1 Patchlevel 7 90/01/10"
X
X /* Configuration parameters:
X */
X***************
X*** 118,127 ****
X
X #ifndef SVR3
X #ifndef lint
X! static char defid[] = "@(#)defs.h: 1.24 Copyright 89/12/29 15:24:49 Chris Lewis";
X #endif
X #else
X! #ident "@(#)defs.h: 1.24 Copyright 89/12/29 15:24:49 Chris Lewis"
X #endif
X
X #include <stdio.h>
X--- 118,127 ----
X
X #ifndef SVR3
X #ifndef lint
X! static char defid[] = "@(#)defs.h: 1.25 Copyright 90/01/10 19:28:40 Chris Lewis";
X #endif
X #else
X! #ident "@(#)defs.h: 1.25 Copyright 90/01/10 19:28:40 Chris Lewis"
X #endif
X
X #include <stdio.h>
X*** /usr4/public/src/t2current/./ps.c Fri Jan 12 17:34:25 1990
X--- ./ps.c Fri Jan 12 17:34:59 1990
X***************
X*** 18,27 ****
X
X #ifndef SVR3
X #ifndef lint
X! static char SCCSid[] = "@(#)ps.c: 1.33 Copyright 90/01/05 20:16:44 Chris Lewis";
X #endif
X #else
X! #ident "@(#)ps.c: 1.33 Copyright 90/01/05 20:16:44 Chris Lewis" /*(SVR3)*/
X #endif
X
X /* ps.c will generate some additional "print" commands to cause
X--- 18,27 ----
X
X #ifndef SVR3
X #ifndef lint
X! static char SCCSid[] = "@(#)ps.c: 1.34 Copyright 90/01/10 19:39:57 Chris Lewis";
X #endif
X #else
X! #ident "@(#)ps.c: 1.34 Copyright 90/01/10 19:39:57 Chris Lewis" /*(SVR3)*/
X #endif
X
X /* ps.c will generate some additional "print" commands to cause
X***************
X*** 570,575 ****
X--- 570,576 ----
X #ifndef NOCHATTER
X EMITPS("(Execution time (seconds): ) print\n");
X EMITPS("usertime btime sub 0.001 mul ( ) cvs print\n");
X+ EMITPS("(; Pages: %d) print\n", currentPage);
X EMITPS("(\\n) print\n");
X #endif
X EMITPS("GlobalSave restore\n");
X*** /usr4/public/src/t2current/./psroff.1 Fri Jan 12 17:34:26 1990
X--- ./psroff.1 Fri Jan 12 17:35:04 1990
X***************
X*** 1,4 ****
X! .\"Copyright 1988 by Chris Lewis 1.8 89/12/29
X .TH PSROFF 1 local
X .SH NAME
X psroff,ljroff,xxroff \- troff replacement for PostScript or other printers
X--- 1,4 ----
X! .\"Copyright 1988 by Chris Lewis 1.10 90/01/12
X .TH PSROFF 1 local
X .SH NAME
X psroff,ljroff,xxroff \- troff replacement for PostScript or other printers
X***************
X*** 6,11 ****
X--- 6,12 ----
X .IB xx roff
X [-D] [-X] [-M] [-F]
X .RI "[-R" nn "]"
X+ .RI "[-O" offset "]"
X .RI "[-T" xx "]"
X .RI "[-rL" length "]"
X .RI [ troffopts ]
X***************
X*** 48,53 ****
X--- 49,65 ----
X .I xx
X will select which printer codes to generate.
X .P
X+ As shipped, the
X+ .I psroff
X+ .RI -T xx
X+ understands ``ps'' (postscript), ``tp'' (ditroff->tpscript also postscript),
X+ ``jt'' (ditroff->jetroff (HP PCL)),
X+ ``lj'' (HP PCL),
X+ ``lk'' (HP PCL with K cartridge),
X+ and
X+ ``dt'' (HP Deskjet).
X+ However, one or more of the above may not be supported at your site.
X+ .P
X .I Psroff
X invokes
X .I troff
X***************
X*** 62,67 ****
X--- 74,97 ----
X used (see the documentation for MM and
X .I troff2ps
X for more details).
X+ .P
X+ The "-O" option allows you to specify a physical offset from the
X+ left margin of the page.
X+ Normal troff prohibits the total page offset plus line length from
X+ being greater than 7.54 inches, which means that it would be impossible
X+ to centre a 7.54 inch line on 8.5 inch wide paper.
X+ The default -O is .5 inch (specified as .5i), which allows you to
X+ centre a 7.5 inch line with a zero troff offset (.po directive).
X+ The .5 inch default was originally a hardcoded offset in troff2ps.
X+ The macro adapters have been tuned to centre the default line length
X+ in a 8.5 inch page.
X+ The value for the "-O" option can take any form allowed by the "-rL"
X+ option in
X+ .IR troffps .
X+ This is not implemented as "-rO", because troff itself isn't supposed
X+ to know about it.
X+ The real line offset on a sheet of paper is the sum of the -O and
X+ troff page offset (.po directive).
X .SH MACROS
X Included with the
X .I psroff
X*** /usr4/public/src/t2current/./Makefile Fri Jan 12 17:34:27 1990
X--- ./Makefile Fri Jan 12 17:35:04 1990
X***************
X*** 12,18 ****
X # Note: This is a System V Makefile, so you may
X # have some problems making a few of the items.
X #
X! #ident "@(#)Makefile: 1.44 Copyright 90/01/08 16:31:17 Chris Lewis"
X
X # Set to where you want the user-interfaces to go
X BINDIR = /usr/lbin
X--- 12,18 ----
X # Note: This is a System V Makefile, so you may
X # have some problems making a few of the items.
X #
X! #ident "@(#)Makefile: 1.48 Copyright 90/01/12 17:28:39 Chris Lewis"
X
X # Set to where you want the user-interfaces to go
X BINDIR = /usr/lbin
X***************
X*** 29,36 ****
X LJOUTPUT = | lp -dlaser -og -n$$copies
X DJOUTPUT = $(LJOUTPUT)
X LKOUTPUT = $(LJOUTPUT)
X! # Ditroff output
X! DTOUTPUT = | /usr/lib/troff/tpscript | rlp -dgate!AppleLaser -n$$copies
X # Testing type:
X TTYPE = ps
X TFLAGS = -mm
X--- 29,40 ----
X LJOUTPUT = | lp -dlaser -og -n$$copies
X DJOUTPUT = $(LJOUTPUT)
X LKOUTPUT = $(LJOUTPUT)
X! # Tpscript output
X! TPOUTPUT = | /usr/lib/troff/tpscript | rlp -dgate!AppleLaser -n$$copies
X! # Jetroff output
X! JTOUTPUT = | djet | rlp -dgate!AppleLaser
X! # DiTROFF output (outputs ditroff on screen)
X! DTOUTPUT =
X # Testing type:
X TTYPE = ps
X TFLAGS = -mm
X***************
X*** 55,61 ****
X
X # Dinna touch from here on
X MAIN = troff2.o utils.o t2conf.o
X! BACKENDS = lj.o ps.o lj.o ljtables.o dt.o
X PLIBDIR = $(LIBDIR)/lib
X
X MACROS = $(TMACDIR)/common.post $(TMACDIR)/common.pre \
X--- 59,65 ----
X
X # Dinna touch from here on
X MAIN = troff2.o utils.o t2conf.o
X! BACKENDS = lj.o ps.o ljtables.o dt.o
X PLIBDIR = $(LIBDIR)/lib
X
X MACROS = $(TMACDIR)/common.post $(TMACDIR)/common.pre \
X***************
X*** 73,81 ****
X--- 77,87 ----
X
X SEDSCRIPT = sed -e 's;%%LJOUTPUT%%;$(LJOUTPUT);g' \
X -e 's;%%LKOUTPUT%%;$(LKOUTPUT);g' \
X+ -e 's;%%JTOUTPUT%%;$(JTOUTPUT);g' \
X -e 's;%%DJOUTPUT%%;$(DJOUTPUT);g' \
X -e 's;%%PSOUTPUT%%;$(PSOUTPUT);g' \
X -e 's;%%DTOUTPUT%%;$(DTOUTPUT);g' \
X+ -e 's;%%TPOUTPUT%%;$(TPOUTPUT);g' \
X -e 's;%%LIBDIR%%;$(LIBDIR);g' \
X -e 's;%%TMACDIR%%;$(TMACDIR);g' \
X -e 's;%%RTMACDIR%%;$(RTMACDIR);g'
X***************
X*** 117,122 ****
X--- 123,130 ----
X confid.ps lethead.ps
X
X all: $(UTILLIST) fonts
X+
X+ utils: $(UTILLIST)
X
X macros: $(MACROS)
X
X*** /usr4/public/src/t2current/./fonts.lj Fri Jan 12 17:33:23 1990
X--- ./fonts.lj Fri Jan 12 17:35:07 1990
X***************
X*** 1,9 ****
X! #@(#)fonts.lj 1.2 89/12/04
X # four fields:
X # troff-name english-name HPLJ-code-to-transmit flags
X # flags of interest: 02 indicates that it's a built-in font.
X # \nnn sequences are only recognized in the HPLJ-code field.
X # Don't put in *any* extraneous spaces.
X # +----------------------------- Symbol set
X # | +---------------------- 0=fixed, 1=proportional
X # | | +-------------------- 0=upright, 1=italics
X--- 1,42 ----
X! #@(#)fonts.lj 1.3 90/01/12
X # four fields:
X # troff-name english-name HPLJ-code-to-transmit flags
X # flags of interest: 02 indicates that it's a built-in font.
X # \nnn sequences are only recognized in the HPLJ-code field.
X # Don't put in *any* extraneous spaces.
X+ #
X+ # The source flags is a string of characters up to 15 long,
X+ # where each character indicates where the font at a specific size
X+ # *is*, and the point sizes go from troff's lowest to highest.
X+ # The character mapping is:
X+ #
X+ # n: non existant - you will get a complaint if selected.
X+ # b: builtin - font is selected by *characteristic*,
X+ # and is either a ROM font/size, or a manually downloaded
X+ # one. I suggest that if you manually download fonts,
X+ # you select fontid's > 1000. (see below)
X+ # s: there is a SFP at LIBDIR/lj/sfp/<troffname>.pointsize
X+ # where troffname is troff's name for a font. Eg: "R".
X+ # And pointsize is troff's point size.
X+ # p: there is a TeX PK format font file at
X+ # LIBDIR/lj/pk/<troffname>.pointsize. see "s" for
X+ # naming conventions.
X+ #
X+ # SFP and PK's are downloaded automatically by the LJ driver.
X+ #
X+ # They are assigned a LJ fontid calculated by:
X+ # "index of the font in this table" * 16 + "index of pointsize"
X+ # (6 is 0, 7 is 1, 36 is 14.)
X+ # They are selected by this fontid. (eg: it doesn't matter if the
X+ # font descriptor in a SFP has the correct characteristics or not)
X+ #
X+ # non-existant ones give you a complaint if they're used, and
X+ # selected as if they were builtin. (which means that they might
X+ # even work reasonably...)
X+ #
X+ # If the source string is too short or omitted, the missing point
X+ # sizes are assumed "builtin". Ditto if DOWNLOAD is undefined.
X+ #
X # +----------------------------- Symbol set
X # | +---------------------- 0=fixed, 1=proportional
X # | | +-------------------- 0=upright, 1=italics
X***************
X*** 10,26 ****
X # | | | +----------------- stroke weight -7...7
X # | | | | +-------------- Typeface
X # | | | | |
X! # | | | | | +----------- 2 == builtin
X # | | | | | |
X # v v v v v v
X! R Times-Roman \033(8U\033(s1p0s00b05T 2
X! I Times-Italic \033(8U\033(s1p1s-3b05T 2
X! B Times-Bold \033(8U\033(s1p0s03b05T 2
X! S Symbol \033(8U\033(s0p0s00b03T 2
X! BI Times-BoldItalic \033(8U\033(s1p1s03b05T 2
X! C Courier \033(8U\033(s0p0s00b03T 2
X! CI Courier-Italic \033(8U\033(s0p1s-3b03T 2
X! CB Courier-Bold \033(8U\033(s0p0s03b03T 2
X! L LinePrinter \033(8U\033(s0p0s00b00T 2
X! LI LinePrinter-Ital \033(8U\033(s0p1s-3b00T 2
X! LB LinePrinter-Bold \033(8U\033(s0p0s03b00T 2
X--- 43,67 ----
X # | | | +----------------- stroke weight -7...7
X # | | | | +-------------- Typeface
X # | | | | |
X! # | | | | | +----------- source flags...
X # | | | | | |
X+ # | | | | | |
X+ # | | | | | |
X+ # | | | | | |
X # v v v v v v
X! # 678910 14 20 28
X! # 11 16 22 36
X! # 12 18 24
X! # |||||||||||||||
X! # vvvvvvvvvvvvvvv
X! R Times-Roman \033(8U\033(s1p0s00b05T sssssssssssssss
X! I Times-Italic \033(8U\033(s1p1s-3b05T sssssssssssssss
X! B Times-Bold \033(8U\033(s1p0s03b05T sssssssssssssss
X! S Symbol \033(8U\033(s0p0s00b03T sssssssssssssss
X! BI Times-BoldItalic \033(8U\033(s1p1s03b05T sssssssssssssss
X! C Courier \033(8U\033(s0p0s00b03T ssssbsbssssssss
X! CI Courier-Italic \033(8U\033(s0p1s-3b03T ssssbsbssssssss
X! CB Courier-Bold \033(8U\033(s0p0s03b03T ssssbsbssssssss
X! L LinePrinter \033(8U\033(s0p0s00b00T sssssssssssssss
X! LI LinePrinter-Ital \033(8U\033(s0p1s-3b00T sssssssssssssss
X! LB LinePrinter-Bold \033(8U\033(s0p0s03b00T sssssssssssssss
X*** /usr4/public/src/t2current/./README Fri Jan 12 17:34:29 1990
X--- ./README Fri Jan 12 17:35:14 1990
X***************
X*** 1,4 ****
X! README 1.23 90/01/08
X See defs.h for the patchlevel
X
X Please read this document, especially any new patches near the end before
X--- 1,4 ----
X! README 1.26 90/01/12
X See defs.h for the patchlevel
X
X Please read this document, especially any new patches near the end before
X***************
X*** 430,439 ****
X (eg: upload, showfont, tmac.t2).
X 6) tmac.t2 is no longer a source file - it's now tmac.t2.sh.
X
X Coming features (watch this space!)
X- - Patch 7 will contain Ron Florence's SFP download improvements.
X- (but this will be superceded by SFP/PK downloading whenever
X- I get around to it).
X - automatic macro/pre/post-processor determination (ala Doug
X Gwyn's doctype function)
X - More complete listings of Postscript font widths.
X--- 430,469 ----
X (eg: upload, showfont, tmac.t2).
X 6) tmac.t2 is no longer a source file - it's now tmac.t2.sh.
X
X+ Patch 7: Jan 12 1990
X+ 1) Undid patch 6 (3). You're stupid Chris! And added a -O
X+ option to specify a page offset in troff2ps, default .5i.
X+ (troff allows .po+.ll to be at most 7.54, unless troff2ps
X+ adds it's own independent offset, it is impossible to
X+ centre 7.5 inch lines on 8.5 inch paper).
X+ The macro adapters have been adjusted to centre the
X+ default linelength. See psroff.1
X+ 2) Added page count to CHATTER stuff.
X+ 3) Built in psroff support for jetroff, differentiated "dt"
X+ as being bare ditroff to stdout, and "tp" as being
X+ an invocation of tpscript. These are examples of how to use
X+ ditroff output with different ditroff->printer converters.
X+ 4) A primitive form of LJ downloading is supported, supporting
X+ either HP SFP's or TeX PK format files. (however, I haven't
X+ shipped the pktype program, so PK's won't work unless you ask
X+ me for it). Do *not* ask me for PK or SFP files, you will
X+ have to find your own. However, if you really want, I
X+ can mail you a PK font defined by Rick Richardson
X+ that has characters not in normal TeX PK files. Note that
X+ Rick's company owns the copyright on this font, and he has
X+ graciously permitted me to ship it (the "cmtrf" font) ONLY
X+ for use with psroff. Any other usage (other than jetroff or
X+ psroff) violates his permission, and is downright unfriendly.
X+
X+ This version does *not* prevent you from asking for more fonts
X+ than the HPLJ will support simultaneously. Nor are any characters
X+ except for the most common ASCII characters likely to appear
X+ when you expect them to.
X+
X+ Besides, it hasn't been tested very well either... (they
X+ stole my IIP ;-)
X+
X Coming features (watch this space!)
X - automatic macro/pre/post-processor determination (ala Doug
X Gwyn's doctype function)
X - More complete listings of Postscript font widths.
END_OF_FILE
if test 33956 -ne `wc -c <'./Patch07'`; then
echo shar: \"'./Patch07'\" unpacked with wrong size!
fi
# end of './Patch07'
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have the archive.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list
More information about the Alt.sources
mailing list