From ae82bf5f7ab396a46e9befb39175ecfd2d0c223c Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Tue, 3 Sep 2024 22:09:32 +0200 Subject: [PATCH] LibGfx/Font: Use harfbuzz in ScaledFont::glyph_width() --- Userland/Libraries/LibGfx/Font/ScaledFont.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGfx/Font/ScaledFont.cpp b/Userland/Libraries/LibGfx/Font/ScaledFont.cpp index b6c74fa70ff..e0ffb90f11e 100644 --- a/Userland/Libraries/LibGfx/Font/ScaledFont.cpp +++ b/Userland/Libraries/LibGfx/Font/ScaledFont.cpp @@ -40,8 +40,8 @@ float ScaledFont::width(Utf8View const& view) const { return measure_text_width( float ScaledFont::glyph_width(u32 code_point) const { - auto id = glyph_id_for_code_point(code_point); - return m_typeface->glyph_advance(id, m_x_scale, m_y_scale, m_point_width, m_point_height); + auto string = String::from_code_point(code_point); + return measure_text_width(Utf8View(string), *this); } template