Kaynağa Gözat

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

Andrew Kaster 1 yıl önce
ebeveyn
işleme
21d027129d

+ 0 - 20
Userland/Libraries/LibGfx/Font/FontDatabase.cpp

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

+ 0 - 2
Userland/Libraries/LibGfx/Font/FontDatabase.h

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