[HarfBuzz] harfbuzz: Branch 'master' - 5 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Jul 23 04:51:16 PDT 2015


 src/hb-ot-layout-private.hh                                             |    9 +
 src/hb-ot-layout.cc                                                     |   22 ++++
 src/hb-ot-map-private.hh                                                |    7 -
 src/hb-ot-map.cc                                                        |   10 ++
 src/hb-ot-shape.cc                                                      |   15 +--
 test/shaping/Makefile.am                                                |    2 
 test/shaping/fonts/sha1sum/191826b9643e3f124d865d617ae609db6a2ce203.ttf |binary
 test/shaping/fonts/sha1sum/MANIFEST                                     |    1 
 test/shaping/record-test.sh                                             |   47 ++++++++--
 test/shaping/run-tests.sh                                               |    9 +
 test/shaping/tests/MANIFEST                                             |    1 
 test/shaping/tests/arabic-fallback-shaping.tests                        |    2 
 test/shaping/tests/arabic-feature-order.tests                           |    6 -
 test/shaping/tests/context-matching.tests                               |    6 -
 test/shaping/tests/default-ignorables.tests                             |    2 
 test/shaping/tests/hangul-jamo.tests                                    |    4 
 test/shaping/tests/indic-joiner-candrabindu.tests                       |    4 
 test/shaping/tests/indic-old-spec.tests                                 |    4 
 test/shaping/tests/indic-pref-blocking.tests                            |    4 
 test/shaping/tests/mongolian-variation-selector.tests                   |    6 -
 test/shaping/tests/vertical.tests                                       |    1 
 test/shaping/tests/zero-width-marks.tests                               |    4 
 22 files changed, 124 insertions(+), 42 deletions(-)

New commits:
commit c81d957a264539dfe3252f9a94ee066c4a44edf4
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 23 12:50:48 2015 +0100

    [test] Add tests for improved 'vert' feature

diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index c7434a6..22e326e 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -45,6 +45,7 @@ TESTS = \
 	tests/indic-old-spec.tests \
 	tests/indic-pref-blocking.tests \
 	tests/mongolian-variation-selector.tests \
+	tests/vertical.tests \
 	tests/zero-width-marks.tests \
 	$(NULL)
 
diff --git a/test/shaping/fonts/sha1sum/191826b9643e3f124d865d617ae609db6a2ce203.ttf b/test/shaping/fonts/sha1sum/191826b9643e3f124d865d617ae609db6a2ce203.ttf
new file mode 100644
index 0000000..dbc6e26
Binary files /dev/null and b/test/shaping/fonts/sha1sum/191826b9643e3f124d865d617ae609db6a2ce203.ttf differ
diff --git a/test/shaping/fonts/sha1sum/MANIFEST b/test/shaping/fonts/sha1sum/MANIFEST
index 0a35ee2..2881f0a 100644
--- a/test/shaping/fonts/sha1sum/MANIFEST
+++ b/test/shaping/fonts/sha1sum/MANIFEST
@@ -1,4 +1,5 @@
 051d92f8bc6ff724511b296c27623f824de256e9.ttf
+191826b9643e3f124d865d617ae609db6a2ce203.ttf
 226bc2deab3846f1a682085f70c67d0421014144.ttf
 270b89df543a7e48e206a2d830c0e10e5265c630.ttf
 37033cc5cf37bb223d7355153016b6ccece93b28.ttf
diff --git a/test/shaping/tests/MANIFEST b/test/shaping/tests/MANIFEST
index 74e7eb2..323ad46 100644
--- a/test/shaping/tests/MANIFEST
+++ b/test/shaping/tests/MANIFEST
@@ -7,4 +7,5 @@ indic-joiner-candrabindu.tests
 indic-old-spec.tests
 indic-pref-blocking.tests
 mongolian-variation-selector.tests
+vertical.tests
 zero-width-marks.tests
diff --git a/test/shaping/tests/vertical.tests b/test/shaping/tests/vertical.tests
new file mode 100644
index 0000000..8276890
--- /dev/null
+++ b/test/shaping/tests/vertical.tests
@@ -0,0 +1 @@
+fonts/sha1sum/191826b9643e3f124d865d617ae609db6a2ce203.ttf:--direction=t:U+300C:[uni300C.vert=0 at -512,-578+0,-1024]
commit 8a6a16dbcb1808c7ed50f9ba320384565bbf405a
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 23 12:49:09 2015 +0100

    [test] Add recently added test
    
    Ouch.

diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index 70bcdd5..c7434a6 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -39,6 +39,7 @@ TESTS = \
 	tests/arabic-fallback-shaping.tests \
 	tests/arabic-feature-order.tests \
 	tests/context-matching.tests \
+	tests/default-ignorables.tests \
 	tests/hangul-jamo.tests \
 	tests/indic-joiner-candrabindu.tests \
 	tests/indic-old-spec.tests \
commit 895fb31c7f0201f13df5a6866b367476bc4aab2e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 23 12:14:03 2015 +0100

    [test] Support additional options to hb-shape in micro-test suite

diff --git a/test/shaping/record-test.sh b/test/shaping/record-test.sh
index a69157f..691f78d 100755
--- a/test/shaping/record-test.sh
+++ b/test/shaping/record-test.sh
@@ -5,11 +5,42 @@ dir=`mktemp --directory`
 hb_shape=$1
 shift
 fontfile=$1
+if test "x${fontfile:0:1}" == 'x-'; then
+	echo "Specify font file before other options." >&2
+	exit 1
+fi
 shift
-hb_shape="$hb_shape $@"
-unicodes=`./hb-unicode-decode`
-text=`./hb-unicode-encode "$unicodes"`
-glyphs=`echo "$text" | $hb_shape "$fontfile"`
+if ! echo "$hb_shape" | grep -q 'hb-shape'; then
+	echo "Specify hb-shape (not hb-view, etc)." >&2
+	exit 1
+fi
+options=
+have_text=false
+for arg in "$@"; do
+	if test "x${arg:0:1}" == 'x-'; then
+		if echo "$arg" | grep -q ' '; then
+			echo "Space in argument is not supported: '$arg'." >&2
+			exit 1
+		fi
+		options="$options${options:+ }$arg"
+		continue
+	fi
+	if $have_text; then
+		echo "Too many arguments found...  Use '=' notation for options: '$arg'" >&2
+		exit 1;
+	fi
+	text="$arg"
+	have_text=true
+done
+if ! $have_text; then
+	text=`cat`
+fi
+unicodes=`./hb-unicode-decode "$text"`
+glyphs=`echo "$text" | $hb_shape $options "$fontfile"`
+if test $? != 0; then
+	echo "hb-shape failed." >&2
+	exit 2
+fi
 
 cp "$fontfile" "$dir/font.ttf"
 pyftsubset \
@@ -22,14 +53,14 @@ if ! test -s "$dir/font.ttf.subset"; then
 fi
 
 # Verify that subset font produces same glyphs!
-glyphs_subset=`echo "$text" | $hb_shape "$dir/font.ttf.subset"`
+glyphs_subset=`echo "$text" | $hb_shape $options "$dir/font.ttf.subset"`
 
 if ! test "x$glyphs" = "x$glyphs_subset"; then
 	echo "Subset font produced different glyphs!" >&2
 	echo "Perhaps font doesn't have glyph names; checking visually..." >&2
 	hb_view=${hb_shape/shape/view}
-	echo "$text" | $hb_view "$dir/font.ttf" --output-format=png --output-file="$dir/orig.png"
-	echo "$text" | $hb_view "$dir/font.ttf.subset" --output-format=png --output-file="$dir/subset.png"
+	echo "$text" | $hb_view $options "$dir/font.ttf" --output-format=png --output-file="$dir/orig.png"
+	echo "$text" | $hb_view $options "$dir/font.ttf.subset" --output-format=png --output-file="$dir/subset.png"
 	if ! cmp "$dir/orig.png" "$dir/subset.png"; then
 		echo "Images differ.  Please inspect $dir/*.png." >&2
 		echo "$glyphs"
@@ -46,7 +77,7 @@ sha1sum=`sha1sum "$dir/font.ttf.subset" | cut -d' ' -f1`
 subset="fonts/sha1sum/$sha1sum.ttf"
 mv "$dir/font.ttf.subset" "$subset"
 
-echo "$subset:$unicodes:$glyphs"
+echo "$subset:$options:$unicodes:$glyphs"
 
 rm -f "$dir/font.ttf"
 rmdir "$dir"
diff --git a/test/shaping/run-tests.sh b/test/shaping/run-tests.sh
index a2cdf32..1e2e34d 100755
--- a/test/shaping/run-tests.sh
+++ b/test/shaping/run-tests.sh
@@ -15,9 +15,14 @@ fi
 IFS=:
 for f in "$@"; do
 	echo "Running tests in $f"
-	while read fontfile unicodes glyphs_expected; do
+	while read fontfile options unicodes glyphs_expected; do
 		echo "Testing $fontfile:$unicodes"
