🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #540

Tgif-2.12-patch13 (13th patch for tgif-2.12), Part 01/01

#540
From: William Cheng
Date: Wed, 11 Nov 1992 08:18
1401 lines
47748 bytes
Below is tgif-2.12-patch13 (13th patch for tgif-2.12).  (The complete
source for tgif-2.12 at patchlevel 13 can be found in the following
places for anonymous ftp:  export.lcs.mit.edu:/contrib/tgif-2.12-p13.tar.Z
and cs.ucla.edu:/pub/tgif/tgif-2.12-p13.tar.Z.)

Tgif is an Xlib based 2-D drawing tool under X11.

Remove everything outside of the 'cut here' lines (inclusive) and save
the file as tgif-2.12-patch13; then apply the patch with
'patch -p -N < tgif-2.12-patch13'.  Here is a short list of added
features/bug fixes.

1)  Fix bugs related to the tgif -print feature.  The problem was that
    popen() calls sh(1) and that quotes are stripped by sh(1).
    Thanks to Yoichiro Ueno <ueno@cs.titech.ac.jp> for the code fixes.
2)  The TextSize and TextStyle menus were reversed.
3)  Generate integer bounding box in PostScript output files.  This is to
    conform to the PostScript standard.
4)  Augment the UsePsAdobeString X default such that specific %!PS-Adobe
    string can be specified.  In addition to ``true'' and ``false'',
    UsePsAdobeString can also be specified with <Adobe_Version>/<EPSF_Version>.
    The command line option "-adobe=<Adobe_Version>/<EPSF_Version>" is also
    added.
5)  Add a new X default, ForceClearAfterEPS.  When it is set to ``true'',
    the PostScript stack is cleared after printing an EPS object.  This action
    was always taken in patchlevel 12 of version 2.12.  However, recently
    I found that the PostScript Language Reference Manual strongly discourages
    doing so.  Therefore, use this only if you REALLY want to generate the
    illegal "clear" command to get around some buggy EPS documents (such as
    the one generated by xgrabsc).
6)  Add the -DHP_LINE_BUG compile option to get around some buggy HP servers.
7)  Remove unrecognized commands in the man pages.

Please send bug reports to william@cs.ucla.edu.
---------------------------------> cut here <---------------------------------
*** eps.c.orig	Tue Nov 10 23:58:42 1992
--- eps.c	Tue Nov 10 23:58:43 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/eps.c,v 2.8.1.2 1992/10/20 04:56:44 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/eps.c,v 2.8.1.3 1992/11/09 07:49:58 william Exp $";
  #endif
  
***************
*** 59,62 ****
--- 59,63 ----
  static struct LineRec	* topLine=NULL, * botLine=NULL;
  static int		numLines = 0;
+ static int		forceClearAfterEPS = FALSE;
  
  void InitEPS ()
***************
*** 68,71 ****
--- 69,77 ----
        if (strcmp ("False", c_ptr) == 0 || strcmp ("false", c_ptr) == 0)
           stripEPSComments = FALSE;
+ 
+    forceClearAfterEPS = TRUE;
+    if ((c_ptr=XGetDefault(mainDisplay,TOOL_NAME,"ForceClearAfterEPS")) != NULL)
+       if (strcmp ("True", c_ptr) == 0 || strcmp ("true", c_ptr) == 0)
+          forceClearAfterEPS = TRUE;
  }
  
***************
*** 636,640 ****
        fprintf (FP, "%s\n", xbm_ptr->epsflines[i]);
  
!    fprintf (FP, "clear\n");
     fprintf (FP, "tgiflevel%1d restore\n", xbm_ptr->epsf_level);
     fprintf (FP, "tgifdict begin\n");
--- 642,646 ----
        fprintf (FP, "%s\n", xbm_ptr->epsflines[i]);
  
!    if (forceClearAfterEPS) fprintf (FP, "clear\n");
     fprintf (FP, "tgiflevel%1d restore\n", xbm_ptr->epsf_level);
     fprintf (FP, "tgifdict begin\n");
*** file.c.orig	Tue Nov 10 23:58:49 1992
--- file.c	Tue Nov 10 23:58:52 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/file.c,v 2.192.1.4 1992/11/04 04:47:29 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/file.c,v 2.192.1.8 1992/11/09 01:53:05 william Exp $";
  #endif
  
***************
*** 121,124 ****
--- 121,125 ----
  int	saveCommentsInSaveNew=TRUE;
  int	usePsAdobeString=FALSE;
+ char	adobeString[80], epsfString[80];
  
  static
***************
*** 2082,2086 ****
  {
     register struct ObjRec	* obj_ptr;
!    int				ltx, lty, rbx, rby;
     double			llx1=0, lly1=0, urx1=0, ury1=0;
  
--- 2083,2087 ----
  {
     register struct ObjRec	* obj_ptr;
!    int				ltx, lty, rbx, rby, llx, lly, urx, ury;
     double			llx1=0, lly1=0, urx1=0, ury1=0;
  
***************
*** 2131,2141 ****
     }
  
!    llx1 += (llx1 >= 0) ? -0.001 : 0.001;
!    lly1 += (lly1 >= 0) ? -0.001 : 0.001;
!    urx1 += (urx1 >= 0) ? 0.001 : -0.001;
!    ury1 += (ury1 >= 0) ? 0.001 : -0.001;
  
!    fprintf (fp,"%%%%BoundingBox: %.3lf %.3lf %.3lf %.3lf\n",
!          llx1, lly1, urx1, ury1);
  }
  
--- 2132,2141 ----
     }
  
!    llx = (llx1 >= 0.0) ? ((int)llx1)-1 : (-((int)(-llx1)))-1;
!    lly = (lly1 >= 0.0) ? ((int)lly1)-1 : (-((int)(-lly1)))-1;
!    urx = (urx1 >= 0.0) ? ((int)urx1)+1 : (-((int)(0.999-urx1)))+1;
!    ury = (ury1 >= 0.0) ? ((int)ury1)+1 : (-((int)(0.999-ury1)))+1;
  
!    fprintf (fp,"%%%%BoundingBox: %1d %1d %1d %1d\n", llx, lly, urx, ury);
  }
  
***************
*** 2165,2169 ****
     char				cmd[MAXSTRING+1], tmp_str[MAXSTRING+1];
     char				tmp_file[MAXSTRING+1], ps_file[MAXSTRING+1];
!    char				msg[MAXSTRING+1], * rest, * loc_time;
     int				i, len, short_name = FALSE;
     FILE				* fp;
--- 2165,2169 ----
     char				cmd[MAXSTRING+1], tmp_str[MAXSTRING+1];
     char				tmp_file[MAXSTRING+1], ps_file[MAXSTRING+1];
!    char				msg[MAXSTRING+1], * rest, loc_time[MAXSTRING+1];
     int				i, len, short_name = FALSE;
     FILE				* fp;
***************
*** 2211,2215 ****
  
     if (usePsAdobeString)
!       fprintf (fp, "%%!PS-Adobe-2.0 EPSF-1.2\n");
     else
        fprintf (fp, "%%!\n");
--- 2211,2222 ----
  
     if (usePsAdobeString)
!    {
!       if (*adobeString == '\0')
!          fprintf (fp, "%%!PS-Adobe-2.0 EPSF-1.2\n");
!       else if (*epsfString == '\0')
!          fprintf (fp, "%%!PS-Adobe-%s\n", adobeString);
!       else
!          fprintf (fp, "%%!PS-Adobe-%s EPSF-%s\n", adobeString, epsfString);
!    }
     else
        fprintf (fp, "%%!\n");
***************
*** 2228,2232 ****
        fprintf (fp, "%%%%Title: [Unnamed]\n");
     time (&tloc);
!    loc_time = ctime (&tloc);
     loc_time[24] = '\0';
     fprintf (fp, "%%%%CreationDate: %s\n", loc_time);
--- 2235,2239 ----
        fprintf (fp, "%%%%Title: [Unnamed]\n");
     time (&tloc);
!    strcpy(loc_time, ctime (&tloc));
     loc_time[24] = '\0';
     fprintf (fp, "%%%%CreationDate: %s\n", loc_time);
***************
*** 2233,2236 ****
--- 2240,2246 ----
     fprintf (fp, "%%%%Creator: Tgif-%s by %s (william@cs.UCLA.edu)\n",
           version_string, "William Chia-Wei Cheng");
+    fprintf (fp, "%%%%Pages: 1\n");
+    fprintf (fp, "%%%%DocumentFonts: %s\n",
+          "Times-Roman Helvetica Courier NewCenturySchlbk Symbol");
  
     DumpPSMacro (fp);
***************
*** 2241,2244 ****
--- 2251,2255 ----
     fprintf (fp, "%%%%EndProlog\n");
     fprintf (fp, "%%%%Page: 1 1\n\n");
+    fprintf (fp, "tgifdict begin\n");
     fprintf (fp, "/tgifsavedpage save def\n\n");
     fprintf (fp, "1 setmiterlimit\n");
*** poly.c.orig	Tue Nov 10 23:59:01 1992
--- poly.c	Tue Nov 10 23:59:02 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/poly.c,v 2.59.1.2 1992/10/21 04:37:27 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/poly.c,v 2.59.1.3 1992/11/07 23:32:42 william Exp $";
  #endif
  
***************
*** 85,88 ****
--- 85,89 ----
  
     v = (XPoint *) calloc (NumVs+1, sizeof(XPoint));
+    if (v == NULL) fprintf (stderr, "Can not calloc().\n");
     for (i = 0; i < NumVs; i++)
     {
***************
*** 204,207 ****
--- 205,209 ----
     v = (XPoint *) calloc (NumPts+1, sizeof(XPoint));
     rv = (XPoint *) calloc (NumPts+1, sizeof(XPoint));
+    if (v == NULL || rv == NULL) fprintf (stderr, "Can not calloc().\n");
     pt_ptr = lastPtPtr;
     ltx = rbx = pt_ptr->x;
***************
*** 287,290 ****
--- 289,293 ----
     {
        v = (XPoint *) calloc (max_n+1, sizeof (XPoint));
+       if (v == NULL) fprintf (stderr, "Can not calloc().\n");
        v[0].x = v[1].x = v[2].x = ABS_X(OrigX);
        v[0].y = v[1].y = v[2].y = ABS_Y(OrigY);
***************
*** 316,321 ****
--- 319,342 ----
        {
           if (curSpline==LT_SPLINE && splineRubberband)
+          {
+ #ifdef HP_LINE_BUG
+             if (sn == 2)
+             {
+                XPoint hp_sv[3];
+ 
+                hp_sv[0].x = sv[0].x; hp_sv[0].y = sv[0].y;
+                hp_sv[1].x = sv[0].x; hp_sv[1].y = sv[0].y;
+                hp_sv[2].x = sv[1].x; hp_sv[2].y = sv[1].y;
+                XDrawLines (mainDisplay, drawWindow, drawGC, hp_sv, 3,
+                      CoordModeOrigin);
+             }
+             else
+                XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
+                      CoordModeOrigin);
+ #else
              XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
                    CoordModeOrigin);
+ #endif
+          }
           else
              XDrawLine (mainDisplay, drawWindow, drawGC, OrigX, OrigY, grid_x,
***************
*** 335,340 ****
--- 356,377 ----
                 v[n-1].y = v[n].y = ABS_Y(grid_y);
                 sv = MakeSplinePolyVertex (&sn, drawOrigX, drawOrigY, n, v);
+ #ifdef HP_LINE_BUG
+                if (sn == 2)
+                {
+                   XPoint hp_sv[3];
+ 
+                   hp_sv[0].x = sv[0].x; hp_sv[0].y = sv[0].y;
+                   hp_sv[1].x = sv[0].x; hp_sv[1].y = sv[0].y;
+                   hp_sv[2].x = sv[1].x; hp_sv[2].y = sv[1].y;
+                   XDrawLines (mainDisplay, drawWindow, drawGC, hp_sv, 3,
+                         CoordModeOrigin);
+                }
+                else
+                   XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
+                         CoordModeOrigin);
+ #else
                 XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
                       CoordModeOrigin);
+ #endif
              }
              else
***************
*** 357,363 ****
--- 394,417 ----
                       max_n += 40;
                       v = (XPoint *) realloc (v, sizeof(XPoint)*max_n+1);
+                      if (v == NULL) fprintf (stderr, "Can not realloc().\n");
+                   }
+ #ifdef HP_LINE_BUG
+                   if (sn == 2)
+                   {
+                      XPoint hp_sv[3];
+ 
+                      hp_sv[0].x = sv[0].x; hp_sv[0].y = sv[0].y;
+                      hp_sv[1].x = sv[0].x; hp_sv[1].y = sv[0].y;
+                      hp_sv[2].x = sv[1].x; hp_sv[2].y = sv[1].y;
+                      XDrawLines (mainDisplay, drawWindow, drawGC, hp_sv, 3,
+                            CoordModeOrigin);
                    }
+                   else
+                      XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
+                            CoordModeOrigin);
+ #else
                    XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
                          CoordModeOrigin);
+ #endif
                    cfree (sv);
                    v[n].x = v[n+1].x = ABS_X(grid_x);
***************
*** 365,370 ****
--- 419,440 ----
                    n++;
                    sv = MakeSplinePolyVertex (&sn, drawOrigX, drawOrigY, n, v);
+ #ifdef HP_LINE_BUG
+                   if (sn == 2)
+                   {
+                      XPoint hp_sv[3];
+ 
+                      hp_sv[0].x = sv[0].x; hp_sv[0].y = sv[0].y;
+                      hp_sv[1].x = sv[0].x; hp_sv[1].y = sv[0].y;
+                      hp_sv[2].x = sv[1].x; hp_sv[2].y = sv[1].y;
+                      XDrawLines (mainDisplay, drawWindow, drawGC, hp_sv, 3,
+                            CoordModeOrigin);
+                   }
+                   else
+                      XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
+                            CoordModeOrigin);
+ #else
                    XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
                          CoordModeOrigin);
+ #endif
                 }
              }
***************
*** 381,386 ****
--- 451,472 ----
                 v[n-1].y = v[n].y = ABS_Y(grid_y);
                 sv = MakeSplinePolyVertex (&sn, drawOrigX, drawOrigY, n, v);
+ #ifdef HP_LINE_BUG
+                if (sn == 2)
+                {
+                   XPoint hp_sv[3];
+ 
+                   hp_sv[0].x = sv[0].x; hp_sv[0].y = sv[0].y;
+                   hp_sv[1].x = sv[0].x; hp_sv[1].y = sv[0].y;
+                   hp_sv[2].x = sv[1].x; hp_sv[2].y = sv[1].y;
+                   XDrawLines (mainDisplay, drawWindow, drawGC, hp_sv, 3,
+                         CoordModeOrigin);
+                }
+                else
+                   XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
+                         CoordModeOrigin);
+ #else
                 XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
                       CoordModeOrigin);
+ #endif
              }
              else
***************
*** 412,418 ****
--- 498,521 ----
                    max_n += 40;
                    v = (XPoint *) realloc (v, sizeof(XPoint)*max_n+1);
+                   if (v == NULL) fprintf (stderr, "Can not realloc().\n");
+                }
+ #ifdef HP_LINE_BUG
+                if (sn == 2)
+                {
+                   XPoint hp_sv[3];
+ 
+                   hp_sv[0].x = sv[0].x; hp_sv[0].y = sv[0].y;
+                   hp_sv[1].x = sv[0].x; hp_sv[1].y = sv[0].y;
+                   hp_sv[2].x = sv[1].x; hp_sv[2].y = sv[1].y;
+                   XDrawLines (mainDisplay, drawWindow, drawGC, hp_sv, 3,
+                         CoordModeOrigin);
                 }
+                else
+                   XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
+                         CoordModeOrigin);
+ #else
                 XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
                       CoordModeOrigin);
+ #endif
                 cfree (sv);
                 v[n].x = v[n+1].x = ABS_X(grid_x);
***************
*** 420,425 ****
--- 523,544 ----
                 n++;
                 sv = MakeSplinePolyVertex (&sn, drawOrigX, drawOrigY, n, v);
+ #ifdef HP_LINE_BUG
+                if (sn == 2)
+                {
+                   XPoint hp_sv[3];
+ 
+                   hp_sv[0].x = sv[0].x; hp_sv[0].y = sv[0].y;
+                   hp_sv[1].x = sv[0].x; hp_sv[1].y = sv[0].y;
+                   hp_sv[2].x = sv[1].x; hp_sv[2].y = sv[1].y;
+                   XDrawLines (mainDisplay, drawWindow, drawGC, hp_sv, 3,
+                         CoordModeOrigin);
+                }
+                else
+                   XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
+                         CoordModeOrigin);
+ #else
                 XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
                       CoordModeOrigin);
+ #endif
              }
           }
***************
*** 987,994 ****
--- 1106,1146 ----
  
     if (style != LS_PLAIN)
+    {
+ #ifdef HP_LINE_BUG
+       if (poly_ptr->asn == 2)
+       {
+          XPoint hp_sv[3];
+ 
+          hp_sv[0].x=poly_ptr->asvlist[0].x; hp_sv[0].y=poly_ptr->asvlist[0].y;
+          hp_sv[1].x=poly_ptr->asvlist[0].x; hp_sv[1].y=poly_ptr->asvlist[0].y;
+          hp_sv[2].x=poly_ptr->asvlist[1].x; hp_sv[2].y=poly_ptr->asvlist[1].y;
+          XDrawLines (mainDisplay, Win, drawGC, hp_sv, 3, CoordModeOrigin);
+       }
+       else
+          XDrawLines (mainDisplay, Win, drawGC, poly_ptr->asvlist, poly_ptr->asn,
+                CoordModeOrigin);
+ #else
        XDrawLines (mainDisplay, Win, drawGC, poly_ptr->asvlist, poly_ptr->asn,
              CoordModeOrigin);
+ #endif
+    }
     else
+    {
+ #ifdef HP_LINE_BUG
+       if (num_pts == 2)
+       {
+          XPoint hp_sv[3];
+ 
+          hp_sv[0].x = v[0].x; hp_sv[0].y = v[0].y;
+          hp_sv[1].x = v[0].x; hp_sv[1].y = v[0].y;
+          hp_sv[2].x = v[1].x; hp_sv[2].y = v[1].y;
+          XDrawLines (mainDisplay, Win, drawGC, hp_sv, 3, CoordModeOrigin);
+       }
+       else
+          XDrawLines (mainDisplay, Win, drawGC, v, num_pts, CoordModeOrigin);
+ #else
        XDrawLines (mainDisplay, Win, drawGC, v, num_pts, CoordModeOrigin);
+ #endif
+    }
  }
  
***************
*** 1067,1070 ****
--- 1219,1223 ----
        v = (XPoint *) calloc (4, sizeof(XPoint));
        rv = (XPoint *) calloc (4, sizeof(XPoint));
+       if (v == NULL || rv == NULL) fprintf (stderr, "Can not calloc().\n");
     }
     else
***************
*** 1072,1075 ****
--- 1225,1229 ----
        v = (XPoint *) calloc (num_pts+1, sizeof(XPoint));
        rv = (XPoint *) calloc (num_pts+1, sizeof(XPoint));
+       if (v == NULL || rv == NULL) fprintf (stderr, "Can not calloc().\n");
     }
  
*** polygon.c.orig	Tue Nov 10 23:59:07 1992
--- polygon.c	Tue Nov 10 23:59:08 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/polygon.c,v 2.58.1.2 1992/10/21 04:40:03 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/polygon.c,v 2.58.1.3 1992/11/07 23:33:09 william Exp $";
  #endif
  
***************
*** 71,74 ****
--- 71,75 ----
  
     v = (XPoint *) calloc (NumVs+1, sizeof(XPoint));
