diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2014-06-21 14:10:38 -0600 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2014-06-21 14:16:54 -0600 |
commit | cd86ab9b4f4d7bd4f563be64a83714fc8fb395d7 (patch) | |
tree | fdcbe9995ee42f04364148d44c71b8c4e46b0d8f | |
parent | 2390d9b67e1dfeccd3f0850d1304c52b54817ca0 (diff) |
[arabic-table] Add ZWJ/ZWNJ now that table is segmented
-rwxr-xr-x | src/gen-arabic-table.py | 2 | ||||
-rw-r--r-- | src/hb-ot-shape-complex-arabic-table.hh | 12 | ||||
-rw-r--r-- | 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 ce80cc8a..a5ec15a0 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 0a61d8ff..77dfc6e2 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 61a55efe..4ce8478f 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<hb_codepoint_t> (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; } |