Evas font: Oops, hb_fonts should be per font instance, not source.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 18 Oct 2011 09:58:49 +0000 (09:58 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 18 Oct 2011 09:58:49 +0000 (09:58 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@64144 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_font_load.c
src/lib/engines/common/evas_font_ot.c
src/lib/include/evas_common.h

index c39becd..98b47f9 100644 (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);
@@ -77,6 +74,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);
    if (fi->fash) fi->fash->freeme(fi->fash);
index cb1eada..2912d55 100644 (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
index d518fcc..e0b1ff1 100644 (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;
 };