浏览代码

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 年之前
父节点
当前提交
627058cf24
共有 1 个文件被更改,包括 6 次插入1 次删除
  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,