LibGfx: Join ScaledFont into Font

Since ScaledFont is the only class inherited from Font we could simply
merge them.
This commit is contained in:
Aliaksandr Kalenik 2025-04-19 19:10:01 +02:00 committed by Andreas Kling
commit 8e2d1559ec
Notes: github-actions[bot] 2025-04-21 07:52:41 +00:00
18 changed files with 166 additions and 234 deletions

View file

@ -7,7 +7,7 @@
#define AK_DONT_REPLACE_STD
#include <AK/TypeCasts.h>
#include <LibGfx/Font/ScaledFont.h>
#include <LibGfx/Font/Font.h>
#include <LibGfx/PathSkia.h>
#include <LibGfx/Rect.h>
#include <LibGfx/SkiaUtils.h>
@ -137,11 +137,11 @@ void PathImplSkia::cubic_bezier_curve_to(FloatPoint c1, FloatPoint c2, FloatPoin
void PathImplSkia::text(Utf8View string, Font const& font)
{
SkTextUtils::GetPath(string.as_string().characters_without_null_termination(), string.as_string().length(), SkTextEncoding::kUTF8, last_point().x(), last_point().y(), as<ScaledFont>(font).skia_font(1), m_path.ptr());
SkTextUtils::GetPath(string.as_string().characters_without_null_termination(), string.as_string().length(), SkTextEncoding::kUTF8, last_point().x(), last_point().y(), font.skia_font(1), m_path.ptr());
}
NonnullOwnPtr<PathImpl> PathImplSkia::place_text_along(Utf8View text, Font const& font) const
{
auto sk_font = as<ScaledFont>(font).skia_font(1);
auto sk_font = font.skia_font(1);
size_t const text_length = text.length();
SkScalar x = 0;
SkScalar y = 0;