summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2014-06-21 14:10:38 -0600
committerBehdad Esfahbod <behdad@behdad.org>2014-06-21 14:16:54 -0600
commitcd86ab9b4f4d7bd4f563be64a83714fc8fb395d7 (patch)
treefdcbe9995ee42f04364148d44c71b8c4e46b0d8f
parent2390d9b67e1dfeccd3f0850d1304c52b54817ca0 (diff)
[arabic-table] Add ZWJ/ZWNJ now that table is segmented
-rwxr-xr-xsrc/gen-arabic-table.py2
-rw-r--r--src/hb-ot-shape-complex-arabic-table.hh12
-rw-r--r--src/hb-ot-shape-complex-arabic.cc5
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;
}