diff options
author | Tom Hacohen <tom@stosb.com> | 2014-06-13 15:29:59 +0100 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2014-06-13 15:32:21 +0100 |
commit | 9ede167f349d3fba9ac5b424c040790786570309 (patch) | |
tree | 86dfd194238cb79d4738be948d832384ad6e5834 | |
parent | 7aff2e7bb1e004b06bf386d90866a230e96e8228 (diff) | |
download | efl-9ede167f349d3fba9ac5b424c040790786570309.tar.gz |
Evas textblock: Fix issue with edje fonts not being used.
The issue was within the fontconfig fallback mechanism and our cache. We
used to just use the fontconfig fallback list, instead of also using the
correct edje font.
This can probably be improved a bit by not caching the fontconfig set,
but cache a list of the filenames instead. This is more generic and will
improve cache as well.
Fixes T1331
@fix
-rw-r--r-- | src/lib/evas/canvas/evas_font_dir.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index 1eed53a40c..0298aeaf8a 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -36,6 +36,8 @@ struct _Fndat #ifdef HAVE_FONTCONFIG FcFontSet *set; FcPattern *p_nm; + + Eina_Bool file_font : 1; /* Indicates this is a font that uses a file rather than fontconfig. */ #endif }; @@ -523,6 +525,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, #ifdef HAVE_FONTCONFIG FcPattern *p_nm = NULL; FcFontSet *set = NULL; + Eina_Bool file_font = EINA_FALSE; #endif Evas_Font_Set *font = NULL; @@ -559,7 +562,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, return fd->font; } #ifdef HAVE_FONTCONFIG - else if (fd->set && fd->p_nm) + else if (fd->set && fd->p_nm && !fd->file_font) { found_fd = fd; } @@ -592,7 +595,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, return fd->font; } #ifdef HAVE_FONTCONFIG - else if (fd->set && fd->p_nm) + else if (fd->set && fd->p_nm && !fd->file_font) { found_fd = fd; } @@ -827,6 +830,8 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, FT_Face face = evas_common_font_freetype_face_get((RGBA_Font *) font); + file_font = EINA_TRUE; + if (face) { p_nm = FcFreeTypeQueryFace(face, (FcChar8 *) "", 0, NULL); @@ -865,6 +870,7 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source, #ifdef HAVE_FONTCONFIG fd->set = set; fd->p_nm = p_nm; + fd->file_font = file_font; #endif } |