From cd86ab9b4f4d7bd4f563be64a83714fc8fb395d7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 21 Jun 2014 14:10:38 -0600 Subject: [PATCH] [arabic-table] Add ZWJ/ZWNJ now that table is segmented --- src/gen-arabic-table.py | 2 -- src/hb-ot-shape-complex-arabic-table.hh | 12 +++++++++++- src/hb-ot-shape-complex-arabic.cc | 5 ----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gen-arabic-table.py b/src/gen-arabic-table.py index ce80cc8a0..a5ec15a0b 100755 --- a/src/gen-arabic-table.py +++ b/src/gen-arabic-table.py @@ -52,8 +52,6 @@ def print_joining_table(f): continue u = int (fields[0], 16) - if u == 0x200C or u == 0x200D: - continue if fields[3] in ["ALAPH", "DALATH RISH"]: value = "JOINING_GROUP_" + fields[3].replace(' ', '_') diff --git a/src/hb-ot-shape-complex-arabic-table.hh b/src/hb-ot-shape-complex-arabic-table.hh index 0a61d8ff7..77dfc6e2b 100644 --- a/src/hb-ot-shape-complex-arabic-table.hh +++ b/src/hb-ot-shape-complex-arabic-table.hh @@ -77,7 +77,13 @@ static const uint8_t joining_table[] = /* 08A0 */ D,X,D,D,D,D,D,D,D,D,R,R,R, -}; /* Table items: 685; occupancy: 45% */ +#define joining_offset_0x200c 685 + + /* General Punctuation */ + + /* 2000 */ U,C, + +}; /* Table items: 687; occupancy: 45% */ static unsigned int @@ -89,6 +95,10 @@ joining_type (hb_codepoint_t u) if (0x0600 <= u && u <= 0x08AC) return joining_table[u - 0x0600 + joining_offset_0x0600]; break; + case 0x2: + if (0x200C <= u && u <= 0x200D) return joining_table[u - 0x200C + joining_offset_0x200c]; + break; + default: break; } diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 61a55efe9..4ce8478f0 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -83,11 +83,6 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ return JOINING_TYPE_D; } - if (unlikely (hb_in_range (u, 0x200C, 0x200D))) - { - return u == 0x200C ? JOINING_TYPE_U : JOINING_TYPE_C; - } - return (FLAG(gen_cat) & (FLAG(HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | FLAG(HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | FLAG(HB_UNICODE_GENERAL_CATEGORY_FORMAT))) ? JOINING_TYPE_T : JOINING_TYPE_U; }