Opened 3 years ago

Closed 3 years ago

#3046 closed defect (fixed)

Cannot set display font

Reported by: cmbarton Owned by: grass-dev@…
Priority: major Milestone: 7.0.5
Component: wxGUI Version: 7.0.4
Keywords: display font Cc:
CPU: Unspecified Platform: MacOSX

Description

Attempting to set display font in preferences generates an error in GRASS 7.0.4 and above. This may or may not be limited to the Mac.

Traceback (most recent call last):
  File "/Applications/GRASS-7.1.app/Contents/MacOS/gui/wxpyt
hon/gui_core/preferences.py", line 1446, in OnSetFont

type = 'font')
  File "/Applications/GRASS-7.1.app/Contents/MacOS/gui/wxpyt
hon/gui_core/preferences.py", line 1563, in __init__

style = wx.LB_SINGLE|wx.LB_SORT)
  File "/Applications/GRASS-7.1.app/Contents/MacOS/etc/pytho
n/wx/_controls.py", line 1284, in __init__

_controls_.ListBox_swiginit(self,_controls_.new_ListBox(*arg
s, **kwargs))
UnicodeDecodeError
:
'ascii' codec can't decode byte 0xe5 in position 14: ordinal
not in range(128)

Change History (12)

comment:1 Changed 3 years ago by cmbarton

More information.

I removed the ~.grass7/wx file to force GRASS to rebuild it. This does happen if save is pressed from preferences.

If I go to preferences and select either display or command console font, I get a Mac-specific dialog to select fonts. But I cannot close the dialog to save the font. I can only crash the GUI to get out of this. After that, I was able to get the standard GRASS font dialog for display font and select a standard font (Helvetica in this case).

I have not been able to even get to the standard GRASS font selection for the console font. Trying to select it only gives the 3 column Mac font selector that does not work in this environment (which is why we had to build the existing font dialog).

This is a pretty serious bug for the display. I don't know exactly when it was introduced, but it is fairly recent since I've been making maps periodically this year with no problem.

Last edited 3 years ago by cmbarton (previous) (diff)

comment:2 Changed 3 years ago by cmbarton

Final thought for now. I think that pressing the "font" button for preferences/appearance (and sometimes for preferences/display) now launches what is supposed to be a wxPython font dialog. This has long been known to be buggy in wxPython 2.x on some systems, including the Mac. At least conditionally for the Mac, the font setting still needs to be done using the simpler, custom built font selection dialog.

comment:3 Changed 3 years ago by annakrat

I fixed the display font in r68532. The crashing of the native font dialog for console font is probably related to this bug and might be fixed already, but there is no new release of wxPython. So I guess we will have to use the custom font dialog.

comment:4 Changed 3 years ago by annakrat

In 68535:

wxGUI: use custom font dialog for output font on Mac, see #3046

comment:5 Changed 3 years ago by cmbarton

I just compiled GRASS trunk (7.3) and tested. There does not seem to be any change in the preferences behavior. Map Display font button opens custom font selection list and Appearance font button opens wxPython font manager (and locks up GUI). Am I testing the wrong code base?

comment:6 in reply to:  5 Changed 3 years ago by annakrat

Replying to cmbarton:

I just compiled GRASS trunk (7.3) and tested. There does not seem to be any change in the preferences behavior. Map Display font button opens custom font selection list and Appearance font button opens wxPython font manager (and locks up GUI). Am I testing the wrong code base?

The display font was not working, as you reported. As for the other font, I assume you have wxPython 2.8 and I think I limited the changes to wxPython 3, because I forgot it's problem in 2.8 as well, I will change it.

comment:7 Changed 3 years ago by annakrat

In 68545:

wxGUI: remove condition for wxpython3, native font dialog doesn't work with any version on Mac, see #3046

comment:8 Changed 3 years ago by cmbarton

Here are 2 wxWidget tickets for the problem. One suggests a possible workaround and the other suggests it may be fixed in the next version of wxPython.

http://trac.wxwidgets.org/ticket/13908

http://trac.wxwidgets.org/ticket/16643

Michael

comment:9 Changed 3 years ago by cmbarton

Custom font dialogs for Mac now work great in GRASS trunk r68543.

Thanks!

Michael

comment:10 Changed 3 years ago by annakrat

In 68548:

wxGUI: fix font dialogs on Mac, see #3046, merged from trunk r68532, r68535, r68545

comment:11 Changed 3 years ago by annakrat

In 68549:

wxGUI: fix font dialogs on Mac, see #3046, merged from trunk r68532, r68535, r68545

comment:12 Changed 3 years ago by annakrat

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.