[pango/harfbuzz-ng] [GPOS] Fix GPOS feature lookup lookups and application



commit b77c4990efcd6f6ef77dc6e956bb3f1df9bf6bff
Author: Behdad Esfahbod <behdad behdad org>
Date:   Wed May 20 03:59:33 2009 -0400

    [GPOS] Fix GPOS feature lookup lookups and application
---
 pango/pango-ot-info.c |   51 ++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index cf309cc..d0e7ac8 100644
--- a/pango/pango-ot-info.c
+++ b/pango/pango-ot-info.c
@@ -555,6 +555,8 @@ _pango_ot_info_position    (const PangoOTInfo    *info,
 {
   unsigned int i;
 
+  _hb_buffer_clear_positions (buffer->buffer);
+
   for (i = 0; i < ruleset->rules->len; i++)
     {
       PangoOTRule *rule = &g_array_index (ruleset->rules, PangoOTRule, i);
@@ -566,18 +568,15 @@ _pango_ot_info_position    (const PangoOTInfo    *info,
 
       mask = rule->property_bit;
       lookup_count = hb_ot_layout_feature_get_lookup_count (info->layout,
-							    HB_OT_LAYOUT_TABLE_TYPE_GSUB,
+							    HB_OT_LAYOUT_TABLE_TYPE_GPOS,
 							    rule->feature_index);
 
-      if (lookup_count)
-	_hb_buffer_clear_positions (buffer->buffer);
-
       for (j = 0; j < lookup_count; j++)
         {
 	  unsigned int lookup_index;
 
 	  lookup_index = hb_ot_layout_feature_get_lookup_index (info->layout,
-								HB_OT_LAYOUT_TABLE_TYPE_GSUB,
+								HB_OT_LAYOUT_TABLE_TYPE_GPOS,
 								rule->feature_index,
 								j);
 	  hb_ot_layout_position_lookup (info->layout,
@@ -586,26 +585,26 @@ _pango_ot_info_position    (const PangoOTInfo    *info,
 					rule->property_bit);
 	}
 
-      if (lookup_count)
-	{
-	  HB_UInt   i, j;
-	  HB_Position positions = buffer->buffer->positions;
-
-	  /* First handle all left-to-right connections */
-	  for (j = 0; j < buffer->buffer->in_length; j++)
-	  {
-	    if (positions[j].cursive_chain > 0)
-	      positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
-	  }
-
-	  /* Then handle all right-to-left connections */
-	  for (i = buffer->buffer->in_length; i > 0; i--)
-	  {
-	    j = i - 1;
-
-	    if (positions[j].cursive_chain < 0)
-	      positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
-	  }
-	}
+    }
+
+    {
+      HB_UInt   i, j;
+      HB_Position positions = buffer->buffer->positions;
+
+      /* First handle all left-to-right connections */
+      for (j = 0; j < buffer->buffer->in_length; j++)
+      {
+	if (positions[j].cursive_chain > 0)
+	  positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
+      }
+
+      /* Then handle all right-to-left connections */
+      for (i = buffer->buffer->in_length; i > 0; i--)
+      {
+	j = i - 1;
+
+	if (positions[j].cursive_chain < 0)
+	  positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos;
+      }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]