Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001477 [Squeak] Multilingual minor always 07-15-05 22:46 09-12-07 01:46
Reporter mzimmerm View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version
Summary 0001477: [BUG][Partial Fix] Paragraph>>asForm
Description Michael Latta <lattam@mac.com>:

"Image 3.7 current full version.

This method behaves contrary to the example included in the method, and
contrary to my expectation.

The method forces foreground color to black and background to white.
It goes to great lengths to do this to support a ColorForm with 2
colors, except that in the case of a TTCStyle it uses a Form with depth
32. It looks like a clear bug. I have yet to figure out how to create
the form with all transparent pixels. The constructor creates it as
black fill, and using "over" or other rules do not replace it with
Color transparent.

Michael

asForm
    "Answer a Form made up of the bits that represent the receiver's
displayable text."
    | theForm oldBackColor oldForeColor |
    oldBackColor _ backColor.
    oldForeColor _ foreColor.
    textStyle isTTCStyle ifTrue: [
        theForm _ (Form extent: compositionRectangle extent depth: 32)
            offset: offset.
        theForm fill: theForm boundingBox rule: Form erase fillColor: Color
transparent.
    ] ifFalse: [
        theForm _ (ColorForm extent: compositionRectangle extent)
            offset: offset;
            colors: (Array
                with: (backColor == nil ifTrue: [Color transparent] ifFalse:
[backColor])
                with: (foreColor == nil ifTrue: [Color black] ifFalse:
[foreColor])).
        backColor _ Color white.
        foreColor _ Color black.
    ].
    self displayOn: theForm
        at: 0@0
        clippingBox: theForm boundingBox
        rule: Form over
        fillColor: nil.
    backColor _ oldBackColor.
    foreColor _ oldForeColor.
    ^ theForm

"Example:
| p |
p _ 'Abc' asParagraph.
p foregroundColor: Color red backgroundColor: Color black.
p asForm displayOn: Display at: 30@30 rule: Form over""

Additional Information
Attached Files

- Relationships
child of 0006570assigned tim A Mother for font and font test problems 

- Notes
(0001812 - 780 - 1011 - 1111 - 1111 - 1111 - 1111)
mzimmerm
07-15-05 23:00
edited on: 07-15-05 23:01

"Boris Gaertner" <Boris.Gaertner@gmx.net>

"> Image 3.7 current full version.
>

> "Example:
> | p |
> p _ 'Abc' asParagraph.
> p foregroundColor: Color red backgroundColor: Color black.
> p asForm displayOn: Display at: 30@30 rule: Form over"
>

This example works both in Morphic and in MVC when
you use StrikeFonts. It does not work when you use
TrueType Fonts. (3.8 gamma 6527) I think it is fair to say
that the example became outdated with the introduction of
support for TrueType fonts. An updated example should
read:

 "example: (coloring needs a StrikeFont)
| p |
p _ 'Abc' asParagraph.
p textStyle: (TextStyle named: 'Accuny').
p foregroundColor: Color red backgroundColor: Color black.
p asForm displayOn: Display at: 30@30 rule: Form over ""

 

- Issue History
Date Modified Username Field Change
07-15-05 22:46 mzimmerm New Issue
07-15-05 22:56 KenCausey Reproducibility have not tried => always
07-15-05 22:56 KenCausey Description Updated
07-15-05 23:00 mzimmerm Note Added: 0001812
07-15-05 23:01 KenCausey Note Edited: 0001812
09-12-07 01:46 wiz Relationship added child of 0006570


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
45 total queries executed.
32 unique queries executed.
Powered by Mantis Bugtracker