From b5f0f94757c6adfe45ff94b884b8c5f461a8b4af Mon Sep 17 00:00:00 2001 From: LukasACH Date: Tue, 21 Mar 2023 15:27:49 +0100 Subject: [PATCH] LibGfx/OpenType: Do not preemptively return while searching for kerning The kerning value for a particular glyph may not be in the first table. Continue until we either run out of tables or we find an applicable value. --- Userland/Libraries/LibGfx/Font/OpenType/Font.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp index 03dced6323..8216a8a96a 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp +++ b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp @@ -1122,7 +1122,7 @@ Optional GPOS::glyph_kerning(u16 left_glyph_id, u16 right_glyph_id) const if (!coverage_index.has_value()) { dbgln_if(OPENTYPE_GPOS_DEBUG, "Glyph ID not covered by table"); - return {}; + continue; } size_t value1_size = popcount(static_cast(pair_pos_format1.value_format1 & 0xff)) * sizeof(u16); @@ -1202,7 +1202,7 @@ Optional GPOS::glyph_kerning(u16 left_glyph_id, u16 right_glyph_id) const if (!left_class.has_value() || !right_class.has_value()) { dbgln_if(OPENTYPE_GPOS_DEBUG, "Need glyph class for both sides"); - return {}; + continue; } dbgln_if(OPENTYPE_GPOS_DEBUG, "Classes: {}, {}", left_class.value(), right_class.value());