Revert "continuation of ascent/descent fix by tom - make textblock work too."

This reverts commit 9473c4a9a5.

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 ).
This commit is contained in:
Tom Hacohen 2013-06-10 14:51:44 +01:00
parent d7db12f196
commit 3137e18962
1 changed files with 4 additions and 44 deletions

View File

@ -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