[HarfBuzz] harfbuzz-ng: Branch 'master' - 2 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Tue Apr 10 13:44:50 PDT 2012


 src/Makefile.am                         |    6 
 src/gen-arabic-table.py                 |  220 ++++++++++++++++++++++----------
 src/gen-indic-table.py                  |    4 
 src/hb-ot-shape-complex-arabic-table.hh |  205 +++++++++++++++++++++++++++++
 src/hb-ot-shape-complex-arabic.cc       |   38 ++++-
 5 files changed, 400 insertions(+), 73 deletions(-)

New commits:
commit b7d04eb606800100faa11100d2adf559e297a4ee
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Apr 10 16:44:38 2012 -0400

    Do Arabic fallback shaping

diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc
index 89d6b53..991f7cf 100644
--- a/src/hb-ot-shape-complex-arabic.cc
+++ b/src/hb-ot-shape-complex-arabic.cc
@@ -58,8 +58,6 @@ enum {
 
 static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_category_t gen_cat)
 {
-  /* TODO Macroize the magic bit operations */
-
   if (likely (hb_in_range<hb_codepoint_t> (u, JOINING_TABLE_FIRST, JOINING_TABLE_LAST))) {
     unsigned int j_type = joining_table[u - JOINING_TABLE_FIRST];
     if (likely (j_type != JOINING_TYPE_X))
@@ -82,6 +80,12 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ
 	 JOINING_TYPE_T : JOINING_TYPE_U;
 }
 
+static hb_codepoint_t get_arabic_shape (hb_codepoint_t u, unsigned int shape)
+{
+  if (likely (hb_in_range<hb_codepoint_t> (u, SHAPING_TABLE_FIRST, SHAPING_TABLE_LAST)) && shape < 4)
+    return shaping_table[u - SHAPING_TABLE_FIRST][shape];
+  return u;
+}
 
 
 static const hb_tag_t arabic_syriac_features[] =
@@ -189,6 +193,15 @@ _hb_ot_shape_complex_normalization_preference_arabic (void)
   return HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS;
 }
 
+
+static void
+arabic_fallback_shape (hb_buffer_t *buffer)
+{
+  unsigned int count = buffer->len;
+  for (unsigned int i = 0; i < count; i++)
+    buffer->info[i].codepoint = get_arabic_shape (buffer->info[i].codepoint, buffer->info[i].arabic_shaping_action());
+}
+
 void
 _hb_ot_shape_complex_setup_masks_arabic (hb_ot_map_t *map, hb_buffer_t *buffer)
 {
@@ -218,12 +231,27 @@ _hb_ot_shape_complex_setup_masks_arabic (hb_ot_map_t *map, hb_buffer_t *buffer)
   }
 
   hb_mask_t mask_array[TOTAL_NUM_FEATURES + 1] = {0};
+  hb_mask_t total_masks = 0;
   unsigned int num_masks = buffer->props.script == HB_SCRIPT_SYRIAC ? SYRIAC_NUM_FEATURES : COMMON_NUM_FEATURES;
-  for (unsigned int i = 0; i < num_masks; i++)
+  for (unsigned int i = 0; i < num_masks; i++) {
     mask_array[i] = map->get_1_mask (arabic_syriac_features[i]);
+    total_masks |= mask_array[i];
+  }
 
-  for (unsigned int i = 0; i < count; i++)
-    buffer->info[i].mask |= mask_array[buffer->info[i].arabic_shaping_action()];
+  if (total_masks) {
+    /* Has OpenType tables */
+    for (unsigned int i = 0; i < count; i++)
+      buffer->info[i].mask |= mask_array[buffer->info[i].arabic_shaping_action()];
+  } else if (buffer->props.script == HB_SCRIPT_ARABIC) {
+    /* Fallback Arabic shaping to Presentation Forms */
+    /* Pitfalls:
+     * - This path fires if user force-set init/medi/fina/isol off,
+     * - If font does not declare script 'arab', well, what to do?
+     *   Most probably it's safe to assume that init/medi/fina/isol
+     *   still mean Arabic shaping, although they do not have to.
+     */
+    arabic_fallback_shape (buffer);
+  }
 
   HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action);
 }
commit ae4a2b9365051c23c9a299cf76f3ab7e661999b1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Apr 10 16:25:08 2012 -0400

    Generate fallback Arabic shaping table
    
    Not hooked up yet.

diff --git a/src/Makefile.am b/src/Makefile.am
index d64efdf..27c69a7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -153,12 +153,12 @@ unicode-tables: arabic-table indic-table
 
 indic-table: gen-indic-table.py IndicSyllabicCategory.txt IndicMatraCategory.txt Blocks.txt
 	$(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-indic-table.hh.tmp && \
-	mv hb-ot-shape-complex-indic-table.hh.tmp hb-ot-shape-complex-indic-table.hh || \
+	mv hb-ot-shape-complex-indic-table.hh.tmp $(srcdir)/hb-ot-shape-complex-indic-table.hh || \
 	($(RM) hb-ot-shape-complex-indic-table.hh.tmp; false)
 
-arabic-table: gen-arabic-table.py ArabicShaping.txt
+arabic-table: gen-arabic-table.py ArabicShaping.txt UnicodeData.txt
 	$(AM_V_GEN) $(builddir)/$^ > hb-ot-shape-complex-arabic-table.hh.tmp && \
-	mv hb-ot-shape-complex-arabic-table.hh.tmp hb-ot-shape-complex-arabic-table.hh || \
+	mv hb-ot-shape-complex-arabic-table.hh.tmp $(srcdir)/hb-ot-shape-complex-arabic-table.hh || \
 	($(RM) hb-ot-shape-complex-arabic-table.hh.tmp; false)
 
 
diff --git a/src/gen-arabic-table.py b/src/gen-arabic-table.py
index 32bf66c..6549cb4 100755
--- a/src/gen-arabic-table.py
+++ b/src/gen-arabic-table.py
@@ -1,89 +1,185 @@
 #!/usr/bin/python
 
 import sys
+import os.path
 
-if len (sys.argv) < 2:
-	print >>sys.stderr, "usage: ./gen-arabic-table.py ArabicShaping.txt"
+if len (sys.argv) != 3:
+	print >>sys.stderr, "usage: ./gen-arabic-table.py ArabicShaping.txt UnicodeData.txt"
 	sys.exit (1)
 
-f = file (sys.argv[1])
+files = [file (x) for x in sys.argv[1:]]
 
-header = f.readline (), f.readline ()
-while f.readline ().find ('##################') < 0:
+headers = [[files[0].readline (), files[0].readline ()]]
+headers.append (["UnicodeData.txt does not have a header."])
+while files[0].readline ().find ('##################') < 0:
 	pass
 
 
+def print_joining_table(f):
+
+	print
+	print "static const uint8_t joining_table[] ="
+	print "{"
+
+	min_u = 0x110000
+	max_u = 0
+	num = 0
+	last = -1
+	block = ''
+	for line in f:
+
+		if line[0] == '#':
+			if line.find (" characters"):
+				block = line[2:].strip ()
+			continue
+
+		fields = [x.strip () for x in line.split (';')]
+		if len (fields) == 1:
+			continue
+
+		u = int (fields[0], 16)
+		if u == 0x200C or u == 0x200D:
+			continue
+		if u < last:
+			raise Exception ("Input data character not sorted", u)
+		min_u = min (min_u, u)
+		max_u = max (max_u, u)
+		num += 1
+
+		if block:
+			print "\n  /* %s */\n" % block
+			block = ''
+
+		if last != -1:
+			last += 1
+			while last < u:
+				print "  JOINING_TYPE_X, /* %04X */" % last
+				last += 1
+		else:
+			last = u
+
+		if fields[3] in ["ALAPH", "DALATH RISH"]:
+			value = "JOINING_GROUP_" + fields[3].replace(' ', '_')
+		else:
+			value = "JOINING_TYPE_" + fields[2]
+		print "  %s, /* %s */" % (value, '; '.join(fields))
+
+	print
+	print "};"
+	print
+	print "#define JOINING_TABLE_FIRST	0x%04X" % min_u
+	print "#define JOINING_TABLE_LAST	0x%04X" % max_u
+	print
+
+	occupancy = num * 100 / (max_u - min_u + 1)
+	# Maintain at least 40% occupancy in the table */
+	if occupancy < 40:
+		raise Exception ("Table too sparse, please investigate: ", occupancy)
+
+def print_shaping_table(f):
+
+	shapes = {}
+	ligatures = {}
+	names = {}
+	for line in f:
+
+		fields = [x.strip () for x in line.split (';')]
+		if fields[5][0:1] != '<':
+			continue
+
+		items = fields[5].split (' ')
+		shape, items = items[0][1:-1], tuple (int (x, 16) for x in items[1:])
+
+		if not shape in ['initial', 'medial', 'isolated', 'final']:
+			continue
+
+		c = int (fields[0], 16)
+		if len (items) != 1:
+			# We only care about lam-alef ligatures
+			if len (items) != 2 or items[0] != 0x0644 or items[1] not in [0x0622, 0x0623, 0x0625, 0x0627]:
+				continue
+
+			# Save ligature
+			names[c] = fields[1]
+			if items not in ligatures:
+				ligatures[items] = {}
+			ligatures[items][shape] = c
+			pass
+		else:
+			# Save shape
+			if items[0] not in names:
+				names[items[0]] = fields[1]
+			else:
+				names[items[0]] = os.path.commonprefix ([names[items[0]], fields[1]]).strip ()
+			if items[0] not in shapes:
+				shapes[items[0]] = {}
+			shapes[items[0]][shape] = c
+
+	print
+	print "static const uint16_t shaping_table[][4] ="
+	print "{"
+
+	keys = shapes.keys ()
+	min_u, max_u = min (keys), max (keys)
+	for u in range (min_u, max_u + 1):
+		s = [shapes[u][shape] if u in shapes and shape in shapes[u] else u
+		     for shape in  ['initial', 'medial', 'final', 'isolated']]
+		value = ', '.join ("0x%04X" % c for c in s)
+		print "  {%s}, /* U+%04X %s */" % (value, u, names[u] if u in names else "")
+
+	print "};"
+	print
+	print "#define SHAPING_TABLE_FIRST	0x%04X" % min_u
+	print "#define SHAPING_TABLE_LAST	0x%04X" % max_u
+	print
+
+	print
+	print "static const uint16_t ligature_table[][3] ="
+	print "{"
+
+	ligas = []
+	for pair in ligatures.keys ():
+		for shape in ligatures[pair]:
+			c = ligatures[pair][shape]
+			if shape == 'isolated':
+				liga = (shapes[pair[0]]['initial'], shapes[pair[1]]['final'])
+			elif shape == 'final':
+				liga = (shapes[pair[0]]['medial'], shapes[pair[1]]['final'])
+			else:
+				raise Exception ("Unexpected shape", shape)
+			ligas.append (liga + (c,))
+	ligas.sort ()
+	for liga in ligas:
+		value = ', '.join ("0x%04X" % c for c in liga)
+		print "  {%s}, /* U+%04X %s */" % (value, liga[2], names[liga[2]])
+
+	print "};"
+	print
+
+
+
 print "/* == Start of generated table == */"
 print "/*"
 print " * The following table is generated by running:"
 print " *"
-print " *   ./gen-arabic-table.py ArabicShaping.txt"
+print " *   ./gen-arabic-table.py ArabicShaping.txt UnicodeData.txt"
 print " *"
 print " * on files with these headers:"
 print " *"
-for line in header:
-	print " * %s" % (line.strip())
+for h in headers:
+	for l in h:
+		print " * %s" % (l.strip())
 print " */"
 print
 print "#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH"
 print "#define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH"
 print
-print "static const uint8_t joining_table[] ="
-print "{"
-
-min_u = 0x110000
-max_u = 0
-num = 0
-last = -1
-block = ''
-for line in f:
-
-	if line[0] == '#':
-		if line.find (" characters"):
-			block = line[2:].strip ()
-		continue
-
-	fields = [x.strip () for x in line.split (';')]
-	if len (fields) == 1:
-		continue
-
-	u = int (fields[0], 16)
-	if u == 0x200C or u == 0x200D:
-		continue
-	if u < last:
-		raise Exception ("Input data character not sorted", u)
-	min_u = min (min_u, u)
-	max_u = max (max_u, u)
-	num += 1
-
-	if block:
-		print "\n  /* %s */\n" % block
-		block = ''
-
-	if last != -1:
-		last += 1
-		while last < u:
-			print "  JOINING_TYPE_X, /* %04X */" % last
-			last += 1
-	else:
-		last = u
-
-	if fields[3] in ["ALAPH", "DALATH RISH"]:
-		value = "JOINING_GROUP_" + fields[3].replace(' ', '_')
-	else:
-		value = "JOINING_TYPE_" + fields[2]
-	print "  %s, /* %s */" % (value, '; '.join(fields))
-print
-print "};"
-print
-print "#define JOINING_TABLE_FIRST	0x%04X" % min_u
-print "#define JOINING_TABLE_LAST	0x%04X" % max_u
+
+print_joining_table (files[0])
+print_shaping_table (files[1])
+
 print
 print "#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH */"
 print
 print "/* == End of generated table == */"
 
-occupancy = num * 100 / (max_u - min_u + 1)
-# Maintain at least 40% occupancy in the table */
-if occupancy < 40:
-	raise Exception ("Table too sparse, please investigate: ", occupancy)
diff --git a/src/gen-indic-table.py b/src/gen-indic-table.py
index 0474a27..94aa2ab 100755
--- a/src/gen-indic-table.py
+++ b/src/gen-indic-table.py
@@ -2,11 +2,11 @@
 
 import sys
 
-if len (sys.argv) < 4:
+if len (sys.argv) != 4:
 	print >>sys.stderr, "usage: ./gen-indic-table.py IndicSyllabicCategory.txt IndicMatraCategory.txt Blocks.txt"
 	sys.exit (1)
 
-files = [file (sys.argv[i+1]) for i in range (3)]
+files = [file (x) for x in sys.argv[1:]]
 
 headers = [[f.readline () for i in range (2)] for f in files]
 
diff --git a/src/hb-ot-shape-complex-arabic-table.hh b/src/hb-ot-shape-complex-arabic-table.hh
index 0ce0b36..e0b27f8 100644
--- a/src/hb-ot-shape-complex-arabic-table.hh
+++ b/src/hb-ot-shape-complex-arabic-table.hh
@@ -2,17 +2,19 @@
 /*
  * The following table is generated by running:
  *
- *   ./gen-arabic-table.py ArabicShaping.txt
+ *   ./gen-arabic-table.py ArabicShaping.txt UnicodeData.txt
  *
  * on files with these headers:
  *
  * # ArabicShaping-6.1.0.txt
  * # Date: 2011-04-15, 23:16:00 GMT [KW]
+ * UnicodeData.txt does not have a header.
  */
 
 #ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH
 #define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH
 
+
 static const uint8_t joining_table[] =
 {
 
@@ -724,6 +726,207 @@ static const uint8_t joining_table[] =
 #define JOINING_TABLE_FIRST	0x0600
 #define JOINING_TABLE_LAST	0x08AC
 
+
+static const uint16_t shaping_table[][4] =
+{
+  {0x0621, 0x0621, 0x0621, 0xFE80}, /* U+0621 ARABIC LETTER HAMZA ISOLATED FORM */
+  {0x0622, 0x0622, 0xFE82, 0xFE81}, /* U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE */
+  {0x0623, 0x0623, 0xFE84, 0xFE83}, /* U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE */
+  {0x0624, 0x0624, 0xFE86, 0xFE85}, /* U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE */
+  {0x0625, 0x0625, 0xFE88, 0xFE87}, /* U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW */
+  {0xFE8B, 0xFE8C, 0xFE8A, 0xFE89}, /* U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE */
+  {0x0627, 0x0627, 0xFE8E, 0xFE8D}, /* U+0627 ARABIC LETTER ALEF */
+  {0xFE91, 0xFE92, 0xFE90, 0xFE8F}, /* U+0628 ARABIC LETTER BEH */
+  {0x0629, 0x0629, 0xFE94, 0xFE93}, /* U+0629 ARABIC LETTER TEH MARBUTA */
+  {0xFE97, 0xFE98, 0xFE96, 0xFE95}, /* U+062A ARABIC LETTER TEH */
+  {0xFE9B, 0xFE9C, 0xFE9A, 0xFE99}, /* U+062B ARABIC LETTER THEH */
+  {0xFE9F, 0xFEA0, 0xFE9E, 0xFE9D}, /* U+062C ARABIC LETTER JEEM */
+  {0xFEA3, 0xFEA4, 0xFEA2, 0xFEA1}, /* U+062D ARABIC LETTER HAH */
+  {0xFEA7, 0xFEA8, 0xFEA6, 0xFEA5}, /* U+062E ARABIC LETTER KHAH */
+  {0x062F, 0x062F, 0xFEAA, 0xFEA9}, /* U+062F ARABIC LETTER DAL */
+  {0x0630, 0x0630, 0xFEAC, 0xFEAB}, /* U+0630 ARABIC LETTER THAL */
+  {0x0631, 0x0631, 0xFEAE, 0xFEAD}, /* U+0631 ARABIC LETTER REH */
+  {0x0632, 0x0632, 0xFEB0, 0xFEAF}, /* U+0632 ARABIC LETTER ZAIN */
+  {0xFEB3, 0xFEB4, 0xFEB2, 0xFEB1}, /* U+0633 ARABIC LETTER SEEN */
+  {0xFEB7, 0xFEB8, 0xFEB6, 0xFEB5}, /* U+0634 ARABIC LETTER SHEEN */
+  {0xFEBB, 0xFEBC, 0xFEBA, 0xFEB9}, /* U+0635 ARABIC LETTER SAD */
+  {0xFEBF, 0xFEC0, 0xFEBE, 0xFEBD}, /* U+0636 ARABIC LETTER DAD */
+  {0xFEC3, 0xFEC4, 0xFEC2, 0xFEC1}, /* U+0637 ARABIC LETTER TAH */
+  {0xFEC7, 0xFEC8, 0xFEC6, 0xFEC5}, /* U+0638 ARABIC LETTER ZAH */
+  {0xFECB, 0xFECC, 0xFECA, 0xFEC9}, /* U+0639 ARABIC LETTER AIN */
+  {0xFECF, 0xFED0, 0xFECE, 0xFECD}, /* U+063A ARABIC LETTER GHAIN */
+  {0x063B, 0x063B, 0x063B, 0x063B}, /* U+063B  */
+  {0x063C, 0x063C, 0x063C, 0x063C}, /* U+063C  */
+  {0x063D, 0x063D, 0x063D, 0x063D}, /* U+063D  */
+  {0x063E, 0x063E, 0x063E, 0x063E}, /* U+063E  */
+  {0x063F, 0x063F, 0x063F, 0x063F}, /* U+063F  */
+  {0x0640, 0x0640, 0x0640, 0x0640}, /* U+0640  */
+  {0xFED3, 0xFED4, 0xFED2, 0xFED1}, /* U+0641 ARABIC LETTER FEH */
+  {0xFED7, 0xFED8, 0xFED6, 0xFED5}, /* U+0642 ARABIC LETTER QAF */
+  {0xFEDB, 0xFEDC, 0xFEDA, 0xFED9}, /* U+0643 ARABIC LETTER KAF */
+  {0xFEDF, 0xFEE0, 0xFEDE, 0xFEDD}, /* U+0644 ARABIC LETTER LAM */
+  {0xFEE3, 0xFEE4, 0xFEE2, 0xFEE1}, /* U+0645 ARABIC LETTER MEEM */
+  {0xFEE7, 0xFEE8, 0xFEE6, 0xFEE5}, /* U+0646 ARABIC LETTER NOON */
+  {0xFEEB, 0xFEEC, 0xFEEA, 0xFEE9}, /* U+0647 ARABIC LETTER HEH */
+  {0x0648, 0x0648, 0xFEEE, 0xFEED}, /* U+0648 ARABIC LETTER WAW */
+  {0xFBE8, 0xFBE9, 0xFEF0, 0xFEEF}, /* U+0649 ARABIC LETTER */
+  {0xFEF3, 0xFEF4, 0xFEF2, 0xFEF1}, /* U+064A ARABIC LETTER YEH */
+  {0x064B, 0x064B, 0x064B, 0x064B}, /* U+064B  */
+  {0x064C, 0x064C, 0x064C, 0x064C}, /* U+064C  */
+  {0x064D, 0x064D, 0x064D, 0x064D}, /* U+064D  */
+  {0x064E, 0x064E, 0x064E, 0x064E}, /* U+064E  */
+  {0x064F, 0x064F, 0x064F, 0x064F}, /* U+064F  */
+  {0x0650, 0x0650, 0x0650, 0x0650}, /* U+0650  */
+  {0x0651, 0x0651, 0x0651, 0x0651}, /* U+0651  */
+  {0x0652, 0x0652, 0x0652, 0x0652}, /* U+0652  */
+  {0x0653, 0x0653, 0x0653, 0x0653}, /* U+0653  */
+  {0x0654, 0x0654, 0x0654, 0x0654}, /* U+0654  */
+  {0x0655, 0x0655, 0x0655, 0x0655}, /* U+0655  */
+  {0x0656, 0x0656, 0x0656, 0x0656}, /* U+0656  */
+  {0x0657, 0x0657, 0x0657, 0x0657}, /* U+0657  */
+  {0x0658, 0x0658, 0x0658, 0x0658}, /* U+0658  */
+  {0x0659, 0x0659, 0x0659, 0x0659}, /* U+0659  */
+  {0x065A, 0x065A, 0x065A, 0x065A}, /* U+065A  */
+  {0x065B, 0x065B, 0x065B, 0x065B}, /* U+065B  */
+  {0x065C, 0x065C, 0x065C, 0x065C}, /* U+065C  */
+  {0x065D, 0x065D, 0x065D, 0x065D}, /* U+065D  */
+  {0x065E, 0x065E, 0x065E, 0x065E}, /* U+065E  */
+  {0x065F, 0x065F, 0x065F, 0x065F}, /* U+065F  */
+  {0x0660, 0x0660, 0x0660, 0x0660}, /* U+0660  */
+  {0x0661, 0x0661, 0x0661, 0x0661}, /* U+0661  */
+  {0x0662, 0x0662, 0x0662, 0x0662}, /* U+0662  */
+  {0x0663, 0x0663, 0x0663, 0x0663}, /* U+0663  */
+  {0x0664, 0x0664, 0x0664, 0x0664}, /* U+0664  */
+  {0x0665, 0x0665, 0x0665, 0x0665}, /* U+0665  */
+  {0x0666, 0x0666, 0x0666, 0x0666}, /* U+0666  */
+  {0x0667, 0x0667, 0x0667, 0x0667}, /* U+0667  */
+  {0x0668, 0x0668, 0x0668, 0x0668}, /* U+0668  */
+  {0x0669, 0x0669, 0x0669, 0x0669}, /* U+0669  */
+  {0x066A, 0x066A, 0x066A, 0x066A}, /* U+066A  */
+  {0x066B, 0x066B, 0x066B, 0x066B}, /* U+066B  */
+  {0x066C, 0x066C, 0x066C, 0x066C}, /* U+066C  */
+  {0x066D, 0x066D, 0x066D, 0x066D}, /* U+066D  */
+  {0x066E, 0x066E, 0x066E, 0x066E}, /* U+066E  */
+  {0x066F, 0x066F, 0x066F, 0x066F}, /* U+066F  */
+  {0x0670, 0x0670, 0x0670, 0x0670}, /* U+0670  */
+  {0x0671, 0x0671, 0xFB51, 0xFB50}, /* U+0671 ARABIC LETTER ALEF WASLA */
+  {0x0672, 0x0672, 0x0672, 0x0672}, /* U+0672  */
+  {0x0673, 0x0673, 0x0673, 0x0673}, /* U+0673  */
+  {0x0674, 0x0674, 0x0674, 0x0674}, /* U+0674  */
+  {0x0675, 0x0675, 0x0675, 0x0675}, /* U+0675  */
+  {0x0676, 0x0676, 0x0676, 0x0676}, /* U+0676  */
+  {0x0677, 0x0677, 0x0677, 0xFBDD}, /* U+0677 ARABIC LETTER U WITH HAMZA ABOVE ISOLATED FORM */
+  {0x0678, 0x0678, 0x0678, 0x0678}, /* U+0678  */
+  {0xFB68, 0xFB69, 0xFB67, 0xFB66}, /* U+0679 ARABIC LETTER TTEH */
+  {0xFB60, 0xFB61, 0xFB5F, 0xFB5E}, /* U+067A ARABIC LETTER TTEHEH */
+  {0xFB54, 0xFB55, 0xFB53, 0xFB52}, /* U+067B ARABIC LETTER BEEH */
+  {0x067C, 0x067C, 0x067C, 0x067C}, /* U+067C  */
+  {0x067D, 0x067D, 0x067D, 0x067D}, /* U+067D  */
+  {0xFB58, 0xFB59, 0xFB57, 0xFB56}, /* U+067E ARABIC LETTER PEH */
+  {0xFB64, 0xFB65, 0xFB63, 0xFB62}, /* U+067F ARABIC LETTER TEHEH */
+  {0xFB5C, 0xFB5D, 0xFB5B, 0xFB5A}, /* U+0680 ARABIC LETTER BEHEH */
+  {0x0681, 0x0681, 0x0681, 0x0681}, /* U+0681  */
+  {0x0682, 0x0682, 0x0682, 0x0682}, /* U+0682  */
+  {0xFB78, 0xFB79, 0xFB77, 0xFB76}, /* U+0683 ARABIC LETTER NYEH */
+  {0xFB74, 0xFB75, 0xFB73, 0xFB72}, /* U+0684 ARABIC LETTER DYEH */
+  {0x0685, 0x0685, 0x0685, 0x0685}, /* U+0685  */
+  {0xFB7C, 0xFB7D, 0xFB7B, 0xFB7A}, /* U+0686 ARABIC LETTER TCHEH */
+  {0xFB80, 0xFB81, 0xFB7F, 0xFB7E}, /* U+0687 ARABIC LETTER TCHEHEH */
+  {0x0688, 0x0688, 0xFB89, 0xFB88}, /* U+0688 ARABIC LETTER DDAL */
+  {0x0689, 0x0689, 0x0689, 0x0689}, /* U+0689  */
+  {0x068A, 0x068A, 0x068A, 0x068A}, /* U+068A  */
+  {0x068B, 0x068B, 0x068B, 0x068B}, /* U+068B  */
+  {0x068C, 0x068C, 0xFB85, 0xFB84}, /* U+068C ARABIC LETTER DAHAL */
+  {0x068D, 0x068D, 0xFB83, 0xFB82}, /* U+068D ARABIC LETTER DDAHAL */
+  {0x068E, 0x068E, 0xFB87, 0xFB86}, /* U+068E ARABIC LETTER DUL */
+  {0x068F, 0x068F, 0x068F, 0x068F}, /* U+068F  */
+  {0x0690, 0x0690, 0x0690, 0x0690}, /* U+0690  */
+  {0x0691, 0x0691, 0xFB8D, 0xFB8C}, /* U+0691 ARABIC LETTER RREH */
+  {0x0692, 0x0692, 0x0692, 0x0692}, /* U+0692  */
+  {0x0693, 0x0693, 0x0693, 0x0693}, /* U+0693  */
+  {0x0694, 0x0694, 0x0694, 0x0694}, /* U+0694  */
+  {0x0695, 0x0695, 0x0695, 0x0695}, /* U+0695  */
+  {0x0696, 0x0696, 0x0696, 0x0696}, /* U+0696  */
+  {0x0697, 0x0697, 0x0697, 0x0697}, /* U+0697  */
+  {0x0698, 0x0698, 0xFB8B, 0xFB8A}, /* U+0698 ARABIC LETTER JEH */
+  {0x0699, 0x0699, 0x0699, 0x0699}, /* U+0699  */
+  {0x069A, 0x069A, 0x069A, 0x069A}, /* U+069A  */
+  {0x069B, 0x069B, 0x069B, 0x069B}, /* U+069B  */
+  {0x069C, 0x069C, 0x069C, 0x069C}, /* U+069C  */
+  {0x069D, 0x069D, 0x069D, 0x069D}, /* U+069D  */
+  {0x069E, 0x069E, 0x069E, 0x069E}, /* U+069E  */
+  {0x069F, 0x069F, 0x069F, 0x069F}, /* U+069F  */
+  {0x06A0, 0x06A0, 0x06A0, 0x06A0}, /* U+06A0  */
+  {0x06A1, 0x06A1, 0x06A1, 0x06A1}, /* U+06A1  */
+  {0x06A2, 0x06A2, 0x06A2, 0x06A2}, /* U+06A2  */
+  {0x06A3, 0x06A3, 0x06A3, 0x06A3}, /* U+06A3  */
+  {0xFB6C, 0xFB6D, 0xFB6B, 0xFB6A}, /* U+06A4 ARABIC LETTER VEH */
+  {0x06A5, 0x06A5, 0x06A5, 0x06A5}, /* U+06A5  */
+  {0xFB70, 0xFB71, 0xFB6F, 0xFB6E}, /* U+06A6 ARABIC LETTER PEHEH */
+  {0x06A7, 0x06A7, 0x06A7, 0x06A7}, /* U+06A7  */
+  {0x06A8, 0x06A8, 0x06A8, 0x06A8}, /* U+06A8  */
+  {0xFB90, 0xFB91, 0xFB8F, 0xFB8E}, /* U+06A9 ARABIC LETTER KEHEH */
+  {0x06AA, 0x06AA, 0x06AA, 0x06AA}, /* U+06AA  */
+  {0x06AB, 0x06AB, 0x06AB, 0x06AB}, /* U+06AB  */
+  {0x06AC, 0x06AC, 0x06AC, 0x06AC}, /* U+06AC  */
+  {0xFBD5, 0xFBD6, 0xFBD4, 0xFBD3}, /* U+06AD ARABIC LETTER NG */
+  {0x06AE, 0x06AE, 0x06AE, 0x06AE}, /* U+06AE  */
+  {0xFB94, 0xFB95, 0xFB93, 0xFB92}, /* U+06AF ARABIC LETTER GAF */
+  {0x06B0, 0x06B0, 0x06B0, 0x06B0}, /* U+06B0  */
+  {0xFB9C, 0xFB9D, 0xFB9B, 0xFB9A}, /* U+06B1 ARABIC LETTER NGOEH */
+  {0x06B2, 0x06B2, 0x06B2, 0x06B2}, /* U+06B2  */
+  {0xFB98, 0xFB99, 0xFB97, 0xFB96}, /* U+06B3 ARABIC LETTER GUEH */
+  {0x06B4, 0x06B4, 0x06B4, 0x06B4}, /* U+06B4  */
+  {0x06B5, 0x06B5, 0x06B5, 0x06B5}, /* U+06B5  */
+  {0x06B6, 0x06B6, 0x06B6, 0x06B6}, /* U+06B6  */
+  {0x06B7, 0x06B7, 0x06B7, 0x06B7}, /* U+06B7  */
+  {0x06B8, 0x06B8, 0x06B8, 0x06B8}, /* U+06B8  */
+  {0x06B9, 0x06B9, 0x06B9, 0x06B9}, /* U+06B9  */
+  {0x06BA, 0x06BA, 0xFB9F, 0xFB9E}, /* U+06BA ARABIC LETTER NOON GHUNNA */
+  {0xFBA2, 0xFBA3, 0xFBA1, 0xFBA0}, /* U+06BB ARABIC LETTER RNOON */
+  {0x06BC, 0x06BC, 0x06BC, 0x06BC}, /* U+06BC  */
+  {0x06BD, 0x06BD, 0x06BD, 0x06BD}, /* U+06BD  */
+  {0xFBAC, 0xFBAD, 0xFBAB, 0xFBAA}, /* U+06BE ARABIC LETTER HEH DOACHASHMEE */
+  {0x06BF, 0x06BF, 0x06BF, 0x06BF}, /* U+06BF  */
+  {0x06C0, 0x06C0, 0xFBA5, 0xFBA4}, /* U+06C0 ARABIC LETTER HEH WITH YEH ABOVE */
+  {0xFBA8, 0xFBA9, 0xFBA7, 0xFBA6}, /* U+06C1 ARABIC LETTER HEH GOAL */
+  {0x06C2, 0x06C2, 0x06C2, 0x06C2}, /* U+06C2  */
+  {0x06C3, 0x06C3, 0x06C3, 0x06C3}, /* U+06C3  */
+  {0x06C4, 0x06C4, 0x06C4, 0x06C4}, /* U+06C4  */
+  {0x06C5, 0x06C5, 0xFBE1, 0xFBE0}, /* U+06C5 ARABIC LETTER KIRGHIZ OE */
+  {0x06C6, 0x06C6, 0xFBDA, 0xFBD9}, /* U+06C6 ARABIC LETTER OE */
+  {0x06C7, 0x06C7, 0xFBD8, 0xFBD7}, /* U+06C7 ARABIC LETTER U */
+  {0x06C8, 0x06C8, 0xFBDC, 0xFBDB}, /* U+06C8 ARABIC LETTER YU */
+  {0x06C9, 0x06C9, 0xFBE3, 0xFBE2}, /* U+06C9 ARABIC LETTER KIRGHIZ YU */
+  {0x06CA, 0x06CA, 0x06CA, 0x06CA}, /* U+06CA  */
+  {0x06CB, 0x06CB, 0xFBDF, 0xFBDE}, /* U+06CB ARABIC LETTER VE */
+  {0xFBFE, 0xFBFF, 0xFBFD, 0xFBFC}, /* U+06CC ARABIC LETTER FARSI YEH */
+  {0x06CD, 0x06CD, 0x06CD, 0x06CD}, /* U+06CD  */
+  {0x06CE, 0x06CE, 0x06CE, 0x06CE}, /* U+06CE  */
+  {0x06CF, 0x06CF, 0x06CF, 0x06CF}, /* U+06CF  */
+  {0xFBE6, 0xFBE7, 0xFBE5, 0xFBE4}, /* U+06D0 ARABIC LETTER E */
+  {0x06D1, 0x06D1, 0x06D1, 0x06D1}, /* U+06D1  */
+  {0x06D2, 0x06D2, 0xFBAF, 0xFBAE}, /* U+06D2 ARABIC LETTER YEH BARREE */
+  {0x06D3, 0x06D3, 0xFBB1, 0xFBB0}, /* U+06D3 ARABIC LETTER YEH BARREE WITH HAMZA ABOVE */
+};
+
+#define SHAPING_TABLE_FIRST	0x0621
+#define SHAPING_TABLE_LAST	0x06D3
+
+
+static const uint16_t ligature_table[][3] =
+{
+  {0xFEDF, 0xFE82, 0xFEF5}, /* U+FEF5 ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM */
+  {0xFEDF, 0xFE84, 0xFEF7}, /* U+FEF7 ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM */
+  {0xFEDF, 0xFE88, 0xFEF9}, /* U+FEF9 ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM */
+  {0xFEDF, 0xFE8E, 0xFEFB}, /* U+FEFB ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM */
+  {0xFEE0, 0xFE82, 0xFEF6}, /* U+FEF6 ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM */
+  {0xFEE0, 0xFE84, 0xFEF8}, /* U+FEF8 ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM */
+  {0xFEE0, 0xFE88, 0xFEFA}, /* U+FEFA ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM */
+  {0xFEE0, 0xFE8E, 0xFEFC}, /* U+FEFC ARABIC LIGATURE LAM WITH ALEF FINAL FORM */
+};
+
+
 #endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH */
 
 /* == End of generated table == */



More information about the HarfBuzz mailing list