Browse Source

wxGUI: show the font dialog even when the font from settings is not recognized (fixes traceback)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70469 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 8 năm trước cách đây
mục cha
commit
627058cf24
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      gui/wxpython/gui_core/dialogs.py

+ 6 - 1
gui/wxpython/gui_core/dialogs.py

@@ -2484,7 +2484,12 @@ class DefaultFontDialog(wx.Dialog):
             return
 
         if self.font:
-            self.fontlb.SetStringSelection(fontdict_reverse[self.font], True)
+            long_name = fontdict_reverse.get(self.font, None)
+            if long_name:
+                self.fontlb.SetStringSelection(long_name, True)
+            else:
+                # font is not in the list of GRASS recognized fonts
+                self.font = None
 
         gridSizer.AddGrowableCol(0)
         sizer.Add(gridSizer, proportion=1,