LibGUI: Skip non-font files in the FontDatabase constructor

This commit is contained in:
Tibor Nagy 2020-03-11 18:13:46 +01:00 committed by Andreas Kling
parent 8d54e4e012
commit cebf6a7039
Notes: sideshowbarker 2024-07-19 08:46:19 +09:00

View File

@ -52,6 +52,9 @@ FontDatabase::FontDatabase()
}
while (di.has_next()) {
String name = di.next_path();
if (!name.ends_with(".font"))
continue;
auto path = String::format("/res/fonts/%s", name.characters());
if (auto font = Gfx::Font::load_from_file(path)) {
Metadata metadata;