ocount error with epsf 
Author Message
 ocount error with epsf

I am using the epsf macros with Plain TeX on an 80486 PC running
RedHat 5.1 Linux. Enclosed are:
(1) A sample TeX file named snafu.tex
(2) A postscript file fig102 to be included into the TeX file
(3) The output messages produced by Ghostscript when I tried to
    use it to look at the resulting postscript file from dvips.

For some reason, this example causes Ghostscript to crash with
an error about something called ocount. It crashes when I try to
go to the second page. What is causing this and what can I do to fix it?

Allan Adler

(1) The TeX file snafu.tex

\input epsf
Why does this cause an ocount error?
\vskip-11truein
\centerline{\hskip8truein\epsfbox{fig102}}\vskip1truein\noindent Maybe
someone smart knows.
\vfill\eject
Well, we need some kind of ordinary text.
\vfill\eject\end

(2) The Postscript file fig102

%!
%1 1 scale
0.35 0.35 scale
3 setlinewidth
/Times-Roman findfont 20 scalefont setfont
%100 100 moveto
%0 1 1 10 {add} for  7 string cvs show
/str 7 string def

/pentagon0 {
40 dict begin
  /cor6 exch def
  /cor5 exch def
  /cor4 exch def
  /cor3 exch def
  /cor2 exch def
  /cor1 exch def
  /s exch def
  /r exch def
  /y exch def
  /x exch def
  /section 60 def
  /ang1x section 2 mul cos def /ang1y section 2 mul sin def
  /ang2x section 1 mul cos def /ang2y section 1 mul sin def
  /ang3x 1 def                 /ang3y 0 def
  /ang4x section 5 mul cos def /ang4y section 5 mul sin def
  /ang5x section 4 mul cos def /ang5y section 4 mul sin def
  /ang6x section 3 mul cos def /ang6y section 3 mul sin def
newpath x r ang1x mul add y r ang1y mul add moveto (a)
show
newpath x r ang2x mul add y r ang2y mul add moveto (b)
show
newpath x r add y moveto (c)
show
newpath x r ang4x mul add y r ang4y mul add moveto (d)
show
newpath x r ang5x mul add y r ang5y mul add moveto (e)
show
  /ang1x section cor1 mul cos def /ang1y section cor1 mul sin def
  /ang2x section cor2 mul cos def /ang2y section cor2 mul sin def
  /ang3x section cor3 mul cos def /ang3y section cor3 mul sin def
  /ang4x section cor4 mul cos def /ang4y section cor4 mul sin def
  /ang5x section cor5 mul cos def /ang5y section cor5 mul sin def
  /ang6x section cor6 mul cos def /ang6y section cor6 mul sin def

/x1 x s ang1x mul add def  /y1 y s ang1y mul add def
/x2 x s ang2x mul add def  /y2 y s ang2y mul add def
/x3 x s ang3x mul add def  /y3 y s ang3y mul add def
/x4 x s ang4x mul add def  /y4 y s ang4y mul add def
/x5 x s ang5x mul add def  /y5 y s ang5y mul add def
/x6 x s ang6x mul add def  /y6 y s ang6y mul add def

newpath x1 y1 moveto x2 y2 lineto stroke
newpath x2 y2 moveto x4 y4 lineto stroke
newpath x4 y4 moveto x5 y5 lineto stroke
newpath x5 y5 moveto x6 y6 lineto stroke
newpath x6 y6 moveto x1 y1 lineto stroke
end } def

/dingle0 {
  /r exch def
  /y exch def
  /x exch def
newpath x y moveto (k) show
newpath x  r 2 mul add y 5 add r 220 500 arc stroke
end } def

% x y r s cor1 cor2 cor3 cor4 cor5 cor6 hexagon
150 100 65 50 1 2 3 4 5 6 pentagon0
newpath
250 100 10 dingle0
showpage

(3) The output messages from Ghostscript

Aladdin Ghostscript 3.33 (4/10/1995)
Copyright (C) 1995 Aladdin Enterprises, Menlo Park, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file COPYING for details.
Loading NimbusRomNo9L-Regu font from /usr/share/ghostscript/fonts/n021003l.pfb... 1750128 446515 1340228 52672 2 done.

Quote:
>>showpage, press <return> to continue<<

Error: /undefined in ocount
Operand stack:
   0
Execution stack:
   %interp_exit   --nostringval--   --nostringval--   --nostringval--   false   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:596/631--   --dict:0/20--   --dict:39/200--   --dict:102/250--
Current allocation mode is local
Current file position is 23530
GS<1>


Fri, 28 Sep 2001 03:00:00 GMT  
 ocount error with epsf

I figured it out: there is an error in the file fig102, namely
an extra "end" in the definition of dingle0.

Allan Adler



Fri, 28 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Difference between PS-Adobe-3.0 EPSF-3.0 and PS-Adobe-2.0 EPSF-2.0

2. Color EPSF

3. EPSF v1.2 versus v2.0

4. Getting EPSI from EPSF - Can it be done?

5. EPSF, TranScript compatibility

6. EPSF, Interleaf <- PostScript, sort of

7. PICT->EPSF

8. page bounding boxes in EPSF

9. Trim down epsf

10. EPSF fix to some Transcript 2.1 utilities

11. Encapsulated (EPSF) PostScript

12. HPGL to EPSF

 

 
Powered by phpBB® Forum Software