forked from enlightenment/efl
evas: request ellipsis from the right font.
This commit is contained in:
parent
cf320aa2b2
commit
3abf3a19f4
|
@ -633,13 +633,23 @@ static const Eina_Unicode _ellip_str[2] = { 0x2026, '\0' };
|
|||
|
||||
/* FIXME: We currently leak ellipsis items. */
|
||||
static Evas_Object_Text_Item *
|
||||
_layout_ellipsis_item_new(Evas_Object_Protected_Data *obj, Evas_Object_Text *o, Evas_Object_Text_Item *ti)
|
||||
_layout_ellipsis_item_new(Evas_Object_Protected_Data *obj, Evas_Object_Text *o)
|
||||
{
|
||||
Evas_Object_Text_Item *ellip_ti;
|
||||
Evas_Script_Type script;
|
||||
Evas_Font_Instance *script_fi = NULL, *cur_fi;
|
||||
size_t len = 1; /* The length of _ellip_str */
|
||||
|
||||
ellip_ti = _evas_object_text_item_new(obj, o, ti->text_props.font_instance,
|
||||
_ellip_str, ti->text_props.script, 0, 0, len);
|
||||
script = evas_common_language_script_type_get(_ellip_str, 1);
|
||||
|
||||
if (o->font)
|
||||
{
|
||||
(void) ENFN->font_run_end_get(ENDT, o->font, &script_fi, &cur_fi,
|
||||
script, _ellip_str, 1);
|
||||
}
|
||||
|
||||
ellip_ti = _evas_object_text_item_new(obj, o, cur_fi,
|
||||
_ellip_str, script, 0, 0, len);
|
||||
|
||||
return ellip_ti;
|
||||
}
|
||||
|
@ -790,7 +800,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, Eina_Unicode
|
|||
}
|
||||
else
|
||||
{
|
||||
start_ellip_it = _layout_ellipsis_item_new(obj, o, o->items);
|
||||
start_ellip_it = _layout_ellipsis_item_new(obj, o);
|
||||
}
|
||||
o->last_computed.ellipsis_start = start_ellip_it;
|
||||
ellip_frame -= start_ellip_it->adv;
|
||||
|
@ -806,7 +816,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Object_Text *o, Eina_Unicode
|
|||
}
|
||||
else
|
||||
{
|
||||
end_ellip_it = _layout_ellipsis_item_new(obj, o, o->items);
|
||||
end_ellip_it = _layout_ellipsis_item_new(obj, o);
|
||||
}
|
||||
o->last_computed.ellipsis_end = end_ellip_it;
|
||||
ellip_frame -= end_ellip_it->adv;
|
||||
|
|
Loading…
Reference in New Issue