mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibGfx: Remove the ability to load fonts from a path directly
This commit is contained in:
parent
4d039b05b2
commit
21d027129d
Notes:
sideshowbarker
2024-07-17 02:55:44 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/21d027129d Pull-request: https://github.com/SerenityOS/serenity/pull/21302 Reviewed-by: https://github.com/kleinesfilmroellchen Reviewed-by: https://github.com/trflynn89
@ -33,8 +33,6 @@ static DeprecatedString s_window_title_font_query;
|
||||
static RefPtr<Font> s_fixed_width_font;
|
||||
static DeprecatedString s_fixed_width_font_query;
|
||||
|
||||
static DeprecatedString s_default_fonts_lookup_path = "/res/fonts";
|
||||
|
||||
void FontDatabase::set_default_font_query(DeprecatedString query)
|
||||
{
|
||||
if (s_default_font_query == query)
|
||||
@ -61,18 +59,6 @@ DeprecatedString FontDatabase::window_title_font_query()
|
||||
return s_window_title_font_query;
|
||||
}
|
||||
|
||||
void FontDatabase::set_default_fonts_lookup_path(DeprecatedString path)
|
||||
{
|
||||
if (s_default_fonts_lookup_path == path)
|
||||
return;
|
||||
s_default_fonts_lookup_path = move(path);
|
||||
}
|
||||
|
||||
DeprecatedString FontDatabase::default_fonts_lookup_path()
|
||||
{
|
||||
return s_default_fonts_lookup_path;
|
||||
}
|
||||
|
||||
Font& FontDatabase::default_font()
|
||||
{
|
||||
if (!s_default_font) {
|
||||
@ -121,11 +107,6 @@ struct FontDatabase::Private {
|
||||
HashMap<FlyString, Vector<NonnullRefPtr<Typeface>>, AK::ASCIICaseInsensitiveFlyStringTraits> typefaces;
|
||||
};
|
||||
|
||||
void FontDatabase::load_all_fonts_from_path(DeprecatedString const& path)
|
||||
{
|
||||
load_all_fonts_from_uri(MUST(String::formatted("file://{}", path)));
|
||||
}
|
||||
|
||||
void FontDatabase::load_all_fonts_from_uri(StringView uri)
|
||||
{
|
||||
auto root_or_error = Core::Resource::load_from_uri(uri);
|
||||
@ -168,7 +149,6 @@ FontDatabase::FontDatabase()
|
||||
: m_private(make<Private>())
|
||||
{
|
||||
load_all_fonts_from_uri("resource://fonts"sv);
|
||||
load_all_fonts_from_path(s_default_fonts_lookup_path);
|
||||
}
|
||||
|
||||
void FontDatabase::for_each_font(Function<void(Gfx::Font const&)> callback)
|
||||
|
@ -47,7 +47,6 @@ public:
|
||||
static void set_default_font_query(DeprecatedString);
|
||||
static void set_window_title_font_query(DeprecatedString);
|
||||
static void set_fixed_width_font_query(DeprecatedString);
|
||||
static void set_default_fonts_lookup_path(DeprecatedString);
|
||||
|
||||
RefPtr<Gfx::Font> get(FlyString const& family, float point_size, unsigned weight, unsigned width, unsigned slope, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
||||
RefPtr<Gfx::Font> get(FlyString const& family, FlyString const& variant, float point_size, Font::AllowInexactSizeMatch = Font::AllowInexactSizeMatch::No);
|
||||
@ -58,7 +57,6 @@ public:
|
||||
void for_each_typeface(Function<void(Typeface const&)>);
|
||||
void for_each_typeface_with_family_name(FlyString const& family_name, Function<void(Typeface const&)>);
|
||||
|
||||
void load_all_fonts_from_path(DeprecatedString const&);
|
||||
void load_all_fonts_from_uri(StringView);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user