From mimsy!dftsrv!ames!pasteur!ucbvax!hoptoad!gnu Sun Jan  1 23:50:55 EST 1989
Article 1554 of comp.lang.postscript:
Path: mimsy!dftsrv!ames!pasteur!ucbvax!hoptoad!gnu
>From: gnu@hoptoad.uucp (John Gilmore)
Newsgroups: comp.windows.news,comp.lang.postscript
Subject: RE: NeWS and DPS
Message-ID: <6139@hoptoad.uucp>
Date: 1 Jan 89 01:55:46 GMT
References: <66472@ti-csl.CSNET>
Organization: Grasshopper Group in San Francisco
Lines: 28
Xref: mimsy comp.windows.news:1071 comp.lang.postscript:1554

After reading much of the DPS preliminary manual, my evaluation of the
situation is that Adobe has largely reimplemented NeWS, but changed all
the names of everything so that applications will not port between them.

Clearly there are design differences in spots, and Adobe has made some
performance hacks at the language level, where Sun didn't feel the
need; but there is a strong fundamental similarity of design.

Why Adobe chose to change all the names is less clear.  Possibly a
straight case of NIH (not invented here) combined with pretensions of
control of the language.  Possibly they, or their major customers DEC
and NeXT, deliberately wanted to fragment the market to reduce its
openness (ability of customers to move to competitors' equipment
without breaking their software).  I doubt DEC would shed a tear if
PostScript on screens never quite took off, since that would leave
their inferior X window system winner by default.

What to do about it has me torn.  In some ways I think Sun and other
NeWS vendors (like me) should move to the DPS names, providing a
compatability package for old NeWS applications.  In other ways I think
the NeWS community should thumb its nose at Adobe, let them remain
incompatible, and beat them fair and square in the market instead.  If
they get away with making us play catch-up this time, they'll repeat it
forever -- the standard IBM-style Fear/Uncertainty/Doubt game.
-- 
John Gilmore    {sun,pacbell,uunet,pyramid,amdahl}!hoptoad!gnu    gnu@toad.com
Love your country but never trust its government.
		     -- from a hand-painted road sign in central Pennsylvania


From mimsy!haven!purdue!decwrl!adobe!bezanson Wed Jan 18 17:21:13 EST 1989
Article 1616 of comp.lang.postscript:
Path: mimsy!haven!purdue!decwrl!adobe!bezanson
>From: bezanson@adobe.COM (Brian Bezanson)
Newsgroups: comp.sys.mac,comp.lang.postscript
Subject: Re: help printing MAC postscript files
Keywords: postscript, UNIX
Message-ID: <219@adobe.COM>
Date: 16 Jan 89 18:00:42 GMT
References: <4024@mtuxo.att.com>
Reply-To: bezanson@adobe.UUCP (Brian Bezanson)
Organization: Adobe Systems Incorporated, Mountain View
Lines: 26
Xref: mimsy comp.sys.mac:27268 comp.lang.postscript:1616

When you take a file generated by a command-F or command-K in the print dialog,
it will produce proper postscript code for your application, but the command-F
version doesn't include Apple's dictionaries, and the command-K version
sometimes isn't too clean. So how do you print those files? My suggestion, based
on what has always worked for me, is to use several different applications to
do a command-K file of a very simple document (i.e. one word in MacWrite, one
line in MacDraw, etc...) Then edit the files to remove the application specfic
code. What you are left with are several copies of the LaserPrep prolog. Compare
these files against each other. If they all seem to be identical, then I'd
assume you have a good copy of the header. Then send this to your Unix machine,
and prepend it to each command-F Mac file you send. Technically you should only
need to download this dictionary/header info once to the laserprinter, but I'd
suggest for the few extra seconds to send it in case someone has purged/reset
the laserprinters memory.

Hope this helps. If you have any problems with the above techniques, send me
some email and I'll compile a list of areas people have problems in. I'd like
to work with someone at Apple and create the definitive guide of bringing your
Mac/Apple LaserPrep generated files to other machines for downloading to 
PostScript(tm) printers.

Good luck.
------------------------------------
Brian Bezanson
Adobe Systems Inc.
bezanson@adobe.com


From mimsy!dftsrv!ukma!cwjcc!mailrus!cornell!uw-beaver!tektronix!sequent!ccssrv!ccsrd11!rob Wed Jan 18 17:24:16 EST 1989
Article 1631 of comp.lang.postscript:
Path: mimsy!dftsrv!ukma!cwjcc!mailrus!cornell!uw-beaver!tektronix!sequent!ccssrv!ccsrd11!rob
>From: rob@ccsrd11.UUCP (Robert Sleator)
Newsgroups: comp.sys.mac,comp.lang.postscript
Subject: Re: help printing MAC postscript files
Keywords: postscript, UNIX
Message-ID: <221@ccsrd11.UUCP>
Date: 17 Jan 89 19:07:00 GMT
References: <4024@mtuxo.att.com>
Reply-To: rob@ccssrv.UUCP (Robert Sleator)
Organization: Control-C Software, Inc., Beaverton, OR
Lines: 36
Xref: mimsy comp.sys.mac:27373 comp.lang.postscript:1631


The LaserPrep file (the PostScript prolog prepended to most Mac files sent
to the LaserWriter) contains code which is more or less equivalent to:

	statusdict /product get		% returns string with product name

	<< is this equal to the string (LaserWriter) (e.g., are you a LaserWriter ?) >>

	{eexec}{flushfile} ifelse	% if LW do eexec, else do flushfile
		.
		.
		.
	<< a bunch of hex >>
		.
		.
		.
	%%EOF

	<< begining of script part of file, which contains your text >>

The problem is that when you save this file with Command-K there is no ^D next to
the %%EOF comment.  If you then run the file on a printer other than a LaserWriter
it executes the flushfile rather than eexec, and flushes to the end of the job.
The solution is to edit the file and insert a control-D next to the %%EOF comment
(and make sure that the "exitserver" line is not commented out). 

Alternatively, if you don't want the prolog downloaded permanently, you can comment
out the exitserver line and delete everything from the first line that resembles this:

	currentfile ok userdict /smooth known not and{eexec}{flushfile}ifelse

down to the %%EOF line.  This should be mostly hex.

NOTE: The above applies to version of the LaserPrep file before version 67.  Version
67 may not have this problem.  It does contain a couple of new examples of 
non-portable code, though.


From mimsy!tank!uxc!csd4.milw.wisc.edu!mailrus!ames!haven!vrdxhq!bdmrrr!rlgvax!smadi Sat Feb 11 01:50:37 EST 1989
Article 1794 of comp.lang.postscript:
Path: mimsy!tank!uxc!csd4.milw.wisc.edu!mailrus!ames!haven!vrdxhq!bdmrrr!rlgvax!smadi
>From: smadi@rlgvax.UUCP (Smadi Paradise)
Newsgroups: comp.lang.postscript
Subject: Re: v17i080:  Fancy-printers for common languages.
Summary: Posted to comp.sources.unix
Keywords: pps slide
Message-ID: <1104@rlgvax.UUCP>
Date: 8 Feb 89 20:37:56 GMT
References: <1470@fig.bbn.com>
Reply-To: smadi@rlgvax.UUCP (On Paradise)
Followup-To: comp.sources.d
Organization: a guest of Computer Consoles Inc, Reston VA 22091
Lines: 17

The Pps fancy printer for PostScript devices which has just been
posted in comp.sources.unix (Volume 17, Issue 80; Archive-name: pps).
Pps handles C, awk, sh, lisp, mail, PostScript and English; adding more
languages is simple.

Pps is almost as fast as plain text-to-PostScript filters, so some
people here use it daily for source-code listing.  Most of the work is
done by the printer: Unix just separates the input into tokens, using
different lex(1) programs for each language.

