=== Top of the Swiki === Attachments ===

Postscript Support

Note: Before making changes to this page, please read the
guidelines to SqueakCentralProjects. Thanks.

Goal

Provide Postscript representations of Morphic graphics for printing and inclusion into graphics programs.

Included in Squeak since: October 16, 1999

Status
[August 8] project declared to exist
[September 10] code made available at (http://www.metaobject.com/downloads/Squeak/MorphicPostscript/)
[September 14] a few bugs fixed, make sure to get all the change-sets at the above URL.
[October 16] Postscript support included in Squeak 2.6 release
[November 15] Bug fixes and better support for older (Postscript Level 1) printers posted

Implementors
Marcel Weiher

Q/A, Integration
Andreas Raab
Lex Spoon {lex@cc.gatech.edu}
Dan Ingalls

General Commentary



[10 Sept 1999,MPW]

The current MorphicPostscript support includes both EPS and multi-page Postscript generation.

BookMorphs generate multi-page files, all other Morphs generate an EPS ready for inclusion, though currently without a bitmap preview.

Postscript generation is split between a high-level class that maps Morphic drawing commands to Postscript imaging model commands and a low level class for generating actual Postscript code for the commands, in order to facilitate drop-in replacements for PDF, SVG or comparable formats.

I also think this is a good base for supporting other device independent graphic models and even direct device independent drawing.

As a matter of fact, I had a barely usable version of Squeak that was drawing via DPS instead of blitting to screen a while ago.

[15 Nov 1999, MPW]

Now that Postscript support has been in the main release for a while, I've summarized this page. The lively VNC discussion has been moved to the Squeak and VNC page.

The following topics are still around:

1. PDF support

Adapting the MorphicPostscript support to output PDF shouldn't be too hard. DWH has obtained the Smalltalk port of the Java PDF generation package jPDF (http://www.splwg.com/Global/1,1004,50227,00.html). Mail him at mailto:dwighth@ipa.net to obtain a Smalltalk port (note: this port is for vanilla VWNC 3.0).

2. Previews for EPS files

The main difficulty here is a TIFF-Writer for Squeak. Once that is available, it would be almost trivial to add DOS-style previews to generated EPS files. Device independent previews would be possible now, but only a few applications seem to support them.

3. Printing system, scaling/poster-printing, paper sizes

My current inclination is to model this after the Cocoa printing system. A morph is first scaled and then paginated. The pages are then mapped to actual printer sheets, doing n-up etc.

There must be scale-factor and paper-size settings, at least for a print job but preferably also attachable to a specific morph + some system-wide defaults.

Of course, to really make this work well would require some direct connection to the host printing system with lookup of the appropriate properties from the selected printer.

4. Better text and font support

Currently, text support has to cheat quite a bit to get high quality results. Getting font support with real (printer) metrics into Squeak, together with the mechanisms for adjusting those metrics for the display of screen fonts, would solve most of these problems, though there are still some areas that are pretty much hard-coded to expect BitBlit.

4. Translucency

The short answer is that this is difficult to achieve in Postscript.

The long answer is that since translucency is not support by the Postscript (or PDF) imaging model, you have to do it yourself. This involves either blitting everything down to a bitmap with a translucency-capable blitter, or remembering every shape and every bitmap output, computing the areas of overlap and outputting new shapes with translucency taken into account for those overlapped shapes.

For this to work you have to convert all text to shapes before output and also consider bitmap/shape intersections.

It is doable (Quickdraw GX does it), but a lot of work.

5. Native drawing, including DPS/DGS

While I was working full capacity on MorphicPostscript, I had a version of the PostscriptCanvas doing DPS native drawing on my MacOS-X-Server box.

It was an interesting experiment, but not really usable yet. The current morphic support code still has a lot of hardwired assumptions about going to a BitBlt oriented display.


[16 Nov 1996 MPW]

One thing to be aware of is that most morphs currently produce an EPS file when asked to "save Postscript to file". EPS files are not stand-alone print files but rather meant to be included in other documents by word-processing or DTP applications.

The exception to this rule are BookMorphs. BookMorphs will produce a stand-alone Postscript file that can be printed as is.



Anyone is invited to add to this list. The implementors are free to remove and summarize any items more than two weeks old.