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

FontEditor: Improve error handling opening, saving and editing fonts

Adds fallible functions for opening and saving fonts and cutting
and copying selections. FontEditor now falls back on a guaranteed
default BitmapFont on startup. Fixes crashing on start when the
default system font is set to TrueType.
This commit is contained in:
thankyouverycool 2022-07-30 07:30:30 -04:00 committed by Andreas Kling
parent e9a150c87c
commit 807bd6da6c
3 changed files with 35 additions and 40 deletions

View file

@ -37,8 +37,8 @@ public:
ErrorOr<void> initialize(String const& path, RefPtr<Gfx::BitmapFont>&&);
ErrorOr<void> initialize_menubar(GUI::Window&);
bool open_file(String const&);
bool save_file(String const&);
ErrorOr<void> open_file(String const&);
ErrorOr<void> save_file(String const&);
bool request_close();
void update_title();
@ -70,8 +70,8 @@ private:
void set_scale(i32);
void set_scale_and_save(i32);
void copy_selected_glyphs();
void cut_selected_glyphs();
ErrorOr<void> copy_selected_glyphs();
ErrorOr<void> cut_selected_glyphs();
void paste_glyphs();
void delete_selected_glyphs();