From f03148f9e327b4542ef426e1db6841cc251e6569 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 25 Sep 2013 15:05:01 +0100 Subject: [PATCH] Evas font: Fixed evas_font_path_* functions to apply to fontconfig. Until now those were only used for custom fonts, and not for fontconfig searches. With this commit, fontconfig will also start looking in those dirs. --- ChangeLog | 4 ++++ NEWS | 1 + src/lib/evas/canvas/evas_font_dir.c | 11 +++++++++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 68b31c42ea..08204e8c6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-09-25 Tom Hacohen + + * Evas font: Make the evas_font_path_* functions apply to fontconfig searches. + 2013-09-25 Tom Hacohen * Evas font: Use our own fontconfig configuration so we don't get diff --git a/NEWS b/NEWS index 7507263a63..0dd45afb49 100644 --- a/NEWS +++ b/NEWS @@ -68,6 +68,7 @@ Additions: - textblock: Make the ellipsis format the same as the surrounding. - Add interceptor for focus_set. - Evas font: Use our own fontconfig configuration so we don't get affected by changes made to the default fontconfig configuration. + - Evas font: Make the evas_font_path_* functions apply to fontconfig searches. * Ecore_X: - Add window profile support. ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index 6ee9e81373..c990a548fd 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -1219,6 +1219,9 @@ _canvas_font_path_clear(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list EINA_UNUS eina_stringshare_del(evas->font_path->data); evas->font_path = eina_list_remove(evas->font_path, evas->font_path->data); } + + if (fc_config) + FcConfigAppFontClear(fc_config); } EAPI void @@ -1237,6 +1240,10 @@ _canvas_font_path_append(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list) Evas_Public_Data *e = _pd; if (!path) return; e->font_path = eina_list_append(e->font_path, eina_stringshare_add(path)); + + evas_font_init(); + if (fc_config) + FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path); } EAPI void @@ -1255,6 +1262,10 @@ _canvas_font_path_prepend(Eo *eo_e EINA_UNUSED, void *_pd, va_list *list) Evas_Public_Data *e = _pd; if (!path) return; e->font_path = eina_list_prepend(e->font_path, eina_stringshare_add(path)); + + evas_font_init(); + if (fc_config) + FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path); } EAPI const Eina_List *