forked from enlightenment/efl
Evas font: Use our own custom fontconfig config.
This will make sure people that change the default config don't affect us.
This commit is contained in:
parent
54551defa6
commit
baf018d659
|
@ -1,3 +1,8 @@
|
||||||
|
2013-09-25 Tom Hacohen
|
||||||
|
|
||||||
|
* Evas font: Use our own fontconfig configuration so we don't get
|
||||||
|
affected by changes made to the default fontconfig configuration.
|
||||||
|
|
||||||
2013-09-06 Christophe Sadoine
|
2013-09-06 Christophe Sadoine
|
||||||
|
|
||||||
* Eet: Added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED().
|
* Eet: Added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED().
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -67,6 +67,7 @@ Additions:
|
||||||
- textblock: Use max ascent/descent at the edges of the textblock.
|
- textblock: Use max ascent/descent at the edges of the textblock.
|
||||||
- textblock: Make the ellipsis format the same as the surrounding.
|
- textblock: Make the ellipsis format the same as the surrounding.
|
||||||
- Add interceptor for focus_set.
|
- 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.
|
||||||
* Ecore_X:
|
* Ecore_X:
|
||||||
- Add window profile support.
|
- Add window profile support.
|
||||||
ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED
|
ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED
|
||||||
|
|
|
@ -48,6 +48,22 @@ static Evas_Font_Dir *object_text_font_cache_dir_add(char *dir);
|
||||||
static void object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd);
|
static void object_text_font_cache_dir_del(char *dir, Evas_Font_Dir *fd);
|
||||||
static int evas_object_text_font_string_parse(char *buffer, char dest[14][256]);
|
static int evas_object_text_font_string_parse(char *buffer, char dest[14][256]);
|
||||||
|
|
||||||
|
#ifdef HAVE_FONTCONFIG
|
||||||
|
static FcConfig *fc_config = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
evas_font_init(void)
|
||||||
|
{
|
||||||
|
static Eina_Bool fc_init = EINA_FALSE;
|
||||||
|
if (fc_init)
|
||||||
|
return;
|
||||||
|
fc_init = EINA_TRUE;
|
||||||
|
#ifdef HAVE_FONTCONFIG
|
||||||
|
fc_config = FcInitLoadConfigAndFonts();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
evas_font_dir_cache_free(void)
|
evas_font_dir_cache_free(void)
|
||||||
{
|
{
|
||||||
|
@ -57,6 +73,13 @@ evas_font_dir_cache_free(void)
|
||||||
eina_hash_free(font_dirs);
|
eina_hash_free(font_dirs);
|
||||||
font_dirs = NULL;
|
font_dirs = NULL;
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_FONTCONFIG
|
||||||
|
if (fc_config)
|
||||||
|
{
|
||||||
|
FcConfigDestroy(fc_config);
|
||||||
|
fc_config = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
@ -484,6 +507,8 @@ evas_font_load(Evas *eo_evas, Evas_Font_Description *fdesc, const char *source,
|
||||||
if (fdesc->weight == EVAS_FONT_WEIGHT_BOLD)
|
if (fdesc->weight == EVAS_FONT_WEIGHT_BOLD)
|
||||||
wanted_rend |= FONT_REND_WEIGHT;
|
wanted_rend |= FONT_REND_WEIGHT;
|
||||||
|
|
||||||
|
evas_font_init();
|
||||||
|
|
||||||
EINA_LIST_FOREACH(fonts_cache, l, fd)
|
EINA_LIST_FOREACH(fonts_cache, l, fd)
|
||||||
{
|
{
|
||||||
if (!evas_font_desc_cmp(fdesc, fd->fdesc))
|
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,
|
||||||
if (fdesc->lang)
|
if (fdesc->lang)
|
||||||
FcPatternAddString (p_nm, FC_LANG, (FcChar8 *) fdesc->lang);
|
FcPatternAddString (p_nm, FC_LANG, (FcChar8 *) fdesc->lang);
|
||||||
|
|
||||||
FcConfigSubstitute(NULL, p_nm, FcMatchPattern);
|
FcConfigSubstitute(fc_config, p_nm, FcMatchPattern);
|
||||||
FcDefaultSubstitute(p_nm);
|
FcDefaultSubstitute(p_nm);
|
||||||
|
|
||||||
/* do matching */
|
/* do matching */
|
||||||
set = FcFontSort(NULL, p_nm, FcTrue, NULL, &res);
|
set = FcFontSort(fc_config, p_nm, FcTrue, NULL, &res);
|
||||||
if (!set)
|
if (!set)
|
||||||
{
|
{
|
||||||
ERR("No fontconfig font matches '%s'. It was the last resource, no font found!", fdesc->name);
|
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)
|
||||||
FcObjectSet *os;
|
FcObjectSet *os;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
evas_font_init();
|
||||||
|
|
||||||
p = FcPatternCreate();
|
p = FcPatternCreate();
|
||||||
os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
|
os = FcObjectSetBuild(FC_FAMILY, FC_STYLE, NULL);
|
||||||
|
|
||||||
if (p && os) set = FcFontList(NULL, p, os);
|
if (p && os) set = FcFontList(fc_config, p, os);
|
||||||
|
|
||||||
if (p) FcPatternDestroy(p);
|
if (p) FcPatternDestroy(p);
|
||||||
if (os) FcObjectSetDestroy(os);
|
if (os) FcObjectSetDestroy(os);
|
||||||
|
|
Loading…
Reference in New Issue