从 wxPython 2.8 切换到 2.9 时的字体问题
我最近从 2.8 切换到 wxPython 2.9。我用 2.9 运行了我的一个程序。除了我的代码中动态调整字体大小的部分之外,一切似乎都有效。我更改字体大小的行似乎是问题的根源。
片段:
sw, sh = self.get_geom(opt='wh')
font = wx.Font(sw/10 , wx.NORMAL, wx.NORMAL, wx.NORMAL) # This is the line that's giving me trouble
self.ST.SetFont(font) # self.ST is a static text widget.
错误:
wx._core.PyAssertionError: C++ assertion "ff_family != (0<<4)" failed at ..\..\src\msw\font.cpp(672) in wxNativeFontInfo::SetFamily(): unknown wxFontFamily
如果有影响的话,这是在 Windows 7 中。
I recently switched to wxPython 2.9 from 2.8. I ran one of my programs with 2.9. Everything seems to have worked, except the portion of my code that dynamically resizes fonts. The line where I change the font size seems to be the root of the problem.
Snippet:
sw, sh = self.get_geom(opt='wh')
font = wx.Font(sw/10 , wx.NORMAL, wx.NORMAL, wx.NORMAL) # This is the line that's giving me trouble
self.ST.SetFont(font) # self.ST is a static text widget.
The Error:
wx._core.PyAssertionError: C++ assertion "ff_family != (0<<4)" failed at ..\..\src\msw\font.cpp(672) in wxNativeFontInfo::SetFamily(): unknown wxFontFamily
This is in Windows 7 if it makes a difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
家庭可以是:
因此你应该使用:
family can be:
thus you should use: