[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Oct 11 13:03:28 UTC 2017


 src/hb-coretext.cc |   20 +++++++++-----------
 src/hb-coretext.h  |    1 +
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 84686bf4c75c001e7cfb2eabdf391b2e76cae335
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Oct 11 15:02:48 2017 +0200

    [coretext-aat] Also pass through CoreText if font has kerx table
    
    SFNSText has kerx table which apparently is applied.

diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc
index 432e0cc1..f43abb9f 100644
--- a/src/hb-coretext.cc
+++ b/src/hb-coretext.cc
@@ -1249,22 +1249,20 @@ struct hb_coretext_aat_shaper_face_data_t {};
 hb_coretext_aat_shaper_face_data_t *
 _hb_coretext_aat_shaper_face_data_create (hb_face_t *face)
 {
-  hb_blob_t *mort_blob = face->reference_table (HB_CORETEXT_TAG_MORT);
-  /* Umm, we just reference the table to check whether it exists.
-   * Maybe add better API for this? */
-  if (!hb_blob_get_length (mort_blob))
+  static const hb_tag_t tags[] = {HB_CORETEXT_TAG_MORX, HB_CORETEXT_TAG_MORT, HB_CORETEXT_TAG_KERX};
+
+  for (unsigned int i = 0; i < ARRAY_LENGTH (tags); i++)
   {
-    hb_blob_destroy (mort_blob);
-    mort_blob = face->reference_table (HB_CORETEXT_TAG_MORX);
-    if (!hb_blob_get_length (mort_blob))
+    hb_blob_t *blob = face->reference_table (tags[i]);
+    if (hb_blob_get_length (blob))
     {
-      hb_blob_destroy (mort_blob);
-      return NULL;
+      hb_blob_destroy (blob);
+      return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL;
     }
+    hb_blob_destroy (blob);
   }
-  hb_blob_destroy (mort_blob);
 
-  return hb_coretext_shaper_face_data_ensure (face) ? (hb_coretext_aat_shaper_face_data_t *) HB_SHAPER_DATA_SUCCEEDED : NULL;
+  return NULL;
 }
 
 void
diff --git a/src/hb-coretext.h b/src/hb-coretext.h
index 82066e4e..c9136ff4 100644
--- a/src/hb-coretext.h
+++ b/src/hb-coretext.h
@@ -42,6 +42,7 @@ HB_BEGIN_DECLS
 
 #define HB_CORETEXT_TAG_MORT HB_TAG('m','o','r','t')
 #define HB_CORETEXT_TAG_MORX HB_TAG('m','o','r','x')
+#define HB_CORETEXT_TAG_KERX HB_TAG('k','e','r','x')
 
 
 HB_EXTERN hb_face_t *


More information about the HarfBuzz mailing list