links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Postscript support
Last updated at 12:49 am UTC on 25 August 2016
Note: Before making changes to this page, please read the guidelines to SqueakCentralProjects (outdated). Thanks.

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

Included in Squeak since: October 16, 1999

[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

Marcel Weiher

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

General Commentary

[14 Mar 2003, NF]

Just a note from a newly 3.4 image user:
To obtain a Postscript file from a BookMorph (see at bottom for a comparison of BookMorph respect other Morphs for a Postscript output), at least in my case it as been necessary to modify the class 'PostscriptCharacterScanner' to be a subclass of 'CharacterScanner' and remove from the former the instance variable 'font'.

[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 SPDF, 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

see SPDF

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.

Postscript support has been re-established in Squeak 5.1.

Anyone is invited to add to this list. The implementors are free to remove and summarize any items.