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

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Aug 23 20:13:20 UTC 2017


 src/hb-buffer.cc |   19 ++++++++++++++++++-
 src/hb-buffer.h  |   11 +++++++++--
 2 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit b2dd0c1c32ba30714355baca1857d64c1608b4c2
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Aug 23 13:12:54 2017 -0700

    Add hb_glyph_info_get_glyph_flags()
    
    New API.

diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 0c175a38..a25a2cb6 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -1412,6 +1412,23 @@ hb_buffer_get_glyph_positions (hb_buffer_t  *buffer,
 }
 
 /**
+ * hb_glyph_info_get_glyph_flags:
+ * @buffer: a #hb_glyph_info_t.
+ *
+ * Returns glyph flags encoded within a #hb_glyph_info_t.
+ *
+ * Return value:
+ * The #hb_glyph_flags_t encoded within @info.
+ *
+ * Since: 1.5.0
+ **/
+hb_glyph_flags_t
+(hb_glyph_info_get_glyph_flags) (const hb_glyph_info_t *info)
+{
+  return hb_glyph_info_get_glyph_flags (info);
+}
+
+/**
  * hb_buffer_reverse:
  * @buffer: an #hb_buffer_t.
  *
diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index 9f5943ec..ffbf66ee 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -63,7 +63,7 @@ HB_BEGIN_DECLS
  */
 typedef struct hb_glyph_info_t {
   hb_codepoint_t codepoint;
-  hb_mask_t      mask; /* Holds hb_glyph_flags_t after hb_shape() */
+  hb_mask_t      mask; /* Holds hb_glyph_flags_t after hb_shape(), plus other things. */
   uint32_t       cluster;
 
   /*< private >*/
@@ -77,6 +77,13 @@ typedef enum { /*< flags >*/
   HB_GLYPH_FLAG_DEFINED			= 0x00000001 /* OR of all defined flags */
 } hb_glyph_flags_t;
 
+HB_EXTERN hb_glyph_flags_t
+hb_glyph_info_get_glyph_flags (const hb_glyph_info_t *info);
+
+#define hb_glyph_info_get_glyph_flags(info) \
+	((hb_glyph_flags_t) ((unsigned int) (info)->mask & HB_GLYPH_FLAG_DEFINED))
+
+
 /**
  * hb_glyph_position_t:
  * @x_advance: how much the line advances after drawing this glyph when setting
commit 3e8f4f145255a905029c6b5cb8f40e6dcca096f3
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Aug 22 17:56:25 2017 -0700

    Rename HB_BUFFER_DIFF_FLAG_MASK_MISMATCH to HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH

diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 9007cd0d..0c175a38 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -1909,7 +1909,7 @@ hb_buffer_diff (hb_buffer_t *buffer,
     if (buf_info->cluster != ref_info->cluster)
       result |= HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH;
     if ((buf_info->mask & HB_GLYPH_FLAG_DEFINED) != (ref_info->mask & HB_GLYPH_FLAG_DEFINED))
-      result |= HB_BUFFER_DIFF_FLAG_MASK_MISMATCH;
+      result |= HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH;
     if (ref_info->codepoint == dottedcircle_glyph)
       result |= HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT;
     else if (ref_info->codepoint == 0)
diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index 98f83ff5..9f5943ec 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -491,7 +491,7 @@ typedef enum { /*< flags >*/
    * and report which aspect(s) of the glyph info/position are different. */
   HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH	= 0x0010,
   HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH		= 0x0020,
-  HB_BUFFER_DIFF_FLAG_MASK_MISMATCH		= 0x0040,
+  HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH	= 0x0040,
   HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH		= 0x0080
 
 } hb_buffer_diff_flags_t;


More information about the HarfBuzz mailing list