From 69f73a185e670c5b3093259f605c86651ad01f23 Mon Sep 17 00:00:00 2001 From: tasn Date: Thu, 26 Jul 2012 11:31:36 +0000 Subject: [PATCH] Evas font: Fixed font cache to correctly handle different font sizes. Used to just go for the first match in the cache which means it would always think we only have the wrong size in the cache, and it would just add new entries all the time. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/evas@74435 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_font_dir.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/lib/canvas/evas_font_dir.c b/src/lib/canvas/evas_font_dir.c index aa0d9c3..551d8d9 100644 --- a/src/lib/canvas/evas_font_dir.c +++ b/src/lib/canvas/evas_font_dir.c @@ -495,6 +495,7 @@ evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Eva Evas_Font_Set *font = NULL; Eina_List *fonts, *l; Fndat *fd; + Fndat *found_fd = NULL; char *nm; Font_Rend_Flags wanted_rend = 0; @@ -525,15 +526,19 @@ evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Eva #ifdef HAVE_FONTCONFIG else if (fd->set && fd->p_nm) { - font = evas_load_fontconfig(evas, fd->set, size, - wanted_rend); - goto on_find; + found_fd = fd; } #endif } } } + if (found_fd) + { + font = evas_load_fontconfig(evas, found_fd->set, size, wanted_rend); + goto on_find; + } + EINA_LIST_FOREACH(fonts_zero, l, fd) { if (!evas_font_desc_cmp(fdesc, fd->fdesc)) @@ -552,15 +557,19 @@ evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Eva #ifdef HAVE_FONTCONFIG else if (fd->set && fd->p_nm) { - font = evas_load_fontconfig(evas, fd->set, size, - wanted_rend); - goto on_find; + found_fd = fd; } #endif } } } + if (found_fd) + { + font = evas_load_fontconfig(evas, found_fd->set, size, wanted_rend); + goto on_find; + } + fonts = evas_font_set_get(fdesc->name); EINA_LIST_FOREACH(fonts, l, nm) /* Load each font in append */ { -- 2.7.4