evas/font: Add evas_font_reinit API. 55/45755/2 accepted/tizen/mobile/20150813.011805 accepted/tizen/tv/20150813.011817 accepted/tizen/wearable/20150813.011829 submit/tizen/20150811.061834 submit/tizen/20150812.050254
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 19 Mar 2015 09:01:41 +0000 (18:01 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 11 Aug 2015 05:37:40 +0000 (22:37 -0700)
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

Change-Id: I9b8fa3429cdcc432fbf51fc60fa4da1bde6dbc45
origin: upstream

src/lib/evas/Evas_Common.h
src/lib/evas/canvas/evas_font_dir.c

index 5c1012d..9e9951d 100644 (file)
@@ -5694,6 +5694,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);
+
+/**
  * @}
  */
 
index d540709..0657eb0 100644 (file)
@@ -1487,3 +1487,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
+}