Imported Upstream version 1.4.6
[platform/upstream/harfbuzz.git] / src / hb-glib.cc
index af43cab..2b91b5b 100644 (file)
@@ -382,3 +382,21 @@ hb_glib_get_unicode_funcs (void)
   return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs);
 }
 
+#if GLIB_CHECK_VERSION(2,31,10)
+/**
+ * hb_glib_blob_create:
+ *
+ * Since: 0.9.38
+ **/
+hb_blob_t *
+hb_glib_blob_create (GBytes *gbytes)
+{
+  gsize size = 0;
+  gconstpointer data = g_bytes_get_data (gbytes, &size);
+  return hb_blob_create ((const char *) data,
+                        size,
+                        HB_MEMORY_MODE_READONLY,
+                        g_bytes_ref (gbytes),
+                        (hb_destroy_func_t) g_bytes_unref);
+}
+#endif