[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Jul 23 18:51:10 UTC 2018


 src/hb-face.cc              |   20 --------------------
 src/hb-open-type-private.hh |    1 +
 src/hb-static.cc            |   22 ++++++++++++++++++++++
 3 files changed, 23 insertions(+), 20 deletions(-)

New commits:
commit c6bc7c38314ea831418fdd1434bbe5afc0875f33
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Jul 23 11:46:46 2018 -0700

    Set num glyphs on sanitizer reference_table()
    
    Move out-of-class definitions of two methods to hb-static so they
    are accessible in libharfbuzz-subset.

diff --git a/src/hb-face.cc b/src/hb-face.cc
index ad44eff5..fab2aa3a 100644
--- a/src/hb-face.cc
+++ b/src/hb-face.cc
@@ -31,8 +31,6 @@
 #include "hb-face-private.hh"
 #include "hb-blob-private.hh"
 #include "hb-open-file-private.hh"
-#include "hb-ot-head-table.hh"
-#include "hb-ot-maxp-table.hh"
 
 
 
@@ -448,15 +446,6 @@ hb_face_get_upem (hb_face_t *face)
   return face->get_upem ();
 }
 
-void
-hb_face_t::load_upem (void) const
-{
-  hb_blob_t *head_blob = OT::hb_sanitize_context_t().reference_table<OT::head> (this);
-  const OT::head *head_table = head_blob->as<OT::head> ();
-  upem = head_table->get_upem ();
-  hb_blob_destroy (head_blob);
-}
-
 /**
  * hb_face_set_glyph_count:
  * @face: a face.
@@ -492,15 +481,6 @@ hb_face_get_glyph_count (hb_face_t *face)
   return face->get_num_glyphs ();
 }
 
-void
-hb_face_t::load_num_glyphs (void) const
-{
-  hb_blob_t *maxp_blob = OT::hb_sanitize_context_t().reference_table<OT::maxp> (this);
-  const OT::maxp *maxp_table = maxp_blob->as<OT::maxp> ();
-  num_glyphs = maxp_table->get_num_glyphs ();
-  hb_blob_destroy (maxp_blob);
-}
-
 /**
  * hb_face_get_table_tags:
  * @face: a face.
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index c59bb6a5..e2a13556 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -348,6 +348,7 @@ struct hb_sanitize_context_t :
   template <typename Type>
   inline hb_blob_t *reference_table (const hb_face_t *face, hb_tag_t tableTag = Type::tableTag)
   {
+    set_num_glyphs (face->get_num_glyphs ());
     return sanitize_blob<Type> (face->reference_table (tableTag));
   }
 
diff --git a/src/hb-static.cc b/src/hb-static.cc
index ee17cd34..729b242c 100644
--- a/src/hb-static.cc
+++ b/src/hb-static.cc
@@ -25,8 +25,30 @@
  */
 
 #include "hb-private.hh"
+#include "hb-face-private.hh"
+#include "hb-open-type-private.hh"
+#include "hb-ot-head-table.hh"
+#include "hb-ot-maxp-table.hh"
 
 #ifndef HB_NO_VISIBILITY
 hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)] = {};
 /*thread_local*/ hb_vector_size_impl_t _hb_CrapPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)] = {};
 #endif
+
+void
+hb_face_t::load_num_glyphs (void) const
+{
+  hb_blob_t *maxp_blob = OT::hb_sanitize_context_t().reference_table<OT::maxp> (this);
+  const OT::maxp *maxp_table = maxp_blob->as<OT::maxp> ();
+  num_glyphs = maxp_table->get_num_glyphs ();
+  hb_blob_destroy (maxp_blob);
+}
+
+void
+hb_face_t::load_upem (void) const
+{
+  hb_blob_t *head_blob = OT::hb_sanitize_context_t().reference_table<OT::head> (this);
+  const OT::head *head_table = head_blob->as<OT::head> ();
+  upem = head_table->get_upem ();
+  hb_blob_destroy (head_blob);
+}


More information about the HarfBuzz mailing list