Working with mathmorphs?

Andreas Raab andreas.raab at gmx.de
Thu Mar 6 19:53:36 UTC 2003


Hi,

> > (b) the Vertex class in the graph package on the mathMorphs 
> > site uses a class called "QuickPrint" which doesn't seem to
> > exist in the current image (and about which the only hint I
> > can find on the Swiki is an aside about "DisplayScanner's
> > #quickPrint: variants").
>
> Squeak 2.7 was the last version with QuickPrint.  That class 
> implemented fast, single-line string display.
> Squeak 2.8 is the first version with quick print protocol in class
> DisplayScanner. (You found the right hint in the 3.4 image)
> QuickPrint was a sublcass of CharacterScanner, which in
> turn at that time was a subclass of BitBlt. Now CharacterScanner is
> subclassed to Object and when you try to file in QuickPrint you will
> be told that some instance variables (those inherited from BitBlt) are
> undefined. So this will also not work. We have no other choice than
> to move all this MathMorphs stuff to the new quickprint protocol 
> in DisplayScanner.

QuickPrint had no longer a purpose when the "regular" display protocol was
streamlined and out-performed QuickPrint by factors of 2-5. Most users of
QuickPrint were clients who wanted to measure the width of a certain string
(QuickPrint's #stringWidth: protocol) which you can simply replace by
querying the font itself (#widthOfString:). E.g., typically QuickPrint was
used for something like

	scanner := QuickPrint newOn: Display box: Display boundingBox font:
aFont.
	aWidth := (scanner stringWidth: aString).

which can be replaced trivially by

	aWidth := aFont widthOfString: aString.

Displaying should always be done by going through the appropriate canvas
protocol, so unless there's some magic involved in MathMorphs (which I don't
think) the above is the only issue you need to check.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list