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

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Jul 26 16:19:38 PDT 2014


 src/hb-ot-shape-complex-indic.cc                                        |    1 
 src/hb-ot-shape-complex-myanmar.cc                                      |   18 ++++++++++
 src/hb-ot-shape-complex-private.hh                                      |    5 +-
 src/hb-ot-shape.cc                                                      |    2 -
 test/shaping/Makefile.am                                                |    1 
 test/shaping/fonts/sha1sum/MANIFEST                                     |    1 
 test/shaping/fonts/sha1sum/bb9473d2403488714043bcfb946c9f78b86ad627.ttf |binary
 test/shaping/tests/MANIFEST                                             |    1 
 test/shaping/tests/zero-width-marks.tests                               |    1 
 9 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit 6f2d9ba52a6d1e3fc200da1ef0e85ba020fcd0dc
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Jul 26 19:17:44 2014 -0400

    Add old-Myanmar shaper
    
    Looks like Unsicribe responds to the 'mymr' tag by zeroing marks
    GDEF_LATE instead of generic-shaper UNICODE_LATE.  Implement that.
    
    Fixes
    Bug 81775 - Incorrect Rendering with harfbuzz-ng myanmar unicode
    https://bugs.freedesktop.org/show_bug.cgi?id=81775
    
    Micro-test added based on Padauk.

diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc
index 258ccc4..d016380 100644
--- a/src/hb-ot-shape-complex-myanmar.cc
+++ b/src/hb-ot-shape-complex-myanmar.cc
@@ -536,6 +536,24 @@ final_reordering (const hb_ot_shape_plan_t *plan,
 }
 
 
+/* Uniscribe seems to have a shaper for 'mymr' that is like the
+ * generic shaper, except that it zeros mark advances GDEF_LATE. */
+const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar_old =
+{
+  "default",
+  NULL, /* collect_features */
+  NULL, /* override_features */
+  NULL, /* data_create */
+  NULL, /* data_destroy */
+  NULL, /* preprocess_text */
+  HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
+  NULL, /* decompose */
+  NULL, /* compose */
+  NULL, /* setup_masks */
+  HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE,
+  true, /* fallback_position */
+};
+
 const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar =
 {
   "myanmar",
diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh
index 3e581af..9a7afcb 100644
--- a/src/hb-ot-shape-complex-private.hh
+++ b/src/hb-ot-shape-complex-private.hh
@@ -56,6 +56,7 @@ enum hb_ot_shape_zero_width_marks_type_t {
   HB_COMPLEX_SHAPER_IMPLEMENT (arabic) \
   HB_COMPLEX_SHAPER_IMPLEMENT (hangul) \
   HB_COMPLEX_SHAPER_IMPLEMENT (hebrew) \
+  HB_COMPLEX_SHAPER_IMPLEMENT (myanmar_old) \
   HB_COMPLEX_SHAPER_IMPLEMENT (indic) \
   HB_COMPLEX_SHAPER_IMPLEMENT (myanmar) \
   HB_COMPLEX_SHAPER_IMPLEMENT (sea) \
@@ -329,10 +330,10 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
 	return &_hb_ot_complex_shaper_default;
 
     case HB_SCRIPT_MYANMAR:
-      /* For Myanmar, we only want to use the Myanmar shaper if the "new" script
-       * tag is found.  For "old" script tag we want to use the default shaper. */
       if (planner->map.chosen_script[0] == HB_TAG ('m','y','m','2'))
 	return &_hb_ot_complex_shaper_myanmar;
+      else if (planner->map.chosen_script[0] == HB_TAG ('m','y','m','r'))
+	return &_hb_ot_complex_shaper_myanmar_old;
       else
 	return &_hb_ot_complex_shaper_default;
 
diff --git a/test/shaping/Makefile.am b/test/shaping/Makefile.am
index c2c4db6..f40f2ff 100644
--- a/test/shaping/Makefile.am
+++ b/test/shaping/Makefile.am
@@ -41,6 +41,7 @@ TESTS = \
 	tests/indic-old-spec.tests \
 	tests/indic-pref-blocking.tests \
 	tests/mongolian-variation-selector.tests \
+	tests/zero-width-marks.tests \
 	$(NULL)
 
 TEST_EXTENSIONS = \
diff --git a/test/shaping/fonts/sha1sum/MANIFEST b/test/shaping/fonts/sha1sum/MANIFEST
index 4aaa54d..0e9da64 100644
--- a/test/shaping/fonts/sha1sum/MANIFEST
+++ b/test/shaping/fonts/sha1sum/MANIFEST
@@ -7,6 +7,7 @@
 8a9fea2a7384f2116e5b84a9b31f83be7850ce21.ttf
 a919b33197965846f21074b24e30250d67277bce.ttf
 bb29ce50df2bdba2d10726427c6b7609bf460e04.ttf
+bb9473d2403488714043bcfb946c9f78b86ad627.ttf
 d629e7fedc0b350222d7987345fe61613fa3929a.ttf
 e207635780b42f898d58654b65098763e340f5c7.ttf
 ef86fe710cfea877bbe0dbb6946a1f88d0661031.ttf
diff --git a/test/shaping/fonts/sha1sum/bb9473d2403488714043bcfb946c9f78b86ad627.ttf b/test/shaping/fonts/sha1sum/bb9473d2403488714043bcfb946c9f78b86ad627.ttf
new file mode 100644
index 0000000..b16dae6
Binary files /dev/null and b/test/shaping/fonts/sha1sum/bb9473d2403488714043bcfb946c9f78b86ad627.ttf differ
diff --git a/test/shaping/tests/MANIFEST b/test/shaping/tests/MANIFEST
index a792e91..8c2bdca 100644
--- a/test/shaping/tests/MANIFEST
+++ b/test/shaping/tests/MANIFEST
@@ -3,3 +3,4 @@ context-matching.tests
 indic-old-spec.tests
 indic-pref-blocking.tests
 mongolian-variation-selector.tests
+zero-width-marks.tests
diff --git a/test/shaping/tests/zero-width-marks.tests b/test/shaping/tests/zero-width-marks.tests
new file mode 100644
index 0000000..bfe0809
--- /dev/null
+++ b/test/shaping/tests/zero-width-marks.tests
@@ -0,0 +1 @@
+fonts/sha1sum/bb9473d2403488714043bcfb946c9f78b86ad627.ttf:U+1030:[circledash=0+636|u1030.med=0 at -162,0+0]
commit 595d2b96c37de8147489dc5e0ddcc4ab1ad3eea9
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Jul 26 18:44:15 2014 -0400

    Minor

diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc
index be5d574..7723600 100644
--- a/src/hb-ot-shape-complex-indic.cc
+++ b/src/hb-ot-shape-complex-indic.cc
@@ -1285,6 +1285,7 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
       info.cluster = buffer->cur().cluster;
       info.mask = buffer->cur().mask;
       info.syllable() = buffer->cur().syllable();
+      /* TODO Set glyph_props? */
 
       /* Insert dottedcircle after possible Repha. */
       while (buffer->idx < buffer->len &&
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 1f99014..66846ed 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -243,7 +243,7 @@ hb_insert_dotted_circle (hb_buffer_t *buffer, hb_font_t *font)
   if (!font->has_glyph (0x25CCu))
     return;
 
-  hb_glyph_info_t dottedcircle;
+  hb_glyph_info_t dottedcircle = {0};
   dottedcircle.codepoint = 0x25CCu;
   _hb_glyph_info_set_unicode_props (&dottedcircle, buffer->unicode);
 


More information about the HarfBuzz mailing list