From 4c450c703f8e4618c587bcd7ef46dcc1f2c7947b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 20 Jul 2012 18:13:04 -0400 Subject: [PATCH] [Indic] Recompose Bengali Ya,Nukta This is a bunch of hacks for now. Improves Bengali a bit. --- src/hb-ot-shape-complex-indic.cc | 4 ++-- src/hb-unicode.cc | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 0316691f..b5ad4ae1 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -407,7 +407,8 @@ hb_ot_shape_normalization_mode_t _hb_ot_shape_complex_normalization_preference_indic (void) { /* We want split matras decomposed by the common shaping logic. */ - return HB_OT_SHAPE_NORMALIZATION_MODE_DECOMPOSED; + /* XXX sort this out after adding per-shaper normalizers. */ + return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS; } @@ -549,7 +550,6 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff if (base < start) base = start; /* Just in case... */ - /* -> If the syllable starts with Ra + Halant (in a script that has Reph) * and has more than one consonant, Ra is excluded from candidates for * base consonants. */ diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc index c5273400..140f3828 100644 --- a/src/hb-unicode.cc +++ b/src/hb-unicode.cc @@ -258,6 +258,14 @@ hb_unicode_compose (hb_unicode_funcs_t *ufuncs, hb_codepoint_t *ab) { *ab = 0; + /* XXX, this belongs to indic normalizer. */ + if ((FLAG (hb_unicode_general_category (ufuncs, a)) & + (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | + FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | + FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))) + return false; + /* XXX, add composition-exclusion exceptions to Indic shaper. */ + if (a == 0x09AF && b == 0x09BC) { *ab = 0x09DF; return true; } return ufuncs->func.compose (ufuncs, a, b, ab, ufuncs->user_data.compose); } -- GitLab