[fa.laser-lovers] Problem with Ditroff and TranScript?

laser-lovers@uw-beaver (10/18/85)

From: ned%UPenn-Grasp%upenn.csnet@CSNET-RELAY.arpa

We've just started using TranScript here, and we seem to have found an
annoying bug in psdit. The last word in the file isn't output! Has anyone
else seen this problem, or know of a fix? We can repeat it with the input
(to ditroff):

	David is a nice person.

The output (and the PostScript file generated by psdit) omits completely the
word 'person.' We've looked at the ditroff output, and it seems up to spec.
The PostScript file looks exactly like the file you'd want generated if you
had input

	David is a nice

It seems like a buffer flushing problem, and we could probably fix it, but
we're pretty surprised to have found it.

Any ideas?

--Ned.

CSnet: ned@UPenn

laser-lovers@cca.UUCP (10/18/85)

From: ned%UPenn-Grasp%upenn.csnet@CSNET-RELAY.ARPA

We've just started using TranScript here, and we seem to have found an
annoying bug in psdit. The last word in the file isn't output! Has anyone
else seen this problem, or know of a fix? We can repeat it with the input
(to ditroff):

	David is a nice person.

The output (and the PostScript file generated by psdit) omits completely the
word 'person.' We've looked at the ditroff output, and it seems up to spec.
The PostScript file looks exactly like the file you'd want generated if you
had input

	David is a nice

It seems like a buffer flushing problem, and we could probably fix it, but
we're pretty surprised to have found it.

Any ideas?

--Ned.

CSnet: ned@UPenn

laser-lovers@uw-beaver (10/30/85)

From: Richard Furuta <Furuta@WASHINGTON.arpa>

Editor's note:

A few days back a message was posted about a buffer flushing problem in
TranScript.  Below are three messages proposing fixes to that problem.  I
have not been able to determine if any of these are "blessed" by
Adobe.

					--Rick
                ---------------

   1) 18-Oct "Francie J Newbery"  Re: Problem with Ditroff and TranScript?
   2) 18-Oct Terry West           Fix to Problem with Ditroff and TranScript?
   3) 29-Oct jjhnsn@ngp.UTEXAS.ED Re: Problem with Ditroff and TranScript?

Message 1 -- ************************
Return-Path: <fjn@Purdue.EDU>
Received: from mordred.Purdue.EDU by WASHINGTON.ARPA with TCP; Fri 18 Oct 85 12:07:19-PDT
Message-Id: <8510181903.AA10258@mordred.Purdue.EDU>
Received: by mordred.Purdue.EDU; Fri, 18 Oct 85 14:03:45 EST
To: ned%UPenn-Grasp%upenn.csnet@csnet-relay.arpa
Cc: laser-lovers@washington.arpa
Subject: Re: Problem with Ditroff and TranScript?
In-Reply-To: Your message of Thu, 17 Oct 85 13:23:13 edt.
	     <8510181752.AA04985@arthur.Purdue.EDU>
Date: 18 Oct 85 14:03:39 EST (Fri)
From: "Francie J Newbery" <fjn@Purdue.EDU>

Your analysis of the problem is exactly right and the fix is very simple.

In the function called devcntrl you need to alter the case for 't'
by adding a call to FlushShow().  Like this:

	case 't': 		/* trailer */
	    FlushShow();				<-- add this line
	    t_trailer ();
	    break;

Francie Newbery (fjn@Purdue.EDU)

Message 2 -- ************************
Return-Path: <@rand-unix.ARPA:terry%owl@rand-unix.ARPA>
Received: from rand-unix.ARPA by WASHINGTON.ARPA with TCP; Fri 18 Oct 85 12:44:17-PDT
Return-Path: <terry@owl>
Received: from owl.arpa (owl) by rand-unix.ARPA; Fri, 18 Oct 85 12:18:44 pdt
Received: by owl.arpa; Fri, 18 Oct 85 12:16:26 pdt
From: Terry West <terry%owl@rand-unix.ARPA>
Message-Id: <8510181916.AA06937@owl.arpa>
To: ned%UPenn-Grasp%upenn.csnet@csnet-relay.arpa
Cc: laser-lovers@washington.arpa
Subject: Fix to Problem with Ditroff and TranScript?
Date: 18 Oct 85 12:16:22 PDT (Fri)

    We've just started using TranScript here, and we seem to have found an
    annoying bug in psdit. The last word in the file isn't output! Has anyone
    else seen this problem, or know of a fix? We can repeat it with the input
    (to ditroff):

In the function t_trailer(), add the FlushShow() call:

private t_trailer()
{
    FlushShow();
    printf("\n%%%%Trailer\n");
    printf("xt\n");
}

   Terry West
   <terry@rand-unix>

Message 3 -- ************************
Return-Path: <jjhnsn@ngp.UTEXAS.EDU>
Received: from ngp.UTEXAS.EDU by WASHINGTON.ARPA with TCP; Tue 29 Oct 85 09:20:10-PST
Date: Mon, 28 Oct 85 16:00:34 cst
From: jjhnsn@ngp.UTEXAS.EDU (J. Lee Johnson)
Posted-Date: Mon, 28 Oct 85 16:00:34 cst
Message-Id: <8510282200.AA15526@ngp.UTEXAS.EDU>
Received: by ngp.UTEXAS.EDU (4.22/4.22)
	id AA15526; Mon, 28 Oct 85 16:00:34 cst
Subject: Re: Problem with Ditroff and TranScript?
Newsgroups: fa.laser-lovers
To: LASER-LOVERS@WASHINGTON.ARPA
References: <4587@cca.UUCP>


In laser-lovers, ned%UPenn-Grasp%upenn.csnet@CSNET-RELAY.arpa says:
> 
> We've just started using TranScript here, and we seem to have found an
> annoying bug in psdit. The last word in the file isn't output! ...
> It seems like a buffer flushing problem, and we could probably fix it, but
> we're pretty surprised to have found it.

He's correct, there is a buffer flushing problem in psdit. There are also
some integer divisions where psdit truncates rather than rounds. The
following is a diff file to correct these problems. Use "patch" to
apply it to psdit.c.
--
James Lee Johnson, U.T. Computation Center, Austin, Texas 78712
ARPA:  jjhnsn@ut-ngp.UTEXAS.EDU
UUCP:  ihnp4!ut-ngp!jjhnsn  allegra!ut-ngp!jjhnsn  gatech!ut-ngp!jjhnsn
       seismo!ut-sally!jjhnsn  harvard!ut-sally!jjhnsn
#
#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
-----cut here-----cut here-----cut here-----cut here-----
#!/bin/sh
# shar:	Shell Archiver
#	Run the following text with /bin/sh to create:
#	psdit.patch
# This archive created: Mon Oct 28 13:33:19 1985
echo shar: extracting psdit.patch '(2393 characters)'
sed 's/^XX//' << \SHAR_EOF > psdit.patch
XX*** psdit.c.dist	Fri Jul  5 11:28:57 1985
XX--- psdit.c	Mon Oct 28 12:35:24 1985
XX***************
XX*** 85,90
XX  #define ErrorTolerance 100
XX  #define PSWID 0x00000FFF
XX  #define ISPSPROC 0x000FF000
XX  
XX  /* we maintain PS coords with 16 times the precision */
XX  /* current PS state is: */
XX
XX--- 85,91 -----
XX  #define ErrorTolerance 100
XX  #define PSWID 0x00000FFF
XX  #define ISPSPROC 0x000FF000
XX+ #define PSscale(x)	((x)+2250)/4500  /* equiv. to  ( x*16 / 72000 ) +0.5 */
XX  
XX  /* we maintain PS coords with 16 times the precision */
XX  /* current PS state is: */
XX***************
XX*** 816,821
XX  
XX  private t_trailer()
XX  {
XX      printf("\n%%%%Trailer\n");
XX      printf("xt\n");
XX  }
XX
XX--- 817,823 -----
XX  
XX  private t_trailer()
XX  {
XX+     FlushShow();FlushFont();MoveTo();DoMove();
XX      printf("\n%%%%Trailer\n");
XX      printf("xt\n");
XX  }
XX***************
XX*** 905,911
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	}
XX  	else {
XX  	    showchar (code);
XX
XX--- 907,913 -----
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += PSscale(pswid * fontsize * dres);
XX  	}
XX  	else {
XX  	    showchar (code);
XX***************
XX*** 910,916
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 		PSshowlen += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	    }
XX  	}
XX      }
XX
XX--- 912,918 -----
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 	        PSshowlen += PSscale(pswid * fontsize * dres);
XX  	    }
XX  	}
XX      }
XX***************
XX*** 919,925
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	}
XX  	else {
XX  	    showchar (code);
XX
XX--- 921,927 -----
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += PSscale(pswid * fontsize * dres);
XX  	}
XX  	else {
XX  	    showchar (code);
XX***************
XX*** 924,930
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 		PSshowlen += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	    }
XX  	}
XX      }
XX
XX--- 926,932 -----
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 	        PSshowlen += PSscale(pswid * fontsize * dres);
XX  	    }
XX  	}
XX      }
SHAR_EOF
if test 2393 -ne "`wc -c psdit.patch`"
then
echo shar: error transmitting psdit.patch '(should have been 2393 characters)'
fi
#	End of shell archive
exit 0
-------

FURUTA@WASHINGTON.ARPA (10/30/85)

From: Richard Furuta <Furuta@WASHINGTON.ARPA>

Editor's note:

A few days back a message was posted about a buffer flushing problem in
TranScript.  Below are three messages proposing fixes to that problem.  I
have not been able to determine if any of these are "blessed" by
Adobe.

					--Rick
                ---------------

   1) 18-Oct "Francie J Newbery"  Re: Problem with Ditroff and TranScript?
   2) 18-Oct Terry West           Fix to Problem with Ditroff and TranScript?
   3) 29-Oct jjhnsn@ngp.UTEXAS.ED Re: Problem with Ditroff and TranScript?

Message 1 -- ************************
Return-Path: <fjn@Purdue.EDU>
Received: from mordred.Purdue.EDU by WASHINGTON.ARPA with TCP; Fri 18 Oct 85 12:07:19-PDT
Message-Id: <8510181903.AA10258@mordred.Purdue.EDU>
Received: by mordred.Purdue.EDU; Fri, 18 Oct 85 14:03:45 EST
To: ned%UPenn-Grasp%upenn.csnet@csnet-relay.arpa
Cc: laser-lovers@washington.arpa
Subject: Re: Problem with Ditroff and TranScript?
In-Reply-To: Your message of Thu, 17 Oct 85 13:23:13 edt.
	     <8510181752.AA04985@arthur.Purdue.EDU>
Date: 18 Oct 85 14:03:39 EST (Fri)
From: "Francie J Newbery" <fjn@Purdue.EDU>

Your analysis of the problem is exactly right and the fix is very simple.

In the function called devcntrl you need to alter the case for 't'
by adding a call to FlushShow().  Like this:

	case 't': 		/* trailer */
	    FlushShow();				<-- add this line
	    t_trailer ();
	    break;

Francie Newbery (fjn@Purdue.EDU)

Message 2 -- ************************
Return-Path: <@rand-unix.ARPA:terry%owl@rand-unix.ARPA>
Received: from rand-unix.ARPA by WASHINGTON.ARPA with TCP; Fri 18 Oct 85 12:44:17-PDT
Return-Path: <terry@owl>
Received: from owl.arpa (owl) by rand-unix.ARPA; Fri, 18 Oct 85 12:18:44 pdt
Received: by owl.arpa; Fri, 18 Oct 85 12:16:26 pdt
From: Terry West <terry%owl@rand-unix.ARPA>
Message-Id: <8510181916.AA06937@owl.arpa>
To: ned%UPenn-Grasp%upenn.csnet@csnet-relay.arpa
Cc: laser-lovers@washington.arpa
Subject: Fix to Problem with Ditroff and TranScript?
Date: 18 Oct 85 12:16:22 PDT (Fri)

    We've just started using TranScript here, and we seem to have found an
    annoying bug in psdit. The last word in the file isn't output! Has anyone
    else seen this problem, or know of a fix? We can repeat it with the input
    (to ditroff):

In the function t_trailer(), add the FlushShow() call:

private t_trailer()
{
    FlushShow();
    printf("\n%%%%Trailer\n");
    printf("xt\n");
}

   Terry West
   <terry@rand-unix>

Message 3 -- ************************
Return-Path: <jjhnsn@ngp.UTEXAS.EDU>
Received: from ngp.UTEXAS.EDU by WASHINGTON.ARPA with TCP; Tue 29 Oct 85 09:20:10-PST
Date: Mon, 28 Oct 85 16:00:34 cst
From: jjhnsn@ngp.UTEXAS.EDU (J. Lee Johnson)
Posted-Date: Mon, 28 Oct 85 16:00:34 cst
Message-Id: <8510282200.AA15526@ngp.UTEXAS.EDU>
Received: by ngp.UTEXAS.EDU (4.22/4.22)
	id AA15526; Mon, 28 Oct 85 16:00:34 cst
Subject: Re: Problem with Ditroff and TranScript?
Newsgroups: fa.laser-lovers
To: LASER-LOVERS@WASHINGTON.ARPA
References: <4587@cca.UUCP>


In laser-lovers, ned%UPenn-Grasp%upenn.csnet@CSNET-RELAY.arpa says:
> 
> We've just started using TranScript here, and we seem to have found an
> annoying bug in psdit. The last word in the file isn't output! ...
> It seems like a buffer flushing problem, and we could probably fix it, but
> we're pretty surprised to have found it.

He's correct, there is a buffer flushing problem in psdit. There are also
some integer divisions where psdit truncates rather than rounds. The
following is a diff file to correct these problems. Use "patch" to
apply it to psdit.c.
--
James Lee Johnson, U.T. Computation Center, Austin, Texas 78712
ARPA:  jjhnsn@ut-ngp.UTEXAS.EDU
UUCP:  ihnp4!ut-ngp!jjhnsn  allegra!ut-ngp!jjhnsn  gatech!ut-ngp!jjhnsn
       seismo!ut-sally!jjhnsn  harvard!ut-sally!jjhnsn
#
#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
-----cut here-----cut here-----cut here-----cut here-----
#!/bin/sh
# shar:	Shell Archiver
#	Run the following text with /bin/sh to create:
#	psdit.patch
# This archive created: Mon Oct 28 13:33:19 1985
echo shar: extracting psdit.patch '(2393 characters)'
sed 's/^XX//' << \SHAR_EOF > psdit.patch
XX*** psdit.c.dist	Fri Jul  5 11:28:57 1985
XX--- psdit.c	Mon Oct 28 12:35:24 1985
XX***************
XX*** 85,90
XX  #define ErrorTolerance 100
XX  #define PSWID 0x00000FFF
XX  #define ISPSPROC 0x000FF000
XX  
XX  /* we maintain PS coords with 16 times the precision */
XX  /* current PS state is: */
XX
XX--- 85,91 -----
XX  #define ErrorTolerance 100
XX  #define PSWID 0x00000FFF
XX  #define ISPSPROC 0x000FF000
XX+ #define PSscale(x)	((x)+2250)/4500  /* equiv. to  ( x*16 / 72000 ) +0.5 */
XX  
XX  /* we maintain PS coords with 16 times the precision */
XX  /* current PS state is: */
XX***************
XX*** 816,821
XX  
XX  private t_trailer()
XX  {
XX      printf("\n%%%%Trailer\n");
XX      printf("xt\n");
XX  }
XX
XX--- 817,823 -----
XX  
XX  private t_trailer()
XX  {
XX+     FlushShow();FlushFont();MoveTo();DoMove();
XX      printf("\n%%%%Trailer\n");
XX      printf("xt\n");
XX  }
XX***************
XX*** 905,911
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	}
XX  	else {
XX  	    showchar (code);
XX
XX--- 907,913 -----
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += PSscale(pswid * fontsize * dres);
XX  	}
XX  	else {
XX  	    showchar (code);
XX***************
XX*** 910,916
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 		PSshowlen += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	    }
XX  	}
XX      }
XX
XX--- 912,918 -----
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 	        PSshowlen += PSscale(pswid * fontsize * dres);
XX  	    }
XX  	}
XX      }
XX***************
XX*** 919,925
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	}
XX  	else {
XX  	    showchar (code);
XX
XX--- 921,927 -----
XX  	pswid = psinfo & PSWID;
XX  	if ((psinfo & ISPSPROC) && (psinfo != -1)) {
XX  	    showspecial (s, code, pswid);
XX! 	    PSx += PSscale(pswid * fontsize * dres);
XX  	}
XX  	else {
XX  	    showchar (code);
XX***************
XX*** 924,930
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 		PSshowlen += (pswid * fontsize * 16 * dres) / (72 * 1000);
XX  	    }
XX  	}
XX      }
XX
XX--- 926,932 -----
XX  	else {
XX  	    showchar (code);
XX  	    if (pswid > 0) {
XX! 	        PSshowlen += PSscale(pswid * fontsize * dres);
XX  	    }
XX  	}
XX      }
SHAR_EOF
if test 2393 -ne "`wc -c psdit.patch`"
then
echo shar: error transmitting psdit.patch '(should have been 2393 characters)'
fi
#	End of shell archive
exit 0
-------