CellProfiler/CellProfiler — Issue #291: GUI Font (Windows Vista/7)
Author: BioTurboNick
Created: 2012-02-18 09:29:59+00:00
State: open

I'm not sure what is all being planned for the file_ui branch, but one problem with relying on wxWidgets is that it does not properly assign the default UI font to "Segoe UI" for Windows Vista and 7. Using this font improves the appearance of CellProfiler on those operating systems. Though currently, this would require implementing OS/version detection in all GUI code (e.g. those that inherit wx.Frame or wx.Dialog). However, short of a fix in the wx libraries, it is unclear what a better solution might be--custom base classes inheriting from wx.Frame/Dialog and having the other classes inherit from them?

```
def __init__(...)
[base class initialization]
# wx doesn't select the right GUI font ("Segoe UI") for Windows Vista/7.
if sys.platform.startswith("win") and sys.getwindowsversion().major >= 6:
font = self.GetClassDefaultAttributes().font
self.Font = wx.Font(font.GetPointSize(), font.GetFamily(), font.GetStyle(), font.GetWeight(), False, u"Segoe UI")

```