[GRASS-dev] [GRASS GIS] #3046: Cannot set display font

#3046: Cannot set display font
--------------------------+-------------------------
Reporter: cmbarton | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Keywords: display font | CPU: Unspecified
Platform: MacOSX |
--------------------------+-------------------------
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)

}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (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). But that font is not used
in the display--only the old GRASS default font. I can even see
"Helvetica" in the wx file and it seems OK. But it is not recognized.

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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (by annakrat):

I fixed the display font in r68532. The crashing of the native font dialog
for console font is probably related to
[http://trac.wxwidgets.org/ticket/17020?cversion=0&cnum_hist=6 this bug]
and might be [http://trac.wxwidgets.org/changeset/78071/svn-wx fixed]
already, but there is no new release of wxPython. So I guess we will have
to use the custom font dialog.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (by annakrat):

In [changeset:"68535" 68535]:
{{{
#!CommitTicketReference repository="" revision="68535"
wxGUI: use custom font dialog for output font on Mac, see #3046
}}}

--
Ticket URL: </ticket/3046#comment:4>
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (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?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (by annakrat):

Replying to [comment:5 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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/3046#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (by annakrat):

In [changeset:"68545" 68545]:
{{{
#!CommitTicketReference repository="" revision="68545"
wxGUI: remove condition for wxpython3, native font dialog doesn't work
with any version on Mac, see #3046
}}}

--
Ticket URL: </ticket/3046#comment:7>
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (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

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (by cmbarton):

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

Thanks!

Michael

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046#comment:9&gt;
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (by annakrat):

In [changeset:"68548" 68548]:
{{{
#!CommitTicketReference repository="" revision="68548"
wxGUI: fix font dialogs on Mac, see #3046, merged from trunk r68532,
r68535, r68545
}}}

--
Ticket URL: </ticket/3046#comment:10>
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------

Comment (by annakrat):

In [changeset:"68549" 68549]:
{{{
#!CommitTicketReference repository="" revision="68549"
wxGUI: fix font dialogs on Mac, see #3046, merged from trunk r68532,
r68535, r68545
}}}

--
Ticket URL: </ticket/3046#comment:11>
GRASS GIS <https://grass.osgeo.org>

#3046: Cannot set display font
--------------------------+--------------------------
  Reporter: cmbarton | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.5
Component: wxGUI | Version: 7.0.4
Resolution: fixed | Keywords: display font
       CPU: Unspecified | Platform: MacOSX
--------------------------+--------------------------
Changes (by annakrat):

* status: new => closed
* resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3046#comment:12&gt;
GRASS GIS <https://grass.osgeo.org>