[wxPython-users] LCD vs CRT Monitors Issues (!)

Robin Dunn robin at alldunn.com
Thu Nov 1 17:11:24 PDT 2007


Andrea Gavana wrote:

> Curiously, just replacing this line:
> 
> fnt = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
> 
> with this line:
> 
> fnt = wx.SystemSettings_GetFont(wx.SYS_ANSI_VAR_FONT)
> 
> Fixed the issue. I have no idea why, but it works. 

Probably because the font used in that case on your system is either a 
bitmap font (instead of a vector format like TTF) or doesn't specify any 
hinting that the system will use for anti-aliased drawing.

I expect that the only way to truly solve this for any font is to make 
sure that the text only gets drawn once.  If it needs to be drawn again 
for some reason, such as it is part of the update region in a paint 
event, then you either need to redraw everything 'behind' it too, or 
don't use dc.SetBackgroundMode(wx.TRANSPARENT).  To better see what is 
happening you should get a tool that lets you zoom in on the display and 
see the individual pixels magnified.  If you look at some text then if 
it's using anti-aliasing (or 'font smoothing' or 'ClearType') you'll see 
some pixels along the curves and corners that are not fully black, or 
that may even have some color.  If the same text gets redrawn at the 
same place then those aliased pixels will be blended with the ones that 
are already there and they will become a little bit darker, and a little 
more dark the next time it is drawn.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list