wx.Font.GetPointSize returning bogus value?

Tim Roberts timr at probo.com
Sun Dec 10 00:16:52 EST 2006


"Roger Miller" <roger.miller at nova-sol.com> wrote:
>
>The following program gets a TextCtrl's text attributes and sets them
>back unchanged. However it reports that the font size is 124, and after
>resetting the attributes the text becomes that size. That is, the
>window displays a normal-size "foo" and a gigantic "bar". Anyone know
>what's going on?
>....
>      print "font face", font.GetFaceName()  # prints MS Shell Dlg 2
>      print "font family", font.GetFamily()  # prints 74
>      print "font size", font.GetPointSize() # prints 124!

Not sure.  On my system, the console output is the same, but the "bar"
appears as a solid black box of the right size (that is, 124 points).

It is a strange set of results.  "MS Shell Dlg 2" is a fake font name that
remaps to a real font depending on your operating system and locale.  74
(0x4A) indicates a vector TrueType font of the "script" family, which is
bizarre.

May I suggest that you set your own default font before beginning?
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list