summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_font_main.c
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2014-02-03 13:58:25 +0000
committerTom Hacohen <tom@stosb.com>2014-02-04 10:44:11 +0000
commit17d028f9444eebc0eafef1e4edaaf258665bb093 (patch)
tree3572c5a1da1bda6e5e4cae5fedf022e503014671 /src/lib/evas/common/evas_font_main.c
parent1c44890491afb1db7ec9d142d7220ebfa768d42f (diff)
Evas font: Added support for font fallback for eet/edje fonts.
This is a long awaited feature that has been requested years ago. Fontconfig finally added the support needed to make it happen, so here it is. I added a fontconfig query to look for similar fonts in case we loaded a font from eet/edje/file(no fontconfig). This now works quite well. Still missing: if you load a bold/italic/whatever font directly (set the file) without putting ":weight=bold" you will not get run-time emboldenment if only non-bold fonts are found. This unfortunately depends on very recent fontconfig version (#ifed out when unavailable), so only people with fontconfig >= 2.11 will enjoy this feature.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_font_main.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_font_main.c b/src/lib/evas/common/evas_font_main.c
index 064007ffaf..97961d002c 100644
--- a/src/lib/evas/common/evas_font_main.c
+++ b/src/lib/evas/common/evas_font_main.c
@@ -73,6 +73,22 @@ evas_common_font_font_all_unload(void)
73 evas_common_font_all_clear(); 73 evas_common_font_all_clear();
74} 74}
75 75
76/* FIXME: This function should not be used. It's a short-cut fix that is meant
77 * to improve font fallback for in-theme fonts. It will break if we stop using
78 * freetype (unlikely) or do anything else fancy. */
79void *
80evas_common_font_freetype_face_get(RGBA_Font *font)
81{
82 RGBA_Font_Int *fi = font->fonts->data;
83
84 if (!fi)
85 return NULL;
86
87 evas_common_font_int_reload(fi);
88
89 return fi->src->ft.face;
90}
91
76EAPI int 92EAPI int
77evas_common_font_instance_ascent_get(RGBA_Font_Int *fi) 93evas_common_font_instance_ascent_get(RGBA_Font_Int *fi)
78{ 94{