Slide does the same, but ``expands'' the output to fit over a full
page. This is useful for making overhead projection transparencies.

Both pps and slide run on Sun, Vax, Gould, CCI, RT and other BSD
machines; they used to cope with SVR2, but that was a long time ago.

On (a guest of uunet!rlgvax!smadi) Paradise 


From mimsy!tank!ncar!unmvax!tut.cis.ohio-state.edu!bloom-beacon!oberon!sm.unisys.com!far-side.sm.unisys.com!dinh Sun Mar  5 19:09:40 EST 1989
Article 1921 of comp.lang.postscript:
Path: mimsy!tank!ncar!unmvax!tut.cis.ohio-state.edu!bloom-beacon!oberon!sm.unisys.com!far-side.sm.unisys.com!dinh
>From: dinh@far-side.sm.unisys.com (Dinh Le)
Newsgroups: comp.lang.postscript
Subject: local variables implementation
Message-ID: <5673@sdcrdcf.sm.unisys.com>
Date: 24 Feb 89 03:03:29 GMT
Sender: news@sm.unisys.com
Reply-To: dinh@sm.unisys.com (Dinh Le)
Organization: Unisys Santa Monica
Lines: 48

I have problems implementing local variables in postscript and wonder if
there are solutions (good or bad).  Here is a description:

Using C-prolog, I wrote a LOGO compiler using postscript as the target
language.  Most commands in LOGO can easily be simulated by postscript;
however, I have a hard time trying to simulate local variables declara-
tion in a LOGO procedure and the return function inside a LOGO procedure.

For example, if I have the following procedure

	procedure hilbert (size level parity)
	begin
		if level = 0 then return;
		left(parity * 90);	/* turn the turtle left by deg */ 
		hilbert(size level-1 -parity);
		forward(size);		/* forward turtle by size units */
		right(parity * 90);	/* turn the turtle right by deg */
		hilbert(size level-1 parity);
		forward size;
		hilbert(size level-1 parity);
		right(parity * 90);
		forward(size);
		hilbert(size level-1 -parity);
		left(parity * 90);
	end

	I've used following solution for local variables implementation, 
	but it doesn't work

	/hilbert {
		/hilbertdict begin
			/size exch def
			/level exch def
			/parity exch def

				...

		end
	} def

	Can someone spot the mistake(s) and suggest a solution for 
	local variable implementation?  Is there a nice way to 
	implement the return function which exit from a postscript 
	procedure?

				Thanks for any hints,

					'Dinh


From mimsy!tank!ncar!ames!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!adobe!greid Sun Mar  5 19:12:44 EST 1989
Article 1926 of comp.lang.postscript:
Path: mimsy!tank!ncar!ames!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!adobe!greid
>From: greid@adobe.com (Glenn Reid)
Newsgroups: comp.lang.postscript
Subject: Re: backspacing letters
Message-ID: <525@adobe.UUCP>
Date: 25 Feb 89 01:24:23 GMT
References: <1281@ccncsu.ColoState.EDU>
Sender: news@adobe.COM
Reply-To: greid@adobe.COM (Glenn Reid)
Organization: Adobe Systems Incorporated, Mountain View
Lines: 58

In article <1281@ccncsu.ColoState.EDU> beaty@handel.colostate.edu.UUCP (Billy Bad Ass) writes:
>i'm trying to modify a font so that the control-H backspaces along with
>printing nothing.  this will allow me to print UNIX man pages and the
>like without having to search the file for control-H's.  here is how
>i'm trying using the example on pp 99-100 in the "red book".  i can get
>'normal' letters to backspace, like the '/one' in the following
>example;  how do i specify control-H in the place of the '/one'?  if
>there is an easier way to get control-H to backspace, please let me
>know at the following address

Steve,

I tried to get mail through to you on this, but it bounced several
times, and since you've posted teh question, I'll just post my
answer....

