From 42848453bf260b456b46a07f066e31b8c3aac2f1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 23 Jul 2012 13:52:07 -0400 Subject: [PATCH] [Thai] Reorder U+0E3A THAI VOWEL SIGN PHINTHU Uniscribe reorders U+0E3A to be after U+0E38 and U+0E39. We do that by modifying the ccc for U+0E3A. Fixes the two remaining Thai failures (see previous commit). --- src/hb-ot-shape-complex-misc.cc | 7 +++++++ src/hb-unicode.cc | 6 ++++++ .../texts/in-tree/shaper-thai/script-thai/misc/MANIFEST | 1 + .../in-tree/shaper-thai/script-thai/misc/phinthu.txt | 16 ++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 test/shaping/texts/in-tree/shaper-thai/script-thai/misc/phinthu.txt diff --git a/src/hb-ot-shape-complex-misc.cc b/src/hb-ot-shape-complex-misc.cc index 17e2625..6852d47 100644 --- a/src/hb-ot-shape-complex-misc.cc +++ b/src/hb-ot-shape-complex-misc.cc @@ -132,6 +132,13 @@ _hb_ot_shape_complex_setup_masks_thai (hb_ot_map_t *map HB_UNUSED, * chattawa. * * Same for Lao. + * + * Note: + * + * Uniscribe also does so below-marks reordering. Namely, it positions U+0E3A + * after U+0E38 and U+0E39. We do that by modifying the ccc for U+0E3A. + * See _hb_unicode_modified_combining_class (). Lao does NOT have a U+0E3A + * equivalent. */ diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc index 140f382..3569b20 100644 --- a/src/hb-unicode.cc +++ b/src/hb-unicode.cc @@ -363,6 +363,12 @@ _hb_unicode_modified_combining_class (hb_unicode_funcs_t *ufuncs, }; c = permuted_hebrew_classes[c - 10]; } + else if (unlikely (unicode == 0x0E3A)) /* THAI VOWEL SIGN PHINTHU */ + { + /* Assign 104, so it reorders after the THAI ccc=103 marks. + * Uniscribe does this. */ + c = 104; + } return c; } diff --git a/test/shaping/texts/in-tree/shaper-thai/script-thai/misc/MANIFEST b/test/shaping/texts/in-tree/shaper-thai/script-thai/misc/MANIFEST index ffd16f1..6aa865b 100644 --- a/test/shaping/texts/in-tree/shaper-thai/script-thai/misc/MANIFEST +++ b/test/shaping/texts/in-tree/shaper-thai/script-thai/misc/MANIFEST @@ -1 +1,2 @@ +phinthu.txt sara-am.txt diff --git a/test/shaping/texts/in-tree/shaper-thai/script-thai/misc/phinthu.txt b/test/shaping/texts/in-tree/shaper-thai/script-thai/misc/phinthu.txt new file mode 100644 index 0000000..e304777 --- /dev/null +++ b/test/shaping/texts/in-tree/shaper-thai/script-thai/misc/phinthu.txt @@ -0,0 +1,16 @@ +ป +ปฺ +ปุ +ปู +ปุู +ปูุ +ปฺุ +ปฺุ +ปฺู +ปฺู +ปฺุู +ปฺุู +ปฺุู +ปฺูุ +ปฺูุ +ปฺูุ -- 2.7.4