[NTLUG:Discuss] GS and Postscript debugging.
Christopher Browne
cbbrowne at hex.net
Fri Jan 7 22:44:56 CST 2000
On Fri, 07 Jan 2000 22:36:31 CST, the world broke into rejoicing as
Steve Baker <sjbaker1 at airmail.net> said:
> I'm trying to debug some Postscript code (Yuk - I *hate* programming
> in Postscript).
>
> I have code straight from the Postscript cookbook that prints text
> using some builtin Postscript fonts - and when I 'lpr' my PS file,
> it does exactly what the manual says it should.
>
> However, as I build up to something more complex, I'm going to get
> through a LOT of paper if I have to print every time I want to run
> my program! Presumably, I should be able to use 'gs' from the command
> line to run my program and see the results on-screen.
>
> When I try to do that, I get complaints about the font not existing.
> This is odd because it's a builtin font:
>
> /Times-Roman findfont 15 scalefont setfont
> (Hello World) show
>
> Can anyone tell me what magical incantation 'lpr' is using to get
> 'gs' to have standard builtin fonts? Are there other differences in
> the way my code might run in a 'gs' run versus running it to the printer?
>
> I've RTFM'ed for half a day now and I still havn't figured it out.
I typescripted a brief run, thusly:
% gs
Aladdin Ghostscript 5.50 (1998-9-16)
Copyright (C) 1998 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>/Times-Roman findfont
Loading NimbusRomNo9L-Regu font from /usr/lib/ghostscript/fonts/n021003l.pfb... 1883292 570593 1309076 23449 0 done.
GS<1>15 scalefont setfont
GS>(Hello World) show
Error: /nocurrentpoint in --show--
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- %loop_continue 2 3 %oparray_pop --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- 1 3 %oparray_pop --nostringval-- --nostringval--
Dictionary stack:
--dict:873/941(G)-- --dict:0/20(G)-- --dict:49/200(L)--
Current allocation mode is local
Current file position is 19
GS>
[At which point I'll let this example drop, as the problems are not
related to fonts, but rather to inadequate setup of the rest of the
environment...]
It *sounds* like something is going wrong with the font path; could
you be a bit more specific as to what messages get emitted?
It may also be relevant to know things like:
a) What version of GS
b) What distribution
c) What the Fontmap file looks like, and where it is
--
"I've seen a look in dogs' eyes, a quickly vanishing look of amazed
contempt, and I am convinced that basically dogs think humans are
nuts." -- John Steinbeck
cbbrowne at hex.net - <http://www.ntlug.org/~cbbrowne/lsf.html>
More information about the Discuss
mailing list