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

LibGfx: Remove static load_from_file() from abstract Font class

This commit is contained in:
Stephan Unverwerth 2021-01-03 17:36:04 +01:00 committed by Andreas Kling
parent 79dfe9846d
commit b8c25bc7ff
6 changed files with 4 additions and 47 deletions

View file

@ -79,7 +79,7 @@ int main(int argc, char** argv)
path = "/tmp/saved.font";
edited_font = static_ptr_cast<Gfx::BitmapFont>(Gfx::FontDatabase::default_font().clone());
} else {
edited_font = static_ptr_cast<Gfx::BitmapFont>(Gfx::Font::load_from_file(path)->clone());
edited_font = static_ptr_cast<Gfx::BitmapFont>(Gfx::BitmapFont::load_from_file(path)->clone());
if (!edited_font) {
String message = String::formatted("Couldn't load font: {}\n", path);
GUI::MessageBox::show(nullptr, message, "Font Editor", GUI::MessageBox::Type::Error);
@ -111,7 +111,7 @@ int main(int argc, char** argv)
if (!open_path.has_value())
return;
RefPtr<Gfx::BitmapFont> new_font = static_ptr_cast<Gfx::BitmapFont>(Gfx::Font::load_from_file(open_path.value())->clone());
RefPtr<Gfx::BitmapFont> new_font = static_ptr_cast<Gfx::BitmapFont>(Gfx::BitmapFont::load_from_file(open_path.value())->clone());
if (!new_font) {
String message = String::formatted("Couldn't load font: {}\n", open_path.value());
GUI::MessageBox::show(window, message, "Font Editor", GUI::MessageBox::Type::Error);