}
descent += fmt->linegap * obj->cur->scale;
descent += ((ascent + descent) * fmt->linerelgap);
- if (*maxascent < ascent) *maxascent = ascent;
- if (*maxdescent < descent) *maxdescent = descent;
+ *maxascent = ascent;
+ *maxdescent = descent;
if (fmt->linefill > 0.0)
{
int dh;
Evas_Coord *maxascent, Evas_Coord *maxdescent,
Evas_Object_Textblock_Item *it, Textblock_Position position)
{
+ Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
void *fi = NULL;
*maxascent = *maxdescent = 0;
{
Evas_Coord asc = 0;
+ *maxascent = ENFN->font_max_ascent_get(ENDT, it->format->font.font);
+
if (fi)
- {
- asc = evas_common_font_instance_max_ascent_get(fi);
- }
- else
- {
- Evas_Object_Protected_Data *obj =
- eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
- asc = ENFN->font_max_ascent_get(ENDT,
- it->format->font.font);
- }
+ asc = evas_common_font_instance_max_ascent_get(fi);
if (asc > *maxascent)
- *maxascent = asc;
+ *maxascent = asc;
}
if ((position == TEXTBLOCK_POSITION_END) ||
/* Calculate max descent. */
Evas_Coord desc = 0;
+ *maxdescent = ENFN->font_max_descent_get(ENDT, it->format->font.font);
+
if (fi)
- {
- desc = evas_common_font_instance_max_descent_get(fi);
- }
- else
- {
- Evas_Object_Protected_Data *obj =
- eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
- desc = ENFN->font_max_descent_get(ENDT,
- it->format->font.font);
- }
+ desc = evas_common_font_instance_max_descent_get(fi);
if (desc > *maxdescent)
- *maxdescent = desc;
+ *maxdescent = desc;
}
}
}
}
- if (fi)
+ if (fmt)
{
- asc = evas_common_font_instance_ascent_get(fi);
- desc = evas_common_font_instance_descent_get(fi);
+ Evas_Object_Protected_Data *obj =
+ eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
+ asc = ENFN->font_ascent_get(ENDT, fmt->font.font);
+ desc = ENFN->font_descent_get(ENDT, fmt->font.font);
}
- else
+
+ if (fi)
{
- if (fmt)
- {
- Evas_Object_Protected_Data *obj =
- eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
- asc = ENFN->font_ascent_get(ENDT, fmt->font.font);
- desc = ENFN->font_descent_get(ENDT, fmt->font.font);
- }
+ int fi_asc = evas_common_font_instance_ascent_get(fi);
+ int fi_desc = evas_common_font_instance_descent_get(fi);
+
+ if (fi_asc > asc) asc = fi_asc;
+ if (fi_desc > desc) desc = fi_desc;
}
+
if (fmt) _layout_format_ascent_descent_adjust(eo_obj, &asc, &desc, fmt);
if (asc > *ascent) *ascent = asc;