Blame SOURCES/harfbuzz-0.9.20-fix-graphite2.patch

05cbd5
diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc
05cbd5
index a309ca8..709aa94 100644
05cbd5
--- a/src/hb-graphite2.cc
05cbd5
+++ b/src/hb-graphite2.cc
05cbd5
@@ -209,6 +209,7 @@ struct hb_graphite2_cluster_t {
05cbd5
   unsigned int num_chars;
05cbd5
   unsigned int base_glyph;
05cbd5
   unsigned int num_glyphs;
05cbd5
+  unsigned int cluster;
05cbd5
 };
05cbd5
 
05cbd5
 hb_bool_t
05cbd5
@@ -299,6 +300,7 @@ _hb_graphite2_shape (hb_shape_plan_t    *shape_plan,
05cbd5
   memset (clusters, 0, sizeof (clusters[0]) * buffer->len);
05cbd5
 
05cbd5
   hb_codepoint_t *pg = gids;
05cbd5
+  clusters[0].cluster = buffer->info[0].cluster;
05cbd5
   for (is = gr_seg_first_slot (seg), ic = 0; is; is = gr_slot_next_in_segment (is), ic++)
05cbd5
   {
05cbd5
     unsigned int before = gr_slot_before (is);
05cbd5
@@ -316,6 +318,7 @@ _hb_graphite2_shape (hb_shape_plan_t    *shape_plan,
05cbd5
     {
05cbd5
       hb_graphite2_cluster_t *c = clusters + ci + 1;
05cbd5
       c->base_char = clusters[ci].base_char + clusters[ci].num_chars;
05cbd5
+      c->cluster = buffer->info[c->base_char].cluster;
05cbd5
       c->num_chars = before - c->base_char;
05cbd5
       c->base_glyph = ic;
05cbd5
       c->num_glyphs = 0;
05cbd5
@@ -335,7 +338,7 @@ _hb_graphite2_shape (hb_shape_plan_t    *shape_plan,
05cbd5
     {
05cbd5
       hb_glyph_info_t *info = &buffer->info[clusters[i].base_glyph + j];
05cbd5
       info->codepoint = gids[clusters[i].base_glyph + j];
05cbd5
-      info->cluster = gr_cinfo_base(gr_seg_cinfo(seg, clusters[i].base_char));
05cbd5
+      info->cluster = clusters[i].cluster;
05cbd5
     }
05cbd5
   }
05cbd5
   buffer->len = glyph_count;