+    if (v == NULL) fprintf (stderr, "Can not calloc().\n");
     for (i = 0; i < NumVs; i++)
     {
***************
*** 387,390 ****
--- 388,392 ----
     polygon_ptr->n = NumPts;
     v = (XPoint *) calloc (NumPts+1, sizeof(XPoint));
+    if (v == NULL) fprintf (stderr, "Can not calloc().\n");
     pt_ptr = lastPtPtr;
     ltx = rbx = pt_ptr->x;
***************
*** 471,474 ****
--- 473,477 ----
     {
        v = (XPoint *) calloc (max_n+1, sizeof (XPoint));
+       if (v == NULL) fprintf (stderr, "Can not calloc().\n");
        v[0].x = v[1].x = v[2].x = ABS_X(OrigX);
        v[0].y = v[1].y = v[2].y = ABS_Y(OrigY);
***************
*** 567,570 ****
--- 570,574 ----
                    max_n += 40;
                    v = (XPoint *) realloc (v, sizeof(XPoint)*max_n+1);
+                   if (v == NULL) fprintf (stderr, "Can not realloc().\n");
                 }
                 XDrawLines (mainDisplay, drawWindow, drawGC, sv, sn,
***************
*** 766,769 ****
--- 770,774 ----
        v = (XPoint *) calloc (5, sizeof(XPoint));
        rv = (XPoint *) calloc (5, sizeof(XPoint));
+       if (v == NULL || rv == NULL) fprintf (stderr, "Can not calloc().\n");
     }
     else
***************
*** 771,774 ****
--- 776,780 ----
        v = (XPoint *) calloc (num_pts+1, sizeof(XPoint));
        rv = (XPoint *) calloc (num_pts+1, sizeof(XPoint));
+       if (v == NULL || rv == NULL) fprintf (stderr, "Can not calloc().\n");
     }
  
*** ps.c.orig	Tue Nov 10 23:59:10 1992
--- ps.c	Tue Nov 10 23:59:11 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/ps.c,v 2.3.1.2 1992/11/04 04:47:58 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/ps.c,v 2.3.1.6 1992/11/09 01:53:28 william Exp $";
  #endif
  
***************
*** 30,37 ****
  #include <stdio.h>
  
  static char	* psMacro[] =
! { "%%Pages: 1",
!   "%%DocumentFonts: Times-Roman Helvetica Courier NewCenturySchlbk Symbol",
!   "%%EndComments",
    "%",
    "%\tDue to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1",
--- 30,38 ----
  #include <stdio.h>
  
+ #include "const.h"
+ 
  static char	* psMacro[] =
! { "%%EndComments",
!   "%%BeginProlog",
    "%",
    "%\tDue to bugs in Transcript, the 'PS-Adobe-' stuff is omitted from line 1",
***************
*** 360,363 ****
--- 361,366 ----
    "   end",
    " } def",
+   "",
+   "end",
    NULL
  };
***************
*** 369,371 ****
--- 372,412 ----
  
     for (i = 0; psMacro[i] != NULL; i++) fprintf (FP, "%s\n", psMacro[i]);
+ }
+ 
+ int ParsePsAdobeString (s, use_ps_adobe_string, adobe_str, epsf_str)
+    char	* s, * adobe_str, * epsf_str;
+    int	* use_ps_adobe_string;
+ {
+    register char	* c_ptr=s, * c_ptr1;
+ 
+    if (!(strcmp ("false", c_ptr) == 0 || strcmp ("False", c_ptr) == 0))
+    {
+       if (*c_ptr >= '0' && *c_ptr <= '9')
+       {
+          *use_ps_adobe_string = TRUE;
+          for (c_ptr1 = c_ptr; *c_ptr1 != '\0'; c_ptr1++)
+             if (*c_ptr1 == '/')
+             {
+                *c_ptr1 = ' ';
+                break;
+             }
+          sscanf (c_ptr, "%s", adobe_str);
+          c_ptr = &c_ptr[strlen(adobe_str)];
+          switch (*c_ptr)
+          {
+             case '\0': break;
+             case ' ':
+                c_ptr++;
+                if (*c_ptr >= '0' && *c_ptr <= '9')
+                   sscanf (c_ptr, "%s", epsf_str);
+                else
+                   return (FALSE);
+                break;
+             default: return (FALSE);
+          }
+       }
+       else
+          return (FALSE);
+    }
+    return (TRUE);
  }
*** setup.c.orig	Tue Nov 10 23:59:16 1992
--- setup.c	Tue Nov 10 23:59:19 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/setup.c,v 2.100.2.1 1992/10/21 04:52:23 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/setup.c,v 2.100.2.2 1992/11/08 01:22:49 william Exp $";
  #endif
  
***************
*** 52,55 ****
--- 52,56 ----
  #include "names.e"
  #include "pattern.e"
+ #include "ps.e"
  #include "raster.e"
  #include "ruler.e"
***************
*** 565,568 ****
--- 566,571 ----
  
     usePsAdobeString = FALSE;
+    *adobeString = '\0';
+    *epsfString = '\0';
     if ((c_ptr = XGetDefault (mainDisplay, TOOL_NAME,
           "UsePsAdobeString")) != NULL)
***************
*** 570,573 ****
--- 573,589 ----
        if (strcmp ("true", c_ptr) == 0 || strcmp ("True", c_ptr) == 0)
           usePsAdobeString = TRUE;
+       else
+       {
+          char	tmp_str[80];
+ 
+          strcpy (tmp_str, c_ptr);
+          if (!ParsePsAdobeString(tmp_str, &usePsAdobeString, adobeString,
+                epsfString))
+          {
+             fprintf (stderr, "%s %s*UsePsAdobeString:  '%s', %s.\n",
+                   "Invalid", TOOL_NAME, tmp_str, "'false' is used");
+             usePsAdobeString = FALSE;
+          }
+       }
     }
  
*** spline.c.orig	Tue Nov 10 23:59:21 1992
--- spline.c	Tue Nov 10 23:59:22 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/spline.c,v 2.21 1992/10/21 04:58:25 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/spline.c,v 2.22 1992/11/07 23:29:22 william Exp $";
  #endif
  
***************
*** 130,134 ****
           break;
        case 2:
!          splineVs = (XPoint *) calloc (3, sizeof (XPoint));
           if (splineVs == NULL)
           {
--- 130,134 ----
           break;
        case 2:
!          splineVs = (XPoint *) calloc (NumVs+1, sizeof (XPoint));
           if (splineVs == NULL)
           {
*** tgif.c.orig	Tue Nov 10 23:59:25 1992
--- tgif.c	Tue Nov 10 23:59:26 1992
***************
*** 25,29 ****
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/tgif.c,v 2.19 1992/11/03 05:42:39 william Exp $";
  #endif
  
--- 25,29 ----
  #ifndef lint
  static char RCSid[] =
!       "@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/tgif.c,v 2.21 1992/11/08 01:13:46 william Exp $";
  #endif
  
***************
*** 232,235 ****
--- 232,238 ----
  
     whereToPrint = PRINTER;
+    usePsAdobeString = FALSE;
+    *adobeString = '\0';
+    *epsfString = '\0';
  
     c_ptr = printCommand;
***************
*** 247,255 ****
           else if (strcmp (*argv, "-adobe") == 0)
              usePsAdobeString = TRUE;
           else if (strcmp (*argv, "-tgif_path") == 0)
           {
              argc--; argv++;
!             strcpy(drawPath, &(*argv)[1]);
!             drawPath[strlen(drawPath)-1] = '\0';
              if (!from_prtgif)
                 fprintf(stderr, "Warning:  -tgif_path should not be used!\n");
--- 250,277 ----
           else if (strcmp (*argv, "-adobe") == 0)
              usePsAdobeString = TRUE;
+          else if (strncmp (*argv, "-adobe=", 7) == 0)
+          {
+             char	tmp_str[80];
+ 
+             strcpy(tmp_str, &(*argv)[7]);
+             if (!ParsePsAdobeString(tmp_str, &usePsAdobeString, adobeString,
+                   epsfString))
+             {
+                fprintf (stderr, "%s %s*UsePsAdobeString:  '%s', %s.\n",
+                      "Invalid", TOOL_NAME, tmp_str, "'false' is used");
+                usePsAdobeString = FALSE;
+             }
+          }
           else if (strcmp (*argv, "-tgif_path") == 0)
           {
              argc--; argv++;
!             len = strlen(*argv);
!             if (**argv == '"' && (*argv)[len-1] == '"')
!             {
!                strcpy(drawPath, &(*argv)[1]);
!                drawPath[strlen(drawPath)-1] = '\0';
!             }
!             else
!                strcpy(drawPath, *argv);
              if (!from_prtgif)
                 fprintf(stderr, "Warning:  -tgif_path should not be used!\n");
***************
*** 258,263 ****
           {
              argc--; argv++;
!             strcpy(printCommand, &(*argv)[1]);
!             printCommand[strlen(printCommand)-1] = '\0';
              if (!from_prtgif)
                 fprintf(stderr, "Warning:  -print_cmd should not be used!\n");
--- 280,291 ----
           {
              argc--; argv++;
!             len = strlen(*argv);
!             if (**argv == '"' && (*argv)[len-1] == '"')
!             {
!                strcpy(printCommand, &(*argv)[1]);
!                printCommand[strlen(printCommand)-1] = '\0';
!             }
!             else
!                strcpy(printCommand, *argv);
              if (!from_prtgif)
                 fprintf(stderr, "Warning:  -print_cmd should not be used!\n");
***************
*** 265,269 ****
           else if (strncmp (*argv, "-o", 2) == 0)
              strcpy (outputDir, &(*argv)[2]);
!          else
           {
              strcat (c_ptr++, " ");
--- 293,299 ----
           else if (strncmp (*argv, "-o", 2) == 0)
              strcpy (outputDir, &(*argv)[2]);
!          else if (strcmp(*argv, "-prtgif") != 0 &&
!                strcmp(*argv, "-print") != 0 &&
!                strcmp(*argv, "-PRINT") != 0)
           {
              strcat (c_ptr++, " ");
***************
*** 279,283 ****
     {
        case 0:
!          printf ("\nTgif File Name to Print> ");
           while (fgets (inbuf, MAXSTRING, stdin) != NULL)
           {
--- 309,314 ----
     {
        case 0:
!          fprintf (stderr, "\nTgif File Name to Print> ");
!          fflush (stderr);
           while (fgets (inbuf, MAXSTRING, stdin) != NULL)
           {
***************
*** 292,296 ****
                 }
              }
!             printf ("\nTgif File Name to Print> ");
           }
           break;
--- 323,328 ----
                 }
              }
!             fprintf (stderr, "\nTgif File Name to Print> ");
!             fflush (stderr);
           }
           break;
*** file.e.orig	Tue Nov 10 23:59:28 1992
--- file.e	Tue Nov 10 23:59:29 1992
***************
*** 23,27 ****
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/file.e,v 2.32 1992/07/17 14:48:24 william Exp $
   */
  
--- 23,27 ----
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/file.e,v 2.33 1992/11/06 17:09:05 william Exp $
   */
  
***************
*** 50,53 ****
--- 50,55 ----
  extern int	saveCommentsInSaveNew;
  extern int	usePsAdobeString;
+ extern char	adobeString[];
+ extern char	epsfString[];
  
  extern void	ClearFileInfo ();
*** ps.e.orig	Tue Nov 10 23:59:33 1992
--- ps.e	Tue Nov 10 23:59:34 1992
***************
*** 23,28 ****
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/ps.e,v 2.2 1992/03/31 08:02:12 william Exp $
   */
  
  extern void	DumpPSMacro ();
--- 23,29 ----
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/ps.e,v 2.3 1992/11/08 00:15:30 william Exp $
   */
  
  extern void	DumpPSMacro ();
+ extern int	ParsePsAdobeString ();
*** const.h.orig	Tue Nov 10 23:59:37 1992
--- const.h	Tue Nov 10 23:59:38 1992
***************
*** 23,27 ****
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/const.h,v 2.73.1.1 1992/10/12 02:09:31 william Exp $
   */
  
--- 23,27 ----
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/const.h,v 2.73.1.2 1992/11/06 04:23:59 william Exp $
   */
  
***************
*** 327,332 ****
  #define MENU_VERTALIGN 7
  #define MENU_FONT 8
! #define MENU_SIZE 9
! #define MENU_STYLE 10
  #define MENU_LINEDASH 11
  #define MENU_LINESTYLE 12
--- 327,332 ----
  #define MENU_VERTALIGN 7
  #define MENU_FONT 8
! #define MENU_STYLE 9
! #define MENU_SIZE 10
  #define MENU_LINEDASH 11
  #define MENU_LINESTYLE 12
*** patchlevel.h.orig	Tue Nov 10 23:59:41 1992
--- patchlevel.h	Tue Nov 10 23:59:41 1992
***************
*** 23,28 ****
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/patchlevel.h,v 2.29.1.1 1992/10/12 02:09:52 william Exp $
   */
  
! #define TGIF_PATCHLEVEL 12
--- 23,28 ----
   * PERFORMANCE OF THIS SOFTWARE.
   *
!  * @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/patchlevel.h,v 2.29.1.2 1992/11/06 06:28:12 william Exp $
   */
  
! #define TGIF_PATCHLEVEL 13
*** Makefile.noimake.orig	Tue Nov 10 23:59:44 1992
--- Makefile.noimake	Tue Nov 10 23:59:45 1992
***************
*** 23,27 ****
  # PERFORMANCE OF THIS SOFTWARE.
  #
! # @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/Makefile.noimake,v 2.131.1.5 1992/10/26 08:05:52 william Exp $
  #
  
--- 23,27 ----
  # PERFORMANCE OF THIS SOFTWARE.
  #
! # @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/Makefile.noimake,v 2.131.1.6 1992/11/08 01:29:30 william Exp $
  #
  
***************
*** 50,53 ****
--- 50,56 ----
  		  -DTELEPORT_ATTR=\"warp_to=\" -DTMP_DIR=\"/tmp/\"
  
+ #-DHP_LINE_BUG
+ #   Include the above line in the DEFINES if two-vertices horizontal and
+ #   verticle line segments don't draw properly on a buggy HP server.
  #-DDONTFREECOLORS
  #   Include the above line in the DEFINES if you don't want the black and
***************
*** 295,299 ****
  		spline.e xpixmap.e
  prtgif.o:	const.h
! ps.o:
  raster.o:	const.h types.h $(RASTER_BM) \
  		choice.e color.e file.e font.e pattern.e poly.e setup.e
--- 298,302 ----
  		spline.e xpixmap.e
  prtgif.o:	const.h
! ps.o:		const.h
  raster.o:	const.h types.h $(RASTER_BM) \
  		choice.e color.e file.e font.e pattern.e poly.e setup.e
***************
*** 315,320 ****
  		attr.e auxtext.e choice.e cmd.e color.e cursor.e drawing.e \
  		dup.e file.e font.e grid.e mainloop.e mainmenu.e mark.e menu.e \
! 		msg.e names.e pattern.e raster.e ruler.e scroll.e select.e \
! 		shortcut.e spline.e stk.e text.e xbitmap.e xpixmap.e
  shortcut.o:	const.h types.h \
  		setup.e
--- 318,323 ----
  		attr.e auxtext.e choice.e cmd.e color.e cursor.e drawing.e \
  		dup.e file.e font.e grid.e mainloop.e mainmenu.e mark.e menu.e \
! 		msg.e names.e pattern.e ps.e raster.e ruler.e scroll.e \
! 		select.e shortcut.e spline.e stk.e text.e xbitmap.e xpixmap.e
  shortcut.o:	const.h types.h \
  		setup.e
***************
*** 341,345 ****
  		prtgif.e raster.e ruler.e scroll.e setup.e xpixmap.e
  tgif.o:		const.h patchlevel.h types.h \
! 		file.e grid.e mainloop.e msg.e obj.e pattern.e setup.e version.e
  version.o:
  vms_compat.o:	vms_compat.h
--- 344,349 ----
  		prtgif.e raster.e ruler.e scroll.e setup.e xpixmap.e
  tgif.o:		const.h patchlevel.h types.h \
! 		file.e grid.e mainloop.e msg.e obj.e pattern.e ps.e setup.e \
! 		version.e
  version.o:
  vms_compat.o:	vms_compat.h
*** Imakefile.orig	Tue Nov 10 23:59:48 1992
--- Imakefile	Tue Nov 10 23:59:49 1992
***************
*** 23,30 ****
  /**/# PERFORMANCE OF THIS SOFTWARE.
  /**/#
! /**/# @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/Imakefile,v 2.84.1.3 1992/10/26 06:41:11 william Exp $
  /**/#
  
! TGIFVERSION	= 2.12-p12
  PROGRAMS	= tgif prtgif /**/#frontend11.o testdrive
  /**/#CDEBUGFLAGS= -g
--- 23,30 ----
  /**/# PERFORMANCE OF THIS SOFTWARE.
  /**/#
! /**/# @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/Imakefile,v 2.84.1.5 1992/11/08 01:29:10 william Exp $
  /**/#
  
! TGIFVERSION	= 2.12-p13
  PROGRAMS	= tgif prtgif /**/#frontend11.o testdrive
  /**/#CDEBUGFLAGS= -g
***************
*** 40,43 ****
--- 40,46 ----
                    -DTELEPORT_ATTR=\"warp_to=\" -DTMP_DIR=\"/tmp/\"
  
+ /**/#-DHP_LINE_BUG
+ /**/#   Include the above line in the DEFINES if two-vertices horizontal and
+ /**/#   verticle line segments don't draw properly on a buggy HP server.
  /**/#-DDONTFREECOLORS
  /**/#   Include the above line in the DEFINES if you don't want the black and
*** tgif.man.orig	Tue Nov 10 23:59:56 1992
--- tgif.man	Tue Nov 10 23:59:57 1992
***************
*** 1,4 ****
! .\"@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/tgif.man,v 2.124 1992/10/26 06:23:36 william Exp $
! .TH TGIF n "Version 2.12-p12 and Above" "Tgif"
  .SH NAME
  \fItgif\fR \- Xlib based interactive 2-D drawing facility under X11.
--- 1,4 ----
! .\"@(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/tgif.man,v 2.128 1992/11/09 08:10:20 william Exp $
! .TH TGIF n "Version 2.12-p13 and Above" "Tgif"
  .SH NAME
  \fItgif\fR \- Xlib based interactive 2-D drawing facility under X11.
***************
*** 27,31 ****
  [\fB-f\fR]
  [\fB-gray\fR]
! [\fB-adobe\fR]
  [\fB-o\fRdir]
  [\fIfile1\fR \fIfile2\fR ...]
--- 27,31 ----
  [\fB-f\fR]
  [\fB-gray\fR]
! [\fB-adobe\fR | -adobe=<number>/<number>]
  [\fB-o\fRdir]
  [\fIfile1\fR \fIfile2\fR ...]
***************
*** 72,77 ****
  Using the \fI-gray\fR option has the same effect as setting the
  Tgif*UseGrayScale X default for tgif (see the X DEFAULTS section below).
! Using the \fI-adobe\fR option has the same effect as setting the
! Tgif*UsePsAdobeString X default for tgif (see the X DEFAULTS section below).
  If the \fI-o\fR option is not specified, the output file (eps or ps)
  goes into the same directory as the input file.  If \fI-o\fRdir
--- 72,78 ----
  Using the \fI-gray\fR option has the same effect as setting the
  Tgif*UseGrayScale X default for tgif (see the X DEFAULTS section below).
! Using the \fI-adobe\fR or the \fI-adobe=<number>/<number>\fR
! option has the same effect as specifying the
! Tgif*UsePsAdobeString X default (see the X DEFAULTS section below).
  If the \fI-o\fR option is not specified, the output file (eps or ps)
  goes into the same directory as the input file.  If \fI-o\fRdir
***************
*** 441,445 ****
  mentioned in the FILES section of this document.)
  .PP
- .DS
    ^a	select all
    ^b	send selected objects to the back
--- 442,445 ----
***************
*** 557,561 ****
   ^#,	import an X11 pixmap file
   ^#-	toggle between English and Metric grid systems
- .DE
  .br
  .SH SHORTCUTS
--- 557,560 ----
***************
*** 583,591 ****
  the following example.  In the Edit menu, two of the entries are,
  .PP
- .DS
     "Delete	^x"
  .br
     "SelectAll	^a"
- .DE
  .PP
  which means that <Control>x activates and Delete() command,
--- 582,588 ----
***************
*** 596,604 ****
  Delete() and 'a' or 'A' to SelectAll():
  .PP
- .DS
     Tgif*ShortCuts:	!<Key>x:Delete() \\n\\
  .br
     				<Key>a:SelectAll()
- .DE
  .PP
  For more examples, please
--- 593,599 ----
***************
*** 611,615 ****
  in popup menus which the COMMAND would correspond to.
  .PP
- .DS
     CyclePrintFormat()	Printer, LaTeXFig, RawPSFile, XBitmap
     ToggleBW/ColorPS()	BlkWhtPS, ColorPS
--- 606,609 ----
***************
*** 625,629 ****
     ScrollPageRight()	(scroll right a window full)
     FreeHandMode()	(change the drawing mode to freehand poly/open-spline)
- .DE
  .br
  .PP
--- 619,622 ----
***************
*** 793,797 ****
  format).
  .PP
- .DS
  .RS
  #define arrow_format 1
--- 786,789 ----
***************
*** 824,828 ****
  .br
  .RE
- .DE
  .SH LATEX FIGURE FORMATS
  Here we show how to make a figure for a LaTeX file, first with
--- 816,819 ----
***************
*** 844,848 ****
  document as follows,
  .PP
- .DS
  .RS
  \\input{psfig}
--- 835,838 ----
***************
*** 857,861 ****
  .br
  .RE
- .DE
  .br
  .PP
--- 847,850 ----
***************
*** 862,866 ****
  An alternative way is to use the \fI\\epsf\fR construct as follows,
  .PP
- .DS
  .RS
  \\input{epsf}
--- 851,854 ----
***************
*** 875,879 ****
  .br
  .RE
- .DE
  .br
  .PP
--- 863,866 ----
***************
*** 899,903 ****
  This file can be included in a LaTeX document as follows,
  .PP
- .DS
  .RS
  \\begin{figure*}[htb]
--- 886,889 ----
***************
*** 912,916 ****
  .br
  .RE
- .DE
  .br
  .PP
--- 898,901 ----
***************
*** 1190,1196 ****
  The default is false.
  .TP
! .I Tgif*UsePsAdobeString: [true,false]
  If set to ``true'', the first line in the PS or EPS file will be
! "%!PS-Adobe-2.0 EPSF-1.2".  Otherwise, it is just "%!".
  The default is false.  The PS-Adobe string might confuse Transcript,
  but it is needed to work with groff.
--- 1175,1183 ----
  The default is false.
  .TP
! .I Tgif*UsePsAdobeString: [true,false,NUMBER_1/NUMBER_2]
  If set to ``true'', the first line in the PS or EPS file will be
! "%!PS-Adobe-2.0 EPSF-1.2".  If set to ``false'', it is just "%!".
! If the third form is used,, the first line will be
! "%!PS-Adobe-NUMBER_1 EPSF-NUMBER_2".
  The default is false.  The PS-Adobe string might confuse Transcript,
  but it is needed to work with groff.
***************
*** 1224,1227 ****
--- 1211,1226 ----
  The default is false.
  .TP
+ .I Tgif*ForceClearAfterEPS: [true,false]
+ If set to ``true'', a PostScript "clear" command will be issued after
+ printing an imported EPS document.  This is strongly discouraged by
+ the PostScript Language Reference Manual.  However, some buggy EPS files
+ (such as the ones generated by xgrabsc) leave junk on the stack.  Using
+ this kludge can get around the problem.  Nevertheless, the resulting file
+ may not work if it is included as an EPS document in another file.
+ (Instead of using an EPS file generated by xgrabsc,
+ one can use the -bm option of xgrabsc
+ to generate an X11 pixmap file, which can also be imported into tgif.)
+ The default is false.
+ .TP
  .I Tgif*MaxColors: NUMBER
  This specifies the maximum number of colors.  Color0 through ColorMax,
***************
*** 1304,1308 ****
  the following csh command should be executed in the current directory.
  .PP
- .DS
  .RS
  .RS
--- 1303,1306 ----
***************
*** 1311,1315 ****
  .RE
  .RE
- .DE
  .br
  .SH FILES
--- 1309,1312 ----
*** HISTORY.orig	Wed Nov 11 00:00:03 1992
--- HISTORY	Wed Nov 11 00:00:06 1992
***************
*** 1,5 ****
  /*
!  *  @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/HISTORY,v 2.36 1992/11/03 06:45:09 william Exp $
   */
  -----------------------> tgif-2.12-p11 => tgif-2.12-p12 <-----------------------
  I've just put tgif-2.12-patch12 (12th patch for tgif-2.12) in the
--- 1,38 ----
  /*
!  *  @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/HISTORY,v 2.37 1992/11/09 08:10:08 william Exp $
   */
+ -----------------------> tgif-2.12-p12 => tgif-2.12-p13 <-----------------------
+ I've just put tgif-2.12-patch13 (13th patch for tgif-2.12) in the
+ following places for anonymous ftp:
+ 
+ 	export.lcs.mit.edu:/contrib/tgif-2.12-patch13.Z
+ 	cs.ucla.edu:/pub/tgif/tgif-2.12-patch13.Z
+ 
+ The patch is also posted to comp.sources.bugs.
+ 
+ Please uncompress and then apply the patch with
+ 'patch -p -N < tgif-2.12-patch13'.
+ Here's a short list of added features/bug fixes.
+ 
+ 1)  Fix bugs related to the tgif -print feature.  The problem was that
+     popen() calls sh(1) and that quotes are stripped by sh(1).
+     Thanks to Yoichiro Ueno <ueno@cs.titech.ac.jp> for the code fixes.
+ 2)  The TextSize and TextStyle menus were reversed.
+ 3)  Generate integer bounding box in PostScript output files.  This is to
+     conform to the PostScript standard.
+ 4)  Augment the UsePsAdobeString X default such that specific %!PS-Adobe
+     string can be specified.  In addition to ``true'' and ``false'',
+     UsePsAdobeString can also be specified with <Adobe_Version>/<EPSF_Version>.
+     The command line option "-adobe=<Adobe_Version>/<EPSF_Version>" is also
+     added.
+ 5)  Add a new X default, ForceClearAfterEPS.  When it is set to ``true'',
+     the PostScript stack is cleared after printing an EPS object.  This action
+     was always taken in patchlevel 12 of version 2.12.  However, recently
+     I found that the PostScript Language Reference Manual strongly discourages
+     doing so.  Therefore, use this only if you REALLY want to generate the
+     illegal "clear" command to get around some buggy EPS documents (such as
+     the one generated by xgrabsc).
+ 6)  Add the -DHP_LINE_BUG compile option to get around some buggy HP servers.
+ 7)  Remove unrecognized commands in the man pages.
  -----------------------> tgif-2.12-p11 => tgif-2.12-p12 <-----------------------
  I've just put tgif-2.12-patch12 (12th patch for tgif-2.12) in the
