mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 14:01:10 +01:00
[glib] Add hb_glib_blob_create() that takes GBytes
This commit is contained in:
1 parent
b91904a40d
commit
0ef179e2dc
2 files changed
+14
No files matched your search
@@ -382,3 +382,14 @@ hb_glib_get_unicode_funcs (void)
|
||||
return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -46,6 +46,9 @@ hb_glib_script_from_script (hb_script_t script);
|
||||
hb_unicode_funcs_t *
|
||||
hb_glib_get_unicode_funcs (void);
|
||||
|
||||
hb_blob_t *
|
||||
hb_glib_blob_create (GBytes *gbytes);
|
||||
|
||||
|
||||
HB_END_DECLS
|
||||
|
||||
|
||||
Reference in new issue
Block a user