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

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Nov 16 22:47:43 UTC 2018


 src/hb-aat-layout-trak-table.hh |    2 +-
 src/hb-ot-layout-gdef-table.hh  |    2 +-
 src/hb-ot-layout-gsubgpos.hh    |    2 +-
 src/hb-ot-math-table.hh         |    2 +-
 src/hb-ot-shape.cc              |    8 ++++++--
 src/hb-ot-var-fvar-table.hh     |    2 +-
 6 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 7a97f7074052a5d746af29f0743abd20682b09a2
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Nov 16 14:46:40 2018 -0800

    Don't apply GPOS if applying morx
    
    That's what Apple does, and it wouldn't degrade our OpenType performance.
    
    Part of https://github.com/harfbuzz/harfbuzz/issues/1348

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 00d4c0b6..ccee8d34 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -126,7 +126,7 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t           &plan,
 
   if (hb_options ().aat && hb_aat_layout_has_positioning (face))
     plan.apply_kerx = true;
-  else if (!disable_gpos && hb_ot_layout_has_positioning (face))
+  else if (!apply_morx && !disable_gpos && hb_ot_layout_has_positioning (face))
     plan.apply_gpos = true;
   else if (hb_aat_layout_has_positioning (face))
     plan.apply_kerx = true;
commit eafd515639497098436ecf4c7b836e231bced323
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Nov 16 14:45:56 2018 -0800

    Prefer morx table if GSUB is empty (no scripts)
    
    Fixes https://github.com/harfbuzz/harfbuzz/issues/1348

diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc
index 093511ef..00d4c0b6 100644
--- a/src/hb-ot-shape.cc
+++ b/src/hb-ot-shape.cc
@@ -62,7 +62,11 @@ _hb_apply_morx (hb_face_t *face)
       hb_aat_layout_has_substitution (face))
     return true;
 
-  return !hb_ot_layout_has_substitution (face) &&
+  /* Ignore empty GSUB tables. */
+  return (!hb_ot_layout_has_substitution (face) ||
+	  !hb_ot_layout_table_get_script_tags (face,
+					       HB_OT_TAG_GSUB,
+					       0, nullptr, nullptr)) &&
 	 hb_aat_layout_has_substitution (face);
 }
 
commit aa06574823e27c4dbb378d2467a3e6f6f36af9fe
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Nov 16 14:31:05 2018 -0800

    Minor

diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh
index 3b55967c..91c0f456 100644
--- a/src/hb-aat-layout-trak-table.hh
+++ b/src/hb-aat-layout-trak-table.hh
@@ -169,7 +169,7 @@ struct trak
 {
   static const hb_tag_t tableTag = HB_AAT_TAG_trak;
 
-  inline bool has_data (void) const { return version.to_int () != 0; }
+  inline bool has_data (void) const { return version.to_int (); }
 
   inline bool apply (hb_aat_apply_context_t *c) const
   {
diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh
index e6804e6b..22e07f7a 100644
--- a/src/hb-ot-layout-gdef-table.hh
+++ b/src/hb-ot-layout-gdef-table.hh
@@ -348,7 +348,7 @@ struct GDEF
     ComponentGlyph	= 4
   };
 
-  inline bool has_data (void) const { return version.to_int () != 0; }
+  inline bool has_data (void) const { return version.to_int (); }
   inline bool has_glyph_classes (void) const { return glyphClassDef != 0; }
   inline unsigned int get_glyph_class (hb_codepoint_t glyph) const
   { return (this+glyphClassDef).get_class (glyph); }
diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh
index 82648680..3d70c55c 100644
--- a/src/hb-ot-layout-gsubgpos.hh
+++ b/src/hb-ot-layout-gsubgpos.hh
@@ -2657,7 +2657,7 @@ struct hb_ot_layout_lookup_accelerator_t
 
 struct GSUBGPOS
 {
-  inline bool has_data (void) const { return version.to_int () != 0; }
+  inline bool has_data (void) const { return version.to_int (); }
   inline unsigned int get_script_count (void) const
   { return (this+scriptList).len; }
   inline const Tag& get_script_tag (unsigned int i) const
diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh
index a28acef7..b8730497 100644
--- a/src/hb-ot-math-table.hh
+++ b/src/hb-ot-math-table.hh
@@ -684,7 +684,7 @@ struct MATH
 {
   static const hb_tag_t tableTag	= HB_OT_TAG_MATH;
 
-  inline bool has_data (void) const { return version.to_int () != 0; }
+  inline bool has_data (void) const { return version.to_int (); }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh
index 96c39c10..6d229c38 100644
--- a/src/hb-ot-var-fvar-table.hh
+++ b/src/hb-ot-var-fvar-table.hh
@@ -88,7 +88,7 @@ struct fvar
 {
   static const hb_tag_t tableTag	= HB_OT_TAG_fvar;
 
-  inline bool has_data (void) const { return version.to_int () != 0; }
+  inline bool has_data (void) const { return version.to_int (); }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {


More information about the HarfBuzz mailing list