diff --git a/Ladybird/FontPluginQt.cpp b/Ladybird/FontPluginQt.cpp index da45b3198a2..e6babcbe39b 100644 --- a/Ladybird/FontPluginQt.cpp +++ b/Ladybird/FontPluginQt.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2022, Andreas Kling + * Copyright (c) 2023, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ @@ -8,6 +9,8 @@ #include "FontPluginQt.h" #include +#include +#include #include #include #include @@ -21,8 +24,9 @@ FontPluginQt::FontPluginQt() // Load the default SerenityOS fonts... Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/res/fonts", s_serenity_resource_root)); - // ...and also anything we can find in /usr/share/fonts - Gfx::FontDatabase::the().load_all_fonts_from_path("/usr/share/fonts"); + // ...and also anything we can find in the system's font directories + for (auto const& path : Core::StandardPaths::font_directories().release_value_but_fixme_should_propagate_errors()) + Gfx::FontDatabase::the().load_all_fonts_from_path(path.to_deprecated_string()); Gfx::FontDatabase::set_default_font_query("Katica 10 400 0"); Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0");