mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
LibTTF: Make load_from_file() take String instead of StringView
This commit is contained in:
parent
0528dc9b87
commit
36f27094d0
2 changed files with 3 additions and 3 deletions
|
@ -225,9 +225,9 @@ GlyphHorizontalMetrics Hmtx::get_glyph_horizontal_metrics(u32 glyph_id) const
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Font> Font::load_from_file(const StringView& path, unsigned index)
|
RefPtr<Font> Font::load_from_file(String path, unsigned index)
|
||||||
{
|
{
|
||||||
auto file_or_error = Core::File::open(String(path), Core::IODevice::ReadOnly);
|
auto file_or_error = Core::File::open(move(path), Core::IODevice::ReadOnly);
|
||||||
if (file_or_error.is_error()) {
|
if (file_or_error.is_error()) {
|
||||||
dbgln("Could not open file: {}", file_or_error.error());
|
dbgln("Could not open file: {}", file_or_error.error());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -66,7 +66,7 @@ class Font : public RefCounted<Font> {
|
||||||
AK_MAKE_NONCOPYABLE(Font);
|
AK_MAKE_NONCOPYABLE(Font);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static RefPtr<Font> load_from_file(const StringView& path, unsigned index = 0);
|
static RefPtr<Font> load_from_file(String path, unsigned index = 0);
|
||||||
static RefPtr<Font> load_from_memory(ByteBuffer&, unsigned index = 0);
|
static RefPtr<Font> load_from_memory(ByteBuffer&, unsigned index = 0);
|
||||||
|
|
||||||
ScaledFontMetrics metrics(float x_scale, float y_scale) const;
|
ScaledFontMetrics metrics(float x_scale, float y_scale) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue