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

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Oct 11 17:27:26 UTC 2018


 src/hb-ot-shape.cc |   24 +++++++++++++-----------
 src/hb-ot-shape.hh |    5 +++--
 2 files changed, 16 insertions(+), 13 deletions(-)

New commits:
commit 0b9d60e1a1c4b7867ac907bbd7c004191a14e697
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Oct 11 13:26:58 2018 -0400

    [aat] Apply kerx if GPOS kern was not applied
    
    Ned tells me this is what Apple does.

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 2b147e34..a5538871 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -100,17 +100,15 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
   else if (hb_aat_layout_has_positioning (face))
     plan.apply_kerx = true;
 
-  if (plan.requested_kerning)
+  if (plan.requested_kerning && !plan.apply_kerx && !has_gpos_kern)
   {
-    if (plan.apply_kerx)
-      ;/* kerx supercedes kern. */
-    else if (!has_gpos_kern)
-    {
-      if (hb_ot_layout_has_kerning (face))
-        plan.apply_kern = true;
-      else
-	plan.fallback_kerning = true;
-    }
+    /* Apparently Apple applies kerx if GPOS kern was not applied. */
+    if (hb_aat_layout_has_positioning (face))
+      plan.apply_kerx = true;
+    if (hb_ot_layout_has_kerning (face))
+      plan.apply_kern = true;
+    else
+      plan.fallback_kerning = true;
   }
 
   plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k'));
commit b59a428af08d6451a47f40ed01e594815ebf6303
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Oct 11 13:24:17 2018 -0400

    Minor

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 3ca54ac8..2b147e34 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -116,6 +116,9 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
   plan.has_gpos_mark = !!plan.map.get_1_mask (HB_TAG ('m','a','r','k'));
   if (!plan.apply_gpos && !plan.apply_kerx)
     plan.fallback_mark_positioning = true;
+
+  /* Currently we always apply trak. */
+  plan.apply_trak = hb_aat_layout_has_tracking (face);
 }
 
 
@@ -838,7 +841,8 @@ hb_ot_position_complex (const hb_ot_shape_context_t *c)
   else if (c->plan->apply_kerx)
     hb_aat_layout_position (c->plan, c->font, c->buffer);
 
-  hb_aat_layout_track (c->plan, c->font, c->buffer);
+  if (c->plan->apply_trak)
+    hb_aat_layout_track (c->plan, c->font, c->buffer);
 
   if (!c->plan->apply_kerx)
     switch (c->plan->shaper->zero_width_marks)
diff --git a/src/hb-ot-shape.hh b/src/hb-ot-shape.hh
index 4943c515..c9c0d3e0 100644
--- a/src/hb-ot-shape.hh
+++ b/src/hb-ot-shape.hh
@@ -50,10 +50,11 @@ struct hb_ot_shape_plan_t
   bool fallback_kerning : 1;
   bool fallback_mark_positioning : 1;
 
-  bool apply_morx : 1;
+  bool apply_gpos : 1;
   bool apply_kerx : 1;
   bool apply_kern : 1;
-  bool apply_gpos : 1;
+  bool apply_morx : 1;
+  bool apply_trak : 1;
 
 
   inline void collect_lookups (hb_tag_t table_tag, hb_set_t *lookups) const


More information about the HarfBuzz mailing list