home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1944 < prev    next >
Internet Message Format  |  1990-12-28  |  25KB

  1. From: clewis@ecicrl.UUCP (Chris Lewis)
  2. Newsgroups: comp.sources.bugs,alt.sources,comp.text
  3. Subject: Psroff 2.0 Patch 3
  4. Message-ID: <882@ecicrl.UUCP>
  5. Date: 12 Oct 90 19:42:42 GMT
  6.  
  7. Archive-name: psroff2.0/Patch.03
  8. Submitted-by: clewis@ecicrl.uucp
  9.  
  10. (Did it work Peter? ;-)
  11.  
  12.     This is official patch 03 for Psroff 2.0.
  13.     Please apply it by:
  14.     cd <psroff source directory>
  15.     patch -N -p < <this file>
  16.  
  17.     Then rebuild all of psroff.
  18.  
  19. Amongst some minor bug fixes, this patch introduces some Ditroff drawing
  20. emulation stuff.  If you pipe ditroff source through "catconv"
  21. and then into psroff, psroff will attempt to emulate the \D drawing
  22. codes.  Eg:
  23.  
  24.     pic foo | catconv | psroff
  25.  
  26. For this to work, INSPECIAL should be defined in defs.h, and you have to
  27. have Perl to run catconv (probably R3).
  28.  
  29. Notes:
  30.     - splines (\D'~) aren't implemented for postscript
  31.     - nothing is implemented for HPPCL
  32.     - ditroff output is completely supported (eg: tpscript).
  33.     - This hasn't been tested very well and some \D'...'
  34.       may fool "catconv".   Further, beyond a certain complexity,
  35.       the backend (troff2ps) misses some of the sequences....
  36.       Simple PIC stuff appears to work, manual \D'...' do too.
  37.  
  38. Don't bother telling me that catconv/ditroff drawing code doesn't
  39. work completely - I know that, but fixes and code would be very
  40. welcome - eg: postscript spline code or more reliable special
  41. sequence recognition.
  42.  
  43. It's hard for me to work on this because I have no access to ANY
  44. printers at the moment.
  45.  
  46. Followups have been directed to comp.text because I don't get
  47. c.s.b or a.s at the moment.
  48.  
  49. ./lib/ps.lib        Drawing code assists
  50. ./README        Slight fixups
  51. ./debug.c        bcopy fix.
  52. ./ps.c            drawing code.
  53. ./utils/pk2sfp.c    standalone compile (released in alt.sources)
  54. ./utils/psxlate.c    so compilers with "const" strings don't die.
  55. ./utils/catconv.S    new utility (see above)
  56. ./defs.h        PL3, drawing code, BCOPYLIB
  57. ./dt.c            drawing code
  58. ./dt.h            drawing code
  59. ./ps.h            drawing code
  60. ./psroff.S        accidentally hard-coded /usr/lib/font fix.
  61.  
  62. *** /tmp/PATCHold/./lib/ps.lib    Fri Oct 12 14:32:47 1990
  63. --- ./lib/ps.lib    Fri Oct 12 14:32:49 1990
  64. ***************
  65. *** 9,15 ****
  66.   %    Module:        ps.lib
  67.   %    Author:     Chris Lewis
  68.   %    Specs:        Predefinitions for PostScript
  69. ! %ident  @(#)ps.lib: 2.1 Copyright 90/07/18 16:52:37 Chris Lewis"
  70.   
  71.   /Y { 3 1 roll dup /CurY exch def moveto show } bind def
  72.   /X { exch CurY moveto show } bind def
  73. --- 9,15 ----
  74.   %    Module:        ps.lib
  75.   %    Author:     Chris Lewis
  76.   %    Specs:        Predefinitions for PostScript
  77. ! %ident  @(#)ps.lib: 2.2 Copyright 90/10/12 13:15:42 Chris Lewis"
  78.   
  79.   /Y { 3 1 roll dup /CurY exch def moveto show } bind def
  80.   /X { exch CurY moveto show } bind def
  81. ***************
  82. *** 405,410 ****
  83. --- 405,444 ----
  84.   } def end
  85.   /BracketFont BracketFontDict definefont pop
  86.   
  87. + /Ellipse {
  88. +     /Yaxis exch 2 div def
  89. +     /Xaxis exch 2 div def
  90. +     currentpoint exch Xaxis add exch
  91. +     /savematrix matrix currentmatrix def
  92. +     translate
  93. +     Xaxis Yaxis scale
  94. +     1 0 moveto
  95. +     0 0 1 0 360 arc
  96. +     savematrix setmatrix
  97. +     %currentpoint exch Xaxis 2 mul add exch moveto
  98. + } bind def
  99. + /Arc {
  100. +     /eY exch def
  101. +     /eX exch def
  102. +     /cY exch def
  103. +     /cX exch def
  104. +     currentpoint cY add exch cX add exch    % center x y
  105. +     cY dup mul cX dup mul add sqrt % radius
  106. +     cY neg cX neg atan    % ang1
  107. +     eY eX atan        % ang2
  108. + %    5 copy
  109. + %    (                    ) cvs print
  110. + %    ( ) print
  111. + %    (                    ) cvs print
  112. + %    ( ) print
  113. + %    (                    ) cvs print
  114. + %    ( ) print
  115. + %    (                    ) cvs print
  116. + %    ( ) print
  117. + %    (                    ) cvs print
  118. +     arc
  119. + } bind def
  120.   
  121.   %    This macro is invoked by ShowPage to display the current form.
  122.   %    Usually redefined to point at a form loaded by an include
  123. *** /tmp/PATCHold/./README    Fri Oct 12 14:33:00 1990
  124. --- ./README    Fri Oct 12 14:33:03 1990
  125. ***************
  126. *** 1,4 ****
  127. !         PSROFF RELEASE 2.0 README 2.1 90/07/18
  128.   
  129.               May 14, 1990
  130.               Chris Lewis
  131. --- 1,4 ----
  132. !         PSROFF RELEASE 2.0 README 2.2 90/08/30
  133.   
  134.               May 14, 1990
  135.               Chris Lewis
  136. ***************
  137. *** 319,331 ****
  138.         .sR.  Further, ".tm" has been redefined to make use of the
  139.         .sR facility.
  140.   
  141. !     - troff2 has 8-font troff support, but:
  142.   
  143.           a) it's never been tested.
  144.           b) I'm no longer convinced that the cat.5 man page is
  145.              correct on how the decoding works.
  146.   
  147. !     - troff2 has BSDHACK support (one of the tilt opcodes being
  148.         replaced by an opcode to multiply the next vertical motion
  149.         by 64), but this has not been tested.  I never heard of it
  150.         before til I saw it in Froyen's troff2lj source.  This cannot
  151. --- 319,331 ----
  152.         .sR.  Further, ".tm" has been redefined to make use of the
  153.         .sR facility.
  154.   
  155. !     - psroff has 8-font troff support, but:
  156.   
  157.           a) it's never been tested.
  158.           b) I'm no longer convinced that the cat.5 man page is
  159.              correct on how the decoding works.
  160.   
  161. !     - psroff has BSDHACK support (one of the tilt opcodes being
  162.         replaced by an opcode to multiply the next vertical motion
  163.         by 64), but this has not been tested.  I never heard of it
  164.         before til I saw it in Froyen's troff2lj source.  This cannot
  165. ***************
  166. *** 391,397 ****
  167.         With Laserjet driving:
  168.   
  169.           MDLF    max # downloaded fonts supported per page.
  170. !         PRELOAD    # fonts statically downloaded
  171.           SFP        enables SFP's with incremental font downloading.
  172.               Needs INCR.
  173.           INCR    enable incremental font downloading.  Needs PARTIAL.
  174. --- 391,398 ----
  175.         With Laserjet driving:
  176.   
  177.           MDLF    max # downloaded fonts supported per page.
  178. !             LJ+ have this as 16.  Later models support more.
  179. !         PRELOAD    # fonts statically downloaded.
  180.           SFP        enables SFP's with incremental font downloading.
  181.               Needs INCR.
  182.           INCR    enable incremental font downloading.  Needs PARTIAL.
  183. ***************
  184. *** 567,573 ****
  185.         The most important thing to remember is that you cannot extend
  186.         the CAT's character sets without modifying troff - unlike ditroff
  187.         where you can add them by changing the makedev files.  This
  188. !       is how you do install overrides:
  189.   
  190.           - Put in a map override in the appropriate *.fonts file that
  191.             emits the character you want in place of a character you
  192. --- 568,574 ----
  193.         The most important thing to remember is that you cannot extend
  194.         the CAT's character sets without modifying troff - unlike ditroff
  195.         where you can add them by changing the makedev files.  This
  196. !       is how you do overrides:
  197.   
  198.           - Put in a map override in the appropriate *.fonts file that
  199.             emits the character you want in place of a character you
  200. ***************
  201. *** 582,588 ****
  202.   
  203.           <troffchar> N|S|n <sequence> <x adjust> <y adjust> <scale>
  204.   
  205. !           x adjust, y adjust, scale default to 0, 0 and 0 respectively.
  206.             x and y adjust are multiplied by .01, then the pointsize
  207.             and of the output driver to give the shift factor in
  208.             1/resolution units.  Scale allows you to change the size
  209. --- 583,589 ----
  210.   
  211.           <troffchar> N|S|n <sequence> <x adjust> <y adjust> <scale>
  212.   
  213. !           x adjust, y adjust, scale default to 0, 0 and 100 respectively.
  214.             x and y adjust are multiplied by .01, then the pointsize
  215.             and of the output driver to give the shift factor in
  216.             1/resolution units.  Scale allows you to change the size
  217. *** /tmp/PATCHold/./debug.c    Fri Oct 12 14:33:18 1990
  218. --- ./debug.c    Fri Oct 12 14:33:19 1990
  219. ***************
  220. *** 2,8 ****
  221.   
  222.   #ifndef    lint
  223.   static char SCCSid[] =
  224. !     "@(#)debug.c: 2.2 Copyright 90/08/08 13:14:09 Chris Lewis";
  225.   #endif
  226.   
  227.   #ifdef    DEBUG
  228. --- 2,8 ----
  229.   
  230.   #ifndef    lint
  231.   static char SCCSid[] =
  232. !     "@(#)debug.c: 2.3 Copyright 90/10/01 14:41:07 Chris Lewis";
  233.   #endif
  234.   
  235.   #ifdef    DEBUG
  236. ***************
  237. *** 115,132 ****
  238.   }
  239.   
  240.   #ifdef    BCOPY
  241.   /*    "slowish" routines when you don't have memcpy and friends
  242.    */
  243.   bcopy(from, to, len)
  244.   register char *from, *to;
  245. ! register int n; {
  246. !     while(n--)
  247.       *to++ = *from++;
  248.   }
  249.   bzero(array, len)
  250.   register char *array;
  251. ! register int len; {
  252. !     while(n--)
  253.       *array++ = '\0';
  254.   }
  255.   #endif
  256. --- 115,137 ----
  257.   }
  258.   
  259.   #ifdef    BCOPY
  260. + #ifndef BCOPYLIB
  261.   /*    "slowish" routines when you don't have memcpy and friends
  262.    */
  263.   bcopy(from, to, len)
  264.   register char *from, *to;
  265. ! register int len; 
  266. ! {
  267. !   while(len--)
  268.       *to++ = *from++;
  269.   }
  270.   bzero(array, len)
  271.   register char *array;
  272. ! register int len; 
  273. ! {
  274. !   while(len--)
  275.       *array++ = '\0';
  276.   }
  277. + #endif BCOPYLIB
  278.   #endif
  279. *** /tmp/PATCHold/./ps.c    Fri Oct 12 14:33:35 1990
  280. --- ./ps.c    Fri Oct 12 14:33:37 1990
  281. ***************
  282. *** 18,24 ****
  283.   
  284.   #ifndef    lint
  285.   static char SCCSid[] =
  286. !     "@(#)ps.c: 2.1 Copyright 90/07/18 16:47:36 Chris Lewis";
  287.   #endif
  288.   
  289.   /*    ps.c will generate some additional "print" commands to cause
  290. --- 18,24 ----
  291.   
  292.   #ifndef    lint
  293.   static char SCCSid[] =
  294. !     "@(#)ps.c: 2.2 Copyright 90/10/12 13:09:32 Chris Lewis";
  295.   #endif
  296.   
  297.   /*    ps.c will generate some additional "print" commands to cause
  298. ***************
  299. *** 358,363 ****
  300. --- 358,365 ----
  301.       }
  302.   }
  303.   
  304. + int indraw = 0;
  305.   psChar(x, y, font, points, troffChar, sequence)
  306.   int x, y;
  307.   int font, points, troffChar;
  308. ***************
  309. *** 370,375 ****
  310. --- 372,398 ----
  311.       doPageStart();
  312.       }
  313.   
  314. +     if (font < 0) {
  315. + #ifdef    TRY
  316. +     if (!indraw) {
  317. + #endif
  318. +         printf("newpath\n");
  319. +         emitnum(nx);
  320. +         putchar(' ');
  321. +         emitnum(ny);
  322. +         printf(" moveto\n");
  323. +         indraw = 1;
  324. + #ifdef    TRY
  325. +     }
  326. + #endif
  327. +     return;
  328. + #ifdef    TRY
  329. +     } else if (indraw) {
  330. +     printf("stroke\n");
  331. +     indraw = 0;
  332. + #endif
  333. +     }
  334.       charCount++;
  335.   
  336.       DBP((D_BEND,"BEFORE (troffChar,x,y,font,points) = (%d,%d,%d,%d,%d)\n",
  337. ***************
  338. *** 556,559 ****
  339. --- 579,676 ----
  340.   #endif
  341.   }
  342.   
  343. + #ifdef    INSPECIAL
  344. + psDraw(origX, origY, s)
  345. + int origX, origY;
  346. + register char *s; {
  347. +     register int opcode, ctindex = 0, temp, neg;
  348. +     /*static int curDX = -1, curDY = -1;*/
  349. +     short int numbers[100];
  350. +     DBP((D_CAT, "psDraw: (%d,%d): %s\n", origX, origY, s));
  351. +     /* Special invocation to get the newpath/moveto done */
  352. +     psChar(origX, origY, -1, -1, (char*) NULL, (char*) NULL);
  353. +     while(*s && isspace(*s)) s++;
  354. +     opcode = *s;
  355. +     neg = 1;
  356. +     for (;*s;s++) {
  357. +     if (isspace(*s))
  358. +         continue;
  359. +     else if (*s == '\\')
  360. +         s += 3;
  361. +     else if (*s == '-')
  362. +         neg = -1;
  363. +     else if (!isdigit(*s))
  364. +         continue;
  365. +     else {
  366. +         temp = *s - '0';
  367. +         while(isdigit(*(s+1)))
  368. +         temp = temp * 10 + (*++s - '0');
  369. +         numbers[ctindex++] = neg * temp;
  370. +         neg = 1;
  371. +     }
  372. +     }
  373. +     switch(opcode) {
  374. +     case 'l':
  375. +         DBP((D_CAT, "drawline: %d, %d\n", numbers[0], numbers[1]));
  376. +         emitnum((int) numbers[0]);
  377. +         putchar(' ');
  378. +         emitnum((int) -numbers[1]);
  379. +         printf(" rlineto\n");
  380. +         break;
  381. +     case 'a':
  382. +         for (temp = 0; temp < 4; temp++) {
  383. +         emitnum((int) ((temp % 2) ? -numbers[temp]: numbers[temp]));
  384. +         putchar(' ');
  385. +         }
  386. +         printf("Arc\n");
  387. +         break;
  388. +     case 'c':
  389. +         numbers[1] = numbers[0];
  390. +     case 'e':
  391. +         DBP((D_CAT, "drawellipse: %d, %d\n", numbers[0], numbers[1]));
  392. +         emitnum((int) numbers[0]);
  393. +         putchar(' ');
  394. +         emitnum((int) numbers[1]);
  395. +         printf(" Ellipse\n");
  396. +         break;
  397. +     case '~':
  398. +         if (ctindex < 4) {
  399. +         fprintf(stderr, "%s: too few points to spline: %s\n",
  400. +             progname, s);
  401. +         break;
  402. +         }
  403. +         fprintf(stderr, "%s: Don't support splines yet\n", progname);
  404. +         /* Some of the following is inspired from tpscript.
  405. +            First convert to RELATIVE to the starting point.
  406. +            Further, There's a bug in PIC that returns negatively one
  407. +            unit LESS than it went forward - fudge it here */
  408. +         for (temp = 2; temp < ctindex; temp++) {
  409. +         if (numbers[temp] < 0)
  410. +             numbers[temp]--;
  411. +         numbers[temp] += numbers[temp-2];
  412. +         }
  413. +         if (ctindex == 4) {
  414. +         emitnum((int) numbers[0] / 2);
  415. +         putchar(' ');
  416. +         emitnum((int) -numbers[1] / 2);
  417. +         putchar(' ');
  418. +         emitnum((int) (numbers[0] + numbers[2]) / 2);
  419. +         putchar(' ');
  420. +         emitnum((int) -(numbers[1] + numbers[3])/ 2);
  421. +         putchar(' ');
  422. +         emitnum((int) numbers[2]);
  423. +         putchar(' ');
  424. +         emitnum((int) -numbers[3]);
  425. +         printf(" rcurveto\n");
  426. +         }
  427. +         break;
  428. +     default:
  429. +         fprintf(stderr, "%s: invalid draw code %c\n", progname, opcode);
  430. +         indraw = 0;
  431. +         break;
  432. +     }
  433. +     printf("stroke\n");
  434. + }
  435. + #endif
  436.   #endif /* PS */
  437. *** /tmp/PATCHold/./utils/pk2sfp.c    Fri Oct 12 14:33:49 1990
  438. --- ./utils/pk2sfp.c    Fri Oct 12 14:33:50 1990
  439. ***************
  440. *** 1,4 ****
  441. ! /*    Copyright 1985, 1986, 1987, 1988 90/07/18 Chris Lewis
  442.           All Rights Reserved
  443.   
  444.       Permission to copy and further distribute is freely given provided
  445. --- 1,4 ----
  446. ! /*    Copyright 1985, 1986, 1987, 1988 90/09/17 Chris Lewis
  447.           All Rights Reserved
  448.   
  449.       Permission to copy and further distribute is freely given provided
  450. ***************
  451. *** 13,19 ****
  452.   
  453.   #ifndef    lint
  454.   static char SCCSID[] =
  455. !     "@(#)pk2sfp.c 2.1 Copyright 90/07/18 16:49:44 Chris Lewis";
  456.   #endif
  457.   
  458.   #include "defs.h"
  459. --- 13,19 ----
  460.   
  461.   #ifndef    lint
  462.   static char SCCSID[] =
  463. !     "@(#)pk2sfp.c 2.2 Copyright 90/09/17 10:50:03 Chris Lewis";
  464.   #endif
  465.   
  466.   #include "defs.h"
  467. ***************
  468. *** 43,48 ****
  469. --- 43,49 ----
  470.   
  471.   char *progname;
  472.   
  473. + #ifdef    PARTIAL
  474.   extern struct enctab encNormal[], encSymbol[];
  475.   
  476.   needchar(font, character)
  477. ***************
  478. *** 67,72 ****
  479. --- 68,80 ----
  480.   
  481.       return(0);
  482.   }
  483. + #else
  484. + needchar(font, character)
  485. + int font;
  486. + long character; {
  487. +     return(1);
  488. + }
  489. + #endif
  490.   
  491.   main(argc, argv)
  492.   int argc;
  493. *** /tmp/PATCHold/./utils/psxlate.c    Fri Oct 12 14:33:57 1990
  494. --- ./utils/psxlate.c    Fri Oct 12 14:33:58 1990
  495. ***************
  496. *** 13,19 ****
  497.   
  498.   #ifndef    lint
  499.   static char SCCSid[] =
  500. !     "@(#)psxlate.c: 2.1 Copyright 90/07/18 16:49:52 Chris Lewis";
  501.   #endif
  502.   
  503.   #include "defs.h"
  504. --- 13,19 ----
  505.   
  506.   #ifndef    lint
  507.   static char SCCSid[] =
  508. !     "@(#)psxlate.c: 2.2 Copyright 90/10/12 13:12:11 Chris Lewis";
  509.   #endif
  510.   
  511.   #include "defs.h"
  512. ***************
  513. *** 39,45 ****
  514.       struct headers *comments;
  515.   } pageidx[MAXPAGE];
  516.   
  517. ! char *tmp = "/tmp/psxXXXXXX";
  518.   int page = 0;
  519.   char *progname;
  520.   int debug, verbose;
  521. --- 39,45 ----
  522.       struct headers *comments;
  523.   } pageidx[MAXPAGE];
  524.   
  525. ! char tmp[] = {"/tmp/psxXXXXXX"};
  526.   int page = 0;
  527.   char *progname;
  528.   int debug, verbose;
  529. *** /tmp/PATCHold/./utils/catconv.S    Fri Oct 12 14:34:06 1990
  530. --- ./utils/catconv.S    Fri Oct 12 14:34:12 1990
  531. ***************
  532. *** 0 ****
  533. --- 1,89 ----
  534. + #! /usr/lbin/perl
  535. + eval "exec  /usr/lbin/perl -S $0 $*"
  536. +     if $running_under_some_shell;
  537. + #    This does a very simpleminded conversion of ditroff-only-isms
  538. + #    (such as graphics) into something handleable by psroff.
  539. + #    Copyright 1990 Chris Lewis, All Rights Reserved.
  540. + #    You can do anything you want with this provided that it is
  541. + #    not for profit and this notice remains intact.
  542. + #    1.1 90/10/12
  543. + $inpic = 0;
  544. + print(".de lf\n");
  545. + print(".mk\n");
  546. + print("..\n");
  547. + while($line = <STDIN>) {
  548. +     chop($line);
  549. +     if ($line =~ /^\.PS/) {
  550. +     $inpic = 1;
  551. +     print "$line\n";
  552. +     next;
  553. +     }
  554. +     if ($line =~ /^\.PE/) {
  555. +     $inpic = 0;
  556. +     print "$line\n";
  557. +     next;
  558. +     }
  559. +     if ($inpic && ($line eq '.sp -1')) {
  560. +     printf(".rt\n");
  561. +     next;
  562. +     }
  563. +     if ($line =~ /\\D'/) {
  564. +     $newline = do process($line);
  565. +     print "$newline\n";
  566. +     } else {
  567. +     print "$line\n";
  568. +     }
  569. + }
  570. + sub process {
  571. +     local($line, $newline, $pre, $opcode, $arglist) = ($_[0]);
  572. + #    printf("in process: $line\n");
  573. +     $predefs = '';
  574. +     $index = 0;
  575. +     while($line =~ /\\D'\s*(.)\s*([^']+)'/) {
  576. +     ($pre, $line, $opcode, $arglist) = ($`, $', $1, $2);
  577. + #    print("pre: $pre\nline: $line\nopcode: $opcode\narglist: $arglist\n");
  578. +     $newline .= $pre;
  579. +     $newargs = '';
  580. +     $newy = '';
  581. +     $newx = '';
  582. +     @args = split(/[ \t]+/, $arglist);
  583. +     for ($i = 0; $i <= $#args; $i++) {
  584. +         $arg = $args[$i];
  585. +         if ($arg =~ '-') {
  586. +         $arg = "0$arg";
  587. +         }
  588. +         $predefs .= ".nr .$index $arg\n";
  589. +         $newargs .= "\\(ts\\n(.$index";
  590. +         if ($opcode eq '~') {
  591. +         if ($i % 2) {
  592. +             $newy .= "+\\n(.$index";
  593. +         } else {
  594. +             $newx .= "+\\n(.$index";
  595. +         }
  596. +         }
  597. +         $index++;
  598. +     }
  599. +     $newline .= "\\ka\\o'\\(bs\\(bs'D$opcode$newargs\\(bs\\h'|\\nau";
  600. +     # Reposition...
  601. +     if ($opcode eq 'l') {
  602. +         $newline .= sprintf("+\\n(.%du'\\v'\\n(.%du'",
  603. +         $index - 2, $index -1);
  604. +     } elsif ($opcode eq 'c') {
  605. +         $newline .= sprintf("+\\n(.%du'", $index - 1);
  606. +     } elsif ($opcode eq 'e') {
  607. +         $newline .= sprintf("+\\n(.%du'", $index - 2);
  608. +     } elsif ($opcode eq '~') {
  609. +         $newy = substr($newy, 1, 9999);
  610. +         $newline .= "$newx'\\v'$newy'";
  611. +     } else {
  612. +         $newline .= "'";
  613. +     }
  614. +     if ($line) {
  615. +         $newline .= "\\\n";
  616. +     }
  617. +     }
  618. +     $newline .= $line;
  619. +     return("$predefs$newline");
  620. + }
  621. *** /tmp/PATCHold/./defs.h    Fri Oct 12 14:34:20 1990
  622. --- ./defs.h    Fri Oct 12 14:34:22 1990
  623. ***************
  624. *** 1,4 ****
  625. ! /*    Copyright 1988, 1989 15:04:07 Chris Lewis
  626.           All Rights Reserved
  627.   
  628.       Permission to copy and further distribute is freely given provided
  629. --- 1,4 ----
  630. ! /*    Copyright 1988, 1989 13:38:22 Chris Lewis
  631.           All Rights Reserved
  632.   
  633.       Permission to copy and further distribute is freely given provided
  634. ***************
  635. *** 6,18 ****
  636.       sold for profit.
  637.   
  638.       Project:    Generic Troff drivers
  639. !     Module:        defs.h 2.3 90/08/29 15:04:07
  640.       Author:     Chris Lewis
  641.       Specs:        Main header file - contains some customization
  642.    */
  643.   
  644.   /*    Official Release and Patch level:    */
  645. ! #define    T2VERSION    "@(#)PSROFF Copyright 90/08/29 Chris Lewis - R2 P2"
  646.   
  647.   #ifndef    LIBDIR
  648.   /*    Don't touch this */
  649. --- 6,18 ----
  650.       sold for profit.
  651.   
  652.       Project:    Generic Troff drivers
  653. !     Module:        defs.h 2.7 90/10/12 13:38:22
  654.       Author:     Chris Lewis
  655.       Specs:        Main header file - contains some customization
  656.    */
  657.   
  658.   /*    Official Release and Patch level:    */
  659. ! #define    T2VERSION    "@(#)PSROFF Copyright 90/10/12 Chris Lewis - R2 P3"
  660.   
  661.   #ifndef    LIBDIR
  662.   /*    Don't touch this */
  663. ***************
  664. *** 30,35 ****
  665. --- 30,38 ----
  666.   #undef    BCOPY        /* Define if you don't have memcpy and friends - eg:
  667.                  oldish BSD systems */
  668.   
  669. + #undef  BCOPYLIB    /* Define if BCOPY is defined and you have */
  670. +             /* a bcopy in the library */ 
  671.   #undef    UNSIGNEDCHAR    /* Define if chars are unsigned on your machine */
  672.   
  673.   /*    The name of a routine that can be called thusly:
  674. ***************
  675. *** 45,50 ****
  676. --- 48,56 ----
  677.   
  678.   #define VFPRINTF    vfprintf
  679.   
  680. + /* If you have the stand-alone pk2sfp distribution, do not touch
  681. +    anything from here on */
  682.   /*    Font width file configuration:
  683.   
  684.       - If HEADERSIZE defined, use that many bytes as a prefix to the
  685. ***************
  686. *** 157,162 ****
  687. --- 163,170 ----
  688.   #define    DEFYOFF   0    /* Default page vertical offset.  See README/TROUBLE/
  689.                  psroff(1) -Y options too */
  690.   
  691. + #define    INSPECIAL    /* enables ditroff graphics capability */
  692.   /*    Edit no more .... */
  693.   
  694.   #define    MAXDLFONTS (MDLF - PRELOAD)    /* # fonts troff2ps can download */
  695. ***************
  696. *** 375,377 ****
  697. --- 383,390 ----
  698.   extern char *mustmalloc();
  699.   
  700.   extern char *version, *shortversion;
  701. + #ifdef    ALONE
  702. + #undef    PARTIAL
  703. + #undef    INCR
  704. + #endif
  705. *** /tmp/PATCHold/./dt.c    Fri Oct 12 14:34:31 1990
  706. --- ./dt.c    Fri Oct 12 14:34:33 1990
  707. ***************
  708. *** 15,21 ****
  709.   
  710.   #ifndef    lint
  711.   static char SCCSid[] =
  712. !     "@(#)dt.c: 2.1 Copyright 90/07/18 16:51:27 Chris Lewis";
  713.   #endif
  714.   
  715.   /*    These two tables are always included so that we have the
  716. --- 15,21 ----
  717.   
  718.   #ifndef    lint
  719.   static char SCCSid[] =
  720. !     "@(#)dt.c: 2.2 Copyright 90/10/12 13:09:25 Chris Lewis";
  721.   #endif
  722.   
  723.   /*    These two tables are always included so that we have the
  724. ***************
  725. *** 413,418 ****
  726. --- 413,419 ----
  727.           else
  728.           printf("c%s\n", sequence);
  729.       }
  730. +     lastXPos = nx;
  731.   #ifdef    NOTYET
  732.       }
  733.   #endif
  734. ***************
  735. *** 466,470 ****
  736. --- 467,502 ----
  737.       printf("x trailer\n");
  738.       printf("x stop\n");
  739.   }
  740. + #ifdef    INSPECIAL
  741. + dtDraw(origX, origY, s)
  742. + int origX, origY;
  743. + register char *s; {
  744. +     register int temp, t2;
  745. +     DBP((D_CAT, "dtDraw: (%d,%d): %s\n", origX, origY, s));
  746. +     printf("H%d\n", TROFF2DTX(origX));
  747. +     printf("V%d\n", TROFF2DTY(origY));
  748. +     putchar('D');
  749. +     putchar(*s);
  750. +     s++;
  751. +     /* We just pass these thru, scaling them to output resolution */
  752. +     for (;*s;s++) {
  753. +     if (isspace(*s))
  754. +         putchar(' ');
  755. +     else if (!isdigit(*s))
  756. +         putchar(*s);
  757. +     else {
  758. +         temp = *s - '0';
  759. +         while(isdigit(*(s+1))) {
  760. +         temp = temp * 10 + (*++s - '0');
  761. +         }
  762. +         t2 = temp * dtresolution / TROFFRESOLUTION;
  763. +         DBP((D_CAT, "dtDraw (scale): %d -> %d\n", temp, t2)); 
  764. +         printf("%d", t2);
  765. +     }
  766. +     }
  767. +     putchar('\n');
  768. + }
  769. + #endif
  770.   
  771.   #endif /* DT */
  772. *** /tmp/PATCHold/./dt.h    Fri Oct 12 14:34:41 1990
  773. --- ./dt.h    Fri Oct 12 14:34:42 1990
  774. ***************
  775. *** 1,4 ****
  776. ! /*    Copyright 1985, 1986, 1987, 1988 16:51:29 Chris Lewis
  777.           All Rights Reserved
  778.   
  779.       Permission to copy and further distribute is freely given provided
  780. --- 1,4 ----
  781. ! /*    Copyright 1985, 1986, 1987, 1988 13:09:46 Chris Lewis
  782.           All Rights Reserved
  783.   
  784.       Permission to copy and further distribute is freely given provided
  785. ***************
  786. *** 6,12 ****
  787.       sold for profit.
  788.   
  789.       Project:    Generic Troff drivers
  790. !     Module:        dt.h 2.1 90/07/18
  791.       Author:     Chris Lewis
  792.       Specs:        Ditroff driver definitions
  793.               Hacked from ps.h
  794. --- 6,12 ----
  795.       sold for profit.
  796.   
  797.       Project:    Generic Troff drivers
  798. !     Module:        dt.h 2.2 90/10/12
  799.       Author:     Chris Lewis
  800.       Specs:        Ditroff driver definitions
  801.               Hacked from ps.h
  802. ***************
  803. *** 21,27 ****
  804.   /*    11" paper length */
  805.   #define    TROFF2DTY(y) ((((long) (y)+pageyoffset)*dtresolution)/TROFFRESOLUTION)
  806.   
  807. ! extern int dtProlog(), dtEpilog(), dtChar(), dtPage(), dtPassthru();
  808.   
  809.   #ifdef    DT
  810.   extern struct troff2befont dtSymFont[], dtStdFont[];
  811. --- 21,27 ----
  812.   /*    11" paper length */
  813.   #define    TROFF2DTY(y) ((((long) (y)+pageyoffset)*dtresolution)/TROFFRESOLUTION)
  814.   
  815. ! extern int dtProlog(), dtEpilog(), dtChar(), dtPage(), dtPassthru(), dtDraw();
  816.   
  817.   #ifdef    DT
  818.   extern struct troff2befont dtSymFont[], dtStdFont[];
  819. *** /tmp/PATCHold/./ps.h    Fri Oct 12 14:34:49 1990
  820. --- ./ps.h    Fri Oct 12 14:34:50 1990
  821. ***************
  822. *** 1,4 ****
  823. ! /*    Copyright 1985, 1986, 1987, 1988 16:51:42 Chris Lewis
  824.           All Rights Reserved
  825.   
  826.       Permission to copy and further distribute is freely given provided
  827. --- 1,4 ----
  828. ! /*    Copyright 1985, 1986, 1987, 1988 13:09:42 Chris Lewis
  829.           All Rights Reserved
  830.   
  831.       Permission to copy and further distribute is freely given provided
  832. ***************
  833. *** 6,12 ****
  834.       sold for profit.
  835.   
  836.       Project:    Generic Troff drivers
  837. !     Module:        ps.h 2.1 90/07/18
  838.       Author:     Chris Lewis
  839.       Specs:        PostScript Driver definitions
  840.    */
  841. --- 6,12 ----
  842.       sold for profit.
  843.   
  844.       Project:    Generic Troff drivers
  845. !     Module:        ps.h 2.2 90/10/12
  846.       Author:     Chris Lewis
  847.       Specs:        PostScript Driver definitions
  848.    */
  849. ***************
  850. *** 30,36 ****
  851.   #define    EMITPS    printf
  852.   
  853.   /*    Entry points: */
  854. ! extern int psProlog(), psEpilog(), psChar(), psPage(),
  855.       psOverlay(), psXlate();
  856.   
  857.   extern struct troff2befont psSymFont[], psStdFont[];
  858. --- 30,36 ----
  859.   #define    EMITPS    printf
  860.   
  861.   /*    Entry points: */
  862. ! extern int psProlog(), psEpilog(), psChar(), psPage(),psDraw(),
  863.       psOverlay(), psXlate();
  864.   
  865.   extern struct troff2befont psSymFont[], psStdFont[];
  866. *** /tmp/PATCHold/./psroff.S    Fri Oct 12 14:35:07 1990
  867. --- ./psroff.S    Fri Oct 12 14:35:10 1990
  868. ***************
  869. *** 11,17 ****
  870.   #    Author:     Chris Lewis
  871.   #    Specs:        troff driver
  872.   #
  873. ! #ident  "@(#)psroff.sh: 2.1 Copyright 90/07/18 16:51:55 Chris Lewis"
  874.   
  875.   LIBDIR="%%LIBDIR%%"
  876.   FONTDIR="%%FONTDIR%%"
  877. --- 11,17 ----
  878.   #    Author:     Chris Lewis
  879.   #    Specs:        troff driver
  880.   #
  881. ! #ident  "@(#)psroff.sh: 2.2 Copyright 90/10/01 14:41:16 Chris Lewis"
  882.   
  883.   LIBDIR="%%LIBDIR%%"
  884.   FONTDIR="%%FONTDIR%%"
  885. ***************
  886. *** 221,227 ****
  887.       ) >&2
  888.   fi
  889.   
  890. ! if [ -n "$widtharg" -a ! -d /usr/lib/font/$width ]
  891.   then
  892.       echo "$0: troff doesn't have width tables ($width) for $type printer" >&2
  893.       echo "Please see the README and gfnttab for creating them" >&2
  894. --- 221,227 ----
  895.       ) >&2
  896.   fi
  897.   
  898. ! if [ -n "$widtharg" -a ! -d %%FONTDIR%%/$width ]
  899.   then
  900.       echo "$0: troff doesn't have width tables ($width) for $type printer" >&2
  901.       echo "Please see the README and gfnttab for creating them" >&2
  902. -- 
  903. Chris Lewis, Phone: TBA
  904. UUCP: uunet!utai!lsuc!ecicrl!clewis
  905. Moderator of the Ferret Mailing List (ferret-request@eci386)
  906. Psroff mailing list (psroff-request@eci386)
  907.