Fixed Font in Text Control

fo = wx.Font(12, wx.MODERN, wx.NORMAL, wx.NORMAL, False)
<ctrl>.SetFont(fo)

If the 2nd argument of fo, font family, is wx.MODERN, a fixed pitch font is used.

On win platform, you can specify the font to be used.

fn = "Courier New"
<ctrl>.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False, fn))

In that case, the face name has priority over the 2nd argument,

Jean-Michel Fauth, Switzerland

Jean-Michel Fauth wrote:

fo = wx.Font(12, wx.MODERN, wx.NORMAL, wx.NORMAL, False)
<ctrl>.SetFont(fo)

If the 2nd argument of fo, font family, is wx.MODERN, a fixed pitch font is used.

Not necessarily, it may not be fixed width in some implemetations although wx.TELETYPE will always be fixed width.

ยทยทยท

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