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

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Feb 13 02:59:59 PST 2013


 src/hb-ot-shape-complex-sea.cc |    2 +-
 src/hb-ot-shape.cc             |   33 +++++++++++++++++++++++----------
 2 files changed, 24 insertions(+), 11 deletions(-)

New commits:
commit bc11de144c0a7a95fa0945aa7f053d8117af282a
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Feb 13 05:59:06 2013 -0500

    [SEA] Don't zero any mark advances
    
    Keep the logic simple, easier to explain to font developers.

diff --git a/src/hb-ot-shape-complex-sea.cc b/src/hb-ot-shape-complex-sea.cc
index 2075a06..cfd0baa 100644
--- a/src/hb-ot-shape-complex-sea.cc
+++ b/src/hb-ot-shape-complex-sea.cc
@@ -395,6 +395,6 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_sea =
   NULL, /* decompose */
   NULL, /* compose */
   setup_masks_sea,
-  HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF,
+  HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
   false, /* fallback_position */
 };
commit 0291a6528685f1f593707655943fb2360579cb9e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Feb 13 05:57:24 2013 -0500

    Further adjust mark advance zeroing
    
    This is a followup to 568000274c8edb5f41bc4f876ce21fcc8bdaeed8.
    Looks like in the Latin shaper, Uniscribe zeroes all Unicode NSM
    advances *after* GPOS, not before.  Match that.
    
    Can be tested using DejaVu Sans Mono, since that font has GPOS
    rules to zero the mark advances on its own.

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index ce13139..d529223 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -418,17 +418,10 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
 
   }
 
+  /* Zero'ing mark widths by GDEF (as used in Myanmar spec) happens
+   * *before* GPOS. */
   switch (c->plan->shaper->zero_width_marks)
   {
-    case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE:
-      for (unsigned int i = 0; i < count; i++)
-	if (_hb_glyph_info_get_general_category (&c->buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
-	{
-	  c->buffer->pos[i].x_advance = 0;
-	  c->buffer->pos[i].y_advance = 0;
-	}
-      break;
-
     case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF:
       for (unsigned int i = 0; i < count; i++)
 	if ((c->buffer->info[i].glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK))
@@ -440,6 +433,7 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
 
     default:
     case HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE:
+    case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE:
       break;
   }
 }
@@ -448,12 +442,12 @@ static inline bool
 hb_ot_position_complex (hb_ot_shape_context_t *c)
 {
   bool ret = false;
+  unsigned int count = c->buffer->len;
 
   if (hb_ot_layout_has_positioning (c->face))
   {
     /* Change glyph origin to what GPOS expects, apply GPOS, change it back. */
 
-    unsigned int count = c->buffer->len;
     for (unsigned int i = 0; i < count; i++) {
       c->font->add_glyph_origin_for_direction (c->buffer->info[i].codepoint,
 					       HB_DIRECTION_LTR,
@@ -473,6 +467,25 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
     ret = true;
   }
 
+  /* Zero'ing mark widths by Unicode happens
+   * *after* GPOS. */
+  switch (c->plan->shaper->zero_width_marks)
+  {
+    case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE:
+      for (unsigned int i = 0; i < count; i++)
+	if (_hb_glyph_info_get_general_category (&c->buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
+	{
+	  c->buffer->pos[i].x_advance = 0;
+	  c->buffer->pos[i].y_advance = 0;
+	}
+      break;
+
+    default:
+    case HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE:
+    case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF:
+      break;
+  }
+
   hb_ot_layout_position_finish (c->font, c->buffer);
 
   return ret;



More information about the HarfBuzz mailing list