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

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Sep 6 12:29:42 PDT 2012


 src/hb-old.cc                |    3 +++
 src/hb-ot-shape-fallback.cc  |    6 +-----
 src/hb-ot-shape-normalize.cc |    5 +----
 src/hb-ot-shape.cc           |    5 +----
 src/hb-unicode-private.hh    |    9 +++++++++
 5 files changed, 15 insertions(+), 13 deletions(-)

New commits:
commit 5d502443f5a07cbd0aa860dd71a0fa4ea8b6ff9f
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Sep 6 15:29:29 2012 -0400

    [old] Clear offset array

diff --git a/src/hb-old.cc b/src/hb-old.cc
index 197e620..529bffa 100644
--- a/src/hb-old.cc
+++ b/src/hb-old.cc
@@ -337,6 +337,9 @@ retry:
   ALLOCATE_ARRAY (HB_GlyphAttributes, item.attributes, num_glyphs);
   ALLOCATE_ARRAY (HB_Fixed, item.advances, num_glyphs);
   ALLOCATE_ARRAY (HB_FixedPoint, item.offsets, num_glyphs);
+  /* Apparently in some cases the offsets array will not be fully assigned to.
+   * Clear it. */
+  memset (item.offsets, 0, num_glyphs * sizeof (item.offsets[0]));
   uint32_t *vis_clusters;
   ALLOCATE_ARRAY (uint32_t, vis_clusters, num_glyphs);
 
commit 9433c218b4853442dd9ad53d0588a837a33dbf1e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Sep 6 14:27:15 2012 -0400

    [OT] Simplify fallback positioning condition

diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc
index ae1137a..e8b41f7 100644
--- a/src/hb-ot-shape-fallback.cc
+++ b/src/hb-ot-shape-fallback.cc
@@ -348,8 +348,7 @@ position_cluster (const hb_ot_shape_plan_t *plan,
 
   /* Find the base glyph */
   for (unsigned int i = start; i < end; i++)
-    if (is_a_ligature (buffer->info[i]) ||
-        !HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[i])))
+    if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[i])))
     {
       position_around_base (plan, font, buffer, i, end);
       break;
commit 028a1706f898bfcee0d14acfba47ebe1de09f0c4
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Sep 6 14:25:48 2012 -0400

    Refactor common macro

diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc
index 8f7eb47..ae1137a 100644
--- a/src/hb-ot-shape-fallback.cc
+++ b/src/hb-ot-shape-fallback.cc
@@ -349,10 +349,7 @@ position_cluster (const hb_ot_shape_plan_t *plan,
   /* Find the base glyph */
   for (unsigned int i = start; i < end; i++)
     if (is_a_ligature (buffer->info[i]) ||
-        !(FLAG (_hb_glyph_info_get_general_category (&buffer->info[i])) &
-	  (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) |
-	   FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
-	   FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))
+        !HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[i])))
     {
       position_around_base (plan, font, buffer, i, end);
       break;
diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc
index f4d8330..18a3f3f 100644
--- a/src/hb-ot-shape-normalize.cc
+++ b/src/hb-ot-shape-normalize.cc
@@ -130,10 +130,7 @@ compose_func (hb_unicode_funcs_t *unicode,
 	      hb_codepoint_t *ab)
 {
   /* XXX, this belongs to indic normalizer. */
-  if ((FLAG (unicode->general_category (a)) &
-       (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) |
-	FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
-	FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))
+  if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (unicode->general_category (a)))
     return false;
   /* XXX, add composition-exclusion exceptions to Indic shaper. */
   if (a == 0x09AF && b == 0x09BC) { *ab = 0x09DF; return true; }
diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 1dd8b0a..9e44c5d 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -270,10 +270,7 @@ hb_form_clusters (hb_buffer_t *buffer)
 {
   unsigned int count = buffer->len;
   for (unsigned int i = 1; i < count; i++)
-    if (FLAG (_hb_glyph_info_get_general_category (&buffer->info[i])) &
-	(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) |
-	 FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
-	 FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
+    if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[i])))
       buffer->merge_clusters (i - 1, i + 1);
 }
 
diff --git a/src/hb-unicode-private.hh b/src/hb-unicode-private.hh
index 7ef5820..9f24a9f 100644
--- a/src/hb-unicode-private.hh
+++ b/src/hb-unicode-private.hh
@@ -268,4 +268,13 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
 #define HB_MODIFIED_COMBINING_CLASS_CCC132 132 /* sign u */
 
 
+/* Misc */
+
+#define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
+	(FLAG (gen_cat) & \
+	 (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
+	  FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
+	  FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
+
+
 #endif /* HB_UNICODE_PRIVATE_HH */



More information about the HarfBuzz mailing list