From a08a278b15c7e57a1d0a783f2bc877471b9d8229 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 21 Jul 2015 18:09:40 +0100 Subject: [PATCH] [USE] Don't compose split matras Same logic as in Indic shaper. --- src/hb-ot-shape-complex-use.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape-complex-use.cc b/src/hb-ot-shape-complex-use.cc index 379eec1bd..208da6209 100644 --- a/src/hb-ot-shape-complex-use.cc +++ b/src/hb-ot-shape-complex-use.cc @@ -462,6 +462,19 @@ reorder (const hb_ot_shape_plan_t *plan, HB_BUFFER_DEALLOCATE_VAR (buffer, use_category); } +static bool +compose_use (const hb_ot_shape_normalize_context_t *c, + hb_codepoint_t a, + hb_codepoint_t b, + hb_codepoint_t *ab) +{ + /* Avoid recomposing split matras. */ + if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (c->unicode->general_category (a))) + return false; + + return c->unicode->compose (a, b, ab); +} + const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use = { @@ -473,7 +486,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use = NULL, /* preprocess_text */ HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, NULL, /* decompose */ - NULL, /* compose */ + compose_use, setup_masks_use, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, false, /* fallback_position */