diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-02-13 18:05:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-13 18:05:54 +0100 |
| commit | 942af5acb48cc2010c1280f72cc314f074fd8b11 (patch) | |
| tree | b6b476f23ba42173775c0ee0de2dd55c65846a0e /lib/gui/edit_json/main_panel.py | |
| parent | a1badc255b19cdf83ee951207f1cc91787e2ca54 (diff) | |
fix a bug in lettering extensions when the last_font can't be found (#3508)
Diffstat (limited to 'lib/gui/edit_json/main_panel.py')
| -rw-r--r-- | lib/gui/edit_json/main_panel.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gui/edit_json/main_panel.py b/lib/gui/edit_json/main_panel.py index 895baef4..fd0d08d9 100644 --- a/lib/gui/edit_json/main_panel.py +++ b/lib/gui/edit_json/main_panel.py @@ -230,7 +230,13 @@ class LetteringEditJsonPanel(wx.Panel): return glyph def on_font_changed(self, event=None): - self.font = self.fonts.get(self.settings_panel.font_chooser.GetValue(), list(self.fonts.values())[0].marked_custom_font_name) + selected_font = self.settings_panel.font_chooser.GetValue() + if selected_font: + self.font = self.fonts[selected_font] + else: + first = list(self.fonts.values())[0].marked_custom_font_name + self.font = self.fonts[first] + self.settings_panel.font_chooser.SetValue(first) global_settings['last_font'] = self.font.marked_custom_font_name self.kerning_pairs = self.font.kerning_pairs self.font._load_variants() |
