[comp.sources.misc] v07i111: Official Patch to thack

allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (07/31/89)

Posting-number: Volume 7, Issue 111
Submitted-by: everson%compsci.bristol.ac.uk@NSFnet-Relay.AC.UK
Archive-name: thack.p2

Please find enclosed the 2nd Official Set of Patches to thack, a troff
to postscript filter, recently posted to comp.sources.misc. These
patches are the work of David R. Kaelbling (drk@twinkie.Rational.COM)
and attempt to make the postscript produced Adobe-conformant. Thanks
David.

Phill Everson
Medical Imaging
Dept Comp Sci
University of Bristol, UK

*** README.orig	Fri Jul 28 13:48:51 1989
--- README	Fri Jul 28 13:50:02 1989
***************
*** 1,6 ****
  
  Enclosed please find thack, a Troff C/A/T to Postscript filter, written
! by a colleague of mine, Gareth Waddell.
  
  Sample usage of thack is, say:
  
--- 1,7 ----
  
  Enclosed please find thack, a Troff C/A/T to Postscript filter, written
! by a colleague of mine, Gareth Waddell. Attempt to make output 
! Adobe-conformant Postscript by David R. Kaelbling (drk@twinkie.Rational.COM)
  
  Sample usage of thack is, say:
  
*** thack.c.orig	Fri Jul 28 13:30:01 1989
--- thack.c	Fri Jul 28 13:48:26 1989
***************
*** 1,5 ****
--- 1,6 ----
  #include "th.h"
  
+ int npages;
  int xpos, ypos, cx, cy;
  int font, cfont, size, csize, tfont, tsize;
  char *pstr, *cstr();
***************
*** 408,413 ****
--- 409,415 ----
  	}
  	if (sflag)
  		endpage();
+ 	epilog();
  }
  
  tprint()
***************
*** 514,524 ****
--- 516,540 ----
  
  newpage()
  {
+ 	printf("%%%%Page: %d %d\n", npages, ++npages);
  	printf("save\n");
  }
  
  prolog()
  {
+ 	long clock = time(0);
+ 	  
+ 	printf("%%!PS-Adobe-\n");
+ 	printf("%%%%Creator: (thack - contact <everson@cs.bris.ac.uk>)\n");
+ 	printf("%%%%Title: unknown\n");
+ 	printf("%%%%CreationDate: %s", asctime (localtime (&clock)));
+ 	printf("%%%%Pages: (atend)\n");
+ 	printf("%%%%DocumentFonts: Times-Roman Times-Italic Times-Bold \
+ 	            Symbol Helvetica Helvetica-Oblique Helvetica-Bold Courier \
+ 		    Courier-Oblique Courier-Bold Times-BoldItalic Helvetica-BoldOblique \
+ 		    Courier-BoldOblique\n");
+ 	printf("%%%%EndComments\n");
+ 
  	printf("/P {moveto show} def\n");
  	printf("/X {currentpoint exch pop moveto show} def\n");
  	printf("/F {findfont exch scalefont setfont} def\n");
***************
*** 536,541 ****
--- 552,560 ----
  	printf("/HBO /Helvetica-BoldOblique def\n");
  	printf("/CBO /Courier-BoldOblique def\n");
  	printf("1 6 div dup scale\n");
+ 
+ 	printf("%%%%EndProlog\n");
+         npages = 0;
  }
  
  endpage()
***************
*** 543,546 ****
--- 562,571 ----
  	printf("showpage\n");
  	printf("restore\n");
  	cfont = csize = -1;	/* Doing this will cause a new font message */
+ }
+ 
+ epilog()
+ {
+   printf("%%%%Trailer\n");
+   printf("%%%%Pages: %d\n", npages);
  }