hb_buffer_t *hb_buffer_create(void) { hb_buffer_t *buffer = calloc(1, sizeof(*buffer)); if (!buffer) return hb_buffer_get_empty(); hb_atomic_int32_set(&buffer->ref_cnt, 1); buffer->unicode = hb_unicode_funcs_get_empty(); hb_buffer_reset(buffer); return buffer; }
hb_unicode_funcs_t * nui_hb_get_unicode_funcs (void) { static hb_unicode_funcs_t* pFunc = NULL; if (!pFunc) { pFunc = hb_unicode_funcs_get_empty(); hb_unicode_funcs_set_combining_class_func(pFunc, nui_hb_get_combining_class, NULL, NULL); hb_unicode_funcs_set_eastasian_width_func(pFunc, nui_hb_get_eastasian_width, NULL, NULL); hb_unicode_funcs_set_general_category_func(pFunc, nui_hb_get_general_category, NULL, NULL); hb_unicode_funcs_set_mirroring_func(pFunc, nui_hb_get_mirroring, NULL, NULL); hb_unicode_funcs_set_script_func(pFunc, nui_hb_get_script, NULL, NULL); hb_unicode_funcs_set_compose_func(pFunc, nui_hb_get_compose, NULL, NULL); hb_unicode_funcs_set_decompose_func(pFunc, nui_hb_get_decompose, NULL, NULL); } return pFunc; }