From 4de03a1585cf735e3ac09847af761ff85fca5a02 Mon Sep 17 00:00:00 2001 From: Martin Hosken Date: Fri, 10 Nov 2017 13:47:38 +0700 Subject: [PATCH] Fix graphite intergration reordered clusters problem --- src/hb-graphite2.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hb-graphite2.cc b/src/hb-graphite2.cc index 6f0598dd0..531c2ad6e 100644 --- a/src/hb-graphite2.cc +++ b/src/hb-graphite2.cc @@ -307,6 +307,8 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, curradv = gr_slot_origin_X(gr_seg_first_slot(seg)); clusters[0].advance = gr_seg_advance_X(seg) - curradv; } + else + clusters[0].advance = 0; for (is = gr_seg_first_slot (seg), ic = 0; is; is = gr_slot_next_in_segment (is), ic++) { unsigned int before = gr_slot_before (is); @@ -332,7 +334,10 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, if (HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) c->advance = curradv - gr_slot_origin_X(is); else - clusters[ci].advance = gr_slot_origin_X(is) - curradv; + { + c->advance = 0; + clusters[ci].advance += gr_slot_origin_X(is) - curradv; + } ci++; curradv = gr_slot_origin_X(is); } @@ -345,7 +350,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan, if (HB_DIRECTION_IS_BACKWARD(buffer->props.direction)) clusters[ci].advance += curradv; else - clusters[ci].advance = gr_seg_advance_X(seg) - curradv; + clusters[ci].advance += gr_seg_advance_X(seg) - curradv; ci++; for (unsigned int i = 0; i < ci; ++i)