[arabic-table] Further tune

In anticipation of Unicode 7.0 data coming in the next commit.
pull/27/merge
Behdad Esfahbod 11 years ago
parent a133e6067a
commit 2390d9b67e
  1. 10
      src/gen-arabic-table.py
  2. 38
      src/hb-ot-shape-complex-arabic-table.hh

@ -73,11 +73,12 @@ def print_joining_table(f):
uu = sorted(values.keys())
num = len(values)
all_blocks = set([blocks[u] for u in uu])
last = -1
ranges = []
for u in uu:
if u - last <= 1+16*3:
if u - last <= 1+16*5:
ranges[-1][-1] = u
else:
ranges.append([u,u])
@ -101,7 +102,10 @@ def print_joining_table(f):
if block != last_block or u == start:
if u != start:
print
print "\n /* %s */" % block
if block in all_blocks:
print "\n /* %s */" % block
else:
print "\n /* FILLER */"
last_block = block
if u % 32 != 0:
print
@ -119,7 +123,7 @@ def print_joining_table(f):
print "}; /* Table items: %d; occupancy: %d%% */" % (offset, occupancy)
print
page_bits = 8
page_bits = 12;
print
print "static unsigned int"
print "joining_type (hb_codepoint_t u)"

@ -52,45 +52,41 @@ static const uint8_t joining_table[] =
/* 0740 */ D,D,D,D,D,D,D,D,D,R,R,R,D,D,D,D,
/* 0760 */ D,D,D,D,D,D,D,D,D,D,D,R,R,D,D,D,D,R,D,R,R,D,D,D,R,R,D,D,D,D,D,D,
#define joining_offset_0x07ca 384
/* FILLER */
/* 0780 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 07A0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* NKo */
/* 07C0 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 07E0 */ D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,C,
/* 07C0 */ X,X,X,X,X,X,X,X,X,X,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 07E0 */ D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,C,X,X,X,X,X,
#define joining_offset_0x0840 433
/* FILLER */
/* Mandaic */
/* 0800 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0820 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0840 */ R,D,D,D,D,D,R,D,D,R,D,D,D,D,D,R,D,D,D,D,R,D,U,U,U,
/* Mandaic */
#define joining_offset_0x08a0 458
/* 0840 */ R,D,D,D,D,D,R,D,D,R,D,D,D,D,D,R,D,D,D,D,R,D,U,U,U,X,X,X,X,X,X,X,
/* 0860 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* 0880 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,
/* Arabic Extended-A */
/* 08A0 */ D,X,D,D,D,D,D,D,D,D,R,R,R,
}; /* Table items: 471; occupancy: 66% */
}; /* Table items: 685; occupancy: 45% */
static unsigned int
joining_type (hb_codepoint_t u)
{
switch (u >> 8)
switch (u >> 12)
{
case 0x6:
if (0x0600 <= u && u <= 0x077F) return joining_table[u - 0x0600 + joining_offset_0x0600];
break;
case 0x7:
if (0x0600 <= u && u <= 0x077F) return joining_table[u - 0x0600 + joining_offset_0x0600];
if (0x07CA <= u && u <= 0x07FA) return joining_table[u - 0x07CA + joining_offset_0x07ca];
break;
case 0x8:
if (0x0840 <= u && u <= 0x0858) return joining_table[u - 0x0840 + joining_offset_0x0840];
if (0x08A0 <= u && u <= 0x08AC) return joining_table[u - 0x08A0 + joining_offset_0x08a0];
case 0x0:
if (0x0600 <= u && u <= 0x08AC) return joining_table[u - 0x0600 + joining_offset_0x0600];
break;
default:

Loading…
Cancel
Save