1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:37:35 +00:00

LibGfx+Utilities: Add helpers to load vector fonts from Core::Resources

This commit is contained in:
Andrew Kaster 2023-10-18 14:12:42 -06:00 committed by Andrew Kaster
parent 286dc6df7f
commit 86ce502ae2
8 changed files with 19 additions and 21 deletions

View file

@ -21,7 +21,7 @@ class Font : public Gfx::VectorFont {
AK_MAKE_NONCOPYABLE(Font);
public:
static ErrorOr<NonnullRefPtr<Font>> try_load_from_file(DeprecatedString path, unsigned index = 0);
static ErrorOr<NonnullRefPtr<Font>> try_load_from_resource(Core::Resource const&, unsigned index = 0);
static ErrorOr<NonnullRefPtr<Font>> try_load_from_externally_owned_memory(ReadonlyBytes bytes, unsigned index = 0);
virtual Gfx::ScaledFontMetrics metrics(float x_scale, float y_scale) const override { return m_input_font->metrics(x_scale, y_scale); }