1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

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.
This commit is contained in:
LukasACH 2023-03-21 15:27:49 +01:00 committed by Andreas Kling
parent b6cfacfd9f
commit b5f0f94757

View file

@ -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());