[arabic-fallback] Add the component loop

Should be able to support 3-letter ligatures now.  Hooking up next.
This commit is contained in:
Behdad Esfahbod 2022-06-18 14:12:30 -06:00
parent 9684d2d8aa
commit 20e9f0b1d2
1 changed files with 9 additions and 6 deletions

View File

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