From 6d260b14b41459c38f9ec6394c9ae639a4cb5aa8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 29 Mar 2022 21:06:51 +0200 Subject: [PATCH] LibGfx: Rasterize TTF glyphs using "hhea" metrics instead of "os2" This matches what other font systems appear to do. --- Userland/Libraries/LibGfx/TrueTypeFont/Font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/TrueTypeFont/Font.cpp b/Userland/Libraries/LibGfx/TrueTypeFont/Font.cpp index cc4bf48a85..3f48d8b0c8 100644 --- a/Userland/Libraries/LibGfx/TrueTypeFont/Font.cpp +++ b/Userland/Libraries/LibGfx/TrueTypeFont/Font.cpp @@ -573,7 +573,7 @@ RefPtr Font::rasterize_glyph(u32 glyph_id, float x_scale, float y_s } auto glyph_offset = m_loca.get_glyph_offset(glyph_id); auto glyph = m_glyf.glyph(glyph_offset); - return glyph.rasterize(m_os2.typographic_ascender(), m_os2.typographic_descender(), x_scale, y_scale, [&](u16 glyph_id) { + return glyph.rasterize(m_hhea.ascender(), m_hhea.descender(), x_scale, y_scale, [&](u16 glyph_id) { if (glyph_id >= glyph_count()) { glyph_id = 0; }