Quantcast

Fixed Font in Text Control

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fixed Font in Text Control

Jean-Michel Fauth
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



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fixed Font in Text Control

Robin Dunn
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!



Loading...