Article View: comp.lang.postscript
Article #4019PostScript vs. X as a graphics protocol
From: Jonathan Monsarrat
Date: Mon, 09 Nov 1992 23:39
Date: Mon, 09 Nov 1992 23:39
79 lines
3264 bytes
3264 bytes
Newsgroups: comp.lang.postscript,
Subject: PostScript vs. X as a graphics protocol
Summary:
Expires:
Sender:
Followup-To:
Distribution: world
Organization: Brown University Department of Computer Science
Keywords:
*******PROBLEM:
I've heard that some people prefer PostScript as a graphics protcol
over some other protocols like the X protocol for the following
reason:
1. PostScript is a program, which means that you can pack the data in
the best way possible, and include a tiny program to interpret it.
2. The X protocol is defined and static, so you can only do the things
that the X protocol allows. Your data must be in one of the
predefined forms.
*******EXAMPLE:
If I wanted to generate a picture made up of filled regions,
I could use the X protocol like this:
line line line line fill line line line line fill line line line fill
etc. etc.
Where the lines and fills belong to some predefined format. In
PostScript I can prepend a special program to let me do the lines and
filling more compactly, like this:
/p 4/f{{}forall moveto gsave{dup 32 mod dup 15 mul rotate sub p div 0 rlineto}
forall fill grestore}def 4 scale 1 def(``f`f`f)dup( )f( i).3 setgray f/p 8 def
1 setgray/h(F!6! 2477!W)def h("4)h(,C)h(6O)h(LT)h(^O)h(tC)h(~6)(7!6!"7#$&6!7 #)
(9~)(""""""""""")(}~)(fTV``Vt)(9!)(e!FR"n&44ED-w@-7&&b)(C2)11{f}repeat showpage
********THINK-UMS:
Well, pros and cons that I can think of.
PostScript Con: the program passed in through the protocol
could be a security problem.
PostScript Con: the program could be non-portable. When you port
X to a platform, it's done. With a PostScript protocol
each protocol program needs porting.
PostScript Pro: Takes less space than X.
X Pro: No need to interpret and compile incoming program. Large common
stuff can be handled directly.
PostScript Con: Unless you combined a little of the "static programs"
of the X method, you'd never be able to interpret data
at all unless there were a program sent with it!
PostScript Con: Is PostScript fast enough?
********DISCUSSION?
Now, I come from MIT where a lot of X stuff happened, but I also
like PostScript a lot. So I am undecided.
Any opinions on this choice and where/when one or the other is best?
What systems use PostScript as a protocol? The NeXT does this, right?
I'm not going to cross-post this to an X newsgroup because I'm just
kind of curious to hear some opinions. I'm not trying to start a
flame session between two newsgroups or anything!! :)
-Jon
%! Jon Monsarrat jgm@cs.brown.edu Brown University %! Obfuscated PostScript
0 0 moveto 15 setlinewidth(qlllll-??LHHL??llH?hH7t,7olCAHH@)1 setlinejoin{dup
10 mul rotate 80 lt{50 0 rlineto}{50 0 rmoveto}ifelse}forall stroke showpage
Technical Details
Message-ID:
<1992Nov9.233933.4574@cs.brown.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!brunix!brunix!jgmShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!brunix!brunix!jgm From: jgm@cs.brown.edu (Jonathan Monsarrat) Subject: PostScript vs. X as a graphics protocol Message-ID: <1992Nov9.233933.4574@cs.brown.edu> Sender: news@cs.brown.edu Organization: Brown University Department of Computer Science Date: Mon, 9 Nov 1992 23:39:33 GMT Lines: 79