From 74707d151bafa37094979df81760f3baa25aab40 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 3 Oct 2023 15:41:48 -0600 Subject: [PATCH] pdf: Load fonts in debug mode via Core::Resource URIs --- Userland/Utilities/pdf.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Utilities/pdf.cpp b/Userland/Utilities/pdf.cpp index 65ffe449ea..422e18356f 100644 --- a/Userland/Utilities/pdf.cpp +++ b/Userland/Utilities/pdf.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include @@ -186,8 +188,8 @@ static PDF::PDFErrorOr pdf_main(Main::Arguments arguments) #if !defined(AK_OS_SERENITY) if (debugging_stats || !render_path.is_empty()) { // Get from Build/lagom/bin/pdf to Base/res/fonts. - auto source_root = LexicalPath(arguments.argv[0]).parent().parent().parent().parent().string(); - Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root)); + auto source_root = LexicalPath(MUST(Core::System::current_executable_path()).to_deprecated_string()).parent().parent().parent().parent().string(); + Core::ResourceImplementation::install(make(TRY(String::formatted("{}/Base/res", source_root)))); } #endif