AW: [squeak-dev] The Trunk: Graphics-mt.152.mcz

Juan Vuletich juan at jvuletich.org
Tue Nov 16 13:53:38 UTC 2010


Hi Marcel,

Marcel Taeumel wrote:
> So "The Inbox: Graphics-mt.157.mcz" includes that missing detail now.
>
> Both code snippets just work fine then:
>
> ('Hello, World' asText addAttribute: (TextColor color: (Color blue alpha:
> 0.5))) asMorph openInHand
>
> Display getCanvas drawString: 'This is a Test' at: 20 at 20 font: TextStyle 
> defaultFont color: (Color red alpha: 0.5)
>
> Bye,
> Marcel Taeumel
>   

I played a little bit more with it, and I think the best solution is to 
completely disable subpixel rendering for translucent text. To do this, 
go back to the old version of the method, (dated on 2009) and replace this :

        (Preferences subPixelRenderFonts and: [ foregroundColor = Color 
black or: [ Preferences subPixelRenderColorFonts ]]) ifTrue: [

by this:

        (Preferences subPixelRenderFonts and: [ foregroundColor = Color 
black or: [ Preferences subPixelRenderColorFonts and: [foregroundColor 
isOpaque]]]) ifTrue: [


This makes almost opaque colors (alpha > 0.9) look much better.

Cheers,
Juan Vuletich



More information about the Squeak-dev mailing list