[comp.sys.hp] Nroff driver for LaserJet

jbr0871@fedeva.UUCP (Blaine Robertson) (02/20/88)

Does anybody have an nroff driver for the LaserJet Series II?

Also, how about a plot driver for HPGL for use on an HP 7550 plotter?

Any response will be greatly appreciated!! Thanks.

Blaine Robertson @ Federal Express
901-922-5832
hplabs!csun!fedeva!jbr0871 or gatech!emcard!fedeva!jbr0871

scottb@hpcvlx.HP.COM (Scott Boyd) (02/23/88)

> Does anybody have an nroff driver for the LaserJet Series II?
> 
Hmmm... you really don't need a specific driver for the LaserJet to have 
nroff work, but you do have to tell nroff to use only 60 lines per page.

This can be done by adding '-RL60' to the command line. For instance to 
print out a document using the MM macros. The following command would work:

	nroff -mm -RL60 filename 

If you have tables or equations, pipe nroff's output through col(1) 
before sending it to the printer. For example:

	cat filename | neqn | tbl | nroff -mm -RL60 | col -x

There are also at least 2 versions of ditroff (device independent troff)
that will drive the LaserJet, with font and bitmap support. One is called
eroff, by the Elan Computer Group in Palo Alto, California. I don't have
info on the other.

				Scott Boyd

USMail:  Hewlett-Packard - Corvallis Workstation Operation
         1000 NE Circle Blvd.  Corvallis, OR 97330

ARPA: scottb@hp-pcd.HP.COM
UUCP: {cmcl2, harpo, hplabs, rice, tektronix}!hp-pcd!scottb

bd@hpsemc.HP.COM (bob desinger) (03/02/88)

Scott Boyd (scottb@hpcvlx.HP.COM) writes:
> Hmmm... you really don't need a specific driver for the LaserJet to have 
> nroff work, but you do have to tell nroff to use only 60 lines per page.
> This can be done by adding '-RL60' to the command line. For instance to 
> print out a document using the MM macros. The following command would work:
> 	nroff -mm -RL60 filename 

