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

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Feb 24 06:55:35 UTC 2016


 src/hb-ot-layout-gpos-table.hh                                          |   28 ++++------
 test/shaping/fonts/sha1sum/07f054357ff8638bac3711b422a1e31180bba863.ttf |binary
 test/shaping/run-tests.sh                                               |    4 +
 test/shaping/tests/cursive-positioning.tests                            |    3 -
 4 files changed, 18 insertions(+), 17 deletions(-)

New commits:
commit ebd7431f824c718db6ce5b85e94f2b3911127af4
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Feb 24 15:53:40 2016 +0900

    Partially revert 86c68c7a2c971efe8e35b1f1bd99401dc8b688d2
    
    That commit moved the advance adjustment for mark positioning to
    be applied immediately, instead of doing late before.  This breaks
    if mark advances are zeroed late, like in Arabic.  Also, easier to
    hit it in RTL scripts since a single mark with non-zero advance is
    enough to hit the bug, whereas in LTR, at least two marks are needed.
    
    This reopens https://github.com/behdad/harfbuzz/issues/211
    The cursive+mark interaction is broken again.  To be fixed in a
    different way.

diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh
index 59dddcf..bbe390c 100644
--- a/src/hb-ot-layout-gpos-table.hh
+++ b/src/hb-ot-layout-gpos-table.hh
@@ -437,22 +437,6 @@ struct MarkArray : ArrayOf<MarkRecord>	/* Array of MarkRecords--in Coverage orde
     o.attach_type() = ATTACH_TYPE_MARK;
     o.attach_chain() = (int) glyph_pos - (int) buffer->idx;
     buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT;
-    {
-      unsigned int i = buffer->idx;
-      unsigned int j = glyph_pos;
-      hb_glyph_position_t *pos = buffer->pos;
-      assert (j < i);
-      if (HB_DIRECTION_IS_FORWARD (c->direction))
-	for (unsigned int k = j; k < i; k++) {
-	  pos[i].x_offset -= pos[k].x_advance;
-	  pos[i].y_offset -= pos[k].y_advance;
-	}
-      else
-	for (unsigned int k = j + 1; k < i + 1; k++) {
-	  pos[i].x_offset += pos[k].x_advance;
-	  pos[i].y_offset += pos[k].y_advance;
-	}
-    }
 
     buffer->idx++;
     return_trace (true);
@@ -1593,6 +1577,18 @@ propagate_attachment_offsets (hb_glyph_position_t *pos, unsigned int i, hb_direc
   {
     pos[i].x_offset += pos[j].x_offset;
     pos[i].y_offset += pos[j].y_offset;
+
+    assert (j < i);
+    if (HB_DIRECTION_IS_FORWARD (direction))
+      for (unsigned int k = j; k < i; k++) {
+	pos[i].x_offset -= pos[k].x_advance;
+	pos[i].y_offset -= pos[k].y_advance;
+      }
+    else
+      for (unsigned int k = j + 1; k < i + 1; k++) {
+	pos[i].x_offset += pos[k].x_advance;
+	pos[i].y_offset += pos[k].y_advance;
+      }
   }
 }
 
diff --git a/test/shaping/tests/cursive-positioning.tests b/test/shaping/tests/cursive-positioning.tests
index 4b2492c..6455202 100644
--- a/test/shaping/tests/cursive-positioning.tests
+++ b/test/shaping/tests/cursive-positioning.tests
@@ -1,4 +1,4 @@
 fonts/sha1sum/c4e48b0886ef460f532fb49f00047ec92c432ec0.ttf::U+0643,U+0645,U+0645,U+062B,U+0644:[gid8=4+738|gid5=3 at 441,1197+0|gid6=3 at 0,432+405|gid9=2 at 0,477+452|gid9=1 at 0,977+452|gid10=0 at 20,1577+207]
 fonts/sha1sum/298c9e1d955f10f6f72c6915c3c6ff9bf9695cec.ttf::U+0643,U+0645,U+0645,U+062B,U+0644:[gid8=4+738|gid5=3 at 441,1197+0|gid6=3 at 0,432+405|gid9=2 at 0,477+500|gid9=1 at 0,577+452|gid10=0 at 20,1177+207]
-fonts/sha1sum/706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf::U+0B1F,U+0B4D,U+0B1A,U+0B4D,U+0B1A:[ttaorya=0+1307|casubscriptorya=0 at -242,104+-231|casubscriptnarroworya=0 at 20,104+507]
+#fonts/sha1sum/706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf::U+0B1F,U+0B4D,U+0B1A,U+0B4D,U+0B1A:[ttaorya=0+1307|casubscriptorya=0 at -242,104+-231|casubscriptnarroworya=0 at 20,104+507]
 fonts/sha1sum/07f054357ff8638bac3711b422a1e31180bba863.ttf::U+0606,U+06E1:[Glyph2=0 at 40,502+0|Glyph1=0+1024]
commit 284481b3120963353f5f34ed094f07ffc13480ef
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Feb 24 15:52:37 2016 +0900

    Add test for mark positioning in rtl with non-zero mark advance
    
    Apparently I broke this 86c68c7a2c971efe8e35b1f1bd99401dc8b688d2.
    Fix coming.

diff --git a/test/shaping/fonts/sha1sum/07f054357ff8638bac3711b422a1e31180bba863.ttf b/test/shaping/fonts/sha1sum/07f054357ff8638bac3711b422a1e31180bba863.ttf
new file mode 100644
index 0000000..fcd4f32
Binary files /dev/null and b/test/shaping/fonts/sha1sum/07f054357ff8638bac3711b422a1e31180bba863.ttf differ
diff --git a/test/shaping/tests/cursive-positioning.tests b/test/shaping/tests/cursive-positioning.tests
index 503554f..4b2492c 100644
--- a/test/shaping/tests/cursive-positioning.tests
+++ b/test/shaping/tests/cursive-positioning.tests
@@ -1,3 +1,4 @@
 fonts/sha1sum/c4e48b0886ef460f532fb49f00047ec92c432ec0.ttf::U+0643,U+0645,U+0645,U+062B,U+0644:[gid8=4+738|gid5=3 at 441,1197+0|gid6=3 at 0,432+405|gid9=2 at 0,477+452|gid9=1 at 0,977+452|gid10=0 at 20,1577+207]
 fonts/sha1sum/298c9e1d955f10f6f72c6915c3c6ff9bf9695cec.ttf::U+0643,U+0645,U+0645,U+062B,U+0644:[gid8=4+738|gid5=3 at 441,1197+0|gid6=3 at 0,432+405|gid9=2 at 0,477+500|gid9=1 at 0,577+452|gid10=0 at 20,1177+207]
 fonts/sha1sum/706c5d7b625f207bc0d874c67237aad6f1e9cd6f.ttf::U+0B1F,U+0B4D,U+0B1A,U+0B4D,U+0B1A:[ttaorya=0+1307|casubscriptorya=0 at -242,104+-231|casubscriptnarroworya=0 at 20,104+507]
+fonts/sha1sum/07f054357ff8638bac3711b422a1e31180bba863.ttf::U+0606,U+06E1:[Glyph2=0 at 40,502+0|Glyph1=0+1024]
commit 56a84e8dd18c63782b8db3a86e94651dae5bb01b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Feb 24 15:50:33 2016 +0900

    [tests] Allow commenting out tests to be skipped

diff --git a/test/shaping/run-tests.sh b/test/shaping/run-tests.sh
index 668bb8c..47bf25b 100755
--- a/test/shaping/run-tests.sh
+++ b/test/shaping/run-tests.sh
@@ -22,6 +22,10 @@ IFS=:
 for f in "$@"; do
 	$reference || echo "Running tests in $f"
 	while read fontfile options unicodes glyphs_expected; do
+		if echo "$fontfile" | grep -q '^#'; then
+			$reference || echo "Skipping $fontfile:$unicodes"
+			continue
+		fi
 		$reference || echo "Testing $fontfile:$unicodes"
 		glyphs=`$srcdir/hb-unicode-encode "$unicodes" | $hb_shape $options "$srcdir/$fontfile"`
 		if test $? != 0; then


More information about the HarfBuzz mailing list