diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index d1a7de1d1..c984da447 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -321,6 +321,19 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan, } } +static bool +is_deleted_glyph (const hb_glyph_info_t *info) +{ + return info->codepoint == AAT::DELETED_GLYPH && + _hb_glyph_info_is_default_ignorable (info); +} + +void +hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer) +{ + buffer->delete_glyphs_inplace (is_deleted_glyph); +} + /** * hb_aat_layout_has_positioning: * @face: #hb_face_t to work upon diff --git a/src/hb-aat-layout.hh b/src/hb-aat-layout.hh index c5d6ecb10..0e4ae6e7b 100644 --- a/src/hb-aat-layout.hh +++ b/src/hb-aat-layout.hh @@ -60,9 +60,6 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan, const hb_feature_t *features, unsigned num_features); -HB_INTERNAL void -hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer); - HB_INTERNAL void hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer); diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index e55221f69..6eecc1a10 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -956,11 +956,21 @@ hb_ot_substitute_pre (const hb_ot_shape_context_t *c) _hb_buffer_allocate_gsubgpos_vars (c->buffer); hb_ot_substitute_plan (c); + +#ifndef HB_NO_AAT_SHAPE + if (c->plan->apply_morx && c->plan->apply_gpos) + hb_aat_layout_remove_deleted_glyphs (c->buffer); +#endif } static inline void hb_ot_substitute_post (const hb_ot_shape_context_t *c) { +#ifndef HB_NO_AAT_SHAPE + if (c->plan->apply_morx && !c->plan->apply_gpos) + hb_aat_layout_remove_deleted_glyphs (c->buffer); +#endif + hb_ot_deal_with_variation_selectors (c->buffer); hb_ot_hide_default_ignorables (c->buffer, c->font); diff --git a/test/shape/data/in-house/tests/aat-morx.tests b/test/shape/data/in-house/tests/aat-morx.tests index b9ecd0d58..b1b5079e0 100644 --- a/test/shape/data/in-house/tests/aat-morx.tests +++ b/test/shape/data/in-house/tests/aat-morx.tests @@ -1,2 +1,2 @@ -../fonts/MORXTwentyeight.ttf;;U+0041,U+0078,U+0045,U+0079,U+0044,U+0079,U+0079;[A_E_D=0+1394|x=0+529|space=0+0|y=0+510|space=0+0|y=5+510|y=6+510] +../fonts/MORXTwentyeight.ttf;;U+0041,U+0078,U+0045,U+0079,U+0044,U+0079,U+0079;[A_E_D=0+1394|x=0+529|y=0+510|y=5+510|y=6+510] ../fonts/e6185e88b04432fbf373594d5971686bb7dd698d.ttf;;U+0B95,U+0BCD,U+0020,U+0B9A,U+0BCD;[ka-tamil=0+825|pulli-tamil=0@-392,0+0|space=2+260|ca-tamil=3+723|pulli-tamil=3@-320,0+0]