Scott means "-rL60", where the `r' is lower case.  (It means "set
register L to 60," and L holds the page length.  From the command
line, you can set only the single-letter registers.)  The book
_Unix_Text_Processing_ by Dougherty and O'Reilly tells more about
this.

-- bd

irf@kuling.UUCP (Bo Thide) (03/05/88)

In article <1170001@hpcvlx.HP.COM> scottb@hpcvlx.HP.COM (Scott Boyd) writes:
>> Does anybody have an nroff driver for the LaserJet Series II?
>> 
>Hmmm... you really don't need a specific driver for the LaserJet to have 

Oh, yes indeed you do.  The nroff driver tables in /usr/lib/term are very
primitive and only provide support for the most trivial typesetting (at
least that's true for HP-UX).  However, there is a nroff table driver
program by Bruce Townsend.  Look in comp.sources.unix.  Bruce has in
his posting added a nroff driver table for the Laserjet+ allowing you to
print nicely looking mathematical formulas, perfectly aligned tables etc.

In fact, the driver table almost turns nroff into troff.  It should work for
Laserjet II too.  You must have access to the special character fonts in
your LJ (either cartridge or soft fonts).  We use a Math Elite cartridge.

If you want I can send the driver program and table. 

-Bo
-- 
>>> Bo Thide', Swedish Institute of Space Physics, S-755 90 Uppsala, Sweden <<<  Phone (+46) 18-300020.  Telex: 76036 (IRFUPP S).  UUCP: ..enea!kuling!irfu!bt

rclark@bgphp1.UUCP (Roger N. Clark) (03/10/88)

> Does anybody have an nroff driver for the LaserJet Series II?

Well, this is not specifically for the Series II, but it is probably compatible.

I have also been waiting for someone to post the laserjet nroff driver
table.  HP helped me with the one below.  They sent the version
from Bruce Townsend (Bruce had it configured for another printer).
I figured out all the escape codes for the laser and made the
table delow.  I gave the table to HP with the hope that they would do
their own quality test on it and make it an HP supported product.  I
still think it is crazy that HP says they support the laser printers
on HPUX and they support nroff.  Most people would make the logical
connection that the laser is supported by nroff!  I guess HP thinks
it is (as a bumb printer)! OH Well.

Anyway, below are three files.  The laserjet Table, a simple makeit
shell script (it makes a table called tabhplaser2, the 2 for my
second try).  I use the ms macros most often and they need modifying if you
want to do underlining, italic and bold at the same time.  I still do
not have it right.  So if anyone figures it out, please send it to me.

There is also a file called CHAR.SET which is the complete nroff
charracter set as I understand it.  After making the laser table,
run the command: nroff -ms -Thplaser2 | <your laser printer spooler>.

We use the table for many manuscripts, letters and memos.  It has
even been used for a thesis.  We have not found any bugs for text.
BUT tbl and neqn do NOT work correctly.  There is something wrong
with positioning.  For example, boxes are not perfect and for
complicated equations, characters can get overwritten by lines used
for division.  If someone figures out this bug, please let me know!

(Any opinions expressed here are mine and not necessarily those of
the USGS)

Roger N. Clark
U.S. Geological Survey, MS 964
Box 25046 Federal Center
Denver, CO 80225-0046
(303) 236-1332
 FTS  776-1332
{known-world}!hplabs!hpfcla!hpfcse!hpuecoa!bgphp1!rclark


#---------------------------------- cut here ----------------------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by rclark at bgphp1 on Wed Mar  9 08:43:03 1988
#
# This archive contains:
#	laser.c		makeit		CHAR.SET	
#
# Error checking via wc(1) will be performed.
# Error checking via sum(1) will be performed.

echo x - laser.c
cat >laser.c <<'@EOF'
/***********************************************************************
*                                                                      *
*     TABLE - A PROGRAM TO PREPARE NROFF DRIVER TABLES                 *
*     copyright (c) 1985 by Bruce Townsend and Bell Northern Research  *
*     Permission hereby granted to use, distribute, modify, or copy    *
*     except for profit, providing this disclaimer is included.        *
*                                                                      *
*                                                                      *
*     Please send bug reports to Bruce Townsend (utcs!bnr-vpa!bruce)   *
*                                                                      *
*     Usage: 1) Modify this source to initialize the "t" structure.    *
*            2) If the amount of char data that the structure          *
*               references is very large, you may want to redefine     *
*               C_SIZE                                                 *
*            3) check to see whether <sgtty.h> or <termio.h> should    *
*               be #included. One of these include files may be        *
*               necessary to provide settings for t.bset, t.breset     *
*            4) Compile this source:                                   *
*                   cc -O table.c -o table                             *
*            5) Run the program as "table filename", where filename    *
*               is of the form "tab*", as in: "tab450"                 *
*            6) Locate the tabfile in the proper place (on our system  *
*               the directory is /usr/lib/term                         *
*                                                                      *
*	Date: Mon Feb 25 1985                                          *
*----------------------------------------------------------------------*
* October 18, 1987:                                                    *
* This version is for the HP Laserjet with the 92286J Math Elite       *
* Font Cartridge.                                                      *
*                                                                      *
* The entries are my best attempt but are not gaurenteed.              *
* We have been using the table for over 2 years and have found no      *
* problems on our HP9000 series 500 (until the 5.2 addition of         *
* kchar).                                                              *
*                                                                      *
* Roger N. Clark, USGS Branch of Geophysics, Denver (303) 236-1332     *
* hpfcla!hpfcse!hpfcmr!hpuecoa!bgphp1!rclark                           *
***********************************************************************/
#include	<stdio.h>
#include	<termio.h>	/* ... or use <sgtty.h> */
/* #include	<sgtty.h>	/* ... or use <termio.h> */

#define C_SIZE	10000	/* The maximum amount of character data allowed
			   in the initialized structure t - increase if
			   necessary */

#define	INCH	240
struct {			/* Initialize this structure */
	int bset;
	int breset;
	int Hor;
	int Vert;
	int Newline;
	int Char;
	int Kchar;
	int Em;
	int Halfline;
	int Adj;
	char *twinit;
	char *twrest;
	char *twnl;
	char *hlr;
	char *hlf;
	char *flr;
	char *bdon;
	char *bdoff;
	char *iton;
	char *itoff;
	char *ploton;
	char *plotoff;
	char *up;
	char *down;
	char *right;
	char *left;
	char *codetab[256-32];
	char *zzz;
} t = {
       /*****************************************************************
       *                                                                *
       *   HP LASERJET (kchar stuff not checked at all!)                *
       *                                                                *
       *****************************************************************/

/*bset*/        0,
/*breset*/      0177420,
/*Hor*/         INCH/120,
/*Vert*/        INCH/48,
/*Newline*/     INCH/6,
/*Char*/        INCH/12,
/*Kchar*/	INCH/12,
/*Em*/          INCH/12,
/*Halfline*/    INCH/12,
/*Adj*/         INCH/12,
/*twinit*/      "\033E\033&l14c1e7.64c66F",
					    /* default reset 66
                                               lines per page, ignore
                                               unprintible region of page
                                               near top and bottom
					                           */
/*twrest*/      "\033E\033&l14c1e7.64c66F",
/*twnl*/        "\n",
/*hlr*/         "\033&a-1R\033=",
/*hlf*/         "\033=",
/*flr*/         "\033&a-1R",
/*bdon*/        "\033(s7B\033(s0S",
/*bdoff*/       "\033(s0B\033(s0S",
/*iton*/	"\033(s1S\033(s0B",
/*itoff*/	"\033(s0S\033(s0B",
/*ploton*/      "\033&k2H\033&l1C",      /* horizontal space:1/120,
                                             vertical space: 1/48 inch */
/*plotoff*/     "\033&k10H\033&l7.64C",      /*horizontal space:1/12,
                                             vertical space: 1/6 inch 
                                             7.64/48 inch actually */
/*up*/          "\033&a-1R",        /* */
/*down*/        "\n",
/*right*/       " ",
/*left*/        "\b",
/*codetab*/

"\001 ",                          /*space*/
"\001!",                          /*!*/
"\001\042",                       /*"*/
"\001#",                          /*#*/
"\001$",                          /*$*/
"\001%",                          /*%*/
"\001&",                          /*&*/
"\001'",                          /*' close*/
"\001(",                          /*(*/
"\001)",                          /*)*/
"\001*",                          /***/
"\001+",                          /*+*/
"\001,",                          /*,*/
"\001-",                          /*- hyphen*/
"\001.",                          /*.*/
"\001/",                          /*/*/
"\2010",                          /*0*/
"\2011",                          /*1*/
"\2012",                          /*2*/
"\2013",                          /*3*/
"\2014",                          /*4*/
"\2015",                          /*5*/
"\2016",                          /*6*/
"\2017",                          /*7*/
"\2018",                          /*8*/
"\2019",                          /*9*/
"\001:",                          /*:*/
"\001;",                          /*;*/
"\001<",                          /*<*/
"\001=",                          /*=*/
"\001>",                          /*>*/
"\001?",                          /*?*/
"\001@",                          /*@*/
"\201A",                          /*A*/
"\201B",                          /*B*/
"\201C",                          /*C*/
"\201D",                          /*D*/
"\201E",                          /*E*/
"\201F",                          /*F*/
"\201G",                          /*G*/
"\201H",                          /*H*/
"\201I",                          /*I*/
"\201J",                          /*J*/
"\201K",                          /*K*/
"\201L",                          /*L*/
"\201M",                          /*M*/
"\201N",                          /*N*/
"\201O",                          /*O*/
"\201P",                          /*P*/
"\201Q",                          /*Q*/
"\201R",                          /*R*/
"\201S",                          /*S*/
"\201T",                          /*T*/
"\201U",                          /*U*/
"\201V",                          /*V*/
"\201W",                          /*W*/
"\201X",                          /*X*/
"\201Y",                          /*Y*/
"\201Z",                          /*Z*/
"\001[",                          /*[*/
"\001\134",                       /*\*/
"\001]",                          /*]*/
"\001^",                          /*^*/
"\001_",                          /*_ dash*/
"\001`",                          /*` open*/
"\201a",                          /*a*/
"\201b",                          /*b*/
"\201c",                          /*c*/
"\201d",                          /*d*/
"\201e",                          /*e*/
"\201f",                          /*f*/
"\201g",                          /*g*/
"\201h",                          /*h*/
"\201i",                          /*i*/
"\201j",                          /*j*/
"\201k",                          /*k*/
"\201l",                          /*l*/
"\201m",                          /*m*/
"\201n",                          /*n*/
"\201o",                          /*o*/
"\201p",                          /*p*/
"\201q",                          /*q*/
"\201r",                          /*r*/
"\201s",                          /*s*/
"\201t",                          /*t*/
"\201u",                          /*u*/
"\201v",                          /*v*/
"\201w",                          /*w*/
"\201x",                          /*x*/
"\201y",                          /*y*/
"\201z",                          /*z*/
"\001{",                          /*{*/
"\001|",                          /*|*/
"\001}",                          /*}*/
"\001~",                          /*~*/
"\001\033&k6H \033&k10H",         /*narrow sp set at 1/2 space, 12cpi*/
"\001-",                          /*hyphen*/
"\001\033(1QL\033(8U",            /*bullet*/
"\001\033(2Ql\033(8U",            /*square*/
"\001\033(0Q-\033(8U",            /*3/4 em*/
"\001_",                          /*rule*/
"\001\033(0Ew\033(8U",            /*1/4*/
"\001\033(0Ex\033(8U",            /*1/2*/
"\0033/4",                        /*3/4*/
"\001-",                          /*minus*/
"\202fi",                         /*fi*/
"\202fl",                         /*fl*/
"\202ff",                         /*ff*/
"\203ffi",                        /*ffi*/
"\203ffl",                        /*ffl*/
"\001\033(0Q#\033(8U",            /*degree*/
"\001\033(0A>\033(8U",            /*dagger*/
"\001\033(0A#\033(8U",            /* section*/
"\001'",                          /*foot mark*/
"\001'",                          /*acute accent*/
"\001`",                          /*grave accent*/
"\001_",                          /*underrule*/
"\001\033(1Qk\033(8U",            /*slash (longer)*/
"\001\033&k3H \033&k10H",     /*half narrow space, set at 1/4 space at 12cpi*/
"\001 ",                          /*unpaddable space*/
"\001\033(0AA\033(8U",            /*alpha*/
"\001\033(0AB\033(8U",            /*beta*/
"\001\033(0Aq\033(8U",            /*gamma*/
"\001\033(0Aw\033(8U",            /*delta*/
"\001\033(0AE\033(8U",            /*epsilon*/
"\001\033(0Az\033(8U",            /*zeta*/
"\001\033(0Ah\033(8U",            /*eta*/
"\001\033(0Ar\033(8U",            /*theta*/
"\001\033(0Ai\033(8U",            /*iota*/
"\001\033(0Ak\033(8U",            /*kappa*/
"\001\033(0Ag\033(8U",            /*lambda*/
"\001\033(0Am\033(8U",            /*mu*/
"\001\033(0An\033(8U",            /*nu*/
"\001\033(0Au\033(8U",            /*xi*/
"\001o",                          /*omicron*/
"\001\033(0Ap\033(8U",            /*pi*/
"\001\033(0Ao\033(8U",            /*rho*/
"\001\033(0As\033(8U",            /*sigma*/
"\001\033(0At\033(8U",            /*tau*/
"\001\033(0Ay\033(8U",            /*upsilon*/
"\001\033(0Ad\033(8U",            /*phi*/
"\001\033(0Ax\033(8U",            /*chi*/
"\001\033(0Ac\033(8U",            /*psi*/
"\001\033(0Al\033(8U",            /*omega*/
"\001\033(0QC\033(8U",            /*Gamma*/
"\001\033(0QD\033(8U",            /*Delta*/
"\001\033(0QH\033(8U",            /*Theta*/
"\001\033(0QK\033(8U",            /*Lambda*/
"\001\033(0QN\033(8U",            /*Xi*/
"\001\033(0QP\033(8U",            /*Pi*/
"\001\033(0QR\033(8U",            /*Sigma*/
"\000\0",                         /**/
"\001\033(0QT\033(8U",            /*Upsilon*/
"\001\033(0QU\033(8U",            /*Phi*/
"\001\033(0QW\033(8U",            /*Psi*/
"\001\033(0QX\033(8U",            /*Omega*/
"\001\033(0Q!\033(8U",            /*square root*/
"\001\033(0Q[\033(8U",            /*terminal sigma*/
"\001\033(1Q0\033(8U",            /*root en*/
"\001\033(0Q^\033(8U",            /*>=*/
"\001\033(0Q\134\033(8U",         /*<=*/
"\001\033(0A-\033(8U",            /*identically equal*/
"\001-",                          /*equation minus*/
"\001\033(0A)\033(8U",            /*approx =*/
"\001~",                          /*approximates*/
"\001\033(0Q]\033(8U",            /*not equal*/
"\001\033(0A|\033(8U",            /*right arrow*/
"\001\033(0A~\033(8U",            /*left arrow*/
"\001\033(0A{\033(8U",            /*up arrow*/
"\001\033(0A_\033(8U",            /*down arrow*/
"\001\033(0Q=\033(8U",            /*equation equal*/
"\001\033(0Q*\033(8U",            /*multiply*/
"\001\033(0A(\033(8U",            /*divide*/
"\001\033(0A%\033(8U",            /*plus-minus*/
"\001\033(1Q5\033(8U",            /*cup (union)*/
"\001\033(1Q6\033(8U",            /*cap (intersection)*/
"\001\033(1Q:\033(8U",            /*subset of*/
"\001\033(1Q;\033(8U",            /*superset of*/
"\001\033(1Q>\033(8U",            /*improper subset*/
"\001\033(1Q?\033(8U",            /*improper superset*/
"\001\033(0A<\033(8U",            /*infinity*/
"\001\033(0AF\033(8U",            /*partial derivative*/
"\001\033(0A$\033(8U",            /*gradient*/
"\001\033(1QH\033(8U",            /*not*/
"\001\033(1QU\033(8U",            /*int. sign*/
"\001\033(0A&\033(8U",            /*proportional to*/
"\001\033(1QX\033(8U",            /*empty set*/
"\001\033(1Q7\033(8U",            /*member of*/
"\001+",                          /*equation plus*/
"\001\033(2Q,\033(8U",            /*registered*/
"\001\033(2Q-\033(8U",            /*copyright*/
"\001\033(0A\042\033(8U",         /*box rule (042 is ")*/
"\001c\b/",                       /*cent sign*/
"\001\033(0A>\033(8U\b-",         /*dbl dagger*/
"\001\033(1Q&\033(8U",            /*right hand*/
"\001\033(1Q(\033(8U",            /*left hand*/
"\001*",                          /*math * */
"\001 ",                          /*bell system sign*/
"\001|",                          /*or (was star)*/
"\001\033(1QM\033(8U",            /*circle*/
"\001\033(1Qb\033(8U",            /*left top of big curley*/
"\001\033(1Qd\033(8U",            /*left bottom of big curley)*/
"\001\033(1Qr\033(8U",            /*right top */
"\001\033(1Qt\033(8U",            /*right bottom */
"\001\033(1Qc\033(8U",            /*left center of big curly bracket*/
"\001\033(1Qs\033(8U",            /*right center of big curly bracket*/
"\001\033(1Qu\033(8U",            /*bold vertical*/
"\001\033(1Qa\033(8U",            /*left floor(left bot of big sq bract)*/
"\001\033(1Qq\033(8U",            /*right floor (rb of ")*/
"\001\033(1Q`\033(8U",            /*left ceiling (lt of ")*/
"\001\033(1Qp\033(8U",           /*right ceiling (rt of ")*/

       NULL
       };


/************* DO NOT ALTER ANYTHING AFTER THIS POINT ***************/

struct {		/* This structure will be stored in the tab file */
	int bset;
	int breset;
	int Hor;
	int Vert;
	int Newline;
	int Char;
	int Kchar;
	int Em;
	int Halfline;
	int Adj;
	int twinit;
	int twrest;
	int twnl;
	int hlr;
	int hlf;
	int flr;
	int bdon;
	int bdoff;
	int iton;
	int itoff;
	int ploton;
	int plotoff;
	int up;
	int down;
	int right;
	int left;
	int codetab[256-32];
	int zzz;
} t_stor;

char	c_data[C_SIZE];
char	*c_pointer[256];
char	*c_end = c_data;
int	n_strings, c_size;

main (argc, argv)
int	argc;
char	*argv[];
{
	FILE	*table;
	int	i, j, i_len, j_len;
	char	*tail, *strcpy();

	if (argc != 2) {	/* Need a file name argument */
	    fprintf (stderr, "Usage: table \"file\"\n");
	    exit (1);
	    }

	/* Open the file */
	if ((table = fopen (argv[1], "w")) == NULL) {
	    fprintf (stderr, "File %s not opened for writing\n", argv[1]);
	    exit (1);
	    }

	/* Copy the integer values from the initialized structure
	   to the storage structure */
	t_stor.bset = t.bset;
	t_stor.breset = t.breset;
	t_stor.Hor = t.Hor;
	t_stor.Vert = t.Vert;
	t_stor.Newline = t.Newline;
	t_stor.Char = t.Char;
	t_stor.Kchar = t.Kchar;
	t_stor.Em = t.Em;
	t_stor.Halfline = t.Halfline;
	t_stor.Adj = t.Adj;

	/* Add the character strings into a character array */
	addstring (t.twinit);
	addstring (t.twrest);
	addstring (t.twnl);
	addstring (t.hlr);
	addstring (t.hlf);
	addstring (t.flr);
	addstring (t.bdon);
	addstring (t.bdoff);
	addstring (t.iton);
	addstring (t.itoff);
	addstring (t.ploton);
	addstring (t.plotoff);
	addstring (t.up);
	addstring (t.down);
	addstring (t.right);
	addstring (t.left);
	for (i = 0; i < 256 - 32; i++) addstring (t.codetab[i]);

	/* eliminate strings which are tails of other strings */
	for (i = 0; i < n_strings; i++) {
	    i_len = strlen (c_pointer[i]);
	    for (j = 0; j < n_strings; j++) {
		if (i == j) continue;
		j_len = strlen (c_pointer[j]);
		if (i_len <= j_len) {	/* string i could be tail of string j */
		    tail = c_pointer[j] + j_len - i_len;
		    if (! strcmp (c_pointer[i], tail)) {
			clearstring (c_pointer[i]);
			break;
			}
		    }
		}
	    }

	/* Compress the c_data array to eliminate strings of nulls */
	for (i = j = 0; i < n_strings; i++) {
	    if (! *c_pointer[i]) continue;
	    tail = strlen (strcpy (c_pointer[j], c_pointer[i])) +
		    c_pointer[j] + 1;
	    c_pointer[++j] = tail;
	    }

	c_size = c_pointer[j] - c_data;	/* The amount of data to be stored */

	/* Now find each string in this table and provide an index to it */
	t_stor.twinit = findstring (t.twinit);
	t_stor.twrest = findstring (t.twrest);
	t_stor.twnl = findstring (t.twnl);
	t_stor.hlr = findstring (t.hlr);
	t_stor.hlf = findstring (t.hlf);
	t_stor.flr = findstring (t.flr);
	t_stor.bdon = findstring (t.bdon);
	t_stor.bdoff = findstring (t.bdoff);
	t_stor.iton = findstring (t.iton);
	t_stor.itoff = findstring (t.itoff);
	t_stor.ploton = findstring (t.ploton);
	t_stor.plotoff = findstring (t.plotoff);
	t_stor.up = findstring (t.up);
	t_stor.down = findstring (t.down);
	t_stor.right = findstring (t.right);
	t_stor.left = findstring (t.left);
	for (i = 0; i < 256 - 32; i++) {
	    t_stor.codetab[i] = findstring (t.codetab[i]);
	    }
	t_stor.zzz = 0;

	/* Write the character storage block size */
	if (fwrite (&c_size, sizeof (c_size), 1, table) != 1)
	    write_err ();

	if (fwrite (&t_stor, sizeof (t_stor), 1, table) != 1)
	    write_err ();

	if (fwrite (c_data, sizeof (*c_data), c_size, table) != c_size)
	    write_err ();

	if (fclose (table)) {
	    fprintf (stderr, "File %s not closed properly\n", argv[1]);
	    exit (1);
	    }
	}

