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

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Nov 26 15:50:22 PST 2015


 src/hb-ot-shape.cc                                                      |   13 ++++++----
 test/shaping/Makefile.am                                                |    1 
 test/shaping/fonts/sha1sum/49c9f7485c1392fa09a1b801bc2ffea79275f22e.ttf |binary
 test/shaping/fonts/sha1sum/MANIFEST                                     |    1 
 test/shaping/tests/MANIFEST                                             |    1 
 test/shaping/tests/simple.tests                                         |    2 +
 6 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 67a36a725e2a61a096ba0324f359d17f9b02d312
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Nov 26 18:48:42 2015 -0500

    Fix vertical GPOS
    
    This was brorken earlier, though, it's really hard to notice it.
    Unlike the glyph_h_origin(), an unset glyph_v_origin() does NOT
    mean that the vertical origin is at 0,0.
    
    Related to https://github.com/behdad/harfbuzz/issues/187

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 81ec94c..bfbd533 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -662,6 +662,7 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
   {
     for (unsigned int i = 0; i < count; i++)
       pos[i].x_advance = c->font->get_glyph_h_advance (info[i].codepoint);
+    /* The nil glyph_h_origin() func returns 0, so no need to apply it. */
     if (c->font->has_glyph_h_origin_func ())
       for (unsigned int i = 0; i < count; i++)
 	c->font->subtract_glyph_h_origin (info[i].codepoint,
@@ -671,12 +672,12 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
   else
   {
     for (unsigned int i = 0; i < count; i++)
+    {
       pos[i].y_advance = c->font->get_glyph_v_advance (info[i].codepoint);
-    if (c->font->has_glyph_v_origin_func ())
-      for (unsigned int i = 0; i < count; i++)
-	c->font->subtract_glyph_v_origin (info[i].codepoint,
-					  &pos[i].x_offset,
-					  &pos[i].y_offset);
+      c->font->subtract_glyph_v_origin (info[i].codepoint,
+					&pos[i].x_offset,
+					&pos[i].y_offset);
+    }
   }
   if (c->buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK)
     _hb_ot_shape_fallback_spaces (c->plan, c->font, c->buffer);
@@ -726,6 +727,7 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
 
     /* Change glyph origin to what GPOS expects (horizontal), apply GPOS, change it back. */
 
+    /* The nil glyph_h_origin() func returns 0, so no need to apply it. */
     if (c->font->has_glyph_h_origin_func ())
       for (unsigned int i = 0; i < count; i++)
 	c->font->add_glyph_h_origin (info[i].codepoint,
@@ -734,6 +736,7 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
 
     c->plan->position (c->font, c->buffer);
 
+    /* The nil glyph_h_origin() func returns 0, so no need to apply it. */
     if (c->font->has_glyph_h_origin_func ())
       for (unsigned int i = 0; i < count; i++)
 	c->font->subtract_glyph_h_origin (info[i].codepoint,
commit 1c6a057dd1a52511474630896a597bf8e5215214
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Nov 26 18:48:30 2015 -0500

    Add tests for previous commit

diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index e7ac9d5..a8e485e 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -54,6 +54,7 @@ TESTS = \
 	tests/indic-pref-blocking.tests \
 	tests/mongolian-variation-selector.tests \
 	tests/spaces.tests \
+	tests/simple.tests \
 	tests/vertical.tests \
 	tests/zero-width-marks.tests \
 	$(NULL)
diff --git a/test/shaping/fonts/sha1sum/49c9f7485c1392fa09a1b801bc2ffea79275f22e.ttf b/test/shaping/fonts/sha1sum/49c9f7485c1392fa09a1b801bc2ffea79275f22e.ttf
new file mode 100644
index 0000000..ea1326d
Binary files /dev/null and b/test/shaping/fonts/sha1sum/49c9f7485c1392fa09a1b801bc2ffea79275f22e.ttf differ
diff --git a/test/shaping/fonts/sha1sum/MANIFEST b/test/shaping/fonts/sha1sum/MANIFEST
index 86871aa..8e46c3a 100644
--- a/test/shaping/fonts/sha1sum/MANIFEST
+++ b/test/shaping/fonts/sha1sum/MANIFEST
@@ -12,6 +12,7 @@
 375d6ae32a3cbe52fbf81a4e5777e3377675d5a3.ttf
 43979b90b2dd929723cf4fe1715990bcb9c9a56b.ttf
 43ef465752be9af900745f72fe29cb853a1401a5.ttf
+49c9f7485c1392fa09a1b801bc2ffea79275f22e.ttf
 4cce528e99f600ed9c25a2b69e32eb94a03b4ae8.ttf
 5028afb650b1bb718ed2131e872fbcce57828fff.ttf
 57a9d9f83020155cbb1d2be1f43d82388cbecc88.ttf
diff --git a/test/shaping/tests/MANIFEST b/test/shaping/tests/MANIFEST
index 0ebbd24..0eed98f 100644
--- a/test/shaping/tests/MANIFEST
+++ b/test/shaping/tests/MANIFEST
@@ -11,6 +11,7 @@ indic-joiner-candrabindu.tests
 indic-old-spec.tests
 indic-pref-blocking.tests
 mongolian-variation-selector.tests
+simple.tests
 spaces.tests
 vertical.tests
 zero-width-marks.tests
diff --git a/test/shaping/tests/simple.tests b/test/shaping/tests/simple.tests
new file mode 100644
index 0000000..bebe008
--- /dev/null
+++ b/test/shaping/tests/simple.tests
@@ -0,0 +1,2 @@
+fonts/sha1sum/49c9f7485c1392fa09a1b801bc2ffea79275f22e.ttf:--shaper=ot:U+0056,U+0041,U+0042,U+0045,U+0061,U+0062,U+0063,U+0064:[V=0+1142|A=1+1295|B=2+1295|E=3+1123|a=4+1126|b=5+1164|c=6+1072|d=7+1164]
+fonts/sha1sum/49c9f7485c1392fa09a1b801bc2ffea79275f22e.ttf:--shaper=fallback:U+0056,U+0041,U+0042,U+0045,U+0061,U+0062,U+0063,U+0064:[V=0+1295|A=1+1295|B=2+1295|E=3+1123|a=4+1126|b=5+1164|c=6+1072|d=7+1164]


More information about the HarfBuzz mailing list