LibCore+LibGfx: Move font_directories from LibCore to LibGfx

the goal is to rely on fontconfig for font directory resolution. it
doesn't seem like it would be appropritate to call to fontconfig funcs
from within the LibCore.

i'm not 100% confident that FontDatabase is the correct place.. seems
okay?
This commit is contained in:
blukai 2025-05-21 02:40:06 +02:00 committed by Andrew Kaster
commit 4b3691ff39
Notes: github-actions[bot] 2025-05-26 18:15:38 +00:00
5 changed files with 53 additions and 51 deletions

View file

@ -36,7 +36,7 @@ FontPlugin::FontPlugin(bool is_layout_test_mode, Gfx::SystemFontProvider* font_p
if (is<Gfx::PathFontProvider>(*font_provider)) {
auto& path_font_provider = static_cast<Gfx::PathFontProvider&>(*font_provider);
// Load 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())
for (auto const& path : Gfx::FontDatabase::font_directories().release_value_but_fixme_should_propagate_errors())
path_font_provider.load_all_fonts_from_uri(MUST(String::formatted("file://{}", path)));
}