1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:38:12 +00:00

Ladybird: Add a FontPlugin and try much harder to find suitable fonts

Instead of only looking at the SerenityOS default fonts, we now also
look recursively in /usr/share/fonts for suitable fonts that we can
load and use.
This commit is contained in:
Andreas Kling 2022-09-08 12:44:17 +02:00 committed by Andrew Kaster
parent 37d844fd66
commit 8a657eaa34
5 changed files with 129 additions and 6 deletions

View file

@ -11,6 +11,7 @@
#include "ConsoleClient.h"
#include "CookieJar.h"
#include "EventLoopPluginQt.h"
#include "FontPluginQt.h"
#include "RequestManagerQt.h"
#include <AK/Assertions.h>
#include <AK/ByteBuffer.h>
@ -830,12 +831,8 @@ void initialize_web_engine()
platform_init();
Web::FrameLoader::set_default_favicon_path(String::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root));
dbgln("Set favicon path to {}", String::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root));
Gfx::FontDatabase::set_default_fonts_lookup_path(String::formatted("{}/res/fonts", s_serenity_resource_root));
Gfx::FontDatabase::set_default_font_query("Katica 10 400 0");
Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0");
Web::Platform::FontPlugin::install(*new Ladybird::FontPluginQt);
Web::FrameLoader::set_error_page_url(String::formatted("file://{}/res/html/error.html", s_serenity_resource_root));
}