This bug has been around a while, but I just discovered the workaround someone posted on the swiki. The problem can be reproduced simply: - in 3.6 image, open a new StackMorph - add a TextMorph to the first page - set text alignment to centered - from the Stack's red "menu" halo button, select "copy & print" -> "print Postscript to file" and accept defaults. - a walkback appears: "PostscriptCharacterScanner doesNotUnderstand: #setAlignment:?"
This problem can be fixed by the suggestion posted on the swiki's "Postscript support" page. The fix is to modify the class 'PostscriptCharacterScanner' to be a subclass of 'CharacterScanner' and remove from the former the instance variable 'font'. I do not know if this fix causes other problems.
Here is the change to PostscriptCharacterScanner:
CharacterScanner subclass: #PostscriptCharacterScanner instanceVariableNames: 'canvas paragraph bounds curPos foregroundColor emphasis ' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Postscript Canvases'
< I'm a bug-fixing machine! >
This post brought to you by the BugFixArchiveViewer, a handy tool that makes it easy to comment on proposed fixes and enhancements for Squeak. For more information, check out the Web page for the BugFixArchiveViewer project: http://minnow.cc.gatech.edu/squeak/3214
< I'm a bug-fixing machine! >
This fixes the DNU but doesn't centre the printed postscript text. This bug is important if printing is important for StackMorphs.
A simpler fix would be to remove the expression
(paragraph text attributesAt: offset forStyle: paragraph textStyle) do:
[:att | att emphasizeScanner: self].
from PostscriptCharacterScanner>>setTextStylesForOffset:offset.
emphasizeScanner: just calls setAlignment:. Given the proposed fix doesn't change the printed postscript, a simpler option might be better. It's possible that there is another bug or missing feature somewhere else in the printing code.
I don't know enough about StackMorph's, postscript, or Squeak's printing to take this any further.
< I'm a bug-fixing machine! >
This post brought to you by the BugFixArchiveViewer, a handy tool that makes it easy to comment on proposed fixes and enhancements for Squeak. For more information, check out the Web page for the BugFixArchiveViewer project: http://minnow.cc.gatech.edu/squeak/3214
< I'm a bug-fixing machine! >
There appears to be a new bug that may obscure this one. When I follow the example instructions:
"- in 3.6 image, open a new StackMorph - add a TextMorph to the first page - set text alignment to centered - from the Stack's red "menu" halo button, select "copy & print" -> "print Postscript to file" and accept defaults. - a walkback appears: "PostscriptCharacterScanner doesNotUnderstand: #setAlignment:?""
in 5923 I get a different bug which appears to be related to a change in update 5660 by Ned. For some reason Ned's code attempts to 'DSCPostscriptCanvas>>drawPage:' on a collection of pages as returned from 'StackMorph>>pages'. fullDraw: doesn't like that.
Whether the old bug is still their and I'm just not getting far enough to see it, I don't know.
Ken
squeak-dev@lists.squeakfoundation.org