diff options
author | Tom Hacohen <tom@stosb.com> | 2013-06-10 14:51:44 +0100 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2013-06-10 14:52:10 +0100 |
commit | 3137e18962146fa3a1f5565c4d84dbb2759056c9 (patch) | |
tree | 534bf7250219df8a3e8a82dc0403de873b3e0203 | |
parent | d7db12f196611acbcf5bbb923fed10621b68b1b8 (diff) | |
download | efl-3137e18962146fa3a1f5565c4d84dbb2759056c9.tar.gz |
Revert "continuation of ascent/descent fix by tom - make textblock work too."
This reverts commit 9473c4a9a5b9e056e516b660895cb83c64a1c77f.
This commit is not correct. It just goes through every font in the
fontset, which is usually all the fonts in the system and tries to get
their ascent/descent and by that getting the max ascent/descent. This
won't work nicely.
The solution is to properly fix textblock, if you think there's
something lacking (I.e in the same way I did text).
However, my changes did not change previous behaviour, but were just
wrappers, so I don't see why extra changes would be needed. Please
elaborate.
I'm reverting this because:
1. I don't think it's correct.
2. It severly broke e in some cases (reference:
http://www.enlightenment.org/ss/e-51b5d5e98cd387.04568822.png ).
-rw-r--r-- | src/lib/evas/common/evas_font_main.c | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/src/lib/evas/common/evas_font_main.c b/src/lib/evas/common/evas_font_main.c index 76247cd2be..80d722144b 100644 --- a/src/lib/evas/common/evas_font_main.c +++ b/src/lib/evas/common/evas_font_main.c @@ -84,7 +84,6 @@ evas_common_font_instance_ascent_get(RGBA_Font_Int *fi) FTUNLOCK(); fi->src->current_size = fi->size; } - if (!fi->src->ft.face) return 0; if (!FT_IS_SCALABLE(fi->src->ft.face)) { WRN("NOT SCALABLE!"); @@ -111,7 +110,6 @@ evas_common_font_instance_descent_get(RGBA_Font_Int *fi) FTUNLOCK(); fi->src->current_size = fi->size; } - if (!fi->src->ft.face) return 0; val = -(int)fi->src->ft.face->size->metrics.descender; return FONT_METRIC_ROUNDUP(val); // if (fi->src->ft.face->units_per_EM == 0) @@ -135,7 +133,6 @@ evas_common_font_instance_max_ascent_get(RGBA_Font_Int *fi) FTUNLOCK(); fi->src->current_size = fi->size; } - if (!fi->src->ft.face) return 0; if ((fi->src->ft.face->bbox.yMax == 0) && (fi->src->ft.face->bbox.yMin == 0) && (fi->src->ft.face->units_per_EM == 0)) @@ -163,7 +160,6 @@ evas_common_font_instance_max_descent_get(RGBA_Font_Int *fi) FTUNLOCK(); fi->src->current_size = fi->size; } - if (!fi->src->ft.face) return 0; if ((fi->src->ft.face->bbox.yMax == 0) && (fi->src->ft.face->bbox.yMin == 0) && (fi->src->ft.face->units_per_EM == 0)) @@ -181,64 +177,28 @@ EAPI int evas_common_font_ascent_get(RGBA_Font *fn) { // evas_common_font_size_use(fn); - int max = 0, v; - Eina_List *l; - RGBA_Font_Int *fi; - - EINA_LIST_FOREACH(fn->fonts, l, fi) - { - v = evas_common_font_instance_ascent_get(fi); - if (v > max) max = v; - } - return max; + return evas_common_font_instance_ascent_get(fn->fonts->data); } EAPI int evas_common_font_descent_get(RGBA_Font *fn) { // evas_common_font_size_use(fn); - int max = 0, v; - Eina_List *l; - RGBA_Font_Int *fi; - - EINA_LIST_FOREACH(fn->fonts, l, fi) - { - v = evas_common_font_instance_descent_get(fi); - if (v > max) max = v; - } - return max; + return evas_common_font_instance_descent_get(fn->fonts->data); } EAPI int evas_common_font_max_ascent_get(RGBA_Font *fn) { // evas_common_font_size_use(fn); - int max = 0, v; - Eina_List *l; - RGBA_Font_Int *fi; - - EINA_LIST_FOREACH(fn->fonts, l, fi) - { - v = evas_common_font_instance_max_ascent_get(fi); - if (v > max) max = v; - } - return max; + return evas_common_font_instance_max_ascent_get(fn->fonts->data); } EAPI int evas_common_font_max_descent_get(RGBA_Font *fn) { // evas_common_font_size_use(fn); - int max = 0, v; - Eina_List *l; - RGBA_Font_Int *fi; - - EINA_LIST_FOREACH(fn->fonts, l, fi) - { - v = evas_common_font_instance_max_descent_get(fi); - if (v > max) max = v; - } - return max; + return evas_common_font_instance_max_descent_get(fn->fonts->data); } EAPI int |