1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Fix display of compositions when font style changes (Cairo backend)

* src/ftcrfont.c (ftcrhbfont_end_hb_font): Don't persist the
result of 'cairo_ft_scaled_font_lock_face' in violation of the
API contract.  (Bug#73752)
This commit is contained in:
Tim Ruffing 2024-11-07 03:09:09 +01:00 committed by Eli Zaretskii
parent 3bf00777be
commit 9149aa89ee

View File

@ -700,6 +700,13 @@ ftcrhbfont_end_hb_font (struct font *font, hb_font_t *hb_font)
struct font_info *ftcrfont_info = (struct font_info *) font;
cairo_scaled_font_t *scaled_font = ftcrfont_info->cr_scaled_font;
eassert (hb_font == ftcrfont_info->hb_font);
/* ftcrfont_info->hb_font holds a reference to the FT_Face returned by
cairo_ft_scaled_font_lock_face. Keeping it around after the
matching unlock call would violate the API contract (Bug#73752). */
hb_font_destroy (ftcrfont_info->hb_font);
ftcrfont_info->hb_font = NULL;
cairo_ft_scaled_font_unlock_face (scaled_font);
ftcrfont_info->ft_size = NULL;
}