Path: utzoo!attcan!uunet!mcvax!ukc!harrier.ukc.ac.uk!eagle.ukc.ac.uk!icdoc!qmc-cs!liam From: liam@cs.qmc.ac.uk (William Roberts) Newsgroups: comp.lang.postscript Subject: Re: Want Laser Prep walkthrough Summary: LaserPrep is a moving target Keywords: PostSCript, LaserPrep Message-ID: <788@sequent.cs.qmc.ac.uk> Date: 15 Dec 88 16:57:54 GMT References: <456@grand.UUCP> <3265@bgsuvax.UUCP> Reply-To: liam@cs.qmc.ac.uk (William Roberts) Organization: Computer Science Dept, Queen Mary College, University of London, UK. Lines: 73 Expires: Sender: Followup-To: Distribution: I have plans to write a paper entitled something like A Short History of the Apple LaserPrep: The Primrose Path to the Enternal Bonfire This will demonstrate the way in which the Apple LaserPrep code has moved further and further away from good taste and decency, resulting in the current state of affairs in which the code conforms almost to the letter of the document structuring conventions whilst being utterly against the spirit! For example: the "od" routine used during document setup. DSC2 says that every page should be independent of every other page: LaserPrep 67 does this by calling od at the start of the document (in a correctly labelled document setup section) which includes newpath clippath mark {transform{itransform moveto}} {transform{itransform lineto}} {6 -2 roll transform 6 -2 roll transform 6 -2 roll transform {itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}} {{closepath}} pathforall newpath counttomark array astore /gc xdf What does this do? Answer: it sets the current path to be the current clipping region, then uses pathforall to walk through the path, producing for each element of the path the point(s) involved *IN DEVICE COORDINATES* and an instruction to turn them back into current coordinates and then execute the appropriate path constructor. It then puts these instructions into an array and saves it under the name "gc". For example, if the clipping path is 100 100 moveto 100 200 lineto 200 200 lineto 200 100 lineto closepath gc will be 352 3776 {itransform moveto} 352 2590 {itransform lineto} 1552 2590 {itransform lineto} 1552 3376 {itransform lineto} {closepath} The start of each page involves executing gc to set up the clipping path for that page. This is obscene (Apple are you listening?). Why is it necessary to use device coordinates? If it were not for the cost to me, I'd buy a copy of the PostScript Green Book and send it to the LaserPrep writers. There is no justification for the grotesque code that is contained in current laserprep files. Incidentally, if anyone out there expects to be able to use modern Apple PostScript inside things like psfig, then they might as well forget it now and not waste time trying to pretend that this stuff can be used in the same way as the early LaserPreps. Can anyone suggest a good place to publish such a paper? -- William Roberts ARPA: liam@cs.qmc.ac.uk (gw: cs.ucl.edu) Queen Mary College UUCP: liam@qmc-cs.UUCP LONDON, UK Tel: 01-975 5250