*** descrip.mms.orig	Wed Nov 11 00:00:13 1992
--- descrip.mms	Wed Nov 11 00:00:14 1992
***************
*** 6,10 ****
  ! $ DEFINE SYS SYS$LIBRARY
  !
! ! @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/descrip.mms,v 2.124.1.3 1992/10/26 07:53:46 william Exp $
  !
  
--- 6,10 ----
  ! $ DEFINE SYS SYS$LIBRARY
  !
! ! @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/descrip.mms,v 2.124.1.4 1992/11/08 01:29:30 william Exp $
  !
  
***************
*** 22,25 ****
--- 22,28 ----
  		   TMP_DIR="""/sys$scratch/""")
  
+ !HP_LINE_BUG
+ !   Include the above line in the DEFINES if two-vertices horizontal and
+ !   verticle line segments don't draw properly on a buggy HP server.
  !DONTFREECOLORS
  !   Include the above line in the DEFINES if you don't want the black and
***************
*** 269,273 ****
  		spline.e,xpixmap.e
  prtgif.obj depends_on prtgif.c,		const.h
! ps.obj depends_on ps.c
  raster.obj depends_on raster.c,		const.h,types.h,$(RASTER_BM),-
  		choice.e,color.e,file.e,font.e,pattern.e,poly.e,setup.e
