15

I'd like to set the font of a wx.TextCtrl widget to Consolas, or at least another monospaced font. How would I go about this?

rectangletangle
  • 50,393
  • 94
  • 205
  • 275

1 Answers1

23
font1 = wx.Font(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, u'Consolas')
myTextCtrl.SetFont(font1)
Stephen Terry
  • 6,169
  • 1
  • 28
  • 31
  • 2
    For more information on fonts and how to apply them, check out http://www.blog.pythonlibrary.org/2011/04/28/wxpython-learning-to-use-fonts/ – Mike Driscoll May 02 '11 at 17:20