1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

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
This commit is contained in:
Andrew Kaster 2023-10-17 12:47:29 -06:00 committed by Andrew Kaster
parent 1567332e34
commit 286dc6df7f
2 changed files with 0 additions and 13 deletions

View file

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

View file

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