Преглед изворни кода

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

Users must now either pass a Core::Resource, a resource:// URI, or
a Core::MappedFile
Andrew Kaster пре 1 година
родитељ
комит
286dc6df7f

+ 0 - 11
Userland/Libraries/LibGfx/Font/BitmapFont.cpp

@@ -250,17 +250,6 @@ ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::try_load_from_uri(StringView uri)
     return try_load_from_resource(TRY(Core::Resource::load_from_uri(uri)));
 }
 
-RefPtr<BitmapFont> BitmapFont::load_from_file(DeprecatedString const& path)
-{
-    return MUST(try_load_from_file(move(path)));
-}
-
-ErrorOr<NonnullRefPtr<BitmapFont>> BitmapFont::try_load_from_file(DeprecatedString const& path)
-{
-    auto mapped_file = TRY(Core::MappedFile::map(path));
-    return try_load_from_mapped_file(move(mapped_file));
-}
-
 ErrorOr<void> BitmapFont::write_to_file(DeprecatedString const& path)
 {
     auto stream = TRY(Core::File::open(path, Core::File::OpenMode::Write));

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

@@ -31,10 +31,8 @@ public:
     ErrorOr<NonnullRefPtr<BitmapFont>> unmasked_character_set() const;
 
     static NonnullRefPtr<BitmapFont> load_from_uri(StringView);
-    static RefPtr<BitmapFont> load_from_file(DeprecatedString const& path);
     static ErrorOr<NonnullRefPtr<BitmapFont>> try_load_from_uri(StringView);
     static ErrorOr<NonnullRefPtr<BitmapFont>> try_load_from_resource(NonnullRefPtr<Core::Resource>);
-    static ErrorOr<NonnullRefPtr<BitmapFont>> try_load_from_file(DeprecatedString const& path);
     static ErrorOr<NonnullRefPtr<BitmapFont>> try_load_from_mapped_file(NonnullOwnPtr<Core::MappedFile>);
     static ErrorOr<NonnullRefPtr<BitmapFont>> try_load_from_stream(FixedMemoryStream&);