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

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Feb 21 12:55:58 PST 2013


 src/hb-ot-layout-private.hh |   10 ++++----
 src/hb-ot-shape-fallback.cc |   50 ++++++++++++++++++++++++--------------------
 2 files changed, 33 insertions(+), 27 deletions(-)

New commits:
commit 57542d7f411c71d9b8110ce6f64090b2c0f6a925
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Feb 21 15:54:05 2013 -0500

    Minor

diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh
index 3c5a1e8..d826108 100644
--- a/src/hb-ot-layout-private.hh
+++ b/src/hb-ot-layout-private.hh
@@ -102,11 +102,11 @@ _hb_glyph_info_is_zwj (const hb_glyph_info_t *info)
  */
 
 typedef enum {
-  HB_OT_LAYOUT_GLYPH_PROPS_UNCLASSIFIED	= 0x0001,
-  HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH	= 0x0002,
-  HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE	= 0x0004,
-  HB_OT_LAYOUT_GLYPH_PROPS_MARK		= 0x0008,
-  HB_OT_LAYOUT_GLYPH_PROPS_COMPONENT	= 0x0010
+  HB_OT_LAYOUT_GLYPH_PROPS_UNCLASSIFIED	= 1 << HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED,
+  HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH	= 1 << HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH,
+  HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE	= 1 << HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE,
+  HB_OT_LAYOUT_GLYPH_PROPS_MARK		= 1 << HB_OT_LAYOUT_GLYPH_CLASS_MARK,
+  HB_OT_LAYOUT_GLYPH_PROPS_COMPONENT	= 1 << HB_OT_LAYOUT_GLYPH_CLASS_COMPONENT
 } hb_ot_layout_glyph_class_mask_t;
 
 
commit d46606e119b48dcca375d6313abd0f93ba5d09c3
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Feb 21 15:39:57 2013 -0500

    Port TrueType-kerning to use skippy iterator
    
    It skips joiners and default ignorables now.  Skips marks too, but only
    if there is proper GDEF classes for marks.

diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc
index cd9d9a4..afe0f39 100644
--- a/src/hb-ot-shape-fallback.cc
+++ b/src/hb-ot-shape-fallback.cc
@@ -25,6 +25,7 @@
  */
 
 #include "hb-ot-shape-fallback-private.hh"
+#include "hb-ot-layout-gsubgpos-private.hh"
 
 static unsigned int
 recategorize_combining_class (hb_codepoint_t u,
@@ -419,31 +420,36 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan,
   hb_mask_t kern_mask = plan->map.get_1_mask (HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction) ?
 					      HB_TAG ('k','e','r','n') : HB_TAG ('v','k','r','n'));
 
-  if (unlikely (!count)) return;
+  OT::hb_apply_context_t c (1, font, buffer, kern_mask, true/*auto_joiners*/);
+  c.set_lookup_props (OT::LookupFlag::IgnoreMarks);
 
-  bool enabled = buffer->info[0].mask & kern_mask;
-  for (unsigned int i = 1; i < count; i++)
+  for (buffer->idx = 0; buffer->idx < count;)
   {
-    bool next = buffer->info[i].mask & kern_mask;
-    if (enabled && next)
+    OT::hb_apply_context_t::skipping_forward_iterator_t skippy_iter (&c, buffer->idx, 1);
+    if (!skippy_iter.next ())
     {
-      hb_position_t x_kern, y_kern, kern1, kern2;
-      font->get_glyph_kerning_for_direction (buffer->info[i - 1].codepoint, buffer->info[i].codepoint,
-					     buffer->props.direction,
-					     &x_kern, &y_kern);
-
-      kern1 = x_kern >> 1;
-      kern2 = x_kern - kern1;
-      buffer->pos[i - 1].x_advance += kern1;
-      buffer->pos[i].x_advance += kern2;
-      buffer->pos[i].x_offset += kern2;
-
-      kern1 = y_kern >> 1;
-      kern2 = y_kern - kern1;
-      buffer->pos[i - 1].y_advance += kern1;
-      buffer->pos[i].y_advance += kern2;
-      buffer->pos[i].y_offset += kern2;
+      buffer->idx++;
+      continue;
     }
-    enabled = next;
+
+    hb_position_t x_kern, y_kern, kern1, kern2;
+    font->get_glyph_kerning_for_direction (buffer->info[buffer->idx].codepoint,
+					   buffer->info[skippy_iter.idx].codepoint,
+					   buffer->props.direction,
+					   &x_kern, &y_kern);
+
+    kern1 = x_kern >> 1;
+    kern2 = x_kern - kern1;
+    buffer->pos[buffer->idx].x_advance += kern1;
+    buffer->pos[skippy_iter.idx].x_advance += kern2;
+    buffer->pos[skippy_iter.idx].x_offset += kern2;
+
+    kern1 = y_kern >> 1;
+    kern2 = y_kern - kern1;
+    buffer->pos[buffer->idx].y_advance += kern1;
+    buffer->pos[skippy_iter.idx].y_advance += kern2;
+    buffer->pos[skippy_iter.idx].y_offset += kern2;
+
+    buffer->idx = skippy_iter.idx;
   }
 }



More information about the HarfBuzz mailing list