[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Jul 14 15:40:25 UTC 2017


 src/gen-arabic-table.py                                                 |    2 +-
 src/gen-indic-table.py                                                  |    2 +-
 src/gen-use-table.py                                                    |    8 +++++---
 src/hb-ot-shape-complex-use-table.cc                                    |    4 ++--
 test/shaping/Makefile.am                                                |    1 +
 test/shaping/fonts/sha1sum/96490dd2ff81233b335a650e7eb660e0e7b2eeea.ttf |binary
 test/shaping/tests/use-syllable.tests                                   |    1 +
 7 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 216b003c914d2209a6846b1ce61fe7a3421c789c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Jul 14 16:38:51 2017 +0100

    [use] Fix shaping of U+AA29 CHAM VOWEL SIGN AA
    
    Part of https://github.com/behdad/harfbuzz/issues/376
    Also see https://github.com/roozbehp/unicode-data/issues/6
    
    Test added, using NotoSansCham built from Noto Phase III sources.

diff --git a/src/gen-arabic-table.py b/src/gen-arabic-table.py
index 308435f9..59bd7601 100755
--- a/src/gen-arabic-table.py
+++ b/src/gen-arabic-table.py
@@ -134,7 +134,7 @@ def print_joining_table(f):
 		for (start,end) in ranges:
 			if p not in [start>>page_bits, end>>page_bits]: continue
 			offset = "joining_offset_0x%04xu" % start
-			print "      if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return joining_table[u - 0x%04Xu + %s];" % (start, end, start, offset)
+			print "      if (hb_in_range<hb_codepoint_t> (u, 0x%04Xu, 0x%04Xu)) return joining_table[u - 0x%04Xu + %s];" % (start, end, start, offset)
 		print "      break;"
 		print ""
 	print "    default:"
diff --git a/src/gen-indic-table.py b/src/gen-indic-table.py
index 3016cd07..a849db18 100755
--- a/src/gen-indic-table.py
+++ b/src/gen-indic-table.py
@@ -232,7 +232,7 @@ for p in sorted(pages):
 	for (start,end) in zip (starts, ends):
 		if p not in [start>>page_bits, end>>page_bits]: continue
 		offset = "indic_offset_0x%04xu" % start
-		print "      if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return indic_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)
+		print "      if (hb_in_range<hb_codepoint_t> (u, 0x%04Xu, 0x%04Xu)) return indic_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)
 	for u,d in singles.items ():
 		if p != u>>page_bits: continue
 		print "      if (unlikely (u == 0x%04Xu)) return _(%s,%s);" % (u, short[0][d[0]], short[1][d[1]])
diff --git a/src/gen-use-table.py b/src/gen-use-table.py
index a922c92f..fcb66a58 100755
--- a/src/gen-use-table.py
+++ b/src/gen-use-table.py
@@ -210,11 +210,13 @@ def is_SYM_MOD(U, UISC, UGC):
 def is_VARIATION_SELECTOR(U, UISC, UGC):
 	return 0xFE00 <= U <= 0xFE0F
 def is_VOWEL(U, UISC, UGC):
+	# https://github.com/roozbehp/unicode-data/issues/6
 	return (UISC == Pure_Killer or
-		(UGC != Lo and UISC in [Vowel, Vowel_Dependent]))
+		(UGC != Lo and UISC in [Vowel, Vowel_Dependent] and U not in [0xAA29]))
 def is_VOWEL_MOD(U, UISC, UGC):
+	# https://github.com/roozbehp/unicode-data/issues/6
 	return (UISC in [Tone_Mark, Cantillation_Mark, Register_Shifter, Visarga] or
-		(UGC != Lo and UISC == Bindu))
+		(UGC != Lo and (UISC == Bindu or U in [0xAA29])))
 
 use_mapping = {
 	'B':	is_BASE,
@@ -449,7 +451,7 @@ for p in sorted(pages):
 	for (start,end) in zip (starts, ends):
 		if p not in [start>>page_bits, end>>page_bits]: continue
 		offset = "use_offset_0x%04xu" % start
-		print "      if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return use_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)
+		print "      if (hb_in_range<hb_codepoint_t> (u, 0x%04Xu, 0x%04Xu)) return use_table[u - 0x%04Xu + %s];" % (start, end-1, start, offset)
 	for u,d in singles.items ():
 		if p != u>>page_bits: continue
 		print "      if (unlikely (u == 0x%04Xu)) return %s;" % (u, d[0])
diff --git a/src/hb-ot-shape-complex-use-table.cc b/src/hb-ot-shape-complex-use-table.cc
index 416d7481..941a003a 100644
--- a/src/hb-ot-shape-complex-use-table.cc
+++ b/src/hb-ot-shape-complex-use-table.cc
@@ -9,7 +9,7 @@
  * # IndicSyllabicCategory-9.0.0.txt
  * # Date: 2016-05-21, 02:46:00 GMT [RP]
  * # IndicPositionalCategory-9.0.0.txt
- * # Date: 2016-02-25, 00:48:00 GMT [RP]
+ * # Date: 2016-06-09, 19:33:00 GMT [RP]
  * # Blocks-9.0.0.txt
  * # Date: 2016-02-05, 23:48:00 GMT [KW]
  * UnicodeData.txt does not have a header.
@@ -410,7 +410,7 @@ static const USE_TABLE_ELEMENT_TYPE use_table[] = {
 
   /* AA00 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
   /* AA10 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,
-  /* AA20 */     B,     B,     B,     B,     B,     B,     B,     B,     B,  VAbv,  VAbv,  VAbv,  VAbv,  VBlw,  VAbv,  VPre,
+  /* AA20 */     B,     B,     B,     B,     B,     B,     B,     B,     B, VMAbv,  VAbv,  VAbv,  VAbv,  VBlw,  VAbv,  VPre,
   /* AA30 */  VPre,  VAbv,  VBlw,  MPst,  MPre,  MBlw,  MBlw,     O,     O,     O,     O,     O,     O,     O,     O,     O,
   /* AA40 */     B,     B,     B,  FAbv,     B,     B,     B,     B,     B,     B,     B,     B,  FAbv,  FPst,     O,     O,
   /* AA50 */     B,     B,     B,     B,     B,     B,     B,     B,     B,     B,     O,     O,     O,     O,     O,     O,
diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index 48569f0b..e4441015 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -71,6 +71,7 @@ TESTS = \
 	tests/tibetan-vowels.tests \
 	tests/use.tests \
 	tests/use-marchen.tests \
+	tests/use-syllable.tests \
 	tests/vertical.tests \
 	tests/zero-width-marks.tests \
 	$(NULL)
diff --git a/test/shaping/fonts/sha1sum/96490dd2ff81233b335a650e7eb660e0e7b2eeea.ttf b/test/shaping/fonts/sha1sum/96490dd2ff81233b335a650e7eb660e0e7b2eeea.ttf
new file mode 100644
index 00000000..78518c08
Binary files /dev/null and b/test/shaping/fonts/sha1sum/96490dd2ff81233b335a650e7eb660e0e7b2eeea.ttf differ
diff --git a/test/shaping/tests/use-syllable.tests b/test/shaping/tests/use-syllable.tests
new file mode 100644
index 00000000..b864c3ea
--- /dev/null
+++ b/test/shaping/tests/use-syllable.tests
@@ -0,0 +1 @@
+fonts/sha1sum/96490dd2ff81233b335a650e7eb660e0e7b2eeea.ttf::U+AA00,U+AA2D,U+AA29:[a_cham=0+1121|uSign_cham=0 at 14,0+0|.notdef=0+600]


More information about the HarfBuzz mailing list