diff options
author | LukasACH <git@lukasach.dev> | 2023-03-21 15:27:49 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-21 19:11:53 +0100 |
commit | b5f0f94757c6adfe45ff94b884b8c5f461a8b4af (patch) | |
tree | 672ddaef0cd496e646b1c0215b71fc04e35e34f9 | |
parent | b6cfacfd9f54335638cccdd4e4ddca5dcef15b94 (diff) | |
download | serenity-b5f0f94757c6adfe45ff94b884b8c5f461a8b4af.zip |
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.
-rw-r--r-- | Userland/Libraries/LibGfx/Font/OpenType/Font.cpp | 4 |
1 files 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<i16> 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<u32>(pair_pos_format1.value_format1 & 0xff)) * sizeof(u16); @@ -1202,7 +1202,7 @@ Optional<i16> 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()); |