-		glyphs=`$srcdir/hb-unicode-encode "$unicodes" | $hb_shape "$srcdir/$fontfile"`
+		glyphs=`$srcdir/hb-unicode-encode "$unicodes" | $hb_shape $options "$srcdir/$fontfile"`
+		if test $? != 0; then
+			echo "hb-shape failed." >&2
+			fails=$((fails+1))
+			continue
+		fi
 		if ! test "x$glyphs" = "x$glyphs_expected"; then
 			echo "Actual:   $glyphs" >&2
 			echo "Expected: $glyphs_expected" >&2
diff --git a/test/shaping/tests/arabic-fallback-shaping.tests b/test/shaping/tests/arabic-fallback-shaping.tests
index e3eaf3f..6f1cb8b 100644
--- a/test/shaping/tests/arabic-fallback-shaping.tests
+++ b/test/shaping/tests/arabic-fallback-shaping.tests
@@ -1 +1 @@
-fonts/sha1sum/df768b9c257e0c9c35786c47cae15c46571d56be.ttf:U+0633,U+064F,U+0644,U+064E,U+0651,U+0627,U+0651,U+0650,U+0645,U+062A,U+06CC:[uni06CC.fina=10+1655|uni062A.medi=9+868|uni0645.init=8+1098|uni0650=2 at 221,0+0|uni0651=2 at 260,736+0|uni064E=2 at 935,1259+0|uni0651=2 at 974,736+0|uni06440627.fina=2+1470|uni064F=0 at 558,-10+0|uni0633.init=0+1585]
+fonts/sha1sum/df768b9c257e0c9c35786c47cae15c46571d56be.ttf::U+0633,U+064F,U+0644,U+064E,U+0651,U+0627,U+0651,U+0650,U+0645,U+062A,U+06CC:[uni06CC.fina=10+1655|uni062A.medi=9+868|uni0645.init=8+1098|uni0650=2 at 221,0+0|uni0651=2 at 260,736+0|uni064E=2 at 935,1259+0|uni0651=2 at 974,736+0|uni06440627.fina=2+1470|uni064F=0 at 558,-10+0|uni0633.init=0+1585]
diff --git a/test/shaping/tests/arabic-feature-order.tests b/test/shaping/tests/arabic-feature-order.tests
index 3e3cf6a..e60ab1a 100644
--- a/test/shaping/tests/arabic-feature-order.tests
+++ b/test/shaping/tests/arabic-feature-order.tests
@@ -1,3 +1,3 @@
-fonts/sha1sum/813c2f8e5512187fd982417a7fb4286728e6f4a8.ttf:U+1820,U+180B:[uni2048.E81A=0+1550]
-fonts/sha1sum/8a9fea2a7384f2116e5b84a9b31f83be7850ce21.ttf:U+1820,U+180B:[uni2048.E81A=0+1550]
-fonts/sha1sum/a919b33197965846f21074b24e30250d67277bce.ttf:U+0644,U+0644,U+0647:[Lellah=0+1503]
+fonts/sha1sum/813c2f8e5512187fd982417a7fb4286728e6f4a8.ttf::U+1820,U+180B:[uni2048.E81A=0+1550]
+fonts/sha1sum/8a9fea2a7384f2116e5b84a9b31f83be7850ce21.ttf::U+1820,U+180B:[uni2048.E81A=0+1550]
+fonts/sha1sum/a919b33197965846f21074b24e30250d67277bce.ttf::U+0644,U+0644,U+0647:[Lellah=0+1503]
diff --git a/test/shaping/tests/context-matching.tests b/test/shaping/tests/context-matching.tests
index 4c7d25f..4af186d 100644
--- a/test/shaping/tests/context-matching.tests
+++ b/test/shaping/tests/context-matching.tests
@@ -1,3 +1,3 @@
-fonts/sha1sum/4cce528e99f600ed9c25a2b69e32eb94a03b4ae8.ttf:U+1A48,U+1A58,U+1A25,U+1A48,U+1A58,U+1A25,U+1A6E,U+1A63:[uni1A48=0+1212|uni1A25=0+1912|uni1A58=0+0|uni1A48=3+1212|uni1A6E=3+1212|uni1A25=3+1912|uni1A58=3+0|uni1A63=3+1212]
-fonts/sha1sum/d629e7fedc0b350222d7987345fe61613fa3929a.ttf:U+0915,U+093F,U+0915,U+093F:[ivowelsign03deva=0+530|kadeva=0+1561|ivowelsign03deva=2+530|kadeva=2+1561]
-fonts/sha1sum/f499fbc23865022234775c43503bba2e63978fe1.ttf:U+09B0,U+09CD,U+09A5,U+09CD,U+09AF,U+09C0:[gid1=0+1320|gid13=0+523|gid18=0+545]
+fonts/sha1sum/4cce528e99f600ed9c25a2b69e32eb94a03b4ae8.ttf::U+1A48,U+1A58,U+1A25,U+1A48,U+1A58,U+1A25,U+1A6E,U+1A63:[uni1A48=0+1212|uni1A25=0+1912|uni1A58=0+0|uni1A48=3+1212|uni1A6E=3+1212|uni1A25=3+1912|uni1A58=3+0|uni1A63=3+1212]
+fonts/sha1sum/d629e7fedc0b350222d7987345fe61613fa3929a.ttf::U+0915,U+093F,U+0915,U+093F:[ivowelsign03deva=0+530|kadeva=0+1561|ivowelsign03deva=2+530|kadeva=2+1561]
+fonts/sha1sum/f499fbc23865022234775c43503bba2e63978fe1.ttf::U+09B0,U+09CD,U+09A5,U+09CD,U+09AF,U+09C0:[gid1=0+1320|gid13=0+523|gid18=0+545]
diff --git a/test/shaping/tests/default-ignorables.tests b/test/shaping/tests/default-ignorables.tests
index 3178731..2d3ce97 100644
--- a/test/shaping/tests/default-ignorables.tests
+++ b/test/shaping/tests/default-ignorables.tests
@@ -1 +1 @@
-fonts/sha1sum/051d92f8bc6ff724511b296c27623f824de256e9.ttf:U+0075,U+0361,U+034F,U+0301,U+0069:[gid2=0+1266|gid7=0 at -617,442+0|gid5=0 at -7,0+0|gid1=4+528]
+fonts/sha1sum/051d92f8bc6ff724511b296c27623f824de256e9.ttf::U+0075,U+0361,U+034F,U+0301,U+0069:[gid2=0+1266|gid7=0 at -617,442+0|gid5=0 at -7,0+0|gid1=4+528]
diff --git a/test/shaping/tests/hangul-jamo.tests b/test/shaping/tests/hangul-jamo.tests
index 667a1cc..fe9973f 100644
--- a/test/shaping/tests/hangul-jamo.tests
+++ b/test/shaping/tests/hangul-jamo.tests
@@ -1,2 +1,2 @@
-fonts/sha1sum/757ebd573617a24aa9dfbf0b885c54875c6fe06b.ttf:U+115F,U+11A2:[gid3=0+920|gid4=0+0]
-fonts/sha1sum/7e14e7883ed152baa158b80e207b66114c823a8b.ttf:U+11A2:[gid1=0+920]
+fonts/sha1sum/757ebd573617a24aa9dfbf0b885c54875c6fe06b.ttf::U+115F,U+11A2:[gid3=0+920|gid4=0+0]
+fonts/sha1sum/7e14e7883ed152baa158b80e207b66114c823a8b.ttf::U+11A2:[gid1=0+920]
diff --git a/test/shaping/tests/indic-joiner-candrabindu.tests b/test/shaping/tests/indic-joiner-candrabindu.tests
index 351e927..2ef3304 100644
--- a/test/shaping/tests/indic-joiner-candrabindu.tests
+++ b/test/shaping/tests/indic-joiner-candrabindu.tests
@@ -1,2 +1,2 @@
-fonts/sha1sum/5028afb650b1bb718ed2131e872fbcce57828fff.ttf:U+0B13,U+200D,U+0B01:[omorya=0+1450]
-fonts/sha1sum/5028afb650b1bb718ed2131e872fbcce57828fff.ttf:U+0B13,U+200C,U+0B01:[oorya=0+1309|space=1+0|candrabinduorya=1+0]
+fonts/sha1sum/5028afb650b1bb718ed2131e872fbcce57828fff.ttf::U+0B13,U+200D,U+0B01:[omorya=0+1450]
+fonts/sha1sum/5028afb650b1bb718ed2131e872fbcce57828fff.ttf::U+0B13,U+200C,U+0B01:[oorya=0+1309|space=1+0|candrabinduorya=1+0]
diff --git a/test/shaping/tests/indic-old-spec.tests b/test/shaping/tests/indic-old-spec.tests
index 96e8cdd..5410a6a 100644
--- a/test/shaping/tests/indic-old-spec.tests
+++ b/test/shaping/tests/indic-old-spec.tests
@@ -1,2 +1,2 @@
-fonts/sha1sum/57a9d9f83020155cbb1d2be1f43d82388cbecc88.ttf:U+0C9A,U+0CCD,U+0C9A,U+0CCD:[U0C9A_U0CCD.haln=0+1066|U0C9A_0CCD.blwf=0+0]
-fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf:U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D:[glyph201=0+1183|U0D4D=0+0]
+fonts/sha1sum/57a9d9f83020155cbb1d2be1f43d82388cbecc88.ttf::U+0C9A,U+0CCD,U+0C9A,U+0CCD:[U0C9A_U0CCD.haln=0+1066|U0C9A_0CCD.blwf=0+0]
+fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf::U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D:[glyph201=0+1183|U0D4D=0+0]
diff --git a/test/shaping/tests/indic-pref-blocking.tests b/test/shaping/tests/indic-pref-blocking.tests
index 260980a..204b92a 100644
--- a/test/shaping/tests/indic-pref-blocking.tests
+++ b/test/shaping/tests/indic-pref-blocking.tests
@@ -1,2 +1,2 @@
-fonts/sha1sum/226bc2deab3846f1a682085f70c67d0421014144.ttf:U+0D2F,U+0D4D,U+0D30,U+0D46:[evowelsignmlym=0+1465|rapostmlym=0+499|yamlym=0+2120]
-fonts/sha1sum/e207635780b42f898d58654b65098763e340f5c7.ttf:U+0D2F,U+0D4D,U+0D30,U+0D46:[yamlym=0+2120|viramamlym=0+0|evowelsignmlym=0+1465|ramlym=0+1507]
+fonts/sha1sum/226bc2deab3846f1a682085f70c67d0421014144.ttf::U+0D2F,U+0D4D,U+0D30,U+0D46:[evowelsignmlym=0+1465|rapostmlym=0+499|yamlym=0+2120]
+fonts/sha1sum/e207635780b42f898d58654b65098763e340f5c7.ttf::U+0D2F,U+0D4D,U+0D30,U+0D46:[yamlym=0+2120|viramamlym=0+0|evowelsignmlym=0+1465|ramlym=0+1507]
diff --git a/test/shaping/tests/mongolian-variation-selector.tests b/test/shaping/tests/mongolian-variation-selector.tests
index 6b7e94a..29d11f4 100644
--- a/test/shaping/tests/mongolian-variation-selector.tests
+++ b/test/shaping/tests/mongolian-variation-selector.tests
@@ -1,3 +1,3 @@
-fonts/sha1sum/37033cc5cf37bb223d7355153016b6ccece93b28.ttf:U+1826,U+180B,U+1826:[uni1826.E85E_ue.init1=0+599|uni1826.E856_ue.fina=2+750]
-fonts/sha1sum/ef86fe710cfea877bbe0dbb6946a1f88d0661031.ttf:U+1820,U+180B:[uni1820.E821_a.isol1=0+1199]
-fonts/sha1sum/bb29ce50df2bdba2d10726427c6b7609bf460e04.ttf:U+183A,U+1823,U+182E,U+182B,U+1822,U+1826,U+180B,U+1832,U+180B,U+1827,U+1837,U+0020,U+182D,U+182D,U+180B,U+0020,U+182D,U+180C,U+0020,U+182D,U+180D,U+200D,U+0020,U+182D,U+200D,U+182D,U+180B,U+200D,U+0020,U+182D,U+180C,U+200D,U+0020,U+182D,U+180D,U+200D,U+0020,U+200D,U+182D,U+200D,U+200D,U+182D,U+180B,U+200D,U+0020,U+200D,U+182D,U+180C,U+200D,U+0020,U+200D,U+182D,U+180D,U+200D,U+0020,U+200D,U+182D,U+200D,U+182D,U+180B,U+0020,U+200D,U+182D,U+180C,U+0020,U+1820,U+200C,U+182D,U+1820,U+1837,U+0020,U+1830,U+1824,U+1837,U+200D,U+200D,U+182D,U+1820,U+200D,U+0020,U+200D,U+182D,U+1824,U+182F,U+1822,U+0020,U+182A,U+1820,U+1822,U+182D,U+180E,U+1820,U+202F,U+1836,U+1822,U+1828:[uni183A1823.E971_ko.init=0+950|uni182E.E904_m.medi=2+400|uni182B1822.E8A6_pi.medi=3+1150|uni1826.E854_ue.medi1=5+1100|uni1832.E916_t.medi1=7+1000|uni1827.E85C_ee.medi=9+750|uni1837.E931_r.fina=10+750|space=11+500|uni182D.E8E2_g.init=12+1000|uni182D.E8E8_g.fina1=13+
 1250|space=15+500|uni182D.EA1B_g.isol2=16+1000|space=18+500|uni182D.EA1E_g.init3=19+650|space=21+0|space=22+500|uni182D.E8E2_g.init=23+1000|space=24+0|uni182D.E8E5_g.medi1=25+800|space=27+0|space=28+500|uni182D.EA1D_g.init2=29+950|space=31+0|space=32+500|uni182D.EA1E_g.init3=33+650|space=35+0|space=36+500|space=37+0|uni182D.E8E4_g.medi=38+800|space=39+0|space=40+0|uni182D.E8E5_g.medi1=41+800|space=43+0|space=44+500|space=45+0|uni182D.E8E6_g.medi2=46+650|space=48+0|space=49+500|space=50+0|uni182D.E8E6_g.medi2=51+650|space=53+0|space=54+500|space=55+0|uni182D.E8E4_g.medi=56+800|space=57+0|uni182D.E8E8_g.fina1=58+1250|space=60+500|space=61+0|uni182D.E8E9_g.fina2=62+1050|space=64+500|uni1820.E820_a.isol=65+1550|space=66+0|uni182D.E8E2_g.init=67+1000|uni1820.E823_a.medi=68+400|uni1837.E931_r.fina=69+750|space=70+500|uni1830.E90B_s.init=71+850|uni1824.E844_u.medi=72+600|uni1837.E930_r.medi=73+600|space=74+0|space=75+0|uni182D.E8E5_g.medi1=76+800|uni1820.E823_a.medi=77+400|space=78+0|space
 =79+500|space=80+0|uni182D.E8E5_g.medi1=81+800|uni1824.E844_u.medi=82+600|uni182F.E908_l.medi=83+400|uni1822.E837_i.fina=84+600|space=85+500|uni182A1820.E875_ba.init=86+1000|uni1822.E836_i.medi2=88+1000|uni182D.E8E8_g.fina1=89+1250|space=90+0|uni1820.E827_a.fina2=91+600|uni202F.nobreak=92+500|uni1836.E92B_y.init1=93+500|uni1822.E834_i.medi=94+500|uni1828.E866_n.fina=95+850]
