Evas font: Oops, hb_fonts should be per font instance, not source.

SVN revision: 64144
This commit is contained in:
Tom Hacohen 2011-10-18 09:58:49 +00:00
parent bfbd9abf9d
commit eca175dbe5
3 changed files with 12 additions and 12 deletions

View File

@ -56,9 +56,6 @@ _evas_common_font_source_free(RGBA_Font_Source *fs)
{
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);
@ -76,6 +73,9 @@ _evas_common_font_int_free(RGBA_Font_Int *fi)
#ifdef HAVE_PTHREAD
pthread_mutex_destroy(&fi->ft_mutex);
#endif
#ifdef USE_HARFBUZZ
hb_font_destroy(fi->ft.hb_font);
#endif
evas_common_font_source_free(fi->src);
if (fi->references == 0) fonts_lru = eina_list_remove(fonts_lru, fi);

View File

@ -246,19 +246,19 @@ static void
_evas_common_font_ot_shape(hb_buffer_t *buffer, RGBA_Font_Int *fi)
{
/* Create hb_font if not previously created */
if (!fi->src->ft.hb_font)
if (!fi->ft.hb_font)
{
hb_font_t *hb_ft_font;
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);
fi->ft.hb_font = hb_font_create_sub_font(hb_ft_font);
hb_font_destroy(hb_ft_font);
hb_font_set_funcs(fi->src->ft.hb_font,
hb_font_set_funcs(fi->ft.hb_font,
_evas_common_font_ot_font_funcs_get(), fi, NULL);
}
hb_shape(fi->src->ft.hb_font, buffer, NULL, 0);
hb_shape(fi->ft.hb_font, buffer, NULL, 0);
}
EAPI Eina_Bool

View File

@ -906,6 +906,8 @@ struct _RGBA_Font
unsigned char sizeok : 1;
};
#include "../engines/common/evas_font_ot.h"
struct _RGBA_Font_Int
{
EINA_INLIST;
@ -919,6 +921,9 @@ struct _RGBA_Font_Int
int usage;
struct {
FT_Size size;
#ifdef USE_HARFBUZZ
void *hb_font;
#endif
} ft;
LK(ft_mutex);
Font_Hint_Flags hinting;
@ -929,8 +934,6 @@ struct _RGBA_Font_Int
unsigned char inuse : 1;
};
#include "../engines/common/evas_font_ot.h"
struct _RGBA_Font_Source
{
const char *name;
@ -942,9 +945,6 @@ struct _RGBA_Font_Source
struct {
int orig_upem;
FT_Face face;
#ifdef USE_HARFBUZZ
void *hb_font;
#endif
} ft;
};