From 20e9f0b1d2efe86b632dcfda067244c578c0e20f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 18 Jun 2022 14:12:30 -0600 Subject: [PATCH] [arabic-fallback] Add the component loop Should be able to support 3-letter ligatures now. Hooking up next. --- src/hb-ot-shaper-arabic-fallback.hh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-shaper-arabic-fallback.hh b/src/hb-ot-shaper-arabic-fallback.hh index 8c513be78..8c7d187e0 100644 --- a/src/hb-ot-shaper-arabic-fallback.hh +++ b/src/hb-ot-shaper-arabic-fallback.hh @@ -153,13 +153,16 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN const auto &components = ligature_table[first_glyph_idx].ligatures[ligature_idx].components; unsigned component_count = ARRAY_LENGTH_CONST (components); - hb_codepoint_t component_u = ligature_table[first_glyph_idx].ligatures[ligature_idx].components[0]; - hb_codepoint_t component_glyph; - if (!component_u || - !hb_font_get_glyph (font, component_u, 0, &component_glyph)) - continue; + for (unsigned i = 0; i < component_count; i++) + { + hb_codepoint_t component_u = ligature_table[first_glyph_idx].ligatures[ligature_idx].components[i]; + hb_codepoint_t component_glyph; + if (!component_u || + !hb_font_get_glyph (font, component_u, 0, &component_glyph)) + continue; - component_list[num_components++] = component_glyph; + component_list[num_components++] = component_glyph; + } component_count_list[num_ligatures] = 1 + component_count; ligature_list[num_ligatures] = ligature_glyph;