I'm not an experienced Smalltalker by any stretch of the imagination, though I've played with Smalltalk systems a number of times. However, spurred by an interest in playing with the Udanax.com release of the Xanadu code, I've become re-interested in Smalltalk and I'm now thinking of doing some side projects in it.
My problem is that I decided that I really want the Antialiased fonts, but I can't get the released version to work properly on Squeak 2.8. I fixed a couple of small breakages (the removal of the QuickPrint Object and its replacement by a method in DisplayScanner, for instance), but it just doesn't work properly.
I've tried to trace the rendering flow of control, and I determined that adding a displayString:on:from:to:at:kern: method to AntialiasedFont seems to fix text display in the MVC world, but characters in TextMorphs would always come out as black blobs. At this point, my grasp of the fine points of BitBlt and display depths, etc. fails me.
It seems significant to me that I can hack MVC to work and not morphic, but I can't tell why.
Has anyone faced and conquered this problem? Are the anti-aliased fonts something that might make their way into the mainline Squeak development at some point?
I'm happy to send my changes so far, if they'd help someone else who's interested in this problem and competent to solve it.
-- David
David G. Durand wrote:
My problem is that I decided that I really want the Antialiased fonts, but I can't get the released version to work properly on Squeak 2.8. I fixed a couple of small breakages (the removal of the QuickPrint Object and its replacement by a method in DisplayScanner, for instance), but it just doesn't work properly.
I've tried to trace the rendering flow of control, and I determined that adding a displayString:on:from:to:at:kern: method to AntialiasedFont seems to fix text display in the MVC world, but characters in TextMorphs would always come out as black blobs. At this point, my grasp of the fine points of BitBlt and display depths, etc. fails me.
It seems significant to me that I can hack MVC to work and not morphic, but I can't tell why.
Has anyone faced and conquered this problem? Are the anti-aliased fonts something that might make their way into the mainline Squeak development at some point?
David,
I have updated this to work with 2.8 and 2.9a--as you've noted, there were some really big changes in 2.8--but I haven't released them because I've waited for FreeType 2.0 to get straightened out. Unfortunately that wait seems to stretch out indefinitely. I keep catching bugs that are just too simple.
Anyway, I've attached a changeset that files in nicely into 2.9a (for me at least). I know there are some dependencies on other code (like the FileList refactoring I posted a few days ago) but you can probably make it work.
The "black" text you experience is because of how various pieces of code use various different Blt modes to draw text. I have refactored this to have text-drawing code ask the font for what blt mode to use, in most places but not all, notably a couple of places in MVC-related code. You can probably figure that out easily; I don't use MVC myself so I'll be happy to have your fixes if you manage. Also, I haven't made my stuff work in 16 bits yet.
I have created a new blt mode that draws sub-pixel rendered fonts correctly on non-white backgrounds. You'll need to compile a BitBlt external plugin for this to work, and you also need to remove a few messages from BitBlt before it will compile--those are test methods I've been experimenting with. But since you've managed to get as far as you have you seem competent enough to figure this out.
Good luck!
Henrik
squeak-dev@lists.squeakfoundation.org