From d345313104d9e3c8a8533ccdebd74e0648d0bee3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 10 Aug 2012 16:34:04 -0400 Subject: [PATCH] [OT] Fix fallback mark positioning with left-to-right text Ouch! --- src/hb-ot-shape-fallback.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc index abc7e2bd..a6e5b163 100644 --- a/src/hb-ot-shape-fallback.cc +++ b/src/hb-ot-shape-fallback.cc @@ -242,6 +242,10 @@ position_around_base (const hb_ot_shape_plan_t *plan, HB_UNUSED bool is_ligature = is_a_ligature (buffer->info[base]); hb_position_t x_offset = 0, y_offset = 0; + if (HB_DIRECTION_IS_FORWARD (buffer->props.direction)) { + x_offset -= buffer->pos[base].x_advance; + y_offset -= buffer->pos[base].y_advance; + } unsigned int last_combining_class = 255; hb_glyph_extents_t cluster_extents; for (unsigned int i = base + 1; i < end; i++) @@ -262,8 +266,13 @@ position_around_base (const hb_ot_shape_plan_t *plan, last_combining_class = this_combining_class; } else { - x_offset -= buffer->pos[i].x_advance; - y_offset -= buffer->pos[i].y_advance; + if (HB_DIRECTION_IS_FORWARD (buffer->props.direction)) { + x_offset -= buffer->pos[i].x_advance; + y_offset -= buffer->pos[i].y_advance; + } else { + x_offset += buffer->pos[i].x_advance; + y_offset += buffer->pos[i].y_advance; + } } -- GitLab