+fonts/sha1sum/37033cc5cf37bb223d7355153016b6ccece93b28.ttf::U+1826,U+180B,U+1826:[uni1826.E85E_ue.init1=0+599|uni1826.E856_ue.fina=2+750]
+fonts/sha1sum/ef86fe710cfea877bbe0dbb6946a1f88d0661031.ttf::U+1820,U+180B:[uni1820.E821_a.isol1=0+1199]
+fonts/sha1sum/bb29ce50df2bdba2d10726427c6b7609bf460e04.ttf::U+183A,U+1823,U+182E,U+182B,U+1822,U+1826,U+180B,U+1832,U+180B,U+1827,U+1837,U+0020,U+182D,U+182D,U+180B,U+0020,U+182D,U+180C,U+0020,U+182D,U+180D,U+200D,U+0020,U+182D,U+200D,U+182D,U+180B,U+200D,U+0020,U+182D,U+180C,U+200D,U+0020,U+182D,U+180D,U+200D,U+0020,U+200D,U+182D,U+200D,U+200D,U+182D,U+180B,U+200D,U+0020,U+200D,U+182D,U+180C,U+200D,U+0020,U+200D,U+182D,U+180D,U+200D,U+0020,U+200D,U+182D,U+200D,U+182D,U+180B,U+0020,U+200D,U+182D,U+180C,U+0020,U+1820,U+200C,U+182D,U+1820,U+1837,U+0020,U+1830,U+1824,U+1837,U+200D,U+200D,U+182D,U+1820,U+200D,U+0020,U+200D,U+182D,U+1824,U+182F,U+1822,U+0020,U+182A,U+1820,U+1822,U+182D,U+180E,U+1820,U+202F,U+1836,U+1822,U+1828:[uni183A1823.E971_ko.init=0+950|uni182E.E904_m.medi=2+400|uni182B1822.E8A6_pi.medi=3+1150|uni1826.E854_ue.medi1=5+1100|uni1832.E916_t.medi1=7+1000|uni1827.E85C_ee.medi=9+750|uni1837.E931_r.fina=10+750|space=11+500|uni182D.E8E2_g.init=12+1000|uni182D.E8E8_g.fina1=13
 +1250|space=15+500|uni182D.EA1B_g.isol2=16+1000|space=18+500|uni182D.EA1E_g.init3=19+650|space=21+0|space=22+500|uni182D.E8E2_g.init=23+1000|space=24+0|uni182D.E8E5_g.medi1=25+800|space=27+0|space=28+500|uni182D.EA1D_g.init2=29+950|space=31+0|space=32+500|uni182D.EA1E_g.init3=33+650|space=35+0|space=36+500|space=37+0|uni182D.E8E4_g.medi=38+800|space=39+0|space=40+0|uni182D.E8E5_g.medi1=41+800|space=43+0|space=44+500|space=45+0|uni182D.E8E6_g.medi2=46+650|space=48+0|space=49+500|space=50+0|uni182D.E8E6_g.medi2=51+650|space=53+0|space=54+500|space=55+0|uni182D.E8E4_g.medi=56+800|space=57+0|uni182D.E8E8_g.fina1=58+1250|space=60+500|space=61+0|uni182D.E8E9_g.fina2=62+1050|space=64+500|uni1820.E820_a.isol=65+1550|space=66+0|uni182D.E8E2_g.init=67+1000|uni1820.E823_a.medi=68+400|uni1837.E931_r.fina=69+750|space=70+500|uni1830.E90B_s.init=71+850|uni1824.E844_u.medi=72+600|uni1837.E930_r.medi=73+600|space=74+0|space=75+0|uni182D.E8E5_g.medi1=76+800|uni1820.E823_a.medi=77+400|space=78+0|spac
 e=79+500|space=80+0|uni182D.E8E5_g.medi1=81+800|uni1824.E844_u.medi=82+600|uni182F.E908_l.medi=83+400|uni1822.E837_i.fina=84+600|space=85+500|uni182A1820.E875_ba.init=86+1000|uni1822.E836_i.medi2=88+1000|uni182D.E8E8_g.fina1=89+1250|space=90+0|uni1820.E827_a.fina2=91+600|uni202F.nobreak=92+500|uni1836.E92B_y.init1=93+500|uni1822.E834_i.medi=94+500|uni1828.E866_n.fina=95+850]
