diff --git a/Userland/Applications/FontEditor/FontEditor.cpp b/Userland/Applications/FontEditor/FontEditor.cpp index cb1f712dfb..5887d93199 100644 --- a/Userland/Applications/FontEditor/FontEditor.cpp +++ b/Userland/Applications/FontEditor/FontEditor.cpp @@ -288,6 +288,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr&& m_type_combobox->on_change = [this](auto&, const auto& index) { m_edited_font->set_type(static_cast(index.row())); + m_glyph_map_widget->reprobe_font(); }; m_presentation_spinbox->on_change = [this, update_demo](int value) { diff --git a/Userland/Applications/FontEditor/GlyphMapWidget.cpp b/Userland/Applications/FontEditor/GlyphMapWidget.cpp index b115472718..c03302f93e 100644 --- a/Userland/Applications/FontEditor/GlyphMapWidget.cpp +++ b/Userland/Applications/FontEditor/GlyphMapWidget.cpp @@ -90,6 +90,14 @@ void GlyphMapWidget::update_glyph(int glyph) update(get_outer_rect(glyph)); } +void GlyphMapWidget::reprobe_font() +{ + VERIFY(m_font); + m_glyph_count = m_font->glyph_count(); + m_selected_glyph = 0; + update(); +} + void GlyphMapWidget::paint_event(GUI::PaintEvent& event) { GUI::Frame::paint_event(event); diff --git a/Userland/Applications/FontEditor/GlyphMapWidget.h b/Userland/Applications/FontEditor/GlyphMapWidget.h index 3c6a683c32..1fb2ccc5d3 100644 --- a/Userland/Applications/FontEditor/GlyphMapWidget.h +++ b/Userland/Applications/FontEditor/GlyphMapWidget.h @@ -47,6 +47,7 @@ public: const Gfx::BitmapFont& font() const { return *m_font; } void update_glyph(int); + void reprobe_font(); Function on_glyph_selected;