1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:17:35 +00:00

FontEditor: Move new font creation to NewFontDialog and handle errors

Fixes potential OOM crashes when creating a new font and an oversight
in which glyph spacing was not being set.
This commit is contained in:
thankyouverycool 2022-07-30 07:34:04 -04:00 committed by Andreas Kling
parent 807bd6da6c
commit 407231f11c
3 changed files with 27 additions and 18 deletions

View file

@ -9,16 +9,13 @@
#include <LibGUI/Window.h>
#include <LibGUI/Wizards/WizardDialog.h>
#include <LibGUI/Wizards/WizardPage.h>
#include <LibGfx/Font/BitmapFont.h>
class NewFontDialog final : public GUI::WizardDialog {
C_OBJECT(NewFontDialog);
public:
auto new_font_metadata()
{
save_metadata();
return m_new_font_metadata;
}
ErrorOr<NonnullRefPtr<Gfx::BitmapFont>> create_font();
private:
NewFontDialog(GUI::Window* parent_window);