forked from enlightenment/efl
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. SVN revision: 74435
This commit is contained in:
parent
b3e1d00b2f
commit
6c9804fba9
|
@ -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 */
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue