home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / misc / volume07 / thack.p2 < prev    next >
Encoding:
Internet Message Format  |  1991-08-27  |  3.3 KB

  1. From decwrl!purdue!tut.cis.ohio-state.edu!unmvax!aplcen!ginosko!uunet!allbery Thu Aug  3 08:52:05 PDT 1989
  2. Article 1003 of comp.sources.misc:
  3. Path: decwrl!purdue!tut.cis.ohio-state.edu!unmvax!aplcen!ginosko!uunet!allbery
  4. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5. Newsgroups: comp.sources.misc
  6. Subject: v07i111: Official Patch to thack (troff -> ps filter) #2
  7. Message-ID: <62023@uunet.UU.NET>
  8. Date: 30 Jul 89 22:42:37 GMT
  9. Sender: allbery@uunet.UU.NET
  10. Reply-To: everson%compsci.bristol.ac.uk@NSFnet-Relay.AC.UK
  11. Lines: 107
  12. Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  13.  
  14. Posting-number: Volume 7, Issue 111
  15. Submitted-by: everson%compsci.bristol.ac.uk@NSFnet-Relay.AC.UK
  16. Archive-name: thack.p2
  17.  
  18. Please find enclosed the 2nd Official Set of Patches to thack, a troff
  19. to postscript filter, recently posted to comp.sources.misc. These
  20. patches are the work of David R. Kaelbling (drk@twinkie.Rational.COM)
  21. and attempt to make the postscript produced Adobe-conformant. Thanks
  22. David.
  23.  
  24. Phill Everson
  25. Medical Imaging
  26. Dept Comp Sci
  27. University of Bristol, UK
  28.  
  29. *** README.orig    Fri Jul 28 13:48:51 1989
  30. --- README    Fri Jul 28 13:50:02 1989
  31. ***************
  32. *** 1,6 ****
  33.   
  34.   Enclosed please find thack, a Troff C/A/T to Postscript filter, written
  35. ! by a colleague of mine, Gareth Waddell.
  36.   
  37.   Sample usage of thack is, say:
  38.   
  39. --- 1,7 ----
  40.   
  41.   Enclosed please find thack, a Troff C/A/T to Postscript filter, written
  42. ! by a colleague of mine, Gareth Waddell. Attempt to make output 
  43. ! Adobe-conformant Postscript by David R. Kaelbling (drk@twinkie.Rational.COM)
  44.   
  45.   Sample usage of thack is, say:
  46.   
  47. *** thack.c.orig    Fri Jul 28 13:30:01 1989
  48. --- thack.c    Fri Jul 28 13:48:26 1989
  49. ***************
  50. *** 1,5 ****
  51. --- 1,6 ----
  52.   #include "th.h"
  53.   
  54. + int npages;
  55.   int xpos, ypos, cx, cy;
  56.   int font, cfont, size, csize, tfont, tsize;
  57.   char *pstr, *cstr();
  58. ***************
  59. *** 408,413 ****
  60. --- 409,415 ----
  61.       }
  62.       if (sflag)
  63.           endpage();
  64. +     epilog();
  65.   }
  66.   
  67.   tprint()
  68. ***************
  69. *** 514,524 ****
  70. --- 516,540 ----
  71.   
  72.   newpage()
  73.   {
  74. +     printf("%%%%Page: %d %d\n", npages, ++npages);
  75.       printf("save\n");
  76.   }
  77.   
  78.   prolog()
  79.   {
  80. +     long clock = time(0);
  81. +       
  82. +     printf("%%!PS-Adobe-\n");
  83. +     printf("%%%%Creator: (thack - contact <everson@cs.bris.ac.uk>)\n");
  84. +     printf("%%%%Title: unknown\n");
  85. +     printf("%%%%CreationDate: %s", asctime (localtime (&clock)));
  86. +     printf("%%%%Pages: (atend)\n");
  87. +     printf("%%%%DocumentFonts: Times-Roman Times-Italic Times-Bold \
  88. +                 Symbol Helvetica Helvetica-Oblique Helvetica-Bold Courier \
  89. +             Courier-Oblique Courier-Bold Times-BoldItalic Helvetica-BoldOblique \
  90. +             Courier-BoldOblique\n");
  91. +     printf("%%%%EndComments\n");
  92.       printf("/P {moveto show} def\n");
  93.       printf("/X {currentpoint exch pop moveto show} def\n");
  94.       printf("/F {findfont exch scalefont setfont} def\n");
  95. ***************
  96. *** 536,541 ****
  97. --- 552,560 ----
  98.       printf("/HBO /Helvetica-BoldOblique def\n");
  99.       printf("/CBO /Courier-BoldOblique def\n");
  100.       printf("1 6 div dup scale\n");
  101. +     printf("%%%%EndProlog\n");
  102. +         npages = 0;
  103.   }
  104.   
  105.   endpage()
  106. ***************
  107. *** 543,546 ****
  108. --- 562,571 ----
  109.       printf("showpage\n");
  110.       printf("restore\n");
  111.       cfont = csize = -1;    /* Doing this will cause a new font message */
  112. + }
  113. + epilog()
  114. + {
  115. +   printf("%%%%Trailer\n");
  116. +   printf("%%%%Pages: %d\n", npages);
  117.   }
  118.  
  119.  
  120.