Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!sdd.hp.com!wuarchive!mit-eddie!bloom-beacon!dont-send-mail-to-path-lines From: fgreco@govt.shearson.COM (Frank Greco) Newsgroups: comp.windows.x Subject: Re: Xlib ---> Postscript Message-ID: <9101091605.AA04115@fis1.> Date: 9 Jan 91 16:05:16 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 42 > > How are Xlib developers handling the problem of printing high-quality > output of the images rendered on the display using Xlib? > > Ideally, I'd like a library with an API similar to Xlib, which would > create a Postscript file. So when the user says "Print", the same > sequence of Xlib calls which created the image on screen, would be > "sent" to this library. The library would generate a Postscript > file suitable for printing. > > Of course, this ideal library would have to deal with mapping X fonts > to one of the available Postscript fonts. And it would have to deal > with mapping from color to mono. And it would have to map from any > arbitrary resolution to normalized Postscript coordinates. > > Does such a beast exist? Is anyone working on something like this? > > Grabbing a bitmap from the X Server and twisting it into a Postscript > bitmap isn't good enough. As much as possible, I'd like to create > resolution independent postscript from Xlib. 1.) I would assume that in your repaint procedure(s) you traverse some sort of display data structure (e.g., tree, list) using Xlib fn's to draw. If "print" is requested, you would have to traverse your data structure, producing Postscript primitives instead of Xlib... That's the "easy" part (at least for vector-style drawing) however, rendering resolution-independent fonts is going to be very problematic for *true* WYSIWIG-stuff. 2.) If you're running on OpenWindows, you can use the NeWS wire service in an XView canvas to send NeWS/PS snippets to do all your on-screen drawing. Then, with a very small amount of NeWS/PS pgming, you send the same sequence to a Postscript printer (or NeWSprinter). Mapping from color to mono is straightforward in this suggestion. 3.) If you have the Display Postscript extension on your X server...see #2 Frank G.