home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / psroff3.0 / patch6 < prev    next >
Encoding:
Internet Message Format  |  1991-12-12  |  30.6 KB

  1. Subject: v25i033: psroff 3.0 patch 6
  2. Newsgroups: comp.sources.unix
  3. Approved: vixie@pa.dec.com
  4.  
  5. Submitted-By: clewis@ferret.ocunix.on.ca (Chris Lewis)
  6. Posting-Number: Volume 25, Issue 33
  7. Archive-Name: psroff3.0/patch6
  8.  
  9.     This is official patch 06 for Psroff 3.0.
  10.     Please apply it by:
  11.     cd <psroff source directory>
  12.     patch -N -p < <this file>
  13.  
  14. This is a moderately important patch:
  15.     1) \X emulation was busted, so you couldn't use psfig.
  16.     2) catconv enabling was a bit confused and buggy.
  17.     3) you couldn't feed troff2ps ditroff output back into
  18.        psroff troff2ps input. Ie: after previewing ditroff
  19.        on xtroff, you pass the file to psroff to print on
  20.        postscript, and if you selected a font past position 9
  21.        in the *.fonts file.  (you would have gotten spurious
  22.        "increase INTFONTS" messages)
  23.     4) \D didn't work with ditroff output.
  24.     5) psrofflib.S wasn't taking advantage of %%FONTDIR%%
  25.     6) Improved documentation on lparg setting and catconv
  26.        enabling (and why you'd want catconv)
  27.  
  28. You are likely to get a number of rejects on psrofflib.S.
  29. Please take the time to merge the changes with your configuration.
  30. There were several places where the build procedure wouldn't
  31. substitute in properly.  Also, for your enjoyment, I have
  32. turned on optimization in the Postscript driver by default, which
  33. should have been done years ago.
  34.  
  35. ./lib/psrofflib.S    documentation/config/-Tps optimizer
  36. ./utils/catconv.S    \X busted.
  37. ./utils/hpinterp.c    fixed missing argument for font dumps
  38. ./dt.c            (3) & (4)
  39. ./utils.c        (3)
  40. ./ps.c            \D't..' (line thickness) didn't work.
  41. ./dit.c            Rewrote misleading error message.
  42. ./README        Futures/hp2pbm/contact info
  43. ./defs.h        patch level
  44. ./Makefile        documentation re perl/catconv.
  45. ./psroff.S        catconv invocation.
  46. ./makeincl.S        PERL substitution botch.
  47.  
  48. Patchwrapped: 911207025223
  49.  
  50. Index: ./lib/psrofflib.S
  51. *** /tmp/PATCHold/./lib/psrofflib.S    Sat Dec  7 02:48:55 1991
  52. --- ./lib/psrofflib.S    Sat Dec  7 02:48:59 1991
  53. ***************
  54. *** 1,8 ****
  55. ! #    2.20 91/08/03
  56.   #    This file controls psroff, you can insert additional printer
  57.   #    types here.  These are eval'd *late* in processing, so that
  58.   #    you can insert $copies etc.
  59.   #
  60.   #    Syntax:
  61.   #
  62.   # troff=<path to troff>
  63. --- 1,17 ----
  64. ! #    2.22 91/12/07
  65.   #    This file controls psroff, you can insert additional printer
  66.   #    types here.  These are eval'd *late* in processing, so that
  67.   #    you can insert $copies etc.
  68.   #
  69. + #    This file contains a couple lines that specify the parameters
  70. + #    for each different -T<xx> option to psroff.  The -T<xx> options
  71. + #    for psroff select which psroff configuration/printer method you
  72. + #    wish to use.  Most people won't have to change anything except
  73. + #    "trofftype" and lparg.  The former once, the latter for each -T
  74. + #    option that is applicable to you.  Each entry is commented
  75. + #    with an english description of the configuration.  Find the one[s]
  76. + #    closest to what you want, and modify as necessary.
  77. + #
  78.   #    Syntax:
  79.   #
  80.   # troff=<path to troff>
  81. ***************
  82. *** 19,27 ****
  83.   #        recommended if you have printers with different character
  84.   #        widths.  Psroff will complain.  See trofftype assignment below.
  85.   #
  86. ! #    name: name of config (eg: xt for ditroff->xtroff).
  87.   #    width: name of width files (eg: "ps" for %%FONTDIR%%/ps/ftXX).
  88. ! #    ptr: default physical printer id (eg: "lp -d$ptr")
  89.   #
  90.   #    Useful troff2ps args:
  91.   #        -T<type>    driver type (ps, lj, dt)
  92. --- 28,38 ----
  93.   #        recommended if you have printers with different character
  94.   #        widths.  Psroff will complain.  See trofftype assignment below.
  95.   #
  96. ! #    name: name of config (eg: xt for ditroff->xtroff).  The name
  97. ! #        is used by psroff to select the configuration via -T<name>.
  98.   #    width: name of width files (eg: "ps" for %%FONTDIR%%/ps/ftXX).
  99. ! @        This is what troff is told, not necessarily troff2ps.
  100. ! #    ptr: default physical printer name (eg: "lp -d$ptr")
  101.   #
  102.   #    Useful troff2ps args:
  103.   #        -T<type>    driver type (ps, lj, dt)
  104. ***************
  105. *** 28,36 ****
  106.   #        -p<printer>    printer-specific initializations - eg:
  107.   #                prefix for *.lib and *.fonts files.
  108.   #                (defaults to <type>).  Should be set
  109. ! #                *before* -T.
  110.   #        -d<device>    x T <device> for ditroff drivers.
  111. ! #                (defaults to alw)
  112.   #        -R<num>        ditroff resolution to use.  Default 300
  113.   #        -O<pageoffset>    offset to be applied *bypassing* troff.
  114.   #                Default "-O.5i".  Set to 0 to get this
  115. --- 39,49 ----
  116.   #        -p<printer>    printer-specific initializations - eg:
  117.   #                prefix for *.lib and *.fonts files.
  118.   #                (defaults to <type>).  Should be set
  119. ! #                *after* -T.
  120.   #        -d<device>    x T <device> for ditroff drivers.
  121. ! #                (defaults to alw)  Normally is same
  122. ! #                as width parameter.  Only matters if you're
  123. ! #                driving some other ditroff drivers.
  124.   #        -R<num>        ditroff resolution to use.  Default 300
  125.   #        -O<pageoffset>    offset to be applied *bypassing* troff.
  126.   #                Default "-O.5i".  Set to 0 to get this
  127. ***************
  128. *** 62,67 ****
  129. --- 75,109 ----
  130.   #        print spool invocation manually simply by changing lparg
  131.   #        to "cat".
  132.   #
  133. + #        On BSDish systems (eg: SunOS, Ultrix etc.) that have lpr
  134. + #        you want:
  135. + #            lparg='lpr -#$copies -P$ptr'
  136. + #        On System V systems with "lp" you want:
  137. + #            lparg='lp -n$copies -d$ptr'
  138. + #
  139. + #        Warning: HP Laserjet output needs a 8-bit path without
  140. + #        any newline or tab expansion.  You will have to examine
  141. + #        your print spooler interface script or documentation to
  142. + #        see how to invoke it.  On many System V systems it's "-og"
  143. + #        (graphics) which leads to a lparg setting of:
  144. + #            lparg='lp -og -n$copies -d$ptr'
  145. + #
  146. + #        Some systems have environment variables that can be
  147. + #        used to default the printer in lp[r].  Your best bet is to
  148. + #        simply leave the "-?$ptr" option out.  However, you
  149. + #        should be cautious about this - a single environment
  150. + #        variable won't be sufficient when you're using multiple
  151. + #        psroff -T's.  For example, if you have a Laserjet and
  152. + #        Postscript printer, the environment variable would
  153. + #        have to change for -Tlj versus -Tps.  Often it's
  154. + #        the same physical printer but different logical names.
  155. + #
  156. + #    One further option: if you add "v=1" to the entry, catconv will
  157. + #    be invoked.  This will enable the ditroff emulation facilities
  158. + #    so that \X'...' (eg: psfig), \D'...' (drawing commands), and the
  159. + #    extended character set will be enabled.  You MUST have perl to have
  160. + #    this work.  This isn't needed for ditroff.
  161. + #    
  162.   #    Use single quotes for all strings that have embedded blanks or
  163.   #    other metacharacters.  (This delays the variable replacement until
  164.   #    the correct point).  Lines can be continued by prepending the
  165. ***************
  166. *** 68,88 ****
  167.   #    continuation lines with the "name" followed by whitespace.
  168.   #
  169.   #    psroff will use the last assignments to troff and trofftype
  170. ! #    ditroff prior to the matching name.
  171. ! #
  172. ! #    There is one additional magic flag, "v".  If you specify
  173. ! #    "v=1" (as in cdps entry below), psroff will arrange to run
  174. ! #    catconv on the (it has to be CAT) troff input.  This will
  175. ! #    permit you to do the extended character set and drawing routine
  176. ! #    stuff without having to manually invoke catconv.  HOWEVER,
  177. ! #    before trying this, you have to have Perl, and make sure that
  178. ! #    Perl will start it up properly (see MISC regarding catconv).
  179.   #
  180.   #    Note: for the automatic ditroff width table installer to work,
  181.   #    the width parameter, -N and -W (if present) options must be
  182.   #    on the same line.
  183.   
  184.   troff=''
  185.   trofftype='-T$width'
  186.   #    Uncomment the following if you're a Sun or Ultrix -F troff.
  187. --- 110,121 ----
  188.   #    continuation lines with the "name" followed by whitespace.
  189.   #
  190.   #    psroff will use the last assignments to troff and trofftype
  191. ! #    prior to the matching name.
  192.   #
  193.   #    Note: for the automatic ditroff width table installer to work,
  194.   #    the width parameter, -N and -W (if present) options must be
  195.   #    on the same line.
  196.   
  197.   troff=''
  198.   trofftype='-T$width'
  199.   #    Uncomment the following if you're a Sun or Ultrix -F troff.
  200. ***************
  201. *** 92,98 ****
  202.   #    turned on.
  203.   #trofftype='-F%%FONTDIR%%/$width/ftXX'
  204.   
  205. ! #    psroff generating postscript directly.
  206.   #    The clause "| $LIBDIR/psxlate -r" is there to reverse the pages
  207.   #    for some Postscript printers (eg: the ones that print the first
  208.   #    page face up and then drop the second page face up on top of the
  209. --- 125,131 ----
  210.   #    turned on.
  211.   #trofftype='-F%%FONTDIR%%/$width/ftXX'
  212.   
  213. ! #    psroff generating postscript directly from CAT troff.
  214.   #    The clause "| $LIBDIR/psxlate -r" is there to reverse the pages
  215.   #    for some Postscript printers (eg: the ones that print the first
  216.   #    page face up and then drop the second page face up on top of the
  217. ***************
  218. *** 103,118 ****
  219.   #    details.  Or, you could do psxlate and the print spooler manually.
  220.   #    In that case simply change lparg to be lparg='cat'.
  221.   #
  222. ! ps    width=ps t2arg=-Tps lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies'
  223.   ps    ptr='gate!AppleLaser'
  224. ! #    Example optimizer entry.
  225. ! ops    width=ps t2arg='-Tps -Z -W/usr/lib/font/ps'
  226. ! ops    lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies' ptr='gate!AppleLaser'
  227.   #    For testing new width tables without clobbering real one.
  228. ! tps    width=tps t2arg='-Tps -Z -W/usr/lib/font/tps'
  229.   tps    lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies' ptr='gate!AppleLaser'
  230.   
  231.   #    System V'ish LJ printing to printer called laser.
  232.   #    (Your lp filter script should support -og (8 bit, no filtering))
  233.   
  234.   lj    width=lj t2arg=-Tlj lparg='| lp -d$ptr -og -n$copies' ptr=laser
  235. --- 136,151 ----
  236.   #    details.  Or, you could do psxlate and the print spooler manually.
  237.   #    In that case simply change lparg to be lparg='cat'.
  238.   #
  239. ! ps    width=ps t2arg='-Tps -Z -W%%FONTDIR%%/ps'
  240. ! ps    lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies'
  241.   ps    ptr='gate!AppleLaser'
  242.   #    For testing new width tables without clobbering real one.
  243. ! tps    width=tps t2arg='-Tps -Z -W%%FONTDIR%%/tps'
  244.   tps    lparg='| $LIBDIR/psxlate -r | rlp -d$ptr -n$copies' ptr='gate!AppleLaser'
  245.   
  246.   #    System V'ish LJ printing to printer called laser.
  247. + #    Don't use this for Laserjet III's - see the *lj3* entries below.
  248.   #    (Your lp filter script should support -og (8 bit, no filtering))
  249.   
  250.   lj    width=lj t2arg=-Tlj lparg='| lp -d$ptr -og -n$copies' ptr=laser
  251. ***************
  252. *** 192,198 ****
  253.   #    Using otroff (CAT troff on these machines) to drive.
  254.   #
  255.   #    You should probably run xproof's devpsc ditroff width tables
  256. ! #    through gfttab ("cd widths; gfnttab /usr/lib/font/devpsc psc" ?)
  257.   #    and change width to psc.  Special note: xproof keeps each symbol
  258.   #    character/pointsize in a separate file, and counts as a separate font.
  259.   #    The limit appears to be 50 fonts, so testtab.m won't print completely.
  260. --- 225,231 ----
  261.   #    Using otroff (CAT troff on these machines) to drive.
  262.   #
  263.   #    You should probably run xproof's devpsc ditroff width tables
  264. ! #    through gfttab ("cd widths; gfnttab %%FONTDIR%%/devpsc psc" ?)
  265.   #    and change width to psc.  Special note: xproof keeps each symbol
  266.   #    character/pointsize in a separate file, and counts as a separate font.
  267.   #    The limit appears to be 50 fonts, so testtab.m won't print completely.
  268. ***************
  269. *** 220,222 ****
  270. --- 253,263 ----
  271.   troff=/usr/local/bin/otroff
  272.   cdps    v=1 width=ps t2arg='-Tps -S -Z'
  273.   cdps    lparg="> /tmp/dps$$; %%LIBDIR%%/dodps /tmp/dps$$; rm /tmp/dps$$'
  274. + #    Using groff (gtroff actually) and driving LJ3:
  275. + #    You have to copy widths/widthlj3/[A-Z]* to gtroff's
  276. + #    width directories/devlj3 for this to work.
  277. + troff=gtroff
  278. + trofftype='-T$width'
  279. + glj3    width=lj3 t2args='-Tlj -plj3 -N -Z -O0 -W%%FONTDIR%%/lj3 -G1'
  280. + glj3    lparg='lp -og -d$ptr -n$copies' ptr=laser
  281. Index: ./utils/catconv.S
  282. *** /tmp/PATCHold/./utils/catconv.S    Sat Dec  7 02:49:29 1991
  283. --- ./utils/catconv.S    Sat Dec  7 02:49:30 1991
  284. ***************
  285. *** 10,16 ****
  286.   #
  287.   #    This does a very simpleminded conversion of ditroff-only-isms
  288.   #    (such as graphics) into something handleable by CAT troff.
  289. ! #    1.8 91/09/27
  290.   $cc{'em'}=1; $cc{'ru'}=1; $cc{'14'}=1; $cc{'12'}=1; $cc{'hy'}=1;
  291.   $cc{'34'}=1; $cc{'fi'}=1; $cc{'fl'}=1; $cc{'ff'}=1; $cc{'ct'}=1;
  292.   $cc{'Fl'}=1; $cc{'Fi'}=1; $cc{'de'}=1; $cc{'dg'}=1; $cc{'rg'}=1;
  293. --- 10,16 ----
  294.   #
  295.   #    This does a very simpleminded conversion of ditroff-only-isms
  296.   #    (such as graphics) into something handleable by CAT troff.
  297. ! #    1.9 91/11/22
  298.   $cc{'em'}=1; $cc{'ru'}=1; $cc{'14'}=1; $cc{'12'}=1; $cc{'hy'}=1;
  299.   $cc{'34'}=1; $cc{'fi'}=1; $cc{'fl'}=1; $cc{'ff'}=1; $cc{'ct'}=1;
  300.   $cc{'Fl'}=1; $cc{'Fi'}=1; $cc{'de'}=1; $cc{'dg'}=1; $cc{'rg'}=1;
  301. ***************
  302. *** 72,78 ****
  303.       }
  304.       print "$line\n";
  305.       while($index) {
  306. !     print ".rr" . $regpref . $regnames[--$index] . "\n";
  307.       }
  308.   }
  309.   
  310. --- 72,78 ----
  311.       }
  312.       print "$line\n";
  313.       while($index) {
  314. !     print ".rr " . $regpref . $regnames[--$index] . "\n";
  315.       }
  316.   }
  317.   
  318. ***************
  319. *** 161,172 ****
  320.       $newy = '';
  321.       $newx = '';
  322.   
  323. !     if ($arglist =~ /[-0-9]+/) {
  324.           if ($arglist =~ '-') {
  325.           $arglist = "0$arglist";
  326.           }
  327.           $num = $regpref . $regnames[$index];
  328. !         $predefs = ".nr $num $arglist\n";
  329.           $newargs = "\\(ts\\n($num";
  330.           $index++;
  331.       } else {
  332. --- 161,172 ----
  333.       $newy = '';
  334.       $newx = '';
  335.   
  336. !     if ($arglist =~ /\\/) {        # has arithmetic in it
  337.           if ($arglist =~ '-') {
  338.           $arglist = "0$arglist";
  339.           }
  340.           $num = $regpref . $regnames[$index];
  341. !         $predefs .= ".nr $num $arglist\n";
  342.           $newargs = "\\(ts\\n($num";
  343.           $index++;
  344.       } else {
  345. Index: ./utils/hpinterp.c
  346. *** /tmp/PATCHold/./utils/hpinterp.c    Sat Dec  7 02:49:40 1991
  347. --- ./utils/hpinterp.c    Sat Dec  7 02:49:42 1991
  348. ***************
  349. *** 10,16 ****
  350.   
  351.   #ifndef    lint
  352.   static char SCCSID[] =
  353. !     "@(#)hpinterp.c 2.7 Copyright 91/08/29 18:22:29 Chris Lewis";
  354.   #endif
  355.   
  356.   /*    To install:
  357. --- 10,16 ----
  358.   
  359.   #ifndef    lint
  360.   static char SCCSID[] =
  361. !     "@(#)hpinterp.c 2.8 Copyright 91/11/22 03:23:36 Chris Lewis";
  362.   #endif
  363.   
  364.   /*    To install:
  365. ***************
  366. *** 645,651 ****
  367.       ta.a[1] = 0x02;
  368.       smallend = ((ta.b&0xff) == 0x01);
  369.   #endif
  370. !     while((c = getopt(argc, argv, "dpv")) != EOF)
  371.       switch(c) {
  372.           case 'p':
  373.           genps++;
  374. --- 645,651 ----
  375.       ta.a[1] = 0x02;
  376.       smallend = ((ta.b&0xff) == 0x01);
  377.   #endif
  378. !     while((c = getopt(argc, argv, "dpvc")) != EOF)
  379.       switch(c) {
  380.           case 'p':
  381.           genps++;
  382. ***************
  383. *** 652,657 ****
  384. --- 652,661 ----
  385.           break;
  386.           case 'v':
  387.           verbose++;
  388. +         break;
  389. +         case 'c':
  390. +         chars++;
  391. +         verbose=chars;
  392.           break;
  393.           case 'd':
  394.           debug++;
  395. Index: ./dt.c
  396. *** /tmp/PATCHold/./dt.c    Sat Dec  7 02:49:58 1991
  397. --- ./dt.c    Sat Dec  7 02:50:00 1991
  398. ***************
  399. *** 12,18 ****
  400.   
  401.   #ifndef    lint
  402.   static char SCCSid[] =
  403. !     "@(#)dt.c: 2.10 Copyright 91/09/27 15:10:19 Chris Lewis";
  404.   #endif
  405.   
  406.   /*    These two tables are always included so that we have the
  407. --- 12,18 ----
  408.   
  409.   #ifndef    lint
  410.   static char SCCSid[] =
  411. !     "@(#)dt.c: 2.13 Copyright 91/11/22 03:55:58 Chris Lewis";
  412.   #endif
  413.   
  414.   /*    These two tables are always included so that we have the
  415. ***************
  416. *** 292,299 ****
  417.   #ifdef    DT
  418.   #include "dt.h"
  419.   
  420. - #define    USED    01
  421.   int dtresolution = DTRESOLUTION;
  422.   
  423.   #ifdef DTOPT
  424. --- 292,297 ----
  425. ***************
  426. *** 325,348 ****
  427.   }
  428.   #endif /* DTOPT */
  429.   
  430. - dtSetFont(font, points)
  431. - int font, points; {
  432. -     if (lastPoints != points || font != lastFont) {
  433. - #ifdef DTOPT
  434. -     checknl();
  435. - #endif /* DTOPT */
  436. -     if (!(fonttable[font].flags)&USED)
  437. -         printf("x font %d %s\n", font+1, fonttable[font].troffName);
  438. -     fonttable[font].flags |= USED;
  439. -     printf("f%d\n", font+1);
  440. -     printf("s%d\n", points);
  441. -     lastPoints = points;
  442. -     lastFont = font;
  443. -     }
  444. - }
  445.   #ifdef DTOPT
  446.   static
  447.   putseq(flag, width, seq)
  448. --- 323,328 ----
  449. ***************
  450. *** 383,388 ****
  451. --- 363,369 ----
  452.   char *sequence; {
  453.       register int nx = TROFF2DTX(x), ny = TROFF2DTY(y);
  454.       register struct troff2befont *rp;
  455. +     int pfont;
  456.   
  457.   #ifdef DTOPT
  458.       int optimizing = 0;
  459. ***************
  460. *** 408,431 ****
  461.       /* Only fonts with "N" are subject to font translation */
  462.       case N:
  463.           if (font == symidx)
  464. !         font = 0;    /* Special chars are Courier */
  465.           else {
  466.           DBP((D_BEND, "dtSetChar %d->%s (%s)\n", font,
  467.               xlatetable[font]->troffName,
  468.               xlatetable[font]->fontName));
  469. !         font = xlatetable[font] - fonttable;
  470.           }
  471.           break;
  472.       case S:
  473. !         font = 3;
  474. !         break;
  475. !     case D:
  476.           break;
  477.       default:
  478.       /* Typically used when the R and S fonts don't have the
  479.          character desired, so select the font via the index
  480.          in the fonts.?? file */
  481. !         font = rp->t2b_font;
  482.           break;
  483.       }
  484.   
  485. --- 389,410 ----
  486.       /* Only fonts with "N" are subject to font translation */
  487.       case N:
  488.           if (font == symidx)
  489. !         pfont = 0;    /* Special chars are Courier */
  490.           else {
  491.           DBP((D_BEND, "dtSetChar %d->%s (%s)\n", font,
  492.               xlatetable[font]->troffName,
  493.               xlatetable[font]->fontName));
  494. !         pfont = xlatetable[font] - fonttable;
  495.           }
  496.           break;
  497.       case S:
  498. !         pfont = 3;
  499.           break;
  500.       default:
  501.       /* Typically used when the R and S fonts don't have the
  502.          character desired, so select the font via the index
  503.          in the fonts.?? file */
  504. !         pfont = rp->t2b_font;
  505.           break;
  506.       }
  507.   
  508. ***************
  509. *** 448,454 ****
  510.       if (rp->t2b_xc) nx += points * (.01 * rp->t2b_xc);
  511.       if (rp->t2b_yc) ny += points * (.01 * rp->t2b_yc);
  512.   
  513. !     dtSetFont(font, points);
  514.   
  515.   #ifndef DTOPT
  516.       {
  517. --- 427,454 ----
  518.       if (rp->t2b_xc) nx += points * (.01 * rp->t2b_xc);
  519.       if (rp->t2b_yc) ny += points * (.01 * rp->t2b_yc);
  520.   
  521. !     if (!(fonttable[pfont].flags&MOUNTED)) {
  522. ! #ifdef DTOPT
  523. !     checknl();
  524. ! #endif /* DTOPT */
  525. !     printf("x font %d %s\n", font+1, fonttable[pfont].troffName);
  526. !     fonttable[pfont].flags |= MOUNTED;
  527. !     lastFont = 9999;
  528. !     }
  529. !     if (lastPoints != points || font != lastFont) {
  530. ! #ifdef DTOPT
  531. !     checknl();
  532. ! #endif /* DTOPT */
  533. !     fonttable[pfont].flags |= USED;
  534. !     printf("f%d\n", font+1);
  535. !     printf("s%d\n", points);
  536. !     lastPoints = points;
  537. !     lastFont = font;
  538. !     }
  539.   
  540.   #ifndef DTOPT
  541.       {
  542. ***************
  543. *** 603,612 ****
  544.   }
  545.   
  546.   #ifdef    INSPECIAL
  547. ! dtDraw(origX, origY, s)
  548.   int origX, origY;
  549.   register char *s; {
  550. !     register int temp, t2;
  551.       DBP((D_CAT, "dtDraw: (%d,%d): %s\n", origX, origY, s));
  552.   
  553.   #ifdef DTOPT
  554. --- 603,617 ----
  555.   }
  556.   
  557.   #ifdef    INSPECIAL
  558. ! dtDraw(origX, origY, opcode, ctindex, numbers, s)
  559.   int origX, origY;
  560. + int opcode;
  561. + int ctindex;
  562. + short *numbers;
  563.   register char *s; {
  564. !     register int i;
  565. !     extern int indtres;
  566.       DBP((D_CAT, "dtDraw: (%d,%d): %s\n", origX, origY, s));
  567.   
  568.   #ifdef DTOPT
  569. ***************
  570. *** 620,645 ****
  571.       return;
  572.   
  573.       putchar('D');
  574. !     putchar(*s);
  575. !     s++;
  576.       /* We just pass these thru, scaling them to output resolution */
  577. !     for (;*s;s++) {
  578. !     if (isspace(*s))
  579. !         putchar(' ');
  580. !     else if (!isdigit(*s))
  581. !         putchar(*s);
  582. !     else {
  583. !         extern int indtres;
  584. !         temp = *s - '0';
  585. !         while(isdigit(*(s+1)))
  586. !         temp = temp * 10 + (*++s - '0');
  587.   
  588. !         t2 = temp * dtresolution / (ditroff? indtres:
  589. !         TROFFRESOLUTION);
  590. !         DBP((D_CAT, "dtDraw (scale): %d -> %d\n", temp, t2));
  591. !         printf("%d", t2);
  592. !     }
  593.       }
  594.       putchar('\n');
  595.   }
  596. --- 625,641 ----
  597.       return;
  598.   
  599.       putchar('D');
  600. !     putchar(opcode);
  601.       /* We just pass these thru, scaling them to output resolution */
  602. !     if (opcode == 'f' || opcode == 't')
  603.   
  604. !     printf(" %d", numbers[0]);
  605. !     else {
  606. !     for (i = 0; i < ctindex; i++)
  607. !         printf(" %d", numbers[i] * dtresolution / TROFFRESOLUTION);
  608.       }
  609.       putchar('\n');
  610.   }
  611. Index: ./utils.c
  612. *** /tmp/PATCHold/./utils.c    Sat Dec  7 02:50:29 1991
  613. --- ./utils.c    Sat Dec  7 02:50:32 1991
  614. ***************
  615. *** 12,18 ****
  616.   
  617.   #ifndef    lint
  618.   static char SCCSid[] =
  619. !     "@(#)utils.c: 2.20 Copyright 91/10/18 16:32:49 Chris Lewis";
  620.   #endif
  621.   
  622.   #ifndef    HEADERSIZE
  623. --- 12,18 ----
  624.   
  625.   #ifndef    lint
  626.   static char SCCSid[] =
  627. !     "@(#)utils.c: 2.21 Copyright 91/11/22 03:21:21 Chris Lewis";
  628.   #endif
  629.   
  630.   #ifndef    HEADERSIZE
  631. ***************
  632. *** 435,440 ****
  633. --- 435,444 ----
  634.   
  635.       for (p = fonttable; p->troffName; p++)
  636.       if (strcmp(p->troffName, to) == 0) {
  637. +         if (xlatetable[intfont]->flags)
  638. +         xlatetable[intfont]->flags &= ~MOUNTED;
  639.           xlatetable[intfont] = p;
  640.           break;
  641.       }
  642. Index: ./ps.c
  643. *** /tmp/PATCHold/./ps.c    Sat Dec  7 02:50:50 1991
  644. --- ./ps.c    Sat Dec  7 02:50:52 1991
  645. ***************
  646. *** 15,21 ****
  647.   
  648.   #ifndef    lint
  649.   static char SCCSid[] =
  650. !     "@(#)ps.c: 2.15 Copyright 91/11/13 00:29:48 Chris Lewis";
  651.   #endif
  652.   
  653.   /*    ps.c will generate some additional "print" commands to cause
  654. --- 15,21 ----
  655.   
  656.   #ifndef    lint
  657.   static char SCCSid[] =
  658. !     "@(#)ps.c: 2.17 Copyright 91/11/22 03:56:10 Chris Lewis";
  659.   #endif
  660.   
  661.   /*    ps.c will generate some additional "print" commands to cause
  662. ***************
  663. *** 28,35 ****
  664.   static char Overlay[100] = {""};
  665.   #endif
  666.   
  667. - #define    USED    01
  668.   struct troff2befont psStdFont[108] = {
  669.   
  670.   /*    Note on X-shift, Y-shift and point scale factor:
  671. --- 28,33 ----
  672. ***************
  673. *** 622,628 ****
  674.   
  675.       int i, fill = 0;
  676.       static float curfill = 0;
  677. !     int curthick = 1;
  678.   
  679.       /* map absolute beginning position. */
  680.       origX = TROFF2PSX(origX);
  681. --- 620,626 ----
  682.   
  683.       int i, fill = 0;
  684.       static float curfill = 0;
  685. !     static int curthick = 1;
  686.   
  687.       /* map absolute beginning position. */
  688.       origX = TROFF2PSX(origX);
  689. Index: ./dit.c
  690. *** /tmp/PATCHold/./dit.c    Sat Dec  7 02:51:08 1991
  691. --- ./dit.c    Sat Dec  7 02:51:09 1991
  692. ***************
  693. *** 12,18 ****
  694.   
  695.   #ifndef    lint
  696.   static char SCCSid[] =
  697. !     "@(#)dit.c: Copyright 91/10/17 11:58:18 Chris Lewis";
  698.   #endif
  699.   
  700.   extern struct cattab tabN[], tabS[], *extidx;
  701. --- 12,18 ----
  702.   
  703.   #ifndef    lint
  704.   static char SCCSid[] =
  705. !     "@(#)dit.c: Copyright 91/11/22 03:53:18 Chris Lewis";
  706.   #endif
  707.   
  708.   extern struct cattab tabN[], tabS[], *extidx;
  709. ***************
  710. *** 160,166 ****
  711.           font = getnum();
  712.           if (font < 0 || font >= INTFONTS) {
  713.               fprintf(stderr,
  714. !             "%s: font number %d too high - make INTFONTS bigger\n",
  715.               progname, font);
  716.               font = 1;
  717.           } else if (font == 0)
  718. --- 160,166 ----
  719.           font = getnum();
  720.           if (font < 0 || font >= INTFONTS) {
  721.               fprintf(stderr,
  722. !             "%s: font number %d too high - get help from Chris!\n",
  723.               progname, font);
  724.               font = 1;
  725.           } else if (font == 0)
  726. Index: ./README
  727. *** /tmp/PATCHold/./README    Sat Dec  7 02:51:22 1991
  728. --- ./README    Sat Dec  7 02:51:26 1991
  729. ***************
  730. *** 1,4 ****
  731. !         PSROFF RELEASE 3.0 README 2.21 91/10/11
  732.   
  733.               Feb 19, 1991
  734.               Chris Lewis
  735. --- 1,4 ----
  736. !         PSROFF RELEASE 3.0 README 2.22 91/12/07
  737.   
  738.               Feb 19, 1991
  739.               Chris Lewis
  740. ***************
  741. *** 389,413 ****
  742.   
  743.   Future directions:
  744.   
  745. ! They are two-fold: replacing the ".tm/.sR" mechanism for communication
  746. ! with the backend.  There is a new method, using a FSA to recognize
  747. ! a special sequence of bell symbols (see catconv).  I haven't converted
  748. ! over to it, because under some not-yet-understood situations, it
  749. ! doesn't work.  Hence, psfig and drawing commands occasionally misbehave.
  750. ! Once this is reliable, all special commands (eg: the .fp fakeouts) will
  751. ! be converted over to the FSA mechanism.
  752.   
  753.   You may have noticed a compile flag called "OPT" which is defined in
  754.   the distributed version of defs.h.  If enabled (via -Z/W), this enables the
  755.   optimizer.  It works well with Postscript output, but not with laserjet
  756. ! unless the fonts you use are VERY good.  It's disabled by default.  The
  757. ! optimizer does two things: it emits as many characters as it can as one
  758.   print directive, rather than one CAT code per print.  On postscript and
  759.   HPLJ's this is a BIG win (printer execution speeds 3 or more times faster),
  760. ! but it won't work with ditroff.  The optimizer requires access to the CAT
  761. ! troff width tables (even when used with ditroff), and if troff2ps can't find
  762. ! them, it simply doesn't optimize.
  763.   
  764.   Psroff limitations:
  765.       - With the use of catconv and CAT troff, psroff supports:
  766.       - all drawing commands (including the newer \D'fn' (set fill),
  767. --- 389,418 ----
  768.   
  769.   Future directions:
  770.   
  771. ! Replacing the ".tm/.sR" mechanism for communication with the backend.
  772. ! There is a new method, using a FSA to recognize a special sequence of
  773. ! bell symbols (see catconv).  I haven't converted over to it, because
  774. ! under some not-yet-understood situations, it doesn't work.  Hence, psfig
  775. ! and drawing commands occasionally misbehave.  Once this is reliable, all
  776. ! special commands (eg: the .fp fakeouts) will be converted over to the FSA
  777. ! mechanism.
  778.   
  779.   You may have noticed a compile flag called "OPT" which is defined in
  780.   the distributed version of defs.h.  If enabled (via -Z/W), this enables the
  781.   optimizer.  It works well with Postscript output, but not with laserjet
  782. ! unless the fonts you use are VERY good.  It's enabled by default for ps.
  783. ! The optimizer does two things: it emits as many characters as it can as one
  784.   print directive, rather than one CAT code per print.  On postscript and
  785.   HPLJ's this is a BIG win (printer execution speeds 3 or more times faster),
  786. ! and is essential with ditroff output to psdit and xtroff.  The optimizer
  787. ! requires access to the CAT troff width tables (even when used with ditroff),
  788. ! and if troff2ps can't find them, it will abort.
  789.   
  790. + Hpinterp was borrowed and converted into a general HP LJ to PBM
  791. + converter.  This permits the output of psroff to be printed on
  792. + just about ANY printer.  The new version of hpinterp (now called
  793. + hp2pbm) will eventually be reintegrated back into psroff.
  794.   Psroff limitations:
  795.       - With the use of catconv and CAT troff, psroff supports:
  796.       - all drawing commands (including the newer \D'fn' (set fill),
  797. ***************
  798. *** 437,442 ****
  799. --- 442,452 ----
  800.       Dunrobin, Ontario,
  801.       Canada K0A 1T0
  802.       Voice Phone: Canada (613) 832-0541
  803. +     [Please note: I will not return LD phone calls.  Even collect.
  804. +     If you catch me in, no problem.  If you get the answering machine,
  805. +     you're best off calling back later.  Email is usually more
  806. +     convenient.  Between 7 and 10pm EST (5 hours behind GMT) is
  807. +     probably the best time.]
  808.       Userid's for e-mail contact:
  809.       Psroff enquiries/help: psroff-request
  810.       Non-psroff mail only: clewis
  811. Index: ./defs.h
  812. *** /tmp/PATCHold/./defs.h    Sat Dec  7 02:51:42 1991
  813. --- ./defs.h    Sat Dec  7 02:51:43 1991
  814. ***************
  815. *** 9,15 ****
  816.    */
  817.   
  818.   /*    Official Release and Patch level:    */
  819. ! #define    T2VERSION    "@(#)PSROFF Copyright 91/11/02 Chris Lewis - R3 PL5"
  820.   
  821.   /*    Configuration parameters:
  822.    */
  823. --- 9,15 ----
  824.    */
  825.   
  826.   /*    Official Release and Patch level:    */
  827. ! #define    T2VERSION    "@(#)PSROFF Copyright 91/11/22 Chris Lewis - R3 PL6"
  828.   
  829.   /*    Configuration parameters:
  830.    */
  831. ***************
  832. *** 292,297 ****
  833. --- 292,300 ----
  834.   };
  835.   
  836.   #define    MAXFONTS    50
  837. + #define    USED        01
  838. + #define    MOUNTED        02
  839.   
  840.   struct fonttable {
  841.       char *tab[4];
  842. Index: ./Makefile
  843. *** /tmp/PATCHold/./Makefile    Sat Dec  7 02:51:55 1991
  844. --- ./Makefile    Sat Dec  7 02:51:57 1991
  845. ***************
  846. *** 7,13 ****
  847.   #    Function: Upper level makefile; configuration options.
  848.   #
  849.   #
  850. ! #ident  "@(#)Makefile: 2.26 Copyright 91/10/18 16:32:33 Chris Lewis"
  851.   
  852.   #    If you're not sure whether you have a System V make, leave
  853.   #    this alone, and run the make anyways.  If it dies horribly
  854. --- 7,13 ----
  855.   #    Function: Upper level makefile; configuration options.
  856.   #
  857.   #
  858. ! #ident  "@(#)Makefile: 2.28 Copyright 91/12/07 02:20:15 Chris Lewis"
  859.   
  860.   #    If you're not sure whether you have a System V make, leave
  861.   #    this alone, and run the make anyways.  If it dies horribly
  862. ***************
  863. *** 144,152 ****
  864.   
  865.   #    If you have perl, make sure that this is the full pathname
  866.   #    for it.  If you don't have perl, you won't be able to use
  867. ! #    catconv or calcfonts.  Which is normally no big deal unless
  868. ! #    you're trying to emulate \D with C/A/T troff OR build Laserjet
  869. ! #    fonts from a TeX heirarchy.
  870.   PERL    = /usr/bin/perl
  871.   
  872.   #    Dinna touch from here on
  873. --- 144,156 ----
  874.   
  875.   #    If you have perl, make sure that this is the full pathname
  876.   #    for it.  If you don't have perl, you won't be able to use
  877. ! #    catconv or calcfonts.  This is normally no big deal unless
  878. ! #    you're trying to emulate \D or \X with C/A/T troff OR build Laserjet
  879. ! #    fonts from a TeX heirarchy.  To enable catconv, you must also alter
  880. ! #    the appropriate psrofflib.S entries to have the "v=1" option. 
  881. ! #    (catconv is a filter that will be run *before* troff to mangle
  882. ! #    ditroffisms to CAT troffisms.  \D is drawing commands.  \X is
  883. ! #    special directives (eg: you want to use psfig))
  884.   PERL    = /usr/bin/perl
  885.   
  886.   #    Dinna touch from here on
  887. ***************
  888. *** 372,378 ****
  889.   
  890.   #    Yes, this is a little wierd, but in this way I can figure
  891.   #    out what you are...
  892. ! TEST:    Makefile defs.h tests/testtab.m tests/exttab.m makeincl
  893.       cd lib ; $(MAKE)
  894.       rm -f TEST1 TEST2
  895.       PATH=.:$(LIBDIR):$$PATH \
  896. --- 376,382 ----
  897.   
  898.   #    Yes, this is a little wierd, but in this way I can figure
  899.   #    out what you are...
  900. ! TEST:    Makefile defs.h sedscript tests/testtab.m tests/exttab.m makeincl
  901.       cd lib ; $(MAKE)
  902.       rm -f TEST1 TEST2
  903.       PATH=.:$(LIBDIR):$$PATH \
  904. Index: ./psroff.S
  905. *** /tmp/PATCHold/./psroff.S    Sat Dec  7 02:52:08 1991
  906. --- ./psroff.S    Sat Dec  7 02:52:10 1991
  907. ***************
  908. *** 7,13 ****
  909.   #
  910.   #    Specs:        troff2ps driver
  911.   #
  912. ! #ident  "@(#)psroff.sh: 2.17 Copyright 91/11/13 00:30:44 Chris Lewis"
  913.   
  914.   LIBDIR="%%LIBDIR%%"
  915.   FONTDIR="%%FONTDIR%%"
  916. --- 7,13 ----
  917.   #
  918.   #    Specs:        troff2ps driver
  919.   #
  920. ! #ident  "@(#)psroff.sh: 2.18 Copyright 91/11/22 03:21:09 Chris Lewis"
  921.   
  922.   LIBDIR="%%LIBDIR%%"
  923.   FONTDIR="%%FONTDIR%%"
  924. ***************
  925. *** 163,169 ****
  926.   #    If -N in t2arg, then this is ditroff.
  927.   teststring=`echo "$t2arg" | sed -n -e '/-N/p'`
  928.   if [ -n "$teststring" ]
  929. - ]
  930.   then
  931.       otroff=
  932.       widtharg="-T$width"
  933. --- 163,168 ----
  934. ***************
  935. *** 299,308 ****
  936.   
  937.       cat $files |
  938.   
  939. !     if [ -f "$PERL" ]
  940.       then
  941.       %%LIBDIR%%/catconv
  942.       else
  943.       sed -e 's/^\\!\(.*\)/.sR "\1"/'
  944.       fi
  945.   else
  946. --- 298,308 ----
  947.   
  948.       cat $files |
  949.   
  950. !     if [ -f "%%PERL%%" -a -z "$v" ]
  951.       then
  952.       %%LIBDIR%%/catconv
  953.       else
  954. +     # you only get \! emulation
  955.       sed -e 's/^\\!\(.*\)/.sR "\1"/'
  956.       fi
  957.   else
  958. Index: ./makeincl.S
  959. *** /tmp/PATCHold/./makeincl.S    Sat Dec  7 02:52:18 1991
  960. --- ./makeincl.S    Sat Dec  7 02:52:19 1991
  961. ***************
  962. *** 4,10 ****
  963.   #    See the LICENSE file for a full description of the restrictions
  964.   #    under which this software is provided.
  965.   #
  966. ! #    Makefile overrides 2.5 91/03/25
  967.   CC    = %%CC%%
  968.   CFLAGS    = %%CCFLAGS%% -I../
  969.   FONTDIR = %%FONTDIR%%
  970. --- 4,10 ----
  971.   #    See the LICENSE file for a full description of the restrictions
  972.   #    under which this software is provided.
  973.   #
  974. ! #    Makefile overrides 2.6 91/11/22
  975.   CC    = %%CC%%
  976.   CFLAGS    = %%CCFLAGS%% -I../
  977.   FONTDIR = %%FONTDIR%%
  978. ***************
  979. *** 20,25 ****
  980. --- 20,26 ----
  981.   IGNORESH = %%IGNORESH%%
  982.   T2DIR = %%T2DIR%%
  983.   MAKEDEV = %%MAKEDEV%%
  984. + PERL = %%PERL%%
  985.   
  986.   #    This override is because apparently a .s suffix on a file will
  987.   #    cause make to not select a ".S:" rule when the target is .s
  988.  
  989. -- 
  990. Chris Lewis; clewis@ferret.ocunix.on.ca; Phone: Canada 613 832-0541
  991. Psroff 3.0 info: psroff-request@ferret.ocunix.on.ca
  992. Moderator of the ferret list: ferret-request@ferret.ocunix.on.ca
  993. **** NEVER let something mechanical know you're in a hurry. ****
  994.