--- 272,276 ----
  		spline.e,xpixmap.e
  prtgif.obj depends_on prtgif.c,		const.h
! ps.obj depends_on ps.c,			const.h
  raster.obj depends_on raster.c,		const.h,types.h,$(RASTER_BM),-
  		choice.e,color.e,file.e,font.e,pattern.e,poly.e,setup.e
***************
*** 289,294 ****
  		attr.e,auxtext.e,choice.e,cmd.e,color.e,cursor.e,drawing.e,-
  		dup.e,file.e,font.e,grid.e,mainloop.e,mainmenu.e,mark.e,menu.e,-
! 		msg.e,names.e,pattern.e,raster.e,ruler.e,scroll.e,select.e,-
! 		shortcut.e,spline.e,stk.e,setup.e,xbitmap.e,xpixmap.e
  shortcut.obj depends_on shortcut.c,	const.h,types.h,-
  		setup.e
--- 292,297 ----
  		attr.e,auxtext.e,choice.e,cmd.e,color.e,cursor.e,drawing.e,-
  		dup.e,file.e,font.e,grid.e,mainloop.e,mainmenu.e,mark.e,menu.e,-
! 		msg.e,names.e,pattern.e,ps.e,raster.e,ruler.e,scroll.e,-
! 		select.e,shortcut.e,spline.e,stk.e,setup.e,xbitmap.e,xpixmap.e
  shortcut.obj depends_on shortcut.c,	const.h,types.h,-
  		setup.e
***************
*** 316,320 ****
  		prtgif.e,raster.e,ruler.e,scroll.e,setup.e,xpixmap.e
  tgif.obj depends_on tgif.c,		const.h,patchlevel.h,types.h,-
! 		file.e,grid.e,mainloop.e,msg.e,obj.e,pattern.e,setup.e,version.e
  version.obj depends_on version.c
  vms_compat.obj depends_on vms_compat.c,	vms_compat.h
--- 319,324 ----
  		prtgif.e,raster.e,ruler.e,scroll.e,setup.e,xpixmap.e
  tgif.obj depends_on tgif.c,		const.h,patchlevel.h,types.h,-
! 		file.e,grid.e,mainloop.e,msg.e,obj.e,pattern.e,ps.e,setup.e,-
! 		version.e
  version.obj depends_on version.c
  vms_compat.obj depends_on vms_compat.c,	vms_compat.h
*** tgif.Xdefaults.orig	Wed Nov 11 00:00:18 1992
--- tgif.Xdefaults	Wed Nov 11 00:00:19 1992
***************
*** 3,7 ****
  ! suitable for appending to any .Xdefaults file.
  !
! ! @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/tgif.Xdefaults,v 2.26 1992/08/08 08:27:05 william Exp $
  !
  Tgif*Geometry:			640x512-40+20
--- 3,7 ----
  ! suitable for appending to any .Xdefaults file.
  !
! ! @(#)$Header: /amnt/kona/tangram/u/william/X11/TGIF2/RCS/tgif.Xdefaults,v 2.28 1992/11/09 07:43:30 william Exp $
  !
  Tgif*Geometry:			640x512-40+20
***************
*** 78,81 ****
--- 78,82 ----
  Tgif*CanvasWindowOnly:		false
  Tgif*UsePsAdobeString:		false
+ !Tgif*UsePsAdobeString:		2.0/1.2
  Tgif*HalfToneBitmap:		false
  Tgif*ThresholdBitmap:		false
***************
*** 82,85 ****
--- 83,87 ----
  Tgif*BitmapThreshold:		0.5
  Tgif*GroupedTextEditable:	false
+ Tgif*ForceClearAfterEPS:	false
  Tgif*MaxColors:			11
  Tgif*Color0:			magenta
---------------------------------> cut here <---------------------------------
-- 
Bill Cheng // UCLA Computer Science Department // (310) 645-8328
3564-C Boelter Hall // Los Angeles, California 90024 // USA
william@CS.UCLA.EDU      ...!{uunet|ucbvax}!cs.ucla.edu!william
Technical Details
Message-ID: <1992Nov11.081849.26985@cs.ucla.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!ucla-cs!lanai.cs.ucla.edu!william

Show Full Headers
Complete Article Headers
Newsgroups: comp.sources.bugs
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!elroy.jpl.nasa.gov!ucla-cs!lanai.cs.ucla.edu!william
From: william@lanai.cs.ucla.edu (William Cheng)
Subject: Tgif-2.12-patch13 (13th patch for tgif-2.12), Part 01/01
Message-ID: <1992Nov11.081849.26985@cs.ucla.edu>
Followup-To: william@cs.ucla.edu
Keywords: draw, postscript, latex, hierarchical, x11, xlib, wysiwyg, bitmap
Sender: usenet@cs.ucla.edu (Mr Usenet)
Nntp-Posting-Host: lanai.cs.ucla.edu
Organization: UCLA, Computer Science Department
Date: Wed, 11 Nov 92 08:18:49 GMT
Lines: 1401