From 0201e0a4649ad5b607e50bcb9605e7a5b7143812 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 17 Jul 2012 13:55:10 -0400 Subject: [PATCH] [Indic] Apply 'cfar' for Khmer Mark stuff after a pre-base reordering Ro 'cfar'. Used in Khmer. This allows distinguishing the following cases with MS Khmer fonts: U+1784,U+17D2,U+179A,U+17D2,U+1782 U+1784,U+17D2,U+1782,U+17D2,U+179A --- src/hb-ot-shape-complex-indic.cc | 16 ++++++++++++++-- .../south-east-asian/script-khmer/misc/misc.txt | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 18a3699..70068ae 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -154,6 +154,7 @@ indic_basic_features[] = {HB_TAG('h','a','l','f'), false}, {HB_TAG('a','b','v','f'), false}, {HB_TAG('p','s','t','f'), false}, + {HB_TAG('c','f','a','r'), false}, {HB_TAG('c','j','c','t'), false}, {HB_TAG('v','a','t','u'), true}, }; @@ -169,6 +170,7 @@ enum { HALF, ABVF, PSTF, + CFAR, CJCT, VATU }; @@ -547,8 +549,18 @@ initial_reordering_consonant_syllable (const hb_ot_map_t *map, hb_buffer_t *buff if (is_halant_or_coeng (info[i]) && info[i + 1].indic_category() == OT_Ra) { - info[i].mask |= basic_mask_array[PREF]; - info[i + 1].mask |= basic_mask_array[PREF]; + info[i++].mask |= basic_mask_array[PREF]; + info[i++].mask |= basic_mask_array[PREF]; + + /* Mark the subsequent stuff with 'cfar'. Used in Khmer. + * Read the feature spec. + * This allows distinguishing the following cases with MS Khmer fonts: + * U+1784,U+17D2,U+179A,U+17D2,U+1782 + * U+1784,U+17D2,U+1782,U+17D2,U+179A + */ + for (; i < end; i++) + info[i].mask |= basic_mask_array[CFAR]; + break; } } diff --git a/test/shaping/texts/in-tree/shaper-indic/south-east-asian/script-khmer/misc/misc.txt b/test/shaping/texts/in-tree/shaper-indic/south-east-asian/script-khmer/misc/misc.txt index 5a354b2..3396db3 100644 --- a/test/shaping/texts/in-tree/shaper-indic/south-east-asian/script-khmer/misc/misc.txt +++ b/test/shaping/texts/in-tree/shaper-indic/south-east-asian/script-khmer/misc/misc.txt @@ -10,3 +10,5 @@ រ្ឥ ងឹ្ឈ ង្ឈឹ +ង្គ្រ +ង្រ្គ -- 2.7.4