[arabic-fallback] More baby steps

pull/3063/head
Behdad Esfahbod 3 years ago
parent 08715d75e0
commit 9684d2d8aa
  1. 16
      src/hb-ot-shaper-arabic-fallback.hh

@ -118,6 +118,7 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN
OT::HBGlyphID16 component_list[ARRAY_LENGTH_CONST (ligature_list) * OT::HBGlyphID16 component_list[ARRAY_LENGTH_CONST (ligature_list) *
ARRAY_LENGTH_CONST (ligature_table[0].ligatures[0].components)]; ARRAY_LENGTH_CONST (ligature_table[0].ligatures[0].components)];
unsigned int num_ligatures = 0; unsigned int num_ligatures = 0;
unsigned int num_components = 0;
/* Populate arrays */ /* Populate arrays */
@ -149,15 +150,18 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN
if (!hb_font_get_glyph (font, ligature_u, 0, &ligature_glyph)) if (!hb_font_get_glyph (font, ligature_u, 0, &ligature_glyph))
continue; continue;
hb_codepoint_t second_u = ligature_table[first_glyph_idx].ligatures[ligature_idx].components[0]; const auto &components = ligature_table[first_glyph_idx].ligatures[ligature_idx].components;
hb_codepoint_t second_glyph; unsigned component_count = ARRAY_LENGTH_CONST (components);
if (!second_u ||
!hb_font_get_glyph (font, second_u, 0, &second_glyph)) 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; continue;
component_list[num_ligatures] = second_glyph; component_list[num_components++] = component_glyph;
component_count_list[num_ligatures] = 2;
component_count_list[num_ligatures] = 1 + component_count;
ligature_list[num_ligatures] = ligature_glyph; ligature_list[num_ligatures] = ligature_glyph;
ligature_per_first_glyph_count_list[i]++; ligature_per_first_glyph_count_list[i]++;

Loading…
Cancel
Save