Article View: comp.lang.postscript
Article #636Re: box function
From: Glenn Reid
Date: Fri, 30 Jun 1989 16:52
Date: Fri, 30 Jun 1989 16:52
31 lines
1505 bytes
1505 bytes
In article <11455@orstcs.CS.ORST.EDU> jasmerb@mist.CS.ORST.EDU (Bryce Jasmer) writes:
>I'm curious as to why there is no box operator in postscript. (note: I only
>know about Adobe PS version 1.0 so if a later version has a box operator than
>you are permitted to flame me.)
>% box
>% call like this: x y width height box
>% bottom - STACK - top
>/box { x y w h
> 4 2 roll w h x y
> moveto w h
> dup w h h
> 0 exch rlineto w h
> exch h w
> 0 rlineto h
> neg 0 exch rlineto -
> closepath
>} def
You have written a very nice procedure. (You should probably use "bind
def" rather than just "def", to make it a little faster; also, I assume
you just forgot the '%' before the stack trace on the right of each
line....).
Also, new operators have been added to the PostScript language to
handle rectangles, but at present they are only available in Display
PostScript interpreters. They are "rectfill" and "rectstroke", and
they use arguments in the same fashion that your "box" procedure does.
Glenn Reid
Adobe Systems
Technical Details
Message-ID:
<953@adobe.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!decwrl!adobe!greidReferences:
<11455@orstcs.CS.ORST.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!decwrl!adobe!greid From: greid@adobe.com (Glenn Reid) Newsgroups: comp.lang.postscript Subject: Re: box function Message-ID: <953@adobe.UUCP> Date: 30 Jun 89 16:52:40 GMT References: <11455@orstcs.CS.ORST.EDU> Sender: news@adobe.COM Reply-To: greid@adobe.COM (Glenn Reid) Organization: Adobe Systems Incorporated, Mountain View Lines: 31