提交 ee8aaf97 编写于 作者: B Behdad Esfahbod

Fix arabic shaping of LTR text

We should ensure-direction before doing any complex work.  The only
exception is mirroring that needs to see the original / final direction,
not the native.  Handle that.
上级 d1f1707a
...@@ -193,7 +193,7 @@ hb_mirror_chars (hb_ot_shape_context_t *c) ...@@ -193,7 +193,7 @@ hb_mirror_chars (hb_ot_shape_context_t *c)
{ {
hb_unicode_get_mirroring_func_t get_mirroring = c->buffer->unicode->v.get_mirroring; hb_unicode_get_mirroring_func_t get_mirroring = c->buffer->unicode->v.get_mirroring;
if (HB_DIRECTION_IS_FORWARD (c->buffer->props.direction)) if (HB_DIRECTION_IS_FORWARD (c->original_direction))
return; return;
hb_mask_t rtlm_mask = c->plan->map.get_1_mask (HB_TAG ('r','t','l','m')); hb_mask_t rtlm_mask = c->plan->map.get_1_mask (HB_TAG ('r','t','l','m'));
...@@ -300,6 +300,8 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c) ...@@ -300,6 +300,8 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c)
hb_set_unicode_props (c); /* BUFFER: Set general_category and combining_class in var1 */ hb_set_unicode_props (c); /* BUFFER: Set general_category and combining_class in var1 */
hb_ensure_native_direction (c);
hb_form_clusters (c); hb_form_clusters (c);
hb_ot_shape_setup_masks (c); /* BUFFER: Clobbers var2 */ hb_ot_shape_setup_masks (c); /* BUFFER: Clobbers var2 */
...@@ -309,8 +311,6 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c) ...@@ -309,8 +311,6 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c)
/* Mirroring needs to see the original direction */ /* Mirroring needs to see the original direction */
hb_mirror_chars (c); hb_mirror_chars (c);
hb_ensure_native_direction (c);
hb_substitute_default (c); hb_substitute_default (c);
hb_ot_substitute_complex (c); hb_ot_substitute_complex (c);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册