diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 495d53465..0cd82f810 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -343,6 +343,7 @@ hb_coretext_face_create hb_coretext_font_create hb_coretext_face_get_cg_font hb_coretext_font_get_ct_font +hb_coretext_font_set_funcs
diff --git a/src/hb-coretext-font.cc b/src/hb-coretext-font.cc index 7f792be2a..5cb095162 100644 --- a/src/hb-coretext-font.cc +++ b/src/hb-coretext-font.cc @@ -279,9 +279,23 @@ _hb_coretext_get_font_funcs () * hb_coretext_font_set_funcs: * @font: #hb_font_t to work upon * - * Sets the font functions to use when working with @font. + * Configures the font-functions structure of the specified + * #hb_font_t font object to use CoreText font functions. * - * Since: 0.9.28 + * In particular, you can use this function to configure an + * existing #hb_face_t face object for use with CoreText font + * functions even if that #hb_face_t face object was initially + * created with hb_face_create(), and therefore was not + * initially configured to use CoreText font functions. + * + * An #hb_font_t object created with hb_coretext_font_create() + * is preconfigured for CoreText font functions and does not + * require this function to be used. + * + * Note: Internally, this function creates a CTFont. +* + * + * XSince: REPLACEME **/ void hb_coretext_font_set_funcs (hb_font_t *font) diff --git a/src/hb-coretext-shape.cc b/src/hb-coretext-shape.cc index 070b8be02..0124d9566 100644 --- a/src/hb-coretext-shape.cc +++ b/src/hb-coretext-shape.cc @@ -439,6 +439,9 @@ _hb_coretext_shaper_font_data_destroy (hb_coretext_font_data_t *data) * Creates an #hb_font_t font object from the specified * CTFontRef. * + * The created font is configured to use the CoreText font functions, + * as set by hb_coretext_font_set_funcs(). + * * Return value: the new #hb_font_t font object * * Since: 1.7.2 @@ -460,6 +463,8 @@ hb_coretext_font_create (CTFontRef ct_font) /* Let there be dragons here... */ font->data.coretext.cmpexch (nullptr, (hb_coretext_font_data_t *) CFRetain (ct_font)); + hb_coretext_font_set_funcs (font); + return font; } diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 2495306d2..7b4724710 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -642,7 +642,9 @@ _hb_ot_get_font_funcs () * hb_ot_font_set_funcs: * @font: #hb_font_t to work upon * - * Sets the font functions to use when working with @font. + * Sets the font functions to use when working with @font to + * the HarfBuzz's native implementation. This is the default + * for fonts newly created. * * Since: 0.9.28 **/