addstring (string)
char	*string;
{
	c_pointer[n_strings] = c_end;
	c_end += strlen (string) + 1;
	if (c_end >= c_data + C_SIZE) {
	    fprintf (stderr, "Table size too small, increase it!/n");
	    exit(1);
	    }
	strcpy (c_pointer[n_strings++], string);
}

clearstring (string)
char	*string;
{
	while (*string) *string++ = 0;
}

findstring (string)
char	*string;
{
	int	c_len, s_len, i;

	for (i = 0; c_pointer[i]; i++) {
	    if ((c_len = strlen (c_pointer[i])) >= (s_len = strlen (string))) {
		if (!strcmp (string, c_pointer[i] + c_len - s_len))
		    return (c_pointer[i] + c_len - s_len - c_data);
		}
	    }
	fprintf (stderr, "Serious bug! string not found in table\n");
	exit(1);
	/* NOT REACHED */
	}



write_err () {
	fprintf (stderr, "Write to file failed\n");
	exit (1);
	}
@EOF
set -- `sum <laser.c`; if test $1 -ne 1563
then
	echo ERROR: laser.c checksum is $1 should be 1563
fi
if test "`wc -lwc <laser.c`" != '    528   1688  19074'
then
	echo ERROR: wc results of laser.c are `wc -lwc <laser.c` should be     528   1688  19074
fi

chmod 644 laser.c

echo x - makeit
cat >makeit <<'@EOF'
set -x
cc -O laser.c -o laser 
laser tabhplaser2
mv tabhplaser2 /usr/lib/term
rm laser
@EOF
set -- `sum <makeit`; if test $1 -ne 7542
then
	echo ERROR: makeit checksum is $1 should be 7542
fi
if test "`wc -lwc <makeit`" != '      5     14     87'
then
	echo ERROR: wc results of makeit are `wc -lwc <makeit` should be       5     14     87
fi

chmod 744 makeit

echo x - CHAR.SET
cat >CHAR.SET <<'@EOF'
.nr LL 4.5i
.ll 4.5i
.nr PO 2.0i
.po 2.0i
.nr VS 18
.vs 18
.ND
.B
.ce 2
NROFF Character Set on the
HP Laserjet
.R

.B
The Alphabet:
.R

 a b c d e f g h i j k l m n o p q r s t u v w x y z
 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


.B
Greek:
.R

 \(*a \(*b \(*g \(*d \(*e \(*z \(*y \(*h \(*i \(*k \(*l \(*m \(*n
\(*c \(*o \(*p \(*r \(*s \(ts \(*t \(*u \(*f \(*x \(*q \(*w
\(*A \(*B \(*G \(*D \(*E \(*Z \(*Y \(*H \(*I \(*K \(*L \(*M \(*N \(*C
\(*O \(*P \(*R \(*S \(*T \(*U \(*F \(*X \(*Q \(*W


.B
Math Symbols:
.R
\(sr \(rn \(>= \(<= \(== \(~= \(ap \(!= \(mu \(di \(+- \(cu \(ca \(sb
\(sp \(ib \(ip \(if \(pd \(gr \(no \(is \(pt \(es \(mo \(br


.B
Numbers:
.R
 1 2 3 4 5 6 7 8 9 0


.B
Other Symbols:
.R
 ! @ # $ % ^ & * ( ) _ - + = ~ ` | \\ [ ] : ; " ' ? / > . < , { }
\(bu \(em \(sq \(14 \(12 \(de \(dg \(ct \(rg \(co \(sc \(-> \(<-
\(ua \(da \(rh \(lh \(ci
 

.bp
.nf

CHAR     INPUT NAME      CHARACTER NAME    

 '          '               close quote          
 `          `               open quote
 \(em       \\(em           3/4 Em dash
 -          -               hyphen or
 \(hy       \\(hy           hyphen
 \-         \\-             current font minus
 \(bu       \\(bu           bullet
 \(sq       \\(sq           square
 \(ru       \\(ru           rule
 \(14       \\(14           1/4
 \(12       \\(12           1/2
 \(34       \\(34           3/4
 \(fi       \\(fi           fi
 \(fl       \\(fl           fl
 \(ff       \\(ff           ff
 \(ffi      \\(Fi           ffi
 \(ffl      \\(Fl           ffl
 \(de       \\(de           degree
 \(dg       \\(dg           dagger
 \(fm       \\(fm           foot mark
 \(ct       \\(ct           cent sign
 \(rg       \\(rg           registered
 \(co       \\(co           copyright
 \(pl       \\(pl           math plus
 \(mi       \\(mi           math minus
 \(eq       \\(eq           math equals
 \(**       \\(**           math star
 \(sc       \\(sc           section
 \(aa       \\(aa           acute accent
 \(ga       \\(ga           grave accent
 \(ul       \\(ul           underrule
 \(sl       \\(sl           slash (matching backslash)
 \(*a       \\(*a           alpha
 \(*b       \\(*b           beta
 \(*g       \\(*g           gamma
 \(*d       \\(*d           delta
 \(*e       \\(*e           epsilon
 \(*z       \\(*z           zeta
 \(*y       \\(*y           eta
 \(*h       \\(*h           theta
 \(*i       \\(*i           iota
 \(*k       \\(*k           kappa
 \(*l       \\(*l           lambda
 \(*m       \\(*m           mu
 \(*n       \\(*n           nu
 \(*c       \\(*c           xi
 \(*o       \\(*o           omicron
 \(*p       \\(*p           pi
 \(*r       \\(*r           rho
 \(*s       \\(*s           sigma
 \(ts       \\(ts           terminal sigma
 \(*t       \\(*t           tau
 \(*u       \\(*u           upsilon
 \(*f       \\(*f           phi
 \(*x       \\(*x           chi
 \(*q       \\(*q           psi
 \(*w       \\(*w           omega
 \(*A       \\(*A           Alpha
 \(*B       \\(*B           Beta
 \(*G       \\(*G           Gamma
 \(*D       \\(*D           Delta
 \(*E       \\(*E           Epsilon
 \(*Z       \\(*Z           Zeta
 \(*Y       \\(*Y           Eta
 \(*H       \\(*H           Theta
 \(*I       \\(*I           Iota
 \(*K       \\(*K           Kappa
 \(*L       \\(*L           Lambda
 \(*M       \\(*M           Mu
 \(*N       \\(*N           Nu
 \(*C       \\(*C           Xi
 \(*O       \\(*O           Omicron
 \(*P       \\(*P           Pi
 \(*R       \\(*R           Rho
 \(*S       \\(*S           Sigma
 \(*T       \\(*T           Tau
 \(*U       \\(*U           Upsilon
 \(*F       \\(*F           Phi
 \(*X       \\(*X           Chi
 \(*Q       \\(*Q           Psi
 \(*W       \\(*W           Omega
 \(sr       \\(sr           square root
 \(rn       \\(rn           root en extender
 \(>=       \\(>=           greater than or equal to
 \(<=       \\(<=           less than or equal to
 \(==       \\(==           exactly equal
 \(~=       \\(~=           approx. =
 \(ap       \\(ap           approximates
 \(!=       \\(!=           not equal
 \(->       \\(->           right arrow
 \(<-       \\(<-           left arrow
 \(ua       \\(ua           up arrow
 \(da       \\(da           down arrow
 \(mu       \\(mu           multiply
 \(di       \\(di           divide
 \(+-       \\(+-           plus-minus
 \(cu       \\(cu           cup (union)
 \(ca       \\(ca           cap (intersection)
 \(sb       \\(sb           subset of
 \(sp       \\(sp           superset of
 \(ib       \\(ib           improper subset
 \(ip       \\(ip           improper superset 
 \(if       \\(if           infinity
 \(pd       \\(pd           partial derivative
 \(gr       \\(gr           gradient
 \(no       \\(no           not
 \(is       \\(is           integral sign
 \(pt       \\(pt           proportional to
 \(es       \\(es           empty set
 \(mo       \\(mo           member of
 \(br       \\(br           box vertical rule
 \(dd       \\(dd           double dagger
 \(rh       \\(rh           right hand
 \(lh       \\(lh           left hand
 \(bs       \\(bs           Bell System logo
 \(or       \\(or           or
 \(ci       \\(ci           circle
 \(lt       \\(lt           left top of curly bracket
 \(lb       \\(lb           left bottom 
 \(rt       \\(rt           right top
 \(rb       \\(rb           right bottom
 \(lk       \\(lk           left center of big curly bracket
 \(rk       \\(rk           right center of big curly bracket
 \(bv       \\(bv           bold vertical
 \(lf       \\(lf           left floor (left bottom of big square
                            bracket) 
 \(rf       \\(rf           right floor (right bottom)
 \(lc       \\(lc           left ceiling (left top)
 \(rc       \\(rc           right ceiling (right top)
@EOF
set -- `sum <CHAR.SET`; if test $1 -ne 13389
then
	echo ERROR: CHAR.SET checksum is $1 should be 13389
fi
if test "`wc -lwc <CHAR.SET`" != '    186    711   5823'
then
	echo ERROR: wc results of CHAR.SET are `wc -lwc <CHAR.SET` should be     186    711   5823
fi

chmod 644 CHAR.SET

exit 0

irf@kuling.UUCP (Bo Thide) (03/20/88)

In article <830002@bgphp1.UUCP> rclark@bgphp1.UUCP (Roger N. Clark) writes:
>> Does anybody have an nroff driver for the LaserJet Series II?
>
>Well, this is not specifically for the Series II, but it is probably compatible.
>
>I have also been waiting for someone to post the laserjet nroff driver
>table.  HP helped me with the one below.  They sent the version
>from Bruce Townsend (Bruce had it configured for another printer).
>I figured out all the escape codes for the laser and made the
>table delow.  I gave the table to HP with the hope that they would do

In fact, Bruce has posted a newer version of his nroff table package with
support for 16-bit characters (kchar).  In his package he also included
a table for Laserjet+ making available ALL nroff charaters (provided
you have the correct font cartridge).  This table was written by me as
part of a very simple table-generating program which was very inferior
to Bruce's.  Anyway, the table is there and works perfectly on our 9000/540
running HP-UX 5.21.  I hope HP takes the various tables as a starting
point for a supported nroff table.  (I know my table has a couple of
null entries written "\200" when they really should have been "\000\0" or
something similar).  At the same time I hope HP fixes the nroff bugs
preventing you from using proportionally spaced characters ...(!)...

-Bo

-- 
>>> Bo Thide', Swedish Institute of Space Physics, S-755 90 Uppsala, Sweden <<<  Phone (+46) 18-300020.  Telex: 76036 (IRFUPP S).  UUCP: ..enea!kuling!irfu!bt