diff --git a/test/shaping/tests/zero-width-marks.tests b/test/shaping/tests/zero-width-marks.tests
index be7ec96..ead3ff4 100644
--- a/test/shaping/tests/zero-width-marks.tests
+++ b/test/shaping/tests/zero-width-marks.tests
@@ -1,2 +1,2 @@
-fonts/sha1sum/bb9473d2403488714043bcfb946c9f78b86ad627.ttf:U+1030:[circledash=0+636|u1030.med=0 at -162,0+0]
-fonts/sha1sum/8454d22037f892e76614e1645d066689a0200e61.ttf:U+05E0,U+05B8,U+0591,U+05DA,U+05B0:[uni05DA05B0=3+991|uni2009=0+200|uni0591=0 at 75,0+0|uni05B8=0 at 495,0+0|uni05E0=0+683]
+fonts/sha1sum/bb9473d2403488714043bcfb946c9f78b86ad627.ttf::U+1030:[circledash=0+636|u1030.med=0 at -162,0+0]
+fonts/sha1sum/8454d22037f892e76614e1645d066689a0200e61.ttf::U+05E0,U+05B8,U+0591,U+05DA,U+05B0:[uni05DA05B0=3+991|uni2009=0+200|uni0591=0 at 75,0+0|uni05B8=0 at 495,0+0|uni05E0=0+683]
commit 0f98fe88f42471eb8fb28d08d45eca9cd8303f7a
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 23 11:52:11 2015 +0100

    [ot] Search globally for 'vert' feature if not found in specified script/lang
    
    Fixes https://github.com/behdad/harfbuzz/issues/63

diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh
index d854563..a98734a 100644
--- a/src/hb-ot-layout-private.hh
+++ b/src/hb-ot-layout-private.hh
@@ -36,6 +36,15 @@
 #include "hb-set-private.hh"
 
 
+/* Private API corresponding to hb-ot-layout.h: */
+
+HB_INTERNAL hb_bool_t
+hb_ot_layout_table_find_feature (hb_face_t    *face,
+				 hb_tag_t      table_tag,
+				 hb_tag_t      feature_tag,
+				 unsigned int *feature_index);
+
+
 /*
  * GDEF
  */
diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc
index 5570a81..6fe7b6c 100644
--- a/src/hb-ot-layout.cc
+++ b/src/hb-ot-layout.cc
@@ -291,6 +291,28 @@ hb_ot_layout_table_get_feature_tags (hb_face_t    *face,
   return g.get_feature_tags (start_offset, feature_count, feature_tags);
 }
 
+hb_bool_t
+hb_ot_layout_table_find_feature (hb_face_t    *face,
+				 hb_tag_t      table_tag,
+				 hb_tag_t      feature_tag,
+				 unsigned int *feature_index)
+{
+  ASSERT_STATIC (OT::Index::NOT_FOUND_INDEX == HB_OT_LAYOUT_NO_FEATURE_INDEX);
+  const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
+
+  unsigned int num_features = g.get_feature_count ();
+  for (unsigned int i = 0; i < num_features; i++)
+  {
+    if (feature_tag == g.get_feature_tag (i)) {
+      if (feature_index) *feature_index = i;
+      return true;
+    }
+  }
+
+  if (feature_index) *feature_index = HB_OT_LAYOUT_NO_FEATURE_INDEX;
+  return false;
+}
+
 
 unsigned int
 hb_ot_layout_script_get_language_tags (hb_face_t    *face,
diff --git a/src/hb-ot-map-private.hh b/src/hb-ot-map-private.hh
index 86b7e9f..f9538af 100644
--- a/src/hb-ot-map-private.hh
+++ b/src/hb-ot-map-private.hh
@@ -154,9 +154,10 @@ struct hb_ot_map_t
 
 enum hb_ot_map_feature_flags_t {
   F_NONE		= 0x0000u,
-  F_GLOBAL		= 0x0001u,
-  F_HAS_FALLBACK	= 0x0002u,
-  F_MANUAL_ZWJ		= 0x0004u
+  F_GLOBAL		= 0x0001u, /* Feature applies to all characters; results in no mask allocated for it. */
+  F_HAS_FALLBACK	= 0x0002u, /* Has fallback implementation, so include mask bit even if feature not found. */
+  F_MANUAL_ZWJ		= 0x0004u, /* Don't skip over ZWJ when matching. */
+  F_GLOBAL_SEARCH	= 0x0008u  /* If feature not found in LangSys, look for it in global feature list and pick one. */
 };
 /* Macro version for where const is desired. */
 #define F_COMBINE(l,r) (hb_ot_map_feature_flags_t ((unsigned int) (l) | (unsigned int) (r)))
diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc
index 4985eb2..95bd04e 100644
--- a/src/hb-ot-map.cc
+++ b/src/hb-ot-map.cc
@@ -216,6 +216,16 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
 						   info->tag,
 						   &feature_index[table_index]);
     }
