diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 591c7431d..ea2a68fcc 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -354,4 +354,5 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic = NULL, /* compose */ setup_masks_arabic, true, /* zero_width_attached_marks */ + true, /* fallback_position */ }; diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 1c7de0dab..130a632ef 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -1360,4 +1360,5 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_indic = compose_indic, setup_masks_indic, false, /* zero_width_attached_marks */ + false, /* fallback_position */ }; diff --git a/src/hb-ot-shape-complex-misc.cc b/src/hb-ot-shape-complex-misc.cc index a65de2f98..afe5f7064 100644 --- a/src/hb-ot-shape-complex-misc.cc +++ b/src/hb-ot-shape-complex-misc.cc @@ -221,6 +221,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default = compose_default, NULL, /* setup_masks */ true, /* zero_width_attached_marks */ + true, /* fallback_position */ }; @@ -334,4 +335,5 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai = NULL, /* compose */ NULL, /* setup_masks */ true, /* zero_width_attached_marks */ + false,/* fallback_position */ }; diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh index 7cc145267..d916f6345 100644 --- a/src/hb-ot-shape-complex-private.hh +++ b/src/hb-ot-shape-complex-private.hh @@ -131,6 +131,7 @@ struct hb_ot_complex_shaper_t hb_font_t *font); bool zero_width_attached_marks; + bool fallback_position; }; #define HB_COMPLEX_SHAPER_IMPLEMENT(name) extern HB_INTERNAL const hb_ot_complex_shaper_t _hb_ot_complex_shaper_##name; diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 634fe6fb2..ee0796e31 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -451,12 +451,6 @@ hb_ot_position_complex (hb_ot_shape_context_t *c) return ret; } -static inline void -hb_ot_position_complex_fallback (hb_ot_shape_context_t *c) -{ - _hb_ot_shape_fallback_position (c->plan, c->font, c->buffer); -} - static inline void hb_ot_truetype_kern (hb_ot_shape_context_t *c) { @@ -482,12 +476,6 @@ hb_ot_truetype_kern (hb_ot_shape_context_t *c) } } -static inline void -hb_position_complex_fallback_visual (hb_ot_shape_context_t *c) -{ - hb_ot_truetype_kern (c); -} - static inline void hb_ot_position (hb_ot_shape_context_t *c) { @@ -495,14 +483,16 @@ hb_ot_position (hb_ot_shape_context_t *c) hb_bool_t fallback = !hb_ot_position_complex (c); - if (fallback) - hb_ot_position_complex_fallback (c); + if (fallback && c->plan->shaper->fallback_position) + _hb_ot_shape_fallback_position (c->plan, c->font, c->buffer); if (HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction)) hb_buffer_reverse (c->buffer); + /* Visual fallback goes here. */ + if (fallback) - hb_position_complex_fallback_visual (c); + hb_ot_truetype_kern (c); }