summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--src/lib/evas/canvas/evas_font_dir.c33
3 files changed, 36 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a6de7dc12a..68b31c42ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12013-09-25 Tom Hacohen
2
3 * Evas font: Use our own fontconfig configuration so we don't get
4 affected by changes made to the default fontconfig configuration.
5
12013-09-06 Christophe Sadoine 62013-09-06 Christophe Sadoine
2 7
3 * Eet: Added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(). 8 * Eet: Added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED().
diff --git a/NEWS b/NEWS
index 1ac141c204..7507263a63 100644
--- a/NEWS
+++ b/NEWS
@@ -67,6 +67,7 @@ Additions:
67 - textblock: Use max ascent/descent at the edges of the textblock. 67 - textblock: Use max ascent/descent at the edges of the textblock.
68 - textblock: Make the ellipsis format the same as the surrounding. 68 - textblock: Make the ellipsis format the same as the surrounding.
69 - Add interceptor for focus_set. 69 - Add interceptor for focus_set.
70 - Evas font: Use our own fontconfig configuration so we don't get affected by changes made to the default fontconfig configuration.
70 * Ecore_X: 71 * Ecore_X:
71 - Add window profile support. 72 - Add window profile support.
72 ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED 73 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 70d3f9a43b..6ee9e81373 100644
--- a/src/lib/evas/canvas/evas_font_dir.c
+++ b/src/lib/evas/canvas/evas_font_dir.c
@@ -48,6 +48,22 @@ static Evas_Font_Dir *object_text_font_cache_dir_add(char *dir);
48static void object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd); 48static void object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd);
49static int evas_object_text_font_string_parse(char *buffer, char dest[14][256]); 49static int evas_object_text_font_string_parse(char *buffer, char dest[14][256]);
50 50
51#ifdef HAVE_FONTCONFIG
52static FcConfig *fc_config = NULL;
53#endif
54
55static void
56evas_font_init(void)
57{
58 static Eina_Bool fc_init = EINA_FALSE;
59 if (fc_init)
60 return;
61 fc_init = EINA_TRUE;
62#ifdef HAVE_FONTCONFIG
63 fc_config = FcInitLoadConfigAndFonts();
64#endif
65}
66
51void 67void
52evas_font_dir_cache_free(void) 68evas_font_dir_cache_free(void)
53{ 69{
@@ -57,6 +73,13 @@ evas_font_dir_cache_free(void)
57 eina_hash_free(font_dirs); 73 eina_hash_free(font_dirs);
58 font_dirs = NULL; 74 font_dirs = NULL;
59 } 75 }
76#ifdef HAVE_FONTCONFIG
77 if (fc_config)
78 {
79 FcConfigDestroy(fc_config);
80 fc_config = NULL;
81 }
82#endif
60} 83}
61 84
62const char * 85const char *
@@ -484,6 +507,8 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
484 if (fdesc->weight == EVAS_FONT_WEIGHT_BOLD) 507 if (fdesc->weight == EVAS_FONT_WEIGHT_BOLD)
485 wanted_rend |= FONT_REND_WEIGHT; 508 wanted_rend |= FONT_REND_WEIGHT;
486 509
510 evas_font_init();
511
487 EINA_LIST_FOREACH(fonts_cache, l, fd) 512 EINA_LIST_FOREACH(fonts_cache, l, fd)
488 { 513 {
489 if (!evas_font_desc_cmp(fdesc, fd->fdesc)) 514 if (!evas_font_desc_cmp(fdesc, fd->fdesc))
@@ -710,11 +735,11 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
710 if (fdesc->lang) 735 if (fdesc->lang)
711 FcPatternAddString (p_nm, FC_LANG, (FcChar8 *) fdesc->lang); 736 FcPatternAddString (p_nm, FC_LANG, (FcChar8 *) fdesc->lang);
712 737
713 FcConfigSubstitute(NULL, p_nm, FcMatchPattern); 738 FcConfigSubstitute(fc_config, p_nm, FcMatchPattern);
714 FcDefaultSubstitute(p_nm); 739 FcDefaultSubstitute(p_nm);
715 740
716 /* do matching */ 741 /* do matching */
717 set = FcFontSort(NULL, p_nm, FcTrue, NULL, &res); 742 set = FcFontSort(fc_config, p_nm, FcTrue, NULL, &res);
718 if (!set) 743 if (!set)
719 { 744 {
720 ERR("No fontconfig font matches '%s'. It was the last resource, no font found!", fdesc->name); 745 ERR("No fontconfig font matches '%s'. It was the last resource, no font found!", fdesc->name);
@@ -777,10 +802,12 @@ evas_font_dir_available_list(const Evas *eo_evas)
777 FcObjectSet *os; 802 FcObjectSet *os;
778 int i; 803 int i;
779 804
805 evas_font_init();
806
780 p = FcPatternCreate(); 807 p = FcPatternCreate();
781 os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL); 808 os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
782 809
783 if (p && os) set = FcFontList(NULL, p, os); 810 if (p && os) set = FcFontList(fc_config, p, os);
784 811
785 if (p) FcPatternDestroy(p); 812 if (p) FcPatternDestroy(p);
786 if (os) FcObjectSetDestroy(os); 813 if (os) FcObjectSetDestroy(os);