summaryrefslogtreecommitdiff
path: root/src/xftfont.c
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2018-06-05 03:25:35 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2018-12-10 00:08:50 +0200
commitca0b6e90f8a943825b728d00c60456bc55d42a25 (patch)
tree253cfbda1db10489dc80a129da32526709c4a61c /src/xftfont.c
parent9014e05fcb1bdfee3d4a0d10129bd1f9cf6a85ab (diff)
downloademacs-ca0b6e90f8a943825b728d00c60456bc55d42a25.tar.gz
Cache hb_font_t
Not sure if the xftfont.c changes are really needed, but followed the libotf code just in case.
Diffstat (limited to 'src/xftfont.c')
-rw-r--r--src/xftfont.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xftfont.c b/src/xftfont.c
index 7650de3a779..e0bd243467a 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -48,6 +48,9 @@ struct xftfont_info
bool maybe_otf; /* Flag to tell if this may be OTF or not. */
OTF *otf;
#endif /* HAVE_LIBOTF */
+#ifdef HAVE_HARFBUZZ
+ hb_font_t *hb_font;
+#endif /* HAVE_HARFBUZZ */
FT_Size ft_size;
int index;
FT_Matrix matrix;
@@ -430,6 +433,9 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
xftfont_info->maybe_otf = (ft_face->face_flags & FT_FACE_FLAG_SFNT) != 0;
xftfont_info->otf = NULL;
#endif /* HAVE_LIBOTF */
+#ifdef HAVE_HARFBUZZ
+ xftfont_info->hb_font = NULL;
+#endif /* HAVE_HARFBUZZ */
xftfont_info->ft_size = ft_face->size;
font->baseline_offset = 0;
@@ -469,6 +475,13 @@ xftfont_close (struct font *font)
xftfont_info->otf = NULL;
}
#endif
+#ifdef HAVE_HARFBUZZ
+ if (xftfont_info->hb_font)
+ {
+ hb_font_destroy (xftfont_info->hb_font);
+ xftfont_info->hb_font = NULL;
+ }
+#endif
/* See comment in xfont_close. */
if (xftfont_info->xftfont