mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 17:00:35 +03:00
Ladybird: Use Core::Resource to locate the emoji lookup path
The path we were using is no longer correct, and we've been silently dropping this error. Use Core::Resource instead, which we use for most other Ladybird resources. This would have made it much more obvious that emoji were not installed with the application.
This commit is contained in:
parent
7463b31754
commit
8af140fd7b
Notes:
sideshowbarker
2024-07-17 06:51:40 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/8af140fd7b Pull-request: https://github.com/SerenityOS/serenity/pull/23643 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/nico
@ -8,12 +8,11 @@
|
||||
#include "FontPlugin.h"
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/Resource.h>
|
||||
#include <LibCore/StandardPaths.h>
|
||||
#include <LibGfx/Font/Emoji.h>
|
||||
#include <LibGfx/Font/FontDatabase.h>
|
||||
|
||||
extern ByteString s_serenity_resource_root;
|
||||
|
||||
namespace Ladybird {
|
||||
|
||||
FontPlugin::FontPlugin(bool is_layout_test_mode)
|
||||
@ -26,7 +25,10 @@ FontPlugin::FontPlugin(bool is_layout_test_mode)
|
||||
Gfx::FontDatabase::set_default_font_query("Katica 10 400 0");
|
||||
Gfx::FontDatabase::set_fixed_width_font_query("Csilla 10 400 0");
|
||||
|
||||
Gfx::Emoji::set_emoji_lookup_path(String::formatted("{}/res/emoji", s_serenity_resource_root).release_value_but_fixme_should_propagate_errors());
|
||||
auto emoji_path = MUST(Core::Resource::load_from_uri("resource://emoji"sv));
|
||||
VERIFY(emoji_path->is_directory());
|
||||
|
||||
Gfx::Emoji::set_emoji_lookup_path(emoji_path->filesystem_path());
|
||||
|
||||
update_generic_fonts();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user