return blob;
}
+static void
+_hb_blob_destroy (void *data)
+{
+ hb_blob_destroy ((hb_blob_t *) data);
+}
+
/**
* hb_blob_create_sub_blob:
* @parent: Parent blob.
MIN (length, parent->length - offset),
HB_MEMORY_MODE_READONLY,
hb_blob_reference (parent),
- (hb_destroy_func_t) hb_blob_destroy);
+ _hb_blob_destroy);
return blob;
}
release_table_data);
}
+static void
+_hb_cg_font_release (void *data)
+{
+ CGFontRelease ((CGFontRef) data);
+}
+
hb_face_t *
hb_coretext_face_create (CGFontRef cg_font)
{
- return hb_face_create_for_tables (reference_table, CGFontRetain (cg_font), (hb_destroy_func_t) CGFontRelease);
+ return hb_face_create_for_tables (reference_table, CGFontRetain (cg_font), _hb_cg_font_release);
}
create_cg_font (hb_face_t *face)
{
CGFontRef cg_font = NULL;
- if (face->destroy == (hb_destroy_func_t) CGFontRelease)
+ if (face->destroy == _hb_cg_font_release)
{
cg_font = CGFontRetain ((CGFontRef) face->user_data);
}
}
static void
-_hb_face_for_data_closure_destroy (hb_face_for_data_closure_t *closure)
+_hb_face_for_data_closure_destroy (void *data)
{
+ hb_face_for_data_closure_t *closure = (hb_face_for_data_closure_t *) data;
+
hb_blob_destroy (closure->blob);
free (closure);
}
face = hb_face_create_for_tables (_hb_face_for_data_reference_table,
closure,
- (hb_destroy_func_t) _hb_face_for_data_closure_destroy);
+ _hb_face_for_data_closure_destroy);
face->index = index;
}
static void
-_hb_ft_face_destroy (FT_Face ft_face)
+_hb_ft_face_destroy (void *data)
{
- FT_Done_Face (ft_face);
+ FT_Done_Face ((FT_Face) data);
}
static void
-_hb_ft_font_destroy (hb_ft_font_t *ft_font)
+_hb_ft_font_destroy (void *data)
{
+ hb_ft_font_t *ft_font = (hb_ft_font_t *) data;
+
if (ft_font->unref)
_hb_ft_face_destroy (ft_font->ft_face);
if (font->immutable)
return;
- if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+ if (font->destroy != _hb_ft_font_destroy)
return;
hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data;
int
hb_ft_font_get_load_flags (hb_font_t *font)
{
- if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+ if (font->destroy != _hb_ft_font_destroy)
return 0;
const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data;
FT_Face
hb_ft_font_get_face (hb_font_t *font)
{
- if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+ if (font->destroy != _hb_ft_font_destroy)
return NULL;
const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data;
hb_font_set_funcs (font,
funcs,
_hb_ft_font_create (ft_face, symbol, unref),
- (hb_destroy_func_t) _hb_ft_font_destroy);
+ _hb_ft_font_destroy);
}
hb_ft_face_create_referenced (FT_Face ft_face)
{
FT_Reference_Face (ft_face);
- return hb_ft_face_create (ft_face, (hb_destroy_func_t) _hb_ft_face_destroy);
+ return hb_ft_face_create (ft_face, _hb_ft_face_destroy);
}
static void
hb_ft_font_create_referenced (FT_Face ft_face)
{
FT_Reference_Face (ft_face);
- return hb_ft_font_create (ft_face, (hb_destroy_func_t) _hb_ft_face_destroy);
+ return hb_ft_font_create (ft_face, _hb_ft_face_destroy);
}
}
#if GLIB_CHECK_VERSION(2,31,10)
+
+static void
+_hb_g_bytes_unref (void *data)
+{
+ g_bytes_unref ((GBytes *) data);
+}
+
/**
* hb_glib_blob_create:
*
size,
HB_MEMORY_MODE_READONLY,
g_bytes_ref (gbytes),
- (hb_destroy_func_t) g_bytes_unref);
+ _hb_g_bytes_unref);
}
#endif
}
static void
-_hb_ot_font_destroy (hb_ot_font_t *ot_font)
+_hb_ot_font_destroy (void *data)
{
+ hb_ot_font_t *ot_font = (hb_ot_font_t *) data;
+
ot_font->cmap.fini ();
ot_font->h_metrics.fini ();
ot_font->v_metrics.fini ();
hb_font_set_funcs (font,
_hb_ot_get_font_funcs (),
ot_font,
- (hb_destroy_func_t) _hb_ot_font_destroy);
+ _hb_ot_font_destroy);
}