mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09: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:
parent
1567332e34
commit
286dc6df7f
Notes:
sideshowbarker
2024-07-17 01:12:07 +09:00
Author: https://github.com/ADKaster
Commit: 286dc6df7f
Pull-request: https://github.com/SerenityOS/serenity/pull/21493
2 changed files with 0 additions and 13 deletions
|
@ -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));
|
||||
|
|
|
@ -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&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue