[gnu.ghostscript.bug] Bugs ...

ath@helios.prosys.se (Anders Thulin) (03/23/89)

I think I've found a couple of bugs in Ghostscript 1.2.

1) Checking out how TheFont scales I found that 'K' doesn't get painted
   correctly either in the X or in the SunView version.  Try:

    /TheFont findfont 100 scalefont setfont
    100 700 moveto (K) show

   Note the white streak running horizontally from the bottom of the
   top right leg (arm?) of the K, to the right.

2) As I was trying out this K-problem in various rotations I found that
   the graphics state isn't reset at showpage/copypage/erasepage.
   I expected that an 'initgraphics' should take place, but apparently not.

-- 
Anders Thulin			INET : ath@prosys.se
ProgramSystem AB		UUCP : ...!{uunet,mcvax}!enea!prosys!ath
Teknikringen 2A			PHONE: +46 (0)13 21 40 40
S-583 30 Linkoping, Sweden	FAX  : +46 (0)13 21 36 35

rokicki@polya.Stanford.EDU (Tomas G. Rokicki) (03/24/89)

Anders Thulin writes:
> I think I've found a couple of bugs in Ghostscript 1.2.

Am I mistaken is asserting that GhostScript is actually rife with
bugs, both major and minor, and that bugs should be reported only
with fixes?  Or should I start making a (huge) list?

Of course, I love GhostScript and appreciate the code very, very
much, but there is still a rather large amount of work to be
done---I envision it becoming competitive with real Adobe PostScript
in the not-to-distant future . . . with as many people working on
it as there are, I wouldn't be surprised to see this happen,
especially given the fine coordination provided so far by the
author.

This baby will take off with a bit more work!

-tom

ath@helios.prosys.se (Anders Thulin) (03/25/89)

Some more bugs and problems in GhostScript 1.2.  Patches are included
for those I understood, the remainder are left as exercises :-)

Suggested patches for these are at end:

* Invoking gs with an unknown option (-p) produces an 'Unknown switch
  -p' message and a core dump. The core dump seems unnecessary.
  gsmain(gsmain.c) calls abort() rather than exit(). 

* There is no statusdict. Hence some 'investigative' programs will
  fail. The one I was using was PSDoctor 1.0.0, recently distributed
  on Usenet. Adding some definitions in ghost.ps fixed the problem.
  Note: my ideas of printer names, etc. might not be yours.

* PSDoctor also showed a problem with 'usertime'. The call to clock()
  in gs_usertime(gsmisc.c) returns microseconds rather than
  milliseconds as wanted.

* Due to the redefinition of findfont in gfonts.ps it was impossible
  to create user defined fonts (see red book, p. 101-102). Changing the
  redefinition at bit fixed the problem. 

No patches for these:

* Halftone screens appear to be aligned with user coordinates rather
  than device coordinates. See the star example on page 51 in the red
  book.

* The lineofcircles example in the blue book (p. 69-70) never
  terminates.  Debug printouts of 'xpos', 'pagewidth', and 'xpos
  pagewidth le' show that although xpos is increased beyond pagewidth
  (i.e. 612), the expression 'xpos pagewidth le' doesn't become false
  when x > pagewidth.

My suggested patches to the 1.2 distribution:

*** gsmisc.c	Sat Mar 25 08:29:08 1989
--- gsmisc.new.c	Sat Mar 25 08:30:58 1989
***************
*** 70,75 ****
  #else				/* Unix */
  	long clock();
  	pdt[0] = 0;
! 	pdt[1] = clock();
  #endif
  }
--- 70,75 ----
  #else				/* Unix */
  	long clock();
  	pdt[0] = 0;
! 	pdt[1] = clock() / 1000; /* clock() returns microseconds */
  #endif
  }
*** gsmain.c	Sat Mar 25 08:39:39 1989
--- gsmain.new.c	Sat Mar 25 08:40:06 1989
***************
*** 110,116 ****
  			default:
  				if ( (*switch_proc)(*arg, arg + 1) < 0 )
  				   {	printf("Unknown switch %s", arg - 1);
! 					abort();
  				   }
  				break;
  			case 'Z':
--- 110,116 ----
  			default:
  				if ( (*switch_proc)(*arg, arg + 1) < 0 )
  				   {	printf("Unknown switch %s", arg - 1);
! 					exit(1);
  				   }
  				break;
  			case 'Z':
*** ghost.ps	Thu Mar 23 13:49:44 1989
--- ghost.new.ps	Sat Mar 25 09:37:32 1989
***************
*** 247,254 ****
  	/lslash /oslash /oe /germandbls /.notdef /.notdef /.notdef /.notdef
  } cvlit readonly def
  
! % Close up systemdict.
! end
  systemdict readonly pop
  
  % Establish a default upper limit in the character cache,
--- 247,291 ----
  	/lslash /oslash /oe /germandbls /.notdef /.notdef /.notdef /.notdef
  } cvlit readonly def
  
! % Create a dummy statusdict, faking lots of things:
! 
!   /statusdict 50 dict def
!   statusdict begin
!    /checkpassword {pop false} def
!    /defaulttimeouts {0 60 300} def
!    /dostartpage {false} def
!    /eescratch {pop 0} def
!    /idlefonts {mark} def
!    /jobname null def
!    /jobtimeout {0} def
!    /manualfeed false def
!    /manualfeedtimeout 60 def
!    /margins {0 0} def
!    /pagecount {4711} def
!    /pagestackorder {true} def
!    /pagetype {0} def
!    /prefeed false def
!    /printererror {pop pop} def
!    /printername {pop product} def % !! Incorrect !!
!    /product 31 string def
!      /product (GhostWriter) def
!    /revision 1 def		
!    /sccbatch {pop 9600 0} def
!    /sccinteractive {pop 9600 0} def
!    /setdefaulttimeouts {pop pop pop} def
!    /setdostartpage {pop} def
!    /seteescratch {pop pop} def
!    /setidlefonts { ] pop} def
!    /setjobtimeout {pop} def
!    /setmargins {pop pop} def
!    /setpagetype {pop} def
!    /setpassword {pop pop false} def
!    /setprintername {pop} def
!    /setsccbatch {pop pop pop} def
!    /setsccinteractive {pop pop pop} def
!    /waittimeout 300 def
!   end	  % statusdict
! end	% systemdict
  systemdict readonly pop
  
  % Establish a default upper limit in the character cache,
*** gfonts.ps	Fri Feb 24 08:18:46 1989
--- gfonts.new.ps	Sat Mar 25 10:08:38 1989
***************
*** 62,71 ****
  
  /TheFont exch definefont pop
  
! % Redefine findfont so it always finds the standard font
  
  /.findfont /findfont load def
! /findfont {pop /TheFont .findfont} def
  
  % Define the PostScript standard fonts as copies of the bit font.
  % This is a no-op for now, since we have redefined findfont.
--- 62,77 ----
  
  /TheFont exch definefont pop
  
! % Redefine findfont so it always returns the standard font
! % when it doesn't know the font requested
  
  /.findfont /findfont load def
! /findfont {	% key  findfont  font
!   dup FontDirectory exch known
!   {FontDirectory exch get}
!   {pop FontDirectory /TheFont get}
!   ifelse
! } def
  
  % Define the PostScript standard fonts as copies of the bit font.
  % This is a no-op for now, since we have redefined findfont.

- - - - - - end of patches - - - - - - 

-- 
Anders Thulin			INET : ath@prosys.se
ProgramSystem AB		UUCP : ...!{uunet,mcvax}!enea!prosys!ath
Teknikringen 2A			PHONE: +46 (0)13 21 40 40
S-583 30 Linkoping, Sweden	FAX  : +46 (0)13 21 36 35