+    if (!found && (info->flags & F_GLOBAL_SEARCH))
+    {
+      for (unsigned int table_index = 0; table_index < 2; table_index++)
+      {
+	found |= hb_ot_layout_table_find_feature (face,
+						  table_tags[table_index],
+						  info->tag,
+						  &feature_index[table_index]);
+      }
+    }
     if (!found && !(info->flags & F_HAS_FALLBACK))
       continue;
 
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 00a2121..f20be2a 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -102,7 +102,11 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t          *planner,
 			 F_HAS_FALLBACK : F_NONE));
   else
   {
-    map->add_global_bool_feature (HB_TAG('v','e','r','t'));
+    /* We really want to find a 'vert' feature if there's any in the font, no
+     * matter which script/langsys it is listed (or not) under.
+     * See various bugs referenced from:
+     * https://github.com/behdad/harfbuzz/issues/63 */
+    map->add_feature (HB_TAG ('v','e','r','t'), 1, F_GLOBAL | F_GLOBAL_SEARCH);
   }
 
   if (planner->shaper->override_features)
commit f327aacfa107bbef0c823ef9c3b7dfc91316040c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 23 11:32:59 2015 +0100

    [ot] Minor

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 993497a..00a2121 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -59,10 +59,6 @@ static hb_tag_t horizontal_features[] = {
   HB_TAG('r','c','l','t'),
 };
 
-static hb_tag_t vertical_features[] = {
-  HB_TAG('v','e','r','t'),
-};
-
 
 
 static void
@@ -105,10 +101,9 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t          *planner,
 			(horizontal_features[i] == HB_TAG('k','e','r','n') ?
 			 F_HAS_FALLBACK : F_NONE));
   else
-    for (unsigned int i = 0; i < ARRAY_LENGTH (vertical_features); i++)
-      map->add_feature (vertical_features[i], 1, F_GLOBAL |
-			(vertical_features[i] == HB_TAG('v','k','r','n') ?
-			 F_HAS_FALLBACK : F_NONE));
+  {
+    map->add_global_bool_feature (HB_TAG('v','e','r','t'));
+  }
 
   if (planner->shaper->override_features)
     planner->shaper->override_features (planner);


More information about the HarfBuzz mailing list