From f9fc13287b5b384cb3485687c150d284a9fe53b2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 27 Dec 2022 11:08:34 -0700 Subject: [PATCH] [hb-cairo] Return hb_font_t* from init-func --- src/hb-cairo.cc | 2 +- src/hb-cairo.h | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hb-cairo.cc b/src/hb-cairo.cc index c8e15a047..7b4d529b3 100644 --- a/src/hb-cairo.cc +++ b/src/hb-cairo.cc @@ -413,7 +413,7 @@ hb_cairo_init_scaled_font (cairo_scaled_font_t *scaled_font, { void *user_data = cairo_font_face_get_user_data (font_face, &hb_cairo_font_init_user_data_user_data_key); - init_func (font, scaled_font, user_data); + font = init_func (font, scaled_font, user_data); } hb_font_make_immutable (font); diff --git a/src/hb-cairo.h b/src/hb-cairo.h index 76469e941..cb7e53e5a 100644 --- a/src/hb-cairo.h +++ b/src/hb-cairo.h @@ -55,11 +55,13 @@ hb_cairo_font_face_get_face (cairo_font_face_t *font_face); * face created using hb_cairo_font_face_create_for_face() * creates an #hb_font_t for a #cairo_scaled_font_t. * + * Return value: the #hb_font_t value to use; in most cases same as @font + * * Since: REPLACEME */ -typedef void (*hb_cairo_font_init_func_t) (hb_font_t *font, - cairo_scaled_font_t *scaled_font, - void *user_data); +typedef hb_font_t * (*hb_cairo_font_init_func_t) (hb_font_t *font, + cairo_scaled_font_t *scaled_font, + void *user_data); HB_EXTERN void hb_cairo_font_face_set_font_init_func (cairo_font_face_t *font_face,