提交 f97bf4f8 编写于 作者: B Behdad Esfahbod

Make sure we initialize all callbacks upon creation

Also fixes issue with unicode callbacks never being set really.
上级 bf36a107
......@@ -75,14 +75,12 @@ hb_font_get_kerning_nil (hb_font_t *font HB_UNUSED,
hb_font_funcs_t _hb_font_funcs_nil = {
HB_REFERENCE_COUNT_INVALID, /* ref_count */
TRUE, /* immutable */
{
hb_font_get_glyph_nil,
hb_font_get_contour_point_nil,
hb_font_get_glyph_metrics_nil,
hb_font_get_kerning_nil
hb_font_get_glyph_nil,
hb_font_get_contour_point_nil,
hb_font_get_glyph_metrics_nil,
hb_font_get_kerning_nil
}
};
......@@ -94,6 +92,8 @@ hb_font_funcs_create (void)
if (!HB_OBJECT_DO_CREATE (hb_font_funcs_t, ffuncs))
return &_hb_font_funcs_nil;
ffuncs->v = _hb_font_funcs_nil.v;
return ffuncs;
}
......@@ -125,11 +125,7 @@ hb_font_funcs_copy (hb_font_funcs_t *other_ffuncs)
if (!HB_OBJECT_DO_CREATE (hb_font_funcs_t, ffuncs))
return &_hb_font_funcs_nil;
*ffuncs = *other_ffuncs;
/* re-init refcount */
HB_OBJECT_DO_INIT (ffuncs);
ffuncs->immutable = FALSE;
ffuncs->v = other_ffuncs->v;
return ffuncs;
}
......
......@@ -40,9 +40,7 @@ static unsigned int hb_unicode_get_eastasian_width_nil (hb_codepoint_t unicode H
hb_unicode_funcs_t _hb_unicode_funcs_nil = {
HB_REFERENCE_COUNT_INVALID, /* ref_count */
TRUE, /* immutable */
{
hb_unicode_get_general_category_nil,
hb_unicode_get_combining_class_nil,
......@@ -60,8 +58,7 @@ hb_unicode_funcs_create (void)
if (!HB_OBJECT_DO_CREATE (hb_unicode_funcs_t, ufuncs))
return &_hb_unicode_funcs_nil;
*ufuncs = _hb_unicode_funcs_nil;
HB_OBJECT_DO_INIT (ufuncs);
ufuncs->v = _hb_unicode_funcs_nil.v;
return ufuncs;
}
......@@ -94,9 +91,7 @@ hb_unicode_funcs_copy (hb_unicode_funcs_t *other_ufuncs)
if (!HB_OBJECT_DO_CREATE (hb_unicode_funcs_t, ufuncs))
return &_hb_unicode_funcs_nil;
*ufuncs = *other_ufuncs;
HB_OBJECT_DO_INIT (ufuncs);
ufuncs->immutable = FALSE;
ufuncs->v = other_ufuncs->v;
return ufuncs;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册