wx.Font(size, wx.FONTFAMILY_MAX, wx.NORMAL, wx.BOLD)

wx.Font(16, wx.FONTFAMILY_MAX, wx.NORMAL, wx.BOLD)

I'm getting an exception when trying to create such a font. I assume it's tripping over the FONTFAMILY_MAX.

wx._core.PyAssertionError: C++ assertion "Assert failure" failed at ..\..\src\msw\font.cpp(621) in wxNativeFontInfo::SetFamily(): invalid font family
...
File "C:\Python27\Lib\site-packages\wx-2.9.2-msw\wx\_gdi.py", line 2243, in __init__
   _gdi_.Font_swiginit(self,_gdi_.new_Font(*args, **kwargs))

I'm pretty sure this was working in 2.8. Any ideas?

Thanks,
Michael

Hi,

wx.Font(16, wx.FONTFAMILY_MAX, wx.NORMAL, wx.BOLD)

I'm getting an exception when trying to create such a font. I assume it's
tripping over the FONTFAMILY_MAX.

wx._core.PyAssertionError: C++ assertion "Assert failure" failed at
..\..\src\msw\font.cpp(621) in wxNativeFontInfo::SetFamily(): invalid font
family
...
File "C:\Python27\Lib\site-packages\wx-2.9.2-msw\wx\_gdi.py", line 2243, in
__init__
_gdi_.Font_swiginit(self,_gdi_.new_Font(*args, **kwargs))

I'm pretty sure this was working in 2.8. Any ideas?

If it worked in 2.8 it was probably a bug. FONTFAMILY_MAX is not a
valid identifier, it is used to mark the max value of the enumeration
of font families (between DEFAULT and MAX).

i.e so you can iterate over all the possible font families:

for ff in range(wx.FONTFAMILY_DEFAULT, wx.FONTFAMILY_MAX):
    ...

Cody

···

On Mon, Oct 17, 2011 at 1:30 PM, Michael Hipp <michael@redmule.com> wrote:

Thanks. Guess that means I need to figure out what it was *supposed* to do.

Michael

···

On 10/17/2011 1:48 PM, Cody wrote:

If it worked in 2.8 it was probably a bug. FONTFAMILY_MAX is not a
valid identifier, it is used to mark the max value of the enumeration
of font families (between DEFAULT and MAX).