[ wxwindows-Bugs-1757465 ] FontDialog Issues

SourceForge.net noreply at sourceforge.net
Sun Aug 12 12:51:46 PDT 2007


Bugs item #1757465, was opened at 2007-07-20 11:13
Message generated for change (Comment added) made by cprecord
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1757465&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMac specific
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: cprecord (cprecord)
Assigned to: Stefan Csomor (csomor)
Summary: FontDialog Issues

Initial Comment:
System Info:
OS X 10.4.10 (intel)
wxPython 2.8.4
python 2.5

Problem:

1) When opening a FontDialog on a Mac the following error is printed to the console 3 times.
2007-07-20 05:59:26.587 Python[1777] Unknown class NSTypographyPanelSlider in Interface Builder file.

2) There is also some unpredictable behavior where the font dialog will raise an error like shown below, when the dialog is closed. This behavior doesn't happen for the same font each time it seems somewhat random. It can be reproduced fairly consistently by opening the dialog choosing a font then closing it then opening it again and choosing a different font then closing (repeat until exception is raised, usually between 5-10 times will do the trick)

Error Sample:
Traceback (most recent call last):
  File "test.py", line 18, in OnButton
    dlg.ShowModal()
  File "//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_windows.py", line 703, in ShowModal
    return _windows_.Dialog_ShowModal(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "err == noErr" failed at /BUILD/wxPython-src-2.8.4.0/src/mac/carbon/fontdlg.cpp(83) in wxMacCarbonFontPanelHandler(): ATSFontFamilyGetName failed


Sample Program used to reproduce the two above issues:

<code>

import wx

class TestFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, title="TestFrame", size=(300, 300))
        
        self._btn = wx.Button(self, label="Open FontDialog")
        sizer = wx.BoxSizer()
        sizer.Add(self._btn, 1, wx.ALIGN_CENTER)
        sizer2 = wx.BoxSizer(wx.VERTICAL)
        sizer2.Add(sizer, 1, wx.ALIGN_CENTER)
        self.SetSizer(sizer2)
        self.Bind(wx.EVT_BUTTON, self.OnButton, self._btn)

    def OnButton(self, evt):
        fontdata = wx.FontData()
        dlg = wx.FontDialog(self, fontdata)
        dlg.ShowModal()
        fontdata = dlg.GetFontData()
        font = fontdata.GetChosenFont()
        print "Face: ", font.GetFaceName().encode('utf-8')
        dlg.Destroy()

if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = TestFrame()
    frame.Show()
    app.MainLoop()

</code>


----------------------------------------------------------------------

>Comment By: cprecord (cprecord)
Date: 2007-08-12 19:51

Message:
Logged In: YES 
user_id=1817314
Originator: YES

Just an update on this issue. 

In the the reports I have received from the users of my software the
problem appears to be much more prevalent on PPC based Macs than Intel.
Some of the users on PPC machines have said it happens everytime that the
dialog is opened on PPC machines.

I have done some testing on the latest release (2.8.4.2) and the error
message that I receive has changed slightly since what was raised in
2.8.4.0.

Traceback (most recent call last):
  File "fontdlg_test.py", line 18, in OnButton
    dlg.ShowModal()
  File
"//Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_windows.py",
line 703, in ShowModal
    return _windows_.Dialog_ShowModal(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "status == noErr" failed at
/BUILD/wxPython-src-2.8.4.2/src/mac/carbon/font.cpp(487) in MacFindFont():
couldn't modify ATSU style

Regards,

Cody Precord


----------------------------------------------------------------------

Comment By: Stefan Csomor (csomor)
Date: 2007-07-20 12:33

Message:
Logged In: YES 
user_id=81467
Originator: NO

Hi

no problem, I will try to reproduce it from the dialogs c++ sample, if I
cannot, I'll come back on that

thanks,

Stefan

----------------------------------------------------------------------

Comment By: cprecord (cprecord)
Date: 2007-07-20 12:14

Message:
Logged In: YES 
user_id=1817314
Originator: YES

Thanks for the quick reply,

1) ok will ignore it

2) would have been nice of my to attach the script instead of posting it
in the comment, since all the spacing go messed up, so if it still matters
I attached it to this post.
File Added: fontdlg_test.py

----------------------------------------------------------------------

Comment By: Stefan Csomor (csomor)
Date: 2007-07-20 11:27

Message:
Logged In: YES 
user_id=81467
Originator: NO

Hi

thanks for reporting 

1) this is not a bug, but a OS limitation when the font dialog is shown
from Carbon, which triggers the log message
2) this is very strange, I'll try to reproduce and come back on that

Best,

Stefan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1757465&group_id=9863




More information about the wx-dev mailing list