LibGfx: Remove the ability to load fonts from a path directly

This commit is contained in:
Andrew Kaster 2023-10-03 15:46:15 -06:00 committed by Andrew Kaster
parent 4d039b05b2
commit 21d027129d
Notes: sideshowbarker 2024-07-17 02:55:44 +09:00
2 changed files with 0 additions and 22 deletions

View File

@ -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)

View File

@ -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: