From ba72801325e4bd58f7597938d4409762c9fa530c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 21 Jul 2015 11:57:23 +0100 Subject: [PATCH] [USE] Add CGJ to table --- src/gen-use-table.py | 13 ++++++++++--- src/hb-ot-shape-complex-use-table.cc | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gen-use-table.py b/src/gen-use-table.py index 7293b73cd..82108750d 100755 --- a/src/gen-use-table.py +++ b/src/gen-use-table.py @@ -39,8 +39,12 @@ for i, f in enumerate (files): data[i][u] = t values[i][t] = values[i].get (t, 0) + end - start + 1 -# Merge data into one dict: defaults = ('Other', 'Not_Applicable', 'Cn', 'No_Block') + +# TODO CGJ is not in Unicode Indic files, but used in USE +data[0][0x034F] = defaults[0] + +# Merge data into one dict: for i,v in enumerate (defaults): values[i][v] = values[i].get (v, 0) + 1 combined = {} @@ -180,7 +184,10 @@ def is_Word_Joiner(U, UISC, UGC): return U == 0x2060 def is_OTHER(U, UISC, UGC): #SPEC-OUTDATED return UGC == Zs # or any other SCRIPT_COMMON characters - return UISC == Other and not is_SYM_MOD(U, UISC, UGC) + return (UISC == Other + and not is_SYM_MOD(U, UISC, UGC) + and not is_CGJ(U, UISC, UGC) + ) def is_Reserved(U, UISC, UGC): return UGC == 'Cn' def is_REPHA(U, UISC, UGC): @@ -325,7 +332,7 @@ data = map_to_use(data) # Remove the outliers singles = {} -for u in [0x25CC, 0x1107F]: +for u in [0x034F, 0x25CC, 0x1107F]: singles[u] = data[u] del data[u] diff --git a/src/hb-ot-shape-complex-use-table.cc b/src/hb-ot-shape-complex-use-table.cc index 4ce9010b2..45c7976ae 100644 --- a/src/hb-ot-shape-complex-use-table.cc +++ b/src/hb-ot-shape-complex-use-table.cc @@ -640,6 +640,7 @@ hb_use_get_categories (hb_codepoint_t u) if (hb_in_range (u, 0x0028u, 0x003Fu)) return use_table[u - 0x0028u + use_offset_0x0028u]; if (hb_in_range (u, 0x00A0u, 0x00D7u)) return use_table[u - 0x00A0u + use_offset_0x00a0u]; if (hb_in_range (u, 0x0900u, 0x0DF7u)) return use_table[u - 0x0900u + use_offset_0x0900u]; + if (unlikely (u == 0x034Fu)) return USE_CGJ; break; case 0x1u: