This is the mechanism that most Unix programs use for printing.
However, for displaying on-screen graphics, it's pretty inefficient.
It also requires a degree of familiarity with PostScript.
A similar option is to popen("wish") and send it Tcl/Tk commands to
create a canvas widget and add graphics objects to it. Tk's canvas
widget includes `postscript' command to generate a PostScript
representation (e.g. for printing).
This has the advantage that Tcl/Tk comes with manual pages which
provide fairly comprehensive documentation on the language, whereas
you really have to get the red book to learn PostScript. Also, there
are probably more Tcl/Tk programmers around than PostScript
programmers.
Another simple alternative for displaying graphics under X is to use
xterm's Tektronix 4014 emulation (if you can find documentation on the
control codes. Incidentally, anyone knows if these are documented
online anywhere, could they let me know.)
--
Glynn Clements <[EMAIL PROTECTED]>