raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6616d11619796eb94755ac62f193dc4ec17c2b48

commit 6616d11619796eb94755ac62f193dc4ec17c2b48
Author: Youngbok Shin <[email protected]>
Date:   Thu Mar 19 18:01:41 2015 +0900

    evas/font: Add evas_font_reinit API.
    
    Summary:
    Reinitialize FontConfig. If FontConfig has to be reinitialized
    according to changes of system enviroments(ex. Changing font config files), 
it will be useful.
    
    Reviewers: woohyun, seoz, tasn, cedric, raster
    
    Reviewed By: raster
    
    Subscribers: raster, herdsman, cedric
    
    Differential Revision: https://phab.enlightenment.org/D1962
---
 src/lib/evas/Evas_Common.h          |  9 +++++++++
 src/lib/evas/canvas/evas_font_dir.c | 16 ++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index ccefa1a..c10668a 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -5690,6 +5690,15 @@ EAPI void                    
evas_font_path_global_prepend(const char *path) EIN
 EAPI const Eina_List        *evas_font_path_global_list(void) 
EINA_WARN_UNUSED_RESULT;
 
 /**
+ * Reinitialize FontConfig. If FontConfig has to be reinitialized
+ * according to changes of system enviroments(ex. Changing font config files), 
it will be useful.
+ *
+ * @ingroup Evas_Font_Path_Group
+ * @since 1.14
+ */
+EAPI void                    evas_font_reinit(void);
+
+/**
  * @}
  */
 
diff --git a/src/lib/evas/canvas/evas_font_dir.c 
b/src/lib/evas/canvas/evas_font_dir.c
index 31debb4..c3491cc 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -1493,3 +1493,19 @@ evas_font_available_list_free(Evas *eo_e, Eina_List 
*available)
    evas_font_dir_available_list_free(available);
 }
 
+EAPI void
+evas_font_reinit(void)
+{
+#ifdef HAVE_FONTCONFIG
+   Eina_List *l;
+   char *path;
+
+   if (fc_config) FcConfigDestroy(fc_config);
+
+   FcInitReinitialize();
+   fc_config = FcInitLoadConfigAndFonts();
+
+   EINA_LIST_FOREACH(global_font_path, l, path)
+      FcConfigAppFontAddDir(fc_config, (const FcChar8 *) path);
+#endif
+}

-- 


Reply via email to