mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
Ladybird: Load fonts via Core::Resource URIs instead of filesystem paths
This commit is contained in:
parent
e03357308c
commit
2e759656de
2 changed files with 5 additions and 5 deletions
|
@ -19,12 +19,9 @@ namespace Ladybird {
|
||||||
FontPlugin::FontPlugin(bool is_layout_test_mode)
|
FontPlugin::FontPlugin(bool is_layout_test_mode)
|
||||||
: m_is_layout_test_mode(is_layout_test_mode)
|
: m_is_layout_test_mode(is_layout_test_mode)
|
||||||
{
|
{
|
||||||
// Load the default SerenityOS fonts...
|
// Load anything we can find in the system's font directories
|
||||||
Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/res/fonts", s_serenity_resource_root));
|
|
||||||
|
|
||||||
// ...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())
|
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::the().load_all_fonts_from_uri(MUST(String::formatted("file://{}", path)));
|
||||||
|
|
||||||
Gfx::FontDatabase::set_default_font_query("Katica 10 400 0");
|
Gfx::FontDatabase::set_default_font_query("Katica 10 400 0");
|
||||||
Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0");
|
Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0");
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include <AK/LexicalPath.h>
|
#include <AK/LexicalPath.h>
|
||||||
#include <AK/Platform.h>
|
#include <AK/Platform.h>
|
||||||
|
#include <LibCore/ResourceImplementationFile.h>
|
||||||
#include <LibCore/System.h>
|
#include <LibCore/System.h>
|
||||||
#include <LibFileSystem/FileSystem.h>
|
#include <LibFileSystem/FileSystem.h>
|
||||||
|
|
||||||
|
@ -39,6 +40,8 @@ void platform_init()
|
||||||
return LexicalPath(app_dir).parent().append("share"sv).string();
|
return LexicalPath(app_dir).parent().append("share"sv).string();
|
||||||
#endif
|
#endif
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
Core::ResourceImplementation::install(make<Core::ResourceImplementationFile>(MUST(String::formatted("{}/res", s_serenity_resource_root))));
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<Vector<String>> get_paths_for_helper_process(StringView process_name)
|
ErrorOr<Vector<String>> get_paths_for_helper_process(StringView process_name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue