tasn pushed a commit to branch master.
commit 3137e18962146fa3a1f5565c4d84dbb2759056c9
Author: Tom Hacohen <[email protected]>
Date: Mon Jun 10 14:51:44 2013 +0100
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 ).
---
src/lib/evas/common/evas_font_main.c | 48 +++---------------------------------
1 file 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 76247cd..80d7221 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
--
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j