Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site panda.UUCP Path: utzoo!watmath!clyde!cbosgd!ucbvax!dual!lll-crg!seismo!harvard!talcott!panda!sources-request From: sources-request@panda.UUCP Newsgroups: mod.sources Subject: HP LaserJet driver part 1 of 2 Message-ID: <942@panda.UUCP> Date: Wed, 25-Sep-85 09:52:14 EDT Article-I.D.: panda.942 Posted: Wed Sep 25 09:52:14 1985 Date-Received: Sat, 28-Sep-85 06:37:45 EDT Sender: jpn@panda.UUCP Lines: 440 Approved: jpn@panda.UUCP Mod.sources: Volume 3, Issue 18 Submitted by: philabs!ron1!ron (Ron Saad) Enclosed is the shar format source for a ditroff driver that I implemented for the HP LaserJet. Ron Saad (4Z4UY) Sys Adm - Center for Advanced Technology in Telecommunications Polytechnic Institute of New York UUCP: ...{ihnp4,seismo}!{philabs,cmcl2}!ron1!ron MAIL: 333 Jay St. Brooklyn, N.Y. 11201 PHONE: (718) 643-7303 #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # README # asctab.h # glyph.h # spectab.h # This archive created: Mon Sep 23 23:09:20 1985 export PATH; PATH=/bin:$PATH echo shar: extracting "'README'" '(3528 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^ X//' << \SHAR_EOF > 'README' XFollowing is a driver (filter, postprocessor?) for getting ditroff Xoutput on the HP LaserJet printer. It is by no means a finished Xproduct. It still needs a lot of work, partly for cleanup and partly Xfor making it really usable. X XThe major drawback of the filter is that the output is GIGANTIC, Xbecause it issues positioning commands for EVERY character. This also Xmakes the printing EXTREMELY SLOW. (but don't get discouraged, it's Xstill usable ...) X XThe only fix to that problem is to use the LaserJet's default spacing Xfor characters, and add width tables for troff to handle the different Xspacings of the LaserJet. This has the advantage of reducing the output Xsize considerably, along with the time required to print it, BUT - you Xalso have to settle for the LaserJet's spacing, which is rather wide Xand unattractive (*my opinion*). Also, the width tables I have don't Xagree TOO well with vfont - they expect the Sys 5 stuff - so that could Xuse some work too. X XThe 'draw' functions are not implemented in this filter. I was too lazy Xto add them since it's a bit of work and I am not using pic for Xanything right now, but if you have the 'draw.c' file that came with XDWB (or maybe the equivalent from Berkeley, which I don't have) than Xyou can do this yourself. X XThe fonts in rasti10 look nicer than the ones in vfont. However, the Xglyphs are placed in different positions in the font file, so they need Xcode tables to drive them. I never got around to adding the code Xtables, but if I do I'll make them available. X XThere is a 'bug' that I haven't fixed yet - the Laserjet barfs on long Xpages. It will not take a positioning command to go to vertical 7600, Xfor example, even though it's less than 11 inches. I haven't had enough Xtime to look into this and find out exactly how much it WILL let me Xuse, but instead I massage all my input files to use a page length Xof 10 inches ... XThis should not be hard to fix, and if you do, let me know about it. X XMany people asked for the ^S/^Q filter. I have received many responses Xtelling me that this can be achieved via the LITOUT bit, and as many Xtelling me that it can't be achieved through LITOUT because of a bug in Xthe device driver. I have also received a few versions of fixes for Xthis problem. I am therefore leaving out this problem, as it seems to Xhave been dealt with extensively. If anybody REALLY wants it, drop me a Xline and I'll mail it to you (along with all the other proposed Xsolutions I received). X XFinally, I have lost my HP LaserJet to an AT&T 6300 in an adjacent Xoffice. Rumors are we are getting an X2700 (II), but financial Xdecisions have not been completed yet. Therefore it seems that Xenhancements to this filter will not be top priority in the near future X(anybody want to donate a LaserJet to an educational institute ? :-) X XIf you wish to add the width tables yourself, the information is Xavailable from Hewlet Packard. Just call them. If you need any info Xfrom me, feel free to contact me either through the net (uucp address Xbelow) or through the phone... X XAnd just one thing. If you do make modifications/enhancements/etc, XPLEASE let me know? send over whatever you have so that we could share Xit with the rest of the net? X X------------the opinions expressed above etc. etc. -------------- X X Ron Saad (4Z4UY) Sys Adm - X Center for Advanced Technology X in Telecommunications X Polytechnic Institute of New York X XUUCP: ...{ihnp4,seismo}!{philabs,cmcl2}!ron1!ron XMAIL: 333 Jay St. Brooklyn, N.Y. 11201 XPHONE: (718) 643-7303 SHAR_EOF if test 3528 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 3528 characters)' fi fi # end of overwriting check echo shar: extracting "'asctab.h'" '(1440 characters)' if test -f 'asctab.h' then echo shar: will not over-write existing file "'asctab.h'" else sed 's/^ X//' << \SHAR_EOF > 'asctab.h' X/* X * $Header: asctab.h,v 1.1 85/08/15 14:55:33 ron Exp $ X */ X X/* X * asctab.h - Copyright (c) 1985 by Ron Saad X * X * This code may be freely distributed in source X * for non commercial purposes. X * Please keep this notice intact. X */ X X/* X * $Log: asctab.h,v $ X * Revision 1.1 85/08/15 14:55:33 ron X * Initial revision X * X * X */ X Xchar *asctab[] ={ X /* X * these should be things that are "easy" X * to generate with esc seq and the X * cartridge data, not needing a raster map, X * plus things that are not available on the X * special font in raster form X */ X "\\|", "\033&a+12H", /* 1/6 em space ?? */ X "\\^", "\033&a+36H", /* 1/2 em space ?? */ X "em", "-", /* FIX THIS TO DO 3/4 EM */ X "hy", "-", X "\\-", "\033&a+30H-", /* curr fnt minus - spacing problem */ X /* "mi", "\033&a+30H-", /* SHOULD BE ON SPEC FONT */ X "ce", "\277", X /* does not work - maybe because we have X * the B cartridge instead of the F one X */ X "dg", "|\033&a-30H-", /* looks lousy - do better */ X "aa", "'", X "ga", "`", X "en", "-", X /* "ru", "_", /* use the bit map instead */ X "l.", ".", X "br", "|", X "vr", "|", X "fm", "'", X "or", "|", X "fi", "f\033&a-25Hi", /* fake ligature */ X "ff", "f\033&a-25Hf", /* fake ligature */ X "fl", "f\033&a-25Hl", /* fake ligature */ X "Fi", "f\033&a-30Hf\033&a-25Hi", /* fake ligature */ X "Fl", "f\033&a-30Hf\033&a-25Hl", /* fake ligature */ X /* "sl", "\033&a-50H/", /* spacing problem - is on the spec font */ X 0, 0, X}; X SHAR_EOF if test 1440 -ne "`wc -c < 'asctab.h'`" then echo shar: error transmitting "'asctab.h'" '(should have been 1440 characters)' fi fi # end of overwriting check echo shar: extracting "'glyph.h'" '(1470 characters)' if test -f 'glyph.h' then echo shar: will not over-write existing file "'glyph.h'" else sed 's/^ X//' << \SHAR_EOF > 'glyph.h' X/* X * $Header: glyph.h,v 1.1 85/08/15 15:07:31 ron Exp $ X */ X X/* X * $Log: glyph.h,v $ X * Revision 1.1 85/08/15 15:07:31 ron X * Initial revision X * X * X */ X Xstruct f_header X { X short f_magic ; X /* X * Should be 0436 - for vfont. rasti10 uses X * just 0 (i think) X */ X unsigned short f_size ; X /* X * Total size of raster section X * of the font file. X */ X /* X * the following are used for vfont, but seem to X * be consistently 0 for rasti10. this gives us X * a way to distinguish between them. X */ X short f_maxx ; /* Largest x of character */ X short f_maxy ; /* Largest y of character */ X short f_xtnd ; /* Largest extender */ X } ; X Xstruct c_param X { X unsigned short c_addr ; X /* X * Offset in file where character X * is located. doesn't include the X * size of the c_param and f_header X * structures - see F_OFFSET below X */ X short c_size ; /* Size in bytes of character */ X char c_up ; X char c_down ; X /* X * c_up + c_down = heigth of raster in X * font file, in rows, for vfont. rasti10 wants X * c_up + c_down + 1. X */ X char c_left ; X char c_right ; X /* X * c_right + c_left = width of raster in X * font file, in bits (dots), for vfont. rasti10 wants X * c_right + c_left + 1. X */ X char c_width ; X /* X * Width, including space required X * to print character. X * rasti10 may not use this. be careful. X */ X } ; X X X#define F_OFFSET ((long)(sizeof(struct f_header)+ \ X 256*sizeof(struct c_param))) SHAR_EOF if test 1470 -ne "`wc -c < 'glyph.h'`" then echo shar: error transmitting "'glyph.h'" '(should have been 1470 characters)' fi fi # end of overwriting check echo shar: extracting "'spectab.h'" '(4258 characters)' if test -f 'spectab.h' then echo shar: will not over-write existing file "'spectab.h'" else sed 's/^ X//' << \SHAR_EOF > 'spectab.h' X/* X * $Header: spectab.h,v 1.1 85/08/15 15:07:15 ron Exp $ X */ X X/* X * spectab.h - Copyright (c) 1985 by Ron Saad X * X * This code may be freely distributed in source X * for non commercial purposes. X * Please keep this notice intact. X */ X X/* X * $Log: spectab.h,v $ X * Revision 1.1 85/08/15 15:07:15 ron X * Initial revision X * X * X */ X Xchar *spectab[] ={ X /* X * these are the names of the characters X * on the Special font, in same order as X * described in the 'Berkeley Font Catalog'. X * The index of the name is supposed to give X * the position of that character in the X * character description table, from which X * we directly grab a pointer to the binary X * bit map starting position. X */ X "", /* space */ X "if", /* infinity */ X "ip", /* improper superset */ X "pt", /* proportional to */ X "rh", /* right hand */ X "cu", /* cup (union) */ X "rn", /* root en extender */ X "bs", /* bell sign - seems to have disappeared from X the troff output according to the DWB manual */ X "+-", /* plus-minus */ X "<=", /* <= */ X ">=", /* >= */ X "sr", /* square root */ X "ts", /* terminal sigma */ X "is", /* integral sign */ X "sl", /* slash */ X "bv", /* bold vertical */ X "lf", /* left floor (big bracket) */ X "rf", /* right floor (big bracket) */ X "lc", /* left ceiling (big bracket) */ X "rc", /* right ceiling (big bracket) */ X "lt", /* left top (big brace) */ X "lb", /* left bottom (big brace) */ X "rt", /* right top (big brace) */ X "rb", /* right bottom (big brace) */ X "lk", /* left center (big brace) */ X "rk", /* right center (big brace) */ X "sb", /* subset of */ X "sp", /* superset of */ X "ca", /* cap (intersection) */ X "no", /* not */ X "lh", /* left hand */ X "mo", /* member of */ X "", X "", X "\"", /* - not in DWB manual */ X "#", /* - not in DWB manual */ X "", X "", X "", X "\\'", /* name not in Berekeley, but looks like X an accute accent. will never be used since X "aa" occurs in asctab first. */ X "gr", /* gradient */ X "", X "mu", /* multiply */ X "pl", /* math plus */ X "", X "mi", /* math minus */ X "", X "di", /* divide */ X "==", /* identically equal */ X "~=", /* approximately equal */ X "ap", /* approximates */ X "!=", /* not equal */ X "<-", /* left arrow */ X "->", /* right arrow */ X "ua", /* up arrow */ X "da", /* down arrow */ X "sc", /* section */ X "**", /* math star */ X "", X "", X "", /* really a '<' */ X "eq", /* name not in Berekeley */ X "", /* really a '>' */ X "", X "", /* looks like the '@' */ X "*A", /* Alpha (mapped into English on font pos 1) */ X "*B", /* Betta (mapped into English on font pos 1) */ X "*G", /* Gamma */ X "*D", /* Delta */ X "*E", /* Epsilon (mapped into English on font pos 1) */ X "*Z", /* Zetta (mapped into English on font pos 1) */ X "*Y", /* Etta (mapped into English on font pos 1) */ X "*H", /* Theta */ X "*I", /* Iotta (mapped into English on font pos 1) */ X "*K", /* Kappa (mapped into English on font pos 1) */ X "*L", /* Lambda */ X "*M", /* Mu (mapped into English on font pos 1) */ X "*N", /* Nu (mapped into English on font pos 1) */ X "*C", /* Xi */ X "*O", /* Omicron (mapped into English on font pos 1) */ X "*P", /* Pi */ X "*R", /* Rho (mapped into English on font pos 1) */ X "*S", /* Sigma */ X "*T", /* Tau (mapped into English on font pos 1) */ X "*U", /* Upsilon */ X "*F", /* Phi */ X "*X", /* Chi (mapped into English on font pos 1) */ X "*Q", /* Psi */ X "*W", /* Omega */ X "dd", /* double dagger - not in DWB manual */ X "br", /* box vertical rule */ X "ib", /* improper subset */ X "\\e", /* backslash - not in DWB manual */ X "ci", /* circle */ X "", /* really a '^' */ X /* "ul", /* underrule - name not in Berkeley */ X "ru", /* try a rule - name not in Berkeley */ X "\\`", /* grave accent ("ga" listed in asctab) */ X "*a", /* alpha */ X "*b", /* betta */ X "*g", /* gamma */ X "*d", /* delta */ X "*e", /* epsilon */ X "*z", /* zetta */ X "*y", /* etta */ X "*h", /* theta */ X "*i", /* iotta */ X "*k", /* kappa */ X "*l", /* lambda */ X "*m", /* mu */ X "*n", /* nu */ X "*c", /* xi */ X "*o", /* omicron */ X "*p", /* pi */ X "*r", /* rho */ X "*s", /* sigma */ X "*t", /* tau */ X "*u", /* upsilon */ X "*f", /* phi */ X "*x", /* chi */ X "*q", /* psi */ X "*w", /* omega */ X "pd", /* partial derivative */ X "es", /* empty set */ X "", /* really a '{' */ X "or", /* or */ X "", /* really a '}' */ X "", /* really a '~' */ X "" X}; X SHAR_EOF if test 4258 -ne "`wc -c < 'spectab.h'`" then echo shar: error transmitting "'spectab.h'" '(should have been 4258 characters)' fi fi # end of overwriting check # End of shell archive exit 0 Brought to you by Super Global Mega Corp .com