It just so happens that my brother and I put this backspace font
together for a project he was working on, and it seems to work pretty
well, although some of the naming is probably less general than it
should be.

Enjoy,
Glenn Reid
Adobe Systems

----------------------------- cut ---
%!
%Title: backspacefont.ps

/backspacefont {
    /Courier findfont dup length dict begin
	{ %forall
	    1 index /FID eq { pop pop } { def } ifelse
	} forall
	currentdict /UniqueID known { %if
	    /UniqueID UniqueID 16#800000 xor def
	} if
	CharStrings length 1 add dict begin
	    CharStrings { def } forall
	    /backspace { -600 0 setcharwidth } bind def
	    currentdict
	end
	/CharStrings exch def
	/Encoding Encoding 256 array copy def
	Encoding 8 /backspace put
	currentdict
    end
    definefont
} bind def

/CourierBack backspacefont

/CourierBack findfont 48 scalefont setfont

100 600 moveto
(ABC\b\b\b___DEF underline\b_\b_\b_\b_\b_\b_\b_\b_\b_) show

showpage


From mimsy!eneevax!haven!ames!mailrus!tut.cis.ohio-state.edu!ucbvax!phoenix.cambridge.ac.UK!CET1 Sun Mar  5 19:17:26 EST 1989
Article 1943 of comp.lang.postscript:
Path: mimsy!eneevax!haven!ames!mailrus!tut.cis.ohio-state.edu!ucbvax!phoenix.cambridge.ac.UK!CET1
>From: CET1@phoenix.cambridge.ac.UK (Chris Thompson)
Newsgroups: comp.lang.postscript
Subject: Re: How long can a PostScript name be?
Message-ID: <9FF0514456347C20@UK.AC.CAM.PHX>
Date: 28 Feb 89 16:04:07 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 20

Thanks to Glenn Reid for his reply to my query, because it has told me
something I didn't know about PostScript: you can apply the "length"
operator to a name and get the length of the string necessary to hold
the results of cvs'ing it.

One couldn't have guessed this from the red book, I think. The "length"
operator is documented as working on arrays, dictionaries, and strings.
It doesn't explicitly say that those are the only things it works on,
but one is probably led to assume that, as "typecheck" is one of the
errors documented as possibly occurring.

In actual fact, experimentation with a LaserWriter (PostScript version
38.0) suggests that "length" can be applied to absolutely anything,
although the results aren't always as interesting as they are for a
name. All types except arrays, dictionaries, names and strings seem
to give the result 1.

Chris Thompson
JANET: cet1@uk.ac.cam.phx
ARPA:  cet1%phx.cam.ac.uk@nss.cs.ucl.ac.uk


From mimsy!tank!ncar!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!nih-csl!crtb Fri Mar 31 02:05:24 EST 1989
Article 2082 of comp.lang.postscript:
Path: mimsy!tank!ncar!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!nih-csl!crtb
>From: crtb@nih-csl.UUCP (chuck bacon)
Newsgroups: comp.lang.postscript
Subject: Debugging PostScript
Keywords: debug postscript Kermit ehandler
Message-ID: <936@nih-csl.UUCP>
Date: 28 Mar 89 15:14:47 GMT
Organization: NIH-CSL, Bethesda, MD
Lines: 35

The easiest way I know of to debug PostScript programs is to use Kermit on
a PC.  Process the words wherever you like, get the .ps file to the PC, and
use Kermit to Transmit the file.  Details:
1. Wheedle, deal and steal as needed, to gain access to the printer's
  serial port via a PC-to-printer link.  This is so valuable that any other
  substitute, even Glenn Reid's errorhandler.ps, fades in comparison.
2. Run MS-Kermit, and optionally ask it to log the session.  The log file
  will contain the echo of the downloaded .ps file as well as error messages.
3. With Kermit in `connect' mode, talk to the printer, and get it to echo
  and talk back with the `executive' command.  Precede with a ctrl-D to
  assure that the printer isn't intentionally ignoring you.
4. Now that you can see what you're typing and the printer responds, learn
  the use of '=', '==', 'print', 'pstack' and related debugging commands.
  Enter some simple program by hand, to verify you're really in touch,
  for example:    /FontDirectory {pop ==} forall
  will type out the names of all 35 (or howevermany) fonts.
5. With the printer's prompt waiting, back off into MS-Kermit, and tell it
  to     transmit myfile.ps
  where myfile.ps is an ordinary postscript file.  You'll see it echoing.
  The trick is that MS-Kermit by default waits for the CR before sending
  each next line, so there's no danger of a data overrun.
6. When you see a PostScript error message rolling up your screen, hit
  ctrl-S or ctrl-C and see what it says.  The error message will appear
  right after the input line which triggered it.
7. If you've lost PostScript (it's decided to ignore you until EOF), you'll
  have to debug by scrolling Kermit back and guessing.

Failing this approach, do load Glenn Reid's ehandler.ps (which appears
in comp.lang.postscript every once in a while), and celebrate as it not
only prints onto the paper an error message, but also prints the image
which otherwise would have been lost.  It's wonderful!  --But, it
interferes a bit with the interactive debugging technique unless you're
on a truly liberal paper budget.
	Chuck Bacon, crtb@alw.nih.gov (Internet), crb@nihcudec (Bitnet)-- 
crtb @ dxi.nih.gov, crtb @ alw.nih.gov, crb @ nihcudec (Bitnet), (301)496-4823


From mimsy!tank!eecae!shadooby!mailrus!cornell!uw-beaver!uw-june!smann Sat May 13 04:31:52 EDT 1989
Article 2398 of comp.lang.postscript:
Path: mimsy!tank!eecae!shadooby!mailrus!cornell!uw-beaver!uw-june!smann
>From: smann@june.cs.washington.edu (Stephen Mann)
Newsgroups: comp.lang.postscript
Subject: Pscal
Keywords: holidays
Message-ID: <8193@june.cs.washington.edu>
Date: 12 May 89 03:02:10 GMT
Distribution: na
Organization: U of Washington, Computer Science, Seattle
Lines: 371


Here's a version of Pscal that has holidays hacked in.  The program
is a Unix C-shell script that sends PostScript directly to a printer.
Documentation appears in the header comments of the script.

Steve
--------
#!/bin/csh -f
#+
#
# NAME:
#	pscal
#
# SYNOPSIS:
#	pscal [-Pprinter] [other printer flags] month year
#
# DESCRIPTION:
#	`Pscal' is a PostScript program to print calendars.
#
#	The file $home/.holiday is read and used to print short messages
#	on specified days.  The .holiday file should consist of lines of
#	the form 
#		month:day:message string
#	Messages should be 20 characters or less, with no more than 4
#	messages per day.  No spaces should appear from the beginning
#	of a line until after the second colon.
#	Month and day should be numbers in the obvious ranges.
#
# OPTIONS:
#	Any argument whose first character is '-' is passed on to lpr.
#
# AUTHOR:
#	Patrick Wood
#	Copyright (C) 1987 by Pipeline Associates, Inc.
#	Permission is granted to modify and distribute this free of charge.
# 
# HISTORY:
#	@Original From: patwood@unirot.UUCP (Patrick Wood)
#	@Shell stuff added 3/9/87 by King Ables
#	@Made pretty by tjt 1988
#	@Holiday and printer flag passing hacks added Dec 1988 
#	@ by smann@june.cs.washington.edu 
#
# BUGS:
#	`Pscal' doesn't work for months before 1753 (weird stuff happened
#	in September, 1752).
#
#	A better format for the dates of holidays would be nice.
#	An escape to allow holiday messages to be raw PostScript would
#	also be nice.
#	The holiday messages should be handled more intelligently (ie,
#	the messages should be clipped to the day).
#

set printer="-Pps"	# set default printer
set flags

top:
if ($#argv > 0) then
	switch ("$argv[1]")
		case -P*:
			set printer="$argv[1]"
			shift argv
			goto top
		case -*:
			set flags = ($flags $argv[1])
			shift argv
			goto top
		case *:
			if ($?month) then
				set year="$argv[1]"
			else if ($?year) then
				echo "usage: $0 [-Pprinter] month year"
				exit 1
			else
				set month="$argv[1]"
			endif
			shift argv
			goto top
	endsw
endif

if ($?year) then
else 
	echo "usage: $0 [-Pprinter] [-flag1 -flag2 ...] month year"
	exit 1
endif

if ( -e $home/.holiday ) then
    set noglob
    set holidays = \
       (  \[ `grep  ^$month\: $home/.holiday | awk -F: '{print $2,"(",$3,")" }'` ] )
else
    set noglob
    set holidays = (\[ ] )
endif

lpr $printer $flags <<END-OF-CALENDAR
%!
% PostScript program to draw calendar
% Copyright (C) 1987 by Pipeline Associates, Inc.
% Permission is granted to modify and distribute this free of charge.

% /month should be set to a number from 1 to 12
% /year should be set to the year you want
% you can change the title and date fonts, if you want
% we figure out the rest
% won't produce valid calendars before 1800 (weird stuff happened
% in September of 1752)

/month $month def
/year $year def
/titlefont /Times-Bold def
/dayfont /Helvetica-Bold def
/eventfont /Times-Roman def

/holidays $holidays def

/month_names [ (January) (February) (March) (April) (May) (June) (July)
		(August) (September) (October) (November) (December) ] def

/prtnum { 3 string cvs show} def

/drawgrid {		% draw calendar boxes
	dayfont findfont 10 scalefont setfont
	0 1 6 {
		dup dup 100 mul 40 moveto
		[ (Sunday) (Monday) (Tuesday) (Wednesday) (Thursday) (Friday) (Saturday) ] exch get
		100 center
		100 mul 35 moveto
		1.0 setlinewidth
		0 1 5 {
			gsave
			100 0 rlineto 
			0 -80 rlineto
			-100 0 rlineto
			closepath stroke
			grestore
			0 -80 rmoveto
		} for
	} for
} def

/drawnums {		% place day numbers on calendar
	dayfont findfont 30 scalefont setfont
	/start startday def
	/days ndays def
	start 100 mul 5 add 10 rmoveto
	1 1 days {
		/day exch def
		gsave
		day start add 7 mod 0 eq
		{
			submonth 0 eq
			{
				.8 setgray
			} if
		} if
		day start add 7 mod 1 eq
		{
			submonth 0 eq
			{
				.8 setgray
			} if
		} if
		day prtnum
		grestore
		day start add 7 mod 0 eq
		{
			currentpoint exch pop 80 sub 5 exch moveto
		}
		{
			100 0 rmoveto
		} ifelse
	} for
} def

/drawfill {		% place fill squares on calendar
	/start startday def
	/days ndays def
	0 35 rmoveto
	1.0 setlinewidth
	0 1 start 1 sub {
		gsave
		.9 setgray
		100 0 rlineto 
		0 -80 rlineto
		-100 0 rlineto
		closepath fill
		grestore
		100 0 rmoveto
	} for
	submonth 1 eq
	{
		/lastday 42 def
		600 -365 moveto
	}
	{
		/lastday 40 def
		400 -365 moveto
	} ifelse
	lastday -1 ndays start 1 add add
	{
		/day exch def
		gsave
		.9 setgray
		100 0 rlineto 
		0 -80 rlineto
		-100 0 rlineto
		closepath fill
		grestore
		day 7 mod 1 eq
		{
			600 -365 80 add moveto
		}
		{
			-100 0 rmoveto
		} ifelse
	} for
} def

/isleap {		% is this a leap year?
	year 4 mod 0 eq		% multiple of 4
	year 100 mod 0 ne 	% not century
	year 1000 mod 0 eq or and	% unless it's a millenia
} 