#include "evas_font_private.h" /* for Frame-Queuing support */
#include "evas_font_ot.h"
+#ifdef USE_HARFBUZZ
+# include <hb.h>
+# include <hb-ft.h>
+#endif
+
extern FT_Library evas_ft_lib;
static int font_cache_usage = 0;
{
FTLOCK();
FT_Done_Face(fs->ft.face);
+#ifdef USE_HARFBUZZ
+ hb_font_destroy(fs->ft.hb_font);
+#endif
FTUNLOCK();
if (fs->name) eina_stringshare_del(fs->name);
if (fs->file) eina_stringshare_del(fs->file);
static void
_evas_common_font_ot_shape(hb_buffer_t *buffer, RGBA_Font_Int *fi)
{
- hb_font_t *hb_font, *hb_ft_font;
-
- hb_ft_font = hb_ft_font_create(fi->src->ft.face, NULL);
- hb_font = hb_font_create_sub_font(hb_ft_font);
+ /* Create hb_font if not previously created */
+ if (!fi->src->ft.hb_font)
+ {
+ hb_font_t *hb_ft_font;
- hb_font_set_funcs(hb_font, _evas_common_font_ot_font_funcs_get(), fi, NULL);
+ hb_ft_font = hb_ft_font_create(fi->src->ft.face, NULL);
+ fi->src->ft.hb_font = hb_font_create_sub_font(hb_ft_font);
+ hb_font_destroy(hb_ft_font);
- hb_shape(hb_font, buffer, NULL, 0);
+ hb_font_set_funcs(fi->src->ft.hb_font,
+ _evas_common_font_ot_font_funcs_get(), fi, NULL);
+ }
- hb_font_destroy(hb_font);
- hb_font_destroy(hb_ft_font);
+ hb_shape(fi->src->ft.hb_font, buffer, NULL, 0);
}
